errornot_notifier 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/CHANGELOG +5 -0
  2. data/INSTALL +8 -8
  3. data/README.rdoc +63 -53
  4. data/Rakefile +92 -8
  5. data/TESTING.rdoc +1 -1
  6. data/generators/{hoptoad/hoptoad_generator.rb → errornot/errornot_generator.rb} +6 -6
  7. data/generators/{hoptoad → errornot}/lib/insert_commands.rb +0 -0
  8. data/generators/{hoptoad → errornot}/lib/rake_commands.rb +0 -0
  9. data/generators/errornot/templates/capistrano_hook.rb +6 -0
  10. data/generators/errornot/templates/errornot_notifier_tasks.rake +5 -0
  11. data/generators/{hoptoad → errornot}/templates/initializer.rb +2 -2
  12. data/lib/{hoptoad_notifier → errornot_notifier}/backtrace.rb +1 -1
  13. data/lib/errornot_notifier/capistrano.rb +20 -0
  14. data/lib/{hoptoad_notifier → errornot_notifier}/configuration.rb +14 -16
  15. data/lib/{hoptoad_notifier → errornot_notifier}/notice.rb +2 -2
  16. data/lib/{hoptoad_notifier → errornot_notifier}/rack.rb +8 -8
  17. data/lib/{hoptoad_notifier → errornot_notifier}/rails/action_controller_catcher.rb +9 -9
  18. data/lib/{hoptoad_notifier → errornot_notifier}/rails/controller_methods.rb +15 -15
  19. data/lib/{hoptoad_notifier → errornot_notifier}/rails/error_lookup.rb +9 -9
  20. data/lib/{hoptoad_notifier → errornot_notifier}/rails.rb +11 -11
  21. data/lib/{hoptoad_notifier → errornot_notifier}/sender.rb +8 -8
  22. data/lib/{hoptoad_notifier → errornot_notifier}/tasks.rb +19 -19
  23. data/lib/errornot_notifier/version.rb +3 -0
  24. data/lib/{hoptoad_notifier.rb → errornot_notifier.rb} +20 -20
  25. data/lib/{hoptoad_tasks.rb → errornot_tasks.rb} +9 -7
  26. data/lib/templates/rescue.erb +5 -5
  27. data/rails/init.rb +1 -1
  28. data/script/integration_test.rb +6 -6
  29. data/test/backtrace_test.rb +16 -16
  30. data/test/catcher_test.rb +22 -22
  31. data/test/configuration_test.rb +21 -23
  32. data/test/erronot_tasks_test.rb +147 -0
  33. data/test/helper.rb +16 -15
  34. data/test/logger_test.rb +12 -10
  35. data/test/notice_test.rb +9 -9
  36. data/test/notifier_test.rb +30 -30
  37. data/test/rack_test.rb +7 -7
  38. data/test/rails_initializer_test.rb +8 -8
  39. data/test/sender_test.rb +13 -12
  40. metadata +73 -53
  41. data/generators/hoptoad/templates/capistrano_hook.rb +0 -6
  42. data/generators/hoptoad/templates/hoptoad_notifier_tasks.rake +0 -5
  43. data/lib/hoptoad_notifier/capistrano.rb +0 -20
  44. data/lib/hoptoad_notifier/version.rb +0 -3
  45. data/test/hoptoad_tasks_test.rb +0 -138
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errornot_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ version: 1.0.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - thoughtbot, inc, Cyril Mougel
@@ -9,71 +14,83 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-20 00:00:00 +01:00
17
+ date: 2010-03-08 00:00:00 +01:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: activesupport
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :runtime
31
+ version_requirements: *id001
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: activerecord
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
33
41
  version: "0"
34
- version:
42
+ type: :development
43
+ version_requirements: *id002
35
44
  - !ruby/object:Gem::Dependency
36
45
  name: actionpack
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
46
+ prerelease: false
47
+ requirement: &id003 !ruby/object:Gem::Requirement
40
48
  requirements:
41
49
  - - ">="
42
50
  - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
43
53
  version: "0"
44
- version:
54
+ type: :development
55
+ version_requirements: *id003
45
56
  - !ruby/object:Gem::Dependency
46
57
  name: jferris-mocha
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
58
+ prerelease: false
59
+ requirement: &id004 !ruby/object:Gem::Requirement
50
60
  requirements:
51
61
  - - ">="
52
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
53
65
  version: "0"
54
- version:
66
+ type: :development
67
+ version_requirements: *id004
55
68
  - !ruby/object:Gem::Dependency
56
69
  name: nokogiri
57
- type: :development
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id005 !ruby/object:Gem::Requirement
60
72
  requirements:
61
73
  - - ">="
62
74
  - !ruby/object:Gem::Version
75
+ segments:
76
+ - 0
63
77
  version: "0"
64
- version:
78
+ type: :development
79
+ version_requirements: *id005
65
80
  - !ruby/object:Gem::Dependency
66
81
  name: shoulda
67
- type: :development
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
82
+ prerelease: false
83
+ requirement: &id006 !ruby/object:Gem::Requirement
70
84
  requirements:
71
85
  - - ">="
72
86
  - !ruby/object:Gem::Version
87
+ segments:
88
+ - 0
73
89
  version: "0"
74
- version:
90
+ type: :development
91
+ version_requirements: *id006
75
92
  description:
76
- email: support@hoptoadapp.com
93
+ email: cyril.mougel@gmail.com
77
94
  executables: []
78
95
 
79
96
  extensions: []
@@ -81,37 +98,38 @@ extensions: []
81
98
  extra_rdoc_files:
82
99
  - README.rdoc
83
100
  files:
101
+ - CHANGELOG
84
102
  - INSTALL
85
103
  - MIT-LICENSE
86
104
  - Rakefile
87
105
  - README.rdoc
88
106
  - SUPPORTED_RAILS_VERSIONS
89
107
  - TESTING.rdoc
90
- - generators/hoptoad/hoptoad_generator.rb
91
- - generators/hoptoad/lib/insert_commands.rb
92
- - generators/hoptoad/lib/rake_commands.rb
93
- - generators/hoptoad/templates/capistrano_hook.rb
94
- - generators/hoptoad/templates/hoptoad_notifier_tasks.rake
95
- - generators/hoptoad/templates/initializer.rb
96
- - lib/hoptoad_notifier/backtrace.rb
97
- - lib/hoptoad_notifier/capistrano.rb
98
- - lib/hoptoad_notifier/configuration.rb
99
- - lib/hoptoad_notifier/notice.rb
100
- - lib/hoptoad_notifier/rack.rb
101
- - lib/hoptoad_notifier/rails/action_controller_catcher.rb
102
- - lib/hoptoad_notifier/rails/controller_methods.rb
103
- - lib/hoptoad_notifier/rails/error_lookup.rb
104
- - lib/hoptoad_notifier/rails.rb
105
- - lib/hoptoad_notifier/sender.rb
106
- - lib/hoptoad_notifier/tasks.rb
107
- - lib/hoptoad_notifier/version.rb
108
- - lib/hoptoad_notifier.rb
109
- - lib/hoptoad_tasks.rb
108
+ - generators/errornot/errornot_generator.rb
109
+ - generators/errornot/lib/insert_commands.rb
110
+ - generators/errornot/lib/rake_commands.rb
111
+ - generators/errornot/templates/capistrano_hook.rb
112
+ - generators/errornot/templates/errornot_notifier_tasks.rake
113
+ - generators/errornot/templates/initializer.rb
114
+ - lib/errornot_notifier/backtrace.rb
115
+ - lib/errornot_notifier/capistrano.rb
116
+ - lib/errornot_notifier/configuration.rb
117
+ - lib/errornot_notifier/notice.rb
118
+ - lib/errornot_notifier/rack.rb
119
+ - lib/errornot_notifier/rails/action_controller_catcher.rb
120
+ - lib/errornot_notifier/rails/controller_methods.rb
121
+ - lib/errornot_notifier/rails/error_lookup.rb
122
+ - lib/errornot_notifier/rails.rb
123
+ - lib/errornot_notifier/sender.rb
124
+ - lib/errornot_notifier/tasks.rb
125
+ - lib/errornot_notifier/version.rb
126
+ - lib/errornot_notifier.rb
127
+ - lib/errornot_tasks.rb
110
128
  - test/backtrace_test.rb
111
129
  - test/catcher_test.rb
112
130
  - test/configuration_test.rb
131
+ - test/erronot_tasks_test.rb
113
132
  - test/helper.rb
114
- - test/hoptoad_tasks_test.rb
115
133
  - test/logger_test.rb
116
134
  - test/notice_test.rb
117
135
  - test/notifier_test.rb
@@ -122,7 +140,7 @@ files:
122
140
  - script/integration_test.rb
123
141
  - lib/templates/rescue.erb
124
142
  has_rdoc: true
125
- homepage: http://www.hoptoadapp.com
143
+ homepage: http://github.com/shingara/errornot_notifier
126
144
  licenses: []
127
145
 
128
146
  post_install_message:
@@ -136,18 +154,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
154
  requirements:
137
155
  - - ">="
138
156
  - !ruby/object:Gem::Version
157
+ segments:
158
+ - 0
139
159
  version: "0"
140
- version:
141
160
  required_rubygems_version: !ruby/object:Gem::Requirement
142
161
  requirements:
143
162
  - - ">="
144
163
  - !ruby/object:Gem::Version
164
+ segments:
165
+ - 0
145
166
  version: "0"
146
- version:
147
167
  requirements: []
148
168
 
149
169
  rubyforge_project:
150
- rubygems_version: 1.3.5
170
+ rubygems_version: 1.3.6
151
171
  signing_key:
152
172
  specification_version: 3
153
173
  summary: Send your application errors to a hosted service and reclaim your inbox.
@@ -155,7 +175,7 @@ test_files:
155
175
  - test/backtrace_test.rb
156
176
  - test/catcher_test.rb
157
177
  - test/configuration_test.rb
158
- - test/hoptoad_tasks_test.rb
178
+ - test/erronot_tasks_test.rb
159
179
  - test/logger_test.rb
160
180
  - test/notice_test.rb
161
181
  - test/notifier_test.rb
@@ -1,6 +0,0 @@
1
-
2
- Dir[File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
3
- $: << File.join(vendored_notifier, 'lib')
4
- end
5
-
6
- require 'hoptoad_notifier/capistrano'
@@ -1,5 +0,0 @@
1
- Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
2
- $: << File.join(vendored_notifier, 'lib')
3
- end
4
-
5
- require 'hoptoad_notifier/tasks'
@@ -1,20 +0,0 @@
1
- # Defines deploy:notify_hoptoad which will send information about the deploy to Hoptoad.
2
-
3
- Capistrano::Configuration.instance(:must_exist).load do
4
- after "deploy", "deploy:notify_hoptoad"
5
- after "deploy:migrations", "deploy:notify_hoptoad"
6
-
7
- namespace :deploy do
8
- desc "Notify Hoptoad of the deployment"
9
- task :notify_hoptoad, :except => { :no_release => true } do
10
- rails_env = fetch(:hoptoad_env, fetch(:rails_env, "production"))
11
- local_user = ENV['USER'] || ENV['USERNAME']
12
- executable = RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake'
13
- notify_command = "#{executable} hoptoad:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
14
- notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
15
- puts "Notifying Hoptoad of Deploy (#{notify_command})"
16
- `#{notify_command}`
17
- puts "Hoptoad Notification Complete."
18
- end
19
- end
20
- end
@@ -1,3 +0,0 @@
1
- module HoptoadNotifier
2
- VERSION = "0.1.0".freeze
3
- end
@@ -1,138 +0,0 @@
1
- require File.dirname(__FILE__) + '/helper'
2
- require 'rubygems'
3
-
4
- require File.dirname(__FILE__) + '/../lib/hoptoad_tasks'
5
- require 'fakeweb'
6
-
7
- FakeWeb.allow_net_connect = false
8
-
9
- class HoptoadTasksTest < Test::Unit::TestCase
10
- def successful_response(body = "")
11
- response = Net::HTTPSuccess.new('1.2', '200', 'OK')
12
- response.stubs(:body).returns(body)
13
- return response
14
- end
15
-
16
- def unsuccessful_response(body = "")
17
- response = Net::HTTPClientError.new('1.2', '200', 'OK')
18
- response.stubs(:body).returns(body)
19
- return response
20
- end
21
-
22
- context "being quiet" do
23
- setup { HoptoadTasks.stubs(:puts) }
24
-
25
- context "in a configured project" do
26
- setup { HoptoadNotifier.configure { |config| config.api_key = "1234123412341234" } }
27
-
28
- context "on deploy({})" do
29
- setup { @output = HoptoadTasks.deploy({}) }
30
-
31
- before_should "complain about missing rails env" do
32
- HoptoadTasks.expects(:puts).with(regexp_matches(/rails environment/i))
33
- end
34
-
35
- should "return false" do
36
- assert !@output
37
- end
38
- end
39
-
40
- context "given valid options" do
41
- setup { @options = {:rails_env => "staging"} }
42
-
43
- context "on deploy(options)" do
44
- setup { @output = HoptoadTasks.deploy(@options) }
45
-
46
- before_should "post to http://hoptoadapp.com/deploys.txt" do
47
- URI.stubs(:parse).with('http://hoptoadapp.com/deploys.txt').returns(:uri)
48
- Net::HTTP.expects(:post_form).with(:uri, kind_of(Hash)).returns(successful_response)
49
- end
50
-
51
- before_should "use the project api key" do
52
- Net::HTTP.expects(:post_form).
53
- with(kind_of(URI), has_entries('api_key' => "1234123412341234")).
54
- returns(successful_response)
55
- end
56
-
57
- before_should "use send the rails_env param" do
58
- Net::HTTP.expects(:post_form).
59
- with(kind_of(URI), has_entries("deploy[rails_env]" => "staging")).
60
- returns(successful_response)
61
- end
62
-
63
- [:local_username, :scm_repository, :scm_revision].each do |key|
64
- before_should "use send the #{key} param if it's passed in." do
65
- @options[key] = "value"
66
- Net::HTTP.expects(:post_form).
67
- with(kind_of(URI), has_entries("deploy[#{key}]" => "value")).
68
- returns(successful_response)
69
- end
70
- end
71
-
72
- before_should "use the :api_key param if it's passed in." do
73
- @options[:api_key] = "value"
74
- Net::HTTP.expects(:post_form).
75
- with(kind_of(URI), has_entries("api_key" => "value")).
76
- returns(successful_response)
77
- end
78
-
79
- before_should "puts the response body on success" do
80
- HoptoadTasks.expects(:puts).with("body")
81
- Net::HTTP.expects(:post_form).with(any_parameters).returns(successful_response('body'))
82
- end
83
-
84
- before_should "puts the response body on failure" do
85
- HoptoadTasks.expects(:puts).with("body")
86
- Net::HTTP.expects(:post_form).with(any_parameters).returns(unsuccessful_response('body'))
87
- end
88
-
89
- should "return false on failure", :before => lambda {
90
- Net::HTTP.expects(:post_form).with(any_parameters).returns(unsuccessful_response('body'))
91
- } do
92
- assert !@output
93
- end
94
-
95
- should "return true on success", :before => lambda {
96
- Net::HTTP.expects(:post_form).with(any_parameters).returns(successful_response('body'))
97
- } do
98
- assert @output
99
- end
100
- end
101
- end
102
- end
103
-
104
- context "in a configured project with custom host" do
105
- setup do
106
- HoptoadNotifier.configure do |config|
107
- config.api_key = "1234123412341234"
108
- config.host = "custom.host"
109
- end
110
- end
111
-
112
- context "on deploy(:rails_env => 'staging')" do
113
- setup { @output = HoptoadTasks.deploy(:rails_env => "staging") }
114
-
115
- before_should "post to the custom host" do
116
- URI.stubs(:parse).with('http://custom.host/deploys.txt').returns(:uri)
117
- Net::HTTP.expects(:post_form).with(:uri, kind_of(Hash)).returns(successful_response)
118
- end
119
- end
120
- end
121
-
122
- context "when not configured" do
123
- setup { HoptoadNotifier.configure { |config| config.api_key = "" } }
124
-
125
- context "on deploy(:rails_env => 'staging')" do
126
- setup { @output = HoptoadTasks.deploy(:rails_env => "staging") }
127
-
128
- before_should "complain about missing api key" do
129
- HoptoadTasks.expects(:puts).with(regexp_matches(/api key/i))
130
- end
131
-
132
- should "return false" do
133
- assert !@output
134
- end
135
- end
136
- end
137
- end
138
- end