Commit 7f282a979717984db4f20e69d9b9404102f35e68

Authored by Jared Pace
1 parent 7e2b77ca
Exists in master and in 1 other branch production

Official project name is Errbit

1 -Hypnotoad: The open source self-hosted Hoptoad Server 1 +Errbit: The open source self-hosted Hoptoad Server
2 ===================================================== 2 =====================================================
3 3
4 WIP 4 WIP
@@ -5,7 +5,7 @@ require File.expand_path('../config/application', __FILE__) @@ -5,7 +5,7 @@ require File.expand_path('../config/application', __FILE__)
5 require 'rake' 5 require 'rake'
6 require 'bundler' 6 require 'bundler'
7 7
8 -Hypnotoad::Application.load_tasks 8 +Errbit::Application.load_tasks
9 9
10 Rake::Task[:default].clear 10 Rake::Task[:default].clear
11 task :default => ['spec'] 11 task :default => ['spec']
12 \ No newline at end of file 12 \ No newline at end of file
app/views/mailer/_signature.text.erb
1 -All Glory,  
2 -Hypnotoad  
3 \ No newline at end of file 1 \ No newline at end of file
  2 +Your loyal servant,
  3 +Errbit
4 \ No newline at end of file 4 \ No newline at end of file
config/application.rb
@@ -12,7 +12,7 @@ require 'mongoid/railtie' @@ -12,7 +12,7 @@ require 'mongoid/railtie'
12 # you've limited to :test, :development, or :production. 12 # you've limited to :test, :development, or :production.
13 Bundler.require(:default, Rails.env) if defined?(Bundler) 13 Bundler.require(:default, Rails.env) if defined?(Bundler)
14 14
15 -module Hypnotoad 15 +module Errbit
16 class Application < Rails::Application 16 class Application < Rails::Application
17 # Settings in config/environments/* take precedence over those specified here. 17 # Settings in config/environments/* take precedence over those specified here.
18 # Application configuration should go into files in config/initializers 18 # Application configuration should go into files in config/initializers
config/config.yml
1 -host: hypnotoad.example.com 1 +host: errbit.example.com
2 2
3 email_at_notices: [1, 10, 100] 3 email_at_notices: [1, 10, 100]
4 -email_from: hypnotoad@example.com  
5 \ No newline at end of file 4 \ No newline at end of file
  5 +email_from: errbit@example.com
6 \ No newline at end of file 6 \ No newline at end of file
config/environment.rb
@@ -2,4 +2,4 @@ @@ -2,4 +2,4 @@
2 require File.expand_path('../application', __FILE__) 2 require File.expand_path('../application', __FILE__)
3 3
4 # Initialize the rails application 4 # Initialize the rails application
5 -Hypnotoad::Application.initialize! 5 +Errbit::Application.initialize!
config/environments/development.rb
1 -Hypnotoad::Application.configure do 1 +Errbit::Application.configure do
2 # Settings specified here will take precedence over those in config/environment.rb 2 # Settings specified here will take precedence over those in config/environment.rb
3 3
4 # In the development environment your application's code is reloaded on 4 # In the development environment your application's code is reloaded on
config/environments/production.rb
1 -Hypnotoad::Application.configure do 1 +Errbit::Application.configure do
2 # Settings specified here will take precedence over those in config/environment.rb 2 # Settings specified here will take precedence over those in config/environment.rb
3 3
4 # The production environment is meant for finished, "live" apps. 4 # The production environment is meant for finished, "live" apps.
config/environments/test.rb
1 -Hypnotoad::Application.configure do 1 +Errbit::Application.configure do
2 # Settings specified here will take precedence over those in config/environment.rb 2 # Settings specified here will take precedence over those in config/environment.rb
3 3
4 # The test environment is used exclusively to run your application's 4 # The test environment is used exclusively to run your application's
config/initializers/secret_token.rb
@@ -4,4 +4,4 @@ @@ -4,4 +4,4 @@
4 # If you change this key, all old signed cookies will become invalid! 4 # If you change this key, all old signed cookies will become invalid!
5 # Make sure the secret is at least 30 characters and all random, 5 # Make sure the secret is at least 30 characters and all random,
6 # no regular words or you'll be exposed to dictionary attacks. 6 # no regular words or you'll be exposed to dictionary attacks.
7 -Hypnotoad::Application.config.secret_token = '41f6b3871b375769786c379a3e542d67a7a234926f926778ed634f40a9480ba6d7b0768993e9852aafcaa73d6b8ddd2ed3b46208b92305e8c21936574f74a9a4' 7 +Errbit::Application.config.secret_token = '41f6b3871b375769786c379a3e542d67a7a234926f926778ed634f40a9480ba6d7b0768993e9852aafcaa73d6b8ddd2ed3b46208b92305e8c21936574f74a9a4'
config/initializers/session_store.rb
1 # Be sure to restart your server when you modify this file. 1 # Be sure to restart your server when you modify this file.
2 2
3 -Hypnotoad::Application.config.session_store :cookie_store, :key => '_hypnotoad_session' 3 +Errbit::Application.config.session_store :cookie_store, :key => '_errbit_session'
4 4
5 # Use the database for sessions instead of the cookie-based default, 5 # Use the database for sessions instead of the cookie-based default,
6 # which shouldn't be used to store highly confidential information 6 # which shouldn't be used to store highly confidential information
7 # (create the session table with "rake db:sessions:create") 7 # (create the session table with "rake db:sessions:create")
8 -# Hypnotoad::Application.config.session_store :active_record_store 8 +# Errbit::Application.config.session_store :active_record_store
config/mongoid.yml
@@ -8,11 +8,11 @@ defaults: &amp;defaults @@ -8,11 +8,11 @@ defaults: &amp;defaults
8 8
9 development: 9 development:
10 <<: *defaults 10 <<: *defaults
11 - database: hypnotoad_development 11 + database: errbit_development
12 12
13 test: 13 test:
14 <<: *defaults 14 <<: *defaults
15 - database: hypnotoad_test 15 + database: errbit_test
16 16
17 # set these environment variables on your prod server 17 # set these environment variables on your prod server
18 production: 18 production:
config/routes.rb
1 -Hypnotoad::Application.routes.draw do 1 +Errbit::Application.routes.draw do
2 2
3 # Hoptoad Notifier Routes 3 # Hoptoad Notifier Routes
4 match '/notifier_api/v2/notices' => 'notices#create' 4 match '/notifier_api/v2/notices' => 'notices#create'
spec/controllers/deploys_controller_spec.rb
@@ -6,16 +6,16 @@ describe DeploysController do @@ -6,16 +6,16 @@ describe DeploysController do
6 before do 6 before do
7 @params = { 7 @params = {
8 'local_username' => 'john.doe', 8 'local_username' => 'john.doe',
9 - 'scm_repository' => 'git@github.com/jdpace/hypnotoad.git', 9 + 'scm_repository' => 'git@github.com/jdpace/errbit.git',
10 'rails_env' => 'production', 10 'rails_env' => 'production',
11 'scm_revision' => '19d77837eef37902cf5df7e4445c85f392a8d0d5' 11 'scm_revision' => '19d77837eef37902cf5df7e4445c85f392a8d0d5'
12 } 12 }
13 - @project = Factory(:project_with_watcher, :api_key => 'ALLGLORYTOTHEHYPNOTOAD') 13 + @project = Factory(:project_with_watcher, :api_key => 'APIKEY')
14 end 14 end
15 15
16 it 'finds the project via the api key' do 16 it 'finds the project via the api key' do
17 - Project.should_receive(:find_by_api_key!).with('ALLGLORYTOTHEHYPNOTOAD').and_return(@project)  
18 - post :create, :deploy => @params, :api_key => 'ALLGLORYTOTHEHYPNOTOAD' 17 + Project.should_receive(:find_by_api_key!).with('APIKEY').and_return(@project)
  18 + post :create, :deploy => @params, :api_key => 'APIKEY'
19 end 19 end
20 20
21 it 'creates a deploy' do 21 it 'creates a deploy' do
@@ -24,14 +24,14 @@ describe DeploysController do @@ -24,14 +24,14 @@ describe DeploysController do
24 with({ 24 with({
25 :username => 'john.doe', 25 :username => 'john.doe',
26 :environment => 'production', 26 :environment => 'production',
27 - :repository => 'git@github.com/jdpace/hypnotoad.git', 27 + :repository => 'git@github.com/jdpace/errbit.git',
28 :revision => '19d77837eef37902cf5df7e4445c85f392a8d0d5' 28 :revision => '19d77837eef37902cf5df7e4445c85f392a8d0d5'
29 }).and_return(Factory(:deploy)) 29 }).and_return(Factory(:deploy))
30 - post :create, :deploy => @params, :api_key => 'ALLGLORYTOTHEHYPNOTOAD' 30 + post :create, :deploy => @params, :api_key => 'APIKEY'
31 end 31 end
32 32
33 it 'sends an email notification', :focused => true do 33 it 'sends an email notification', :focused => true do
34 - post :create, :deploy => @params, :api_key => 'ALLGLORYTOTHEHYPNOTOAD' 34 + post :create, :deploy => @params, :api_key => 'APIKEY'
35 email = ActionMailer::Base.deliveries.last 35 email = ActionMailer::Base.deliveries.last
36 email.to.should include(@project.watchers.first.email) 36 email.to.should include(@project.watchers.first.email)
37 email.subject.should == "[#{@project.name}] Deployed to production by john.doe" 37 email.subject.should == "[#{@project.name}] Deployed to production by john.doe"
spec/factories/project_factories.rb
@@ -19,7 +19,7 @@ end @@ -19,7 +19,7 @@ end
19 Factory.define(:deploy) do |d| 19 Factory.define(:deploy) do |d|
20 d.project {|p| p.association :project} 20 d.project {|p| p.association :project}
21 d.username 'clyde.frog' 21 d.username 'clyde.frog'
22 - d.repository 'git@github.com/jdpace/hypnotoad.git' 22 + d.repository 'git@github.com/jdpace/errbit.git'
23 d.environment 'production' 23 d.environment 'production'
24 d.revision '2e601cb575ca97f1a1097f12d0edfae241a70263' 24 d.revision '2e601cb575ca97f1a1097f12d0edfae241a70263'
25 end 25 end
26 \ No newline at end of file 26 \ No newline at end of file
spec/fixtures/hoptoad_test_notice.xml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <notice version="2.0"> 2 <notice version="2.0">
3 - <api-key>ALLGLORYTOTHEHYPNOTOAD</api-key> 3 + <api-key>APIKEY</api-key>
4 <notifier> 4 <notifier>
5 <name>Hoptoad Notifier</name> 5 <name>Hoptoad Notifier</name>
6 <version>2.3.2</version> 6 <version>2.3.2</version>
spec/models/notice_spec.rb
@@ -25,7 +25,7 @@ describe Notice do @@ -25,7 +25,7 @@ describe Notice do
25 context '#from_xml' do 25 context '#from_xml' do
26 before do 26 before do
27 @xml = Rails.root.join('spec','fixtures','hoptoad_test_notice.xml').read 27 @xml = Rails.root.join('spec','fixtures','hoptoad_test_notice.xml').read
28 - @project = Factory(:project, :api_key => 'ALLGLORYTOTHEHYPNOTOAD') 28 + @project = Factory(:project, :api_key => 'APIKEY')
29 Digest::MD5.stub(:hexdigest).and_return('fingerprintdigest') 29 Digest::MD5.stub(:hexdigest).and_return('fingerprintdigest')
30 end 30 end
31 31
spec/models/project_spec.rb
@@ -10,8 +10,8 @@ describe Project do @@ -10,8 +10,8 @@ describe Project do
10 end 10 end
11 11
12 it 'requires unique names' do 12 it 'requires unique names' do
13 - Factory(:project, :name => 'Hypnotoad')  
14 - project = Factory.build(:project, :name => 'Hypnotoad') 13 + Factory(:project, :name => 'Errbit')
  14 + project = Factory.build(:project, :name => 'Errbit')
15 project.should_not be_valid 15 project.should_not be_valid
16 project.errors[:name].should include('is already taken') 16 project.errors[:name].should include('is already taken')
17 end 17 end