honeybadger 1.12.0.beta2 → 1.12.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
data/Appraisals CHANGED
@@ -10,7 +10,12 @@ if RUBY_VERSION > '1.9' && RUBY_PLATFORM !~ /java/
10
10
  end
11
11
 
12
12
  appraise 'rake' do
13
- gem 'sinatra'
13
+ gem 'rake'
14
+ gem 'honeybadger', :path => '../'
15
+ end
16
+
17
+ appraise 'thor' do
18
+ gem 'thor'
14
19
  gem 'honeybadger', :path => '../'
15
20
  end
16
21
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Honeybadger 1.12.0 (unreleased) ##
2
2
 
3
+ * Catch exceptions in Thor tasks.
4
+
5
+ *Ryan Sonnek*
6
+
3
7
  * Add option to send local_variables when binding_of_caller is
4
8
  installed. In order to enable it, the gem must be present in the
5
9
  project, and `config.send_local_variables` must be `true`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- honeybadger (1.12.0.beta2)
4
+ honeybadger (1.12.0.beta3)
5
5
  json
6
6
 
7
7
  GEM
data/Rakefile CHANGED
@@ -72,6 +72,8 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
72
72
  t.cucumber_opts << 'features/rack.feature'
73
73
  when /rake/
74
74
  t.cucumber_opts << 'features/rake.feature'
75
+ when /thor/
76
+ t.cucumber_opts << 'features/thor.feature'
75
77
  when /sinatra/
76
78
  t.cucumber_opts << 'features/sinatra.feature'
77
79
  else
@@ -0,0 +1,4 @@
1
+ When /I run thor with (.+)/ do |command|
2
+ FileUtils.cp(File.expand_path('../../support/test.thor', __FILE__), TEMP_DIR)
3
+ step %(I run `thor #{command.gsub(' ','_')}`)
4
+ end
@@ -0,0 +1,22 @@
1
+ require 'thor'
2
+ require 'honeybadger'
3
+
4
+ require 'sham_rack'
5
+
6
+ ShamRack.at("api.honeybadger.io", 443).stub.tap do |app|
7
+ app.register_resource("/v1/notices/", %({"id":"123456789"}), "application/json")
8
+ app.register_resource("/v1/ping/", %({"features":{"notices":true,"feedback":true}, "limit":null}), "application/json")
9
+ end
10
+
11
+ Honeybadger.configure do |config|
12
+ config.api_key = 'asdf'
13
+ config.debug = true
14
+ config.logger = Logger.new(STDOUT)
15
+ end
16
+
17
+ class Test < Thor
18
+ desc "honeybadger", "this goes boom"
19
+ def honeybadger
20
+ fail 'boom'
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ Feature: Use the Gem to catch errors in a Thor application
2
+
3
+ Scenario: Catching exceptions in Thor
4
+ When I run thor with test:honeybadger
5
+ Then I should receive a Honeybadger notification
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sinatra"
5
+ gem "rake"
6
6
  gem "honeybadger", :path=>"../"
7
7
 
8
8
  gemspec :path=>"../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "thor"
6
+ gem "honeybadger", :path=>"../"
7
+
8
+ gemspec :path=>"../"
data/honeybadger.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'honeybadger'
7
- s.version = '1.12.0.beta2'
8
- s.date = '2014-04-01'
7
+ s.version = '1.12.0.beta3'
8
+ s.date = '2014-04-08'
9
9
 
10
10
  s.summary = 'Error reports you can be happy about.'
11
11
  s.description = 'Make managing application errors a more pleasant experience.'
@@ -59,11 +59,14 @@ Gem::Specification.new do |s|
59
59
  features/step_definitions/rails_steps.rb
60
60
  features/step_definitions/rake_steps.rb
61
61
  features/step_definitions/standalone_steps.rb
62
+ features/step_definitions/thor_steps.rb
62
63
  features/support/env.rb
63
64
  features/support/honeybadger_failure_shim.rb.template
64
65
  features/support/honeybadger_shim.rb.template
65
66
  features/support/rails.rb
66
67
  features/support/rake/Rakefile
68
+ features/support/test.thor
69
+ features/thor.feature
67
70
  gemfiles/binding_of_caller.gemfile
68
71
  gemfiles/rack.gemfile
69
72
  gemfiles/rails.gemfile
@@ -76,6 +79,7 @@ Gem::Specification.new do |s|
76
79
  gemfiles/rake.gemfile
77
80
  gemfiles/sinatra.gemfile
78
81
  gemfiles/standalone.gemfile
82
+ gemfiles/thor.gemfile
79
83
  generators/honeybadger/honeybadger_generator.rb
80
84
  generators/honeybadger/lib/insert_commands.rb
81
85
  generators/honeybadger/lib/rake_commands.rb
@@ -96,6 +100,7 @@ Gem::Specification.new do |s|
96
100
  lib/honeybadger/integrations/delayed_job.rb
97
101
  lib/honeybadger/integrations/delayed_job/plugin.rb
98
102
  lib/honeybadger/integrations/sidekiq.rb
103
+ lib/honeybadger/integrations/thor.rb
99
104
  lib/honeybadger/monitor.rb
100
105
  lib/honeybadger/monitor/railtie.rb
101
106
  lib/honeybadger/monitor/sender.rb
@@ -133,6 +138,7 @@ Gem::Specification.new do |s|
133
138
  spec/honeybadger/exception_extensions_spec.rb
134
139
  spec/honeybadger/integrations/delayed_job_spec.rb
135
140
  spec/honeybadger/integrations/sidekiq_spec.rb
141
+ spec/honeybadger/integrations/thor_spec.rb
136
142
  spec/honeybadger/logger_spec.rb
137
143
  spec/honeybadger/monitor/worker_spec.rb
138
144
  spec/honeybadger/notice_spec.rb
data/lib/honeybadger.rb CHANGED
@@ -19,7 +19,7 @@ require 'honeybadger/exception_extensions'
19
19
  require 'honeybadger/railtie' if defined?(Rails::Railtie)
20
20
 
21
21
  module Honeybadger
22
- VERSION = '1.12.0.beta2'
22
+ VERSION = '1.12.0.beta3'
23
23
  LOG_PREFIX = "** [Honeybadger] "
24
24
 
25
25
  HEADERS = {
@@ -2,3 +2,4 @@ module Honeybadger::Integrations; end
2
2
 
3
3
  require 'honeybadger/integrations/delayed_job'
4
4
  require 'honeybadger/integrations/sidekiq'
5
+ require 'honeybadger/integrations/thor'
@@ -0,0 +1,29 @@
1
+ module Honeybadger
2
+ module Integrations
3
+ module Thor
4
+ def self.included(base)
5
+ base.class_eval do
6
+ no_commands do
7
+ alias_method :invoke_command_without_honeybadger, :invoke_command
8
+ alias_method :invoke_command, :invoke_command_with_honeybadger
9
+ end
10
+ end
11
+ end
12
+
13
+ def invoke_command_with_honeybadger(*args)
14
+ invoke_command_without_honeybadger(*args)
15
+ rescue Exception => e
16
+ Honeybadger.notify_or_ignore(e)
17
+ raise
18
+ end
19
+ end
20
+ end
21
+
22
+ Dependency.register do
23
+ requirement { defined?(::Thor) }
24
+
25
+ injection do
26
+ Thor.send(:include, Integrations::Thor)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Thor Dependency" do
4
+ before do
5
+ Honeybadger::Dependency.reset!
6
+ end
7
+
8
+ context "when thor is not installed" do
9
+ it "fails quietly" do
10
+ expect { Honeybadger::Dependency.inject! }.not_to raise_error
11
+ end
12
+ end
13
+
14
+ context "when thor is installed" do
15
+ let(:shim) do
16
+ double('fake thor')
17
+ end
18
+
19
+ before do
20
+ Object.const_set(:Thor, shim)
21
+ end
22
+ after { Object.send(:remove_const, :Thor) }
23
+
24
+ it "includes integration module into Thor" do
25
+ shim.should_receive(:send).with(:include, Honeybadger::Integrations::Thor)
26
+ Honeybadger::Dependency.inject!
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,32 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0.beta2
4
+ version: 1.12.0.beta3
5
+ prerelease: 7
5
6
  platform: ruby
6
7
  authors:
7
8
  - Joshua Wood
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
12
+ date: 2014-04-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: json
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: cucumber
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: sham_rack
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: capistrano
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: guard
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -97,113 +110,129 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: guard-rspec
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - '>='
115
+ - - ! '>='
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - '>='
123
+ - - ! '>='
109
124
  - !ruby/object:Gem::Version
110
125
  version: '0'
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: rake
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - '>='
131
+ - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
133
  version: '0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - '>='
139
+ - - ! '>='
123
140
  - !ruby/object:Gem::Version
124
141
  version: '0'
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: sinatra
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
- - - '>='
147
+ - - ! '>='
130
148
  - !ruby/object:Gem::Version
131
149
  version: '0'
132
150
  type: :development
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
- - - '>='
155
+ - - ! '>='
137
156
  - !ruby/object:Gem::Version
138
157
  version: '0'
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: aruba
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
- - - '>='
163
+ - - ! '>='
144
164
  - !ruby/object:Gem::Version
145
165
  version: '0'
146
166
  type: :development
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
- - - '>='
171
+ - - ! '>='
151
172
  - !ruby/object:Gem::Version
152
173
  version: '0'
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: appraisal
155
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
- - - '>='
179
+ - - ! '>='
158
180
  - !ruby/object:Gem::Version
159
181
  version: '0'
160
182
  type: :development
161
183
  prerelease: false
162
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
- - - '>='
187
+ - - ! '>='
165
188
  - !ruby/object:Gem::Version
166
189
  version: '0'
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: fuubar
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
- - - '>='
195
+ - - ! '>='
172
196
  - !ruby/object:Gem::Version
173
197
  version: '0'
174
198
  type: :development
175
199
  prerelease: false
176
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
177
202
  requirements:
178
- - - '>='
203
+ - - ! '>='
179
204
  - !ruby/object:Gem::Version
180
205
  version: '0'
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: growl
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
- - - '>='
211
+ - - ! '>='
186
212
  - !ruby/object:Gem::Version
187
213
  version: '0'
188
214
  type: :development
189
215
  prerelease: false
190
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
191
218
  requirements:
192
- - - '>='
219
+ - - ! '>='
193
220
  - !ruby/object:Gem::Version
194
221
  version: '0'
195
222
  - !ruby/object:Gem::Dependency
196
223
  name: webmock
197
224
  requirement: !ruby/object:Gem::Requirement
225
+ none: false
198
226
  requirements:
199
- - - '>='
227
+ - - ! '>='
200
228
  - !ruby/object:Gem::Version
201
229
  version: '0'
202
230
  type: :development
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
205
234
  requirements:
206
- - - '>='
235
+ - - ! '>='
207
236
  - !ruby/object:Gem::Version
208
237
  version: '0'
209
238
  description: Make managing application errors a more pleasant experience.
@@ -233,11 +262,14 @@ files:
233
262
  - features/step_definitions/rails_steps.rb
234
263
  - features/step_definitions/rake_steps.rb
235
264
  - features/step_definitions/standalone_steps.rb
265
+ - features/step_definitions/thor_steps.rb
236
266
  - features/support/env.rb
237
267
  - features/support/honeybadger_failure_shim.rb.template
238
268
  - features/support/honeybadger_shim.rb.template
239
269
  - features/support/rails.rb
240
270
  - features/support/rake/Rakefile
271
+ - features/support/test.thor
272
+ - features/thor.feature
241
273
  - gemfiles/binding_of_caller.gemfile
242
274
  - gemfiles/rack.gemfile
243
275
  - gemfiles/rails.gemfile
@@ -250,6 +282,7 @@ files:
250
282
  - gemfiles/rake.gemfile
251
283
  - gemfiles/sinatra.gemfile
252
284
  - gemfiles/standalone.gemfile
285
+ - gemfiles/thor.gemfile
253
286
  - generators/honeybadger/honeybadger_generator.rb
254
287
  - generators/honeybadger/lib/insert_commands.rb
255
288
  - generators/honeybadger/lib/rake_commands.rb
@@ -270,6 +303,7 @@ files:
270
303
  - lib/honeybadger/integrations/delayed_job.rb
271
304
  - lib/honeybadger/integrations/delayed_job/plugin.rb
272
305
  - lib/honeybadger/integrations/sidekiq.rb
306
+ - lib/honeybadger/integrations/thor.rb
273
307
  - lib/honeybadger/monitor.rb
274
308
  - lib/honeybadger/monitor/railtie.rb
275
309
  - lib/honeybadger/monitor/sender.rb
@@ -307,6 +341,7 @@ files:
307
341
  - spec/honeybadger/exception_extensions_spec.rb
308
342
  - spec/honeybadger/integrations/delayed_job_spec.rb
309
343
  - spec/honeybadger/integrations/sidekiq_spec.rb
344
+ - spec/honeybadger/integrations/thor_spec.rb
310
345
  - spec/honeybadger/logger_spec.rb
311
346
  - spec/honeybadger/monitor/worker_spec.rb
312
347
  - spec/honeybadger/notice_spec.rb
@@ -328,7 +363,6 @@ files:
328
363
  - spec/support/helpers.rb
329
364
  homepage: http://www.honeybadger.io
330
365
  licenses: []
331
- metadata: {}
332
366
  post_install_message:
333
367
  rdoc_options:
334
368
  - --charset=UTF-8
@@ -336,18 +370,23 @@ rdoc_options:
336
370
  require_paths:
337
371
  - lib
338
372
  required_ruby_version: !ruby/object:Gem::Requirement
373
+ none: false
339
374
  requirements:
340
- - - '>='
375
+ - - ! '>='
341
376
  - !ruby/object:Gem::Version
342
377
  version: '0'
378
+ segments:
379
+ - 0
380
+ hash: -754790268402252973
343
381
  required_rubygems_version: !ruby/object:Gem::Requirement
382
+ none: false
344
383
  requirements:
345
- - - '>'
384
+ - - ! '>'
346
385
  - !ruby/object:Gem::Version
347
386
  version: 1.3.1
348
387
  requirements: []
349
388
  rubyforge_project:
350
- rubygems_version: 2.1.5
389
+ rubygems_version: 1.8.23
351
390
  signing_key:
352
391
  specification_version: 2
353
392
  summary: Error reports you can be happy about.
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: f13dbb0c4361cea34b1fe5d3f1a85432fc40a8b0
4
- data.tar.gz: c7f4632eb5ee4bcfca17a9c81f96b7cd1c033f45
5
- SHA512:
6
- metadata.gz: c3cdc55eb70ec84d95057d366c0813b28b58c300daf3df88226e82f5309aae8e0f4b1b3a37c1b3a07b32760e26aaac768f45d74976f755b99705ff6678d30633
7
- data.tar.gz: 59ad35ef1d2d59acbc1ccb711109d96928b470508f2d3f581725959f18b1a160f296eb995e61736695e838a1c3f3b8c80a2bb368698f36fbd3b5e2249a883956