honeybadger 1.9.5 → 1.10.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Appraisals +0 -12
  2. data/CHANGELOG.md +19 -5
  3. data/Gemfile.lock +1 -5
  4. data/MIT-LICENSE +6 -5
  5. data/README.md +6 -596
  6. data/Rakefile +5 -5
  7. data/features/rails.feature +37 -12
  8. data/features/step_definitions/rails_steps.rb +20 -0
  9. data/features/support/honeybadger_shim.rb.template +3 -5
  10. data/gemfiles/rack.gemfile +0 -1
  11. data/gemfiles/rack.gemfile.lock +1 -8
  12. data/gemfiles/rails2.3.gemfile +0 -1
  13. data/gemfiles/rails2.3.gemfile.lock +1 -8
  14. data/gemfiles/rails3.0.gemfile +0 -2
  15. data/gemfiles/rails3.0.gemfile.lock +2 -12
  16. data/gemfiles/rails3.1.gemfile +0 -2
  17. data/gemfiles/rails3.1.gemfile.lock +3 -13
  18. data/gemfiles/rails3.2.gemfile +0 -2
  19. data/gemfiles/rails3.2.gemfile.lock +4 -14
  20. data/gemfiles/rails4.gemfile +0 -2
  21. data/gemfiles/rails4.gemfile.lock +4 -14
  22. data/gemfiles/rake.gemfile +0 -1
  23. data/gemfiles/rake.gemfile.lock +1 -8
  24. data/gemfiles/sinatra.gemfile +0 -1
  25. data/gemfiles/sinatra.gemfile.lock +1 -8
  26. data/honeybadger.gemspec +7 -3
  27. data/lib/honeybadger.rb +7 -5
  28. data/lib/honeybadger/configuration.rb +7 -3
  29. data/lib/honeybadger/monitor/sender.rb +4 -6
  30. data/lib/honeybadger/notice.rb +30 -4
  31. data/lib/honeybadger/rails.rb +2 -0
  32. data/lib/honeybadger/rails3_tasks.rb +2 -2
  33. data/lib/honeybadger/railtie.rb +3 -1
  34. data/lib/honeybadger/sender.rb +63 -53
  35. data/lib/honeybadger/templates/feedback_form.html.erb +82 -0
  36. data/lib/honeybadger/user_feedback.rb +42 -0
  37. data/lib/honeybadger/user_informer.rb +26 -0
  38. data/spec/honeybadger/configuration_spec.rb +4 -1
  39. data/spec/honeybadger/logger_spec.rb +25 -2
  40. data/spec/honeybadger/notice_spec.rb +69 -3
  41. data/spec/honeybadger/sender_spec.rb +77 -54
  42. data/spec/honeybadger/user_feedback_spec.rb +55 -0
  43. data/spec/honeybadger/user_informer_spec.rb +30 -0
  44. data/spec/support/helpers.rb +9 -6
  45. metadata +63 -39
  46. checksums.yaml +0 -7
data/Rakefile CHANGED
@@ -90,13 +90,13 @@ end
90
90
 
91
91
  desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
92
92
  task :release => :build do
93
- #unless `git branch` =~ /^\* master$/
94
- #puts "You must be on the master branch to release!"
95
- #exit!
96
- #end
93
+ unless `git branch` =~ /^\* master$/
94
+ puts "You must be on the master branch to release!"
95
+ exit!
96
+ end
97
97
  sh "git commit --allow-empty -a -m 'Release #{version}'"
98
98
  sh "git tag v#{version}"
99
- sh "git push origin 1.9"
99
+ sh "git push origin master"
100
100
  sh "git push origin v#{version}"
101
101
  sh "gem push pkg/#{name}-#{version}.gem"
102
102
  end
@@ -68,18 +68,6 @@ Feature: Install the Gem in a Rails application
68
68
  Then the output should contain "Better Errors detected"
69
69
  And I should receive a Honeybadger notification
70
70
 
71
- @rails_3
72
- Scenario: Running the test task with rack-mini-profiler installed
73
- When I configure Rails with:
74
- """
75
- require 'rack-mini-profiler'
76
- """
77
- And I configure the notifier to use "myapikey" as an API key
78
- And I configure my application to require Honeybadger
79
- And I run `rake honeybadger:test`
80
- Then the output should not contain "rake aborted"
81
- And I should receive a Honeybadger notification
82
-
83
71
  Scenario: Rescue an exception in a controller
84
72
  When I configure my application to require Honeybadger
85
73
  And I configure Honeybadger with:
@@ -111,6 +99,43 @@ Feature: Install the Gem in a Rails application
111
99
  And I perform a request to "http://example.com:123/test/index?param=value"
112
100
  Then I should receive a Honeybadger notification
113
101
 
102
+ Scenario: Output when user informer is enabled
103
+ When I configure my application to require Honeybadger
104
+ And I configure Honeybadger with:
105
+ """
106
+ config.api_key = 'myapikey'
107
+ config.logger = Logger.new(STDOUT)
108
+ """
109
+ And I define a response for "TestController#index":
110
+ """
111
+ session[:value] = "test"
112
+ raise RuntimeError, "some message"
113
+ """
114
+ And I configure the user informer
115
+ And I route "/test/index" to "test#index"
116
+ And I perform a request to "http://example.com:123/test/index?param=value"
117
+ Then the output should contain "Honeybadger Error 123456789"
118
+ And the output should not contain "<!-- HONEYBADGER ERROR -->"
119
+
120
+ @rails_3
121
+ Scenario: Output when user feedback is enabled
122
+ When I configure my application to require Honeybadger
123
+ And I configure Honeybadger with:
124
+ """
125
+ config.api_key = 'myapikey'
126
+ config.logger = Logger.new(STDOUT)
127
+ """
128
+ And I define a response for "TestController#index":
129
+ """
130
+ session[:value] = "test"
131
+ raise RuntimeError, "some message"
132
+ """
133
+ And I configure the user feedback form
134
+ And I route "/test/index" to "test#index"
135
+ And I perform a request to "http://example.com:123/test/index?param=value"
136
+ Then the output should contain "honeybadger_feedback_token"
137
+ And the output should not contain "<!-- HONEYBADGER FEEDBACK -->"
138
+
114
139
  Scenario: Log output in production environments
115
140
  When I configure my application to require Honeybadger
116
141
  And I configure Honeybadger with:
@@ -119,6 +119,26 @@ When /^I perform a request to "([^\"]*)"$/ do |uri|
119
119
  perform_request(uri)
120
120
  end
121
121
 
122
+ When /^I configure the user informer/ do
123
+ error_page = File.join(rails_root, 'public', '500.html')
124
+ File.open(error_page, "r+") do |file|
125
+ content = file.read
126
+ content.gsub!('</body>', '<!-- HONEYBADGER ERROR --></body>')
127
+ file.rewind
128
+ file.write(content)
129
+ end
130
+ end
131
+
132
+ When /^I configure the user feedback form/ do
133
+ error_page = File.join(rails_root, 'public', '500.html')
134
+ File.open(error_page, "r+") do |file|
135
+ content = file.read
136
+ content.gsub!('</body>', '<!-- HONEYBADGER FEEDBACK --></body>')
137
+ file.rewind
138
+ file.write(content)
139
+ end
140
+ end
141
+
122
142
  When /^I route "([^\"]*)" to "([^\"]*)"$/ do |path, controller_action_pair|
123
143
  route = if rails2?
124
144
  controller, action = controller_action_pair.split('#')
@@ -1,8 +1,6 @@
1
1
  require 'sham_rack'
2
2
 
3
- ShamRack.at("api.honeybadger.io", 443) do |env|
4
- response = <<-end_json
5
- {"id":"123456789"}
6
- end_json
7
- ["200 OK", { "Content-type" => "application/json" }, [response]]
3
+ ShamRack.at("api.honeybadger.io", 443).stub.tap do |app|
4
+ app.register_resource("/v1/notices/", %({"id":"123456789"}), "application/json")
5
+ app.register_resource("/v1/ping/", %({"features":{"notices":true,"feedback":true}, "limit":null}), "application/json")
8
6
  end
@@ -4,6 +4,5 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rack"
6
6
  gem "honeybadger", :path=>"../"
7
- gem "faraday", "~> 0.7.0"
8
7
 
9
8
  gemspec :path=>"../"
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/josh/code/honeybadger-ruby
3
3
  specs:
4
- honeybadger (1.9.5)
5
- faraday (~> 0.7)
4
+ honeybadger (1.10.0.beta1)
6
5
  json
7
6
 
8
7
  GEM
@@ -34,10 +33,6 @@ GEM
34
33
  gherkin (~> 2.11.7)
35
34
  multi_json (~> 1.3)
36
35
  diff-lcs (1.2.4)
37
- faraday (0.7.6)
38
- addressable (~> 2.2)
39
- multipart-post (~> 1.1)
40
- rack (~> 1.1)
41
36
  ffi (1.9.3)
42
37
  formatador (0.2.4)
43
38
  fuubar (1.2.1)
@@ -65,7 +60,6 @@ GEM
65
60
  lumberjack (1.0.4)
66
61
  method_source (0.8.2)
67
62
  multi_json (1.8.2)
68
- multipart-post (1.2.0)
69
63
  net-scp (1.1.2)
70
64
  net-ssh (>= 2.6.5)
71
65
  net-sftp (2.1.2)
@@ -118,7 +112,6 @@ DEPENDENCIES
118
112
  aruba
119
113
  capistrano (~> 2.0)
120
114
  cucumber (~> 1.2.1)
121
- faraday (~> 0.7.0)
122
115
  fuubar
123
116
  growl
124
117
  guard (~> 1.8.3)
@@ -5,7 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "2.3.14"
6
6
  gem "rake", "0.9.5"
7
7
  gem "honeybadger", :path=>"../"
8
- gem "faraday", "~> 0.7.0"
9
8
  gem "capistrano", "~> 2.0"
10
9
 
11
10
  gemspec :path=>"../"
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/josh/code/honeybadger-ruby
3
3
  specs:
4
- honeybadger (1.9.5)
5
- faraday (~> 0.7)
4
+ honeybadger (1.10.0.beta1)
6
5
  json
7
6
 
8
7
  GEM
@@ -45,10 +44,6 @@ GEM
45
44
  gherkin (~> 2.11.7)
46
45
  multi_json (~> 1.3)
47
46
  diff-lcs (1.2.4)
48
- faraday (0.7.6)
49
- addressable (~> 2.2)
50
- multipart-post (~> 1.1)
51
- rack (~> 1.1)
52
47
  ffi (1.9.3)
53
48
  formatador (0.2.4)
54
49
  fuubar (1.2.1)
@@ -76,7 +71,6 @@ GEM
76
71
  lumberjack (1.0.4)
77
72
  method_source (0.8.2)
78
73
  multi_json (1.8.2)
79
- multipart-post (1.2.0)
80
74
  net-scp (1.1.2)
81
75
  net-ssh (>= 2.6.5)
82
76
  net-sftp (2.1.2)
@@ -134,7 +128,6 @@ DEPENDENCIES
134
128
  aruba
135
129
  capistrano (~> 2.0)
136
130
  cucumber (~> 1.2.1)
137
- faraday (~> 0.7.0)
138
131
  fuubar
139
132
  growl
140
133
  guard (~> 1.8.3)
@@ -5,8 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "3.0.17"
6
6
  gem "honeybadger", :path=>"../"
7
7
  gem "better_errors", :require=>false
8
- gem "faraday", "~> 0.7.0"
9
- gem "rack-mini-profiler", :require=>false
10
8
  gem "capistrano", "~> 2.0"
11
9
 
12
10
  gemspec :path=>"../"
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/josh/code/honeybadger-ruby
3
3
  specs:
4
- honeybadger (1.9.5)
5
- faraday (~> 0.7)
4
+ honeybadger (1.10.0.beta1)
6
5
  json
7
6
 
8
7
  GEM
@@ -68,10 +67,6 @@ GEM
68
67
  diff-lcs (1.2.4)
69
68
  erubis (2.6.6)
70
69
  abstract (>= 1.0.0)
71
- faraday (0.7.6)
72
- addressable (~> 2.2)
73
- multipart-post (~> 1.1)
74
- rack (~> 1.1)
75
70
  ffi (1.9.3)
76
71
  formatador (0.2.4)
77
72
  fuubar (1.2.1)
@@ -104,9 +99,8 @@ GEM
104
99
  mime-types (~> 1.16)
105
100
  treetop (~> 1.4.8)
106
101
  method_source (0.8.2)
107
- mime-types (1.25.1)
102
+ mime-types (1.25)
108
103
  multi_json (1.8.2)
109
- multipart-post (1.2.0)
110
104
  net-scp (1.1.2)
111
105
  net-ssh (>= 2.6.5)
112
106
  net-sftp (2.1.2)
@@ -120,8 +114,6 @@ GEM
120
114
  method_source (~> 0.8)
121
115
  slop (~> 3.4)
122
116
  rack (1.2.8)
123
- rack-mini-profiler (0.1.31)
124
- rack (>= 1.1.3)
125
117
  rack-mount (0.6.14)
126
118
  rack (>= 1.0.0)
127
119
  rack-test (0.5.7)
@@ -185,13 +177,11 @@ DEPENDENCIES
185
177
  better_errors
186
178
  capistrano (~> 2.0)
187
179
  cucumber (~> 1.2.1)
188
- faraday (~> 0.7.0)
189
180
  fuubar
190
181
  growl
191
182
  guard (~> 1.8.3)
192
183
  guard-rspec
193
184
  honeybadger!
194
- rack-mini-profiler
195
185
  rails (= 3.0.17)
196
186
  rake
197
187
  rspec (~> 2.14.0)
@@ -5,8 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "3.1.8"
6
6
  gem "honeybadger", :path=>"../"
7
7
  gem "better_errors", :require=>false
8
- gem "faraday", "~> 0.7.0"
9
- gem "rack-mini-profiler", :require=>false
10
8
  gem "capistrano", "~> 2.0"
11
9
 
12
10
  gemspec :path=>"../"
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/josh/code/honeybadger-ruby
3
3
  specs:
4
- honeybadger (1.9.5)
5
- faraday (~> 0.7)
4
+ honeybadger (1.10.0.beta1)
6
5
  json
7
6
 
8
7
  GEM
@@ -67,10 +66,6 @@ GEM
67
66
  json (>= 1.4.6)
68
67
  diff-lcs (1.2.4)
69
68
  erubis (2.7.0)
70
- faraday (0.7.6)
71
- addressable (~> 2.2)
72
- multipart-post (~> 1.1)
73
- rack (~> 1.1)
74
69
  ffi (1.9.3)
75
70
  formatador (0.2.4)
76
71
  fuubar (1.2.1)
@@ -91,7 +86,7 @@ GEM
91
86
  rspec (~> 2.13)
92
87
  highline (1.6.20)
93
88
  hike (1.2.3)
94
- i18n (0.6.9)
89
+ i18n (0.6.5)
95
90
  json (1.8.1)
96
91
  listen (1.3.1)
97
92
  rb-fsevent (>= 0.9.3)
@@ -103,9 +98,8 @@ GEM
103
98
  mime-types (~> 1.16)
104
99
  treetop (~> 1.4.8)
105
100
  method_source (0.8.2)
106
- mime-types (1.25.1)
101
+ mime-types (1.25)
107
102
  multi_json (1.2.0)
108
- multipart-post (1.2.0)
109
103
  net-scp (1.1.2)
110
104
  net-ssh (>= 2.6.5)
111
105
  net-sftp (2.1.2)
@@ -121,8 +115,6 @@ GEM
121
115
  rack (1.3.6)
122
116
  rack-cache (1.2)
123
117
  rack (>= 0.4)
124
- rack-mini-profiler (0.1.31)
125
- rack (>= 1.1.3)
126
118
  rack-mount (0.8.3)
127
119
  rack (>= 1.0.0)
128
120
  rack-protection (1.5.1)
@@ -195,13 +187,11 @@ DEPENDENCIES
195
187
  better_errors
196
188
  capistrano (~> 2.0)
197
189
  cucumber (~> 1.2.1)
198
- faraday (~> 0.7.0)
199
190
  fuubar
200
191
  growl
201
192
  guard (~> 1.8.3)
202
193
  guard-rspec
203
194
  honeybadger!
204
- rack-mini-profiler
205
195
  rails (= 3.1.8)
206
196
  rake
207
197
  rspec (~> 2.14.0)
@@ -5,8 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "3.2.12"
6
6
  gem "honeybadger", :path=>"../"
7
7
  gem "better_errors", :require=>false
8
- gem "faraday", "~> 0.7.0"
9
- gem "rack-mini-profiler", :require=>false
10
8
  gem "capistrano", "~> 2.0"
11
9
 
12
10
  gemspec :path=>"../"
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/josh/code/honeybadger-ruby
3
3
  specs:
4
- honeybadger (1.9.5)
5
- faraday (~> 0.7)
4
+ honeybadger (1.10.0.beta1)
6
5
  json
7
6
 
8
7
  GEM
@@ -39,7 +38,7 @@ GEM
39
38
  appraisal (0.5.2)
40
39
  bundler
41
40
  rake
42
- arel (3.0.3)
41
+ arel (3.0.2)
43
42
  aruba (0.5.3)
44
43
  childprocess (>= 0.3.6)
45
44
  cucumber (>= 1.1.1)
@@ -66,10 +65,6 @@ GEM
66
65
  multi_json (~> 1.3)
67
66
  diff-lcs (1.2.4)
68
67
  erubis (2.7.0)
69
- faraday (0.7.6)
70
- addressable (~> 2.2)
71
- multipart-post (~> 1.1)
72
- rack (~> 1.1)
73
68
  ffi (1.9.3)
74
69
  formatador (0.2.4)
75
70
  fuubar (1.2.1)
@@ -90,7 +85,7 @@ GEM
90
85
  rspec (~> 2.13)
91
86
  highline (1.6.20)
92
87
  hike (1.2.3)
93
- i18n (0.6.9)
88
+ i18n (0.6.5)
94
89
  journey (1.0.4)
95
90
  json (1.8.1)
96
91
  listen (1.3.1)
@@ -103,9 +98,8 @@ GEM
103
98
  mime-types (~> 1.16)
104
99
  treetop (~> 1.4.8)
105
100
  method_source (0.8.2)
106
- mime-types (1.25.1)
101
+ mime-types (1.25)
107
102
  multi_json (1.8.2)
108
- multipart-post (1.2.0)
109
103
  net-scp (1.1.2)
110
104
  net-ssh (>= 2.6.5)
111
105
  net-sftp (2.1.2)
@@ -121,8 +115,6 @@ GEM
121
115
  rack (1.4.5)
122
116
  rack-cache (1.2)
123
117
  rack (>= 0.4)
124
- rack-mini-profiler (0.1.31)
125
- rack (>= 1.1.3)
126
118
  rack-protection (1.5.1)
127
119
  rack
128
120
  rack-ssl (1.3.3)
@@ -194,13 +186,11 @@ DEPENDENCIES
194
186
  better_errors
195
187
  capistrano (~> 2.0)
196
188
  cucumber (~> 1.2.1)
197
- faraday (~> 0.7.0)
198
189
  fuubar
199
190
  growl
200
191
  guard (~> 1.8.3)
201
192
  guard-rspec
202
193
  honeybadger!
203
- rack-mini-profiler
204
194
  rails (= 3.2.12)
205
195
  rake
206
196
  rspec (~> 2.14.0)
@@ -5,8 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "4.0.1"
6
6
  gem "honeybadger", :path=>"../"
7
7
  gem "better_errors", :require=>false
8
- gem "faraday", "~> 0.7.0"
9
- gem "rack-mini-profiler", :require=>false
10
8
  gem "capistrano", "~> 2.0"
11
9
 
12
10
  gemspec :path=>"../"
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/josh/code/honeybadger-ruby
3
3
  specs:
4
- honeybadger (1.9.5)
5
- faraday (~> 0.7)
4
+ honeybadger (1.10.0.beta1)
6
5
  json
7
6
 
8
7
  GEM
@@ -64,10 +63,6 @@ GEM
64
63
  multi_json (~> 1.3)
65
64
  diff-lcs (1.2.4)
66
65
  erubis (2.7.0)
67
- faraday (0.7.6)
68
- addressable (~> 2.2)
69
- multipart-post (~> 1.1)
70
- rack (~> 1.1)
71
66
  ffi (1.9.3)
72
67
  formatador (0.2.4)
73
68
  fuubar (1.2.1)
@@ -88,7 +83,7 @@ GEM
88
83
  rspec (~> 2.13)
89
84
  highline (1.6.20)
90
85
  hike (1.2.3)
91
- i18n (0.6.9)
86
+ i18n (0.6.5)
92
87
  json (1.8.1)
93
88
  listen (1.3.1)
94
89
  rb-fsevent (>= 0.9.3)
@@ -99,10 +94,9 @@ GEM
99
94
  mime-types (~> 1.16)
100
95
  treetop (~> 1.4.8)
101
96
  method_source (0.8.2)
102
- mime-types (1.25.1)
97
+ mime-types (1.25)
103
98
  minitest (4.7.5)
104
99
  multi_json (1.8.2)
105
- multipart-post (1.2.0)
106
100
  net-scp (1.1.2)
107
101
  net-ssh (>= 2.6.5)
108
102
  net-sftp (2.1.2)
@@ -116,8 +110,6 @@ GEM
116
110
  method_source (~> 0.8)
117
111
  slop (~> 3.4)
118
112
  rack (1.5.2)
119
- rack-mini-profiler (0.1.31)
120
- rack (>= 1.1.3)
121
113
  rack-protection (1.5.1)
122
114
  rack
123
115
  rack-test (0.6.2)
@@ -159,7 +151,7 @@ GEM
159
151
  rack-protection (~> 1.4)
160
152
  tilt (~> 1.3, >= 1.3.4)
161
153
  slop (3.4.6)
162
- sprockets (2.10.1)
154
+ sprockets (2.10.0)
163
155
  hike (~> 1.2)
164
156
  multi_json (~> 1.0)
165
157
  rack (~> 1.0)
@@ -189,13 +181,11 @@ DEPENDENCIES
189
181
  better_errors
190
182
  capistrano (~> 2.0)
191
183
  cucumber (~> 1.2.1)
192
- faraday (~> 0.7.0)
193
184
  fuubar
194
185
  growl
195
186
  guard (~> 1.8.3)
196
187
  guard-rspec
197
188
  honeybadger!
198
- rack-mini-profiler
199
189
  rails (= 4.0.1)
200
190
  rake
201
191
  rspec (~> 2.14.0)