honeybadger 2.0.0.beta.11 → 2.0.0.beta.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 047e06b2f9c1ad1178f0acec89a80c7a4a6ac51c
4
- data.tar.gz: 48949791254cdaf720f012fa3e516f269edb3533
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ N2NjM2Y4Yzg0ODBmNmVjZTBkYWEzNDgxNzc3MDlmMWFmMTlmODRhMQ==
5
+ data.tar.gz: !binary |-
6
+ Njc3ZjA5YTRjZGExMjVlMmY1NmUxMmEwZjU1YjI5ZGNlNmQyNDA2MQ==
5
7
  SHA512:
6
- metadata.gz: a975c34dcdb43f187251696ac68af8cf29290faca1c18e55a85e99b9d5e1a10dd1e2a326933c5916ddd876a0233fd075f59a39f35d903bb75fdb10d9a2d112ad
7
- data.tar.gz: ce873c45c9e52d2658861851dae85457154e072d561f9a2e20f3691e1c7a5d2beecf354a9583b5c7c29b9bbe5c07039f1934211c72c48e0e7daac396c1bb53e0
8
+ metadata.gz: !binary |-
9
+ ZTg5NWI3ZmE0NTc3N2E4ZTZhZmQwZWQyMjY2ODQ5ZTJkYTVkMzBkN2U0OTZk
10
+ MWQ2MzFmMDE4ZDk0Y2Q4MjI0MjJjOTRkMzAxNzQ0MDMzMzBmZWY3YzQ2NThj
11
+ YjYzM2I3NWZmMGNiZjA0N2Q3ODZmMjMyNDAyNzUzZWE1N2JmMWU=
12
+ data.tar.gz: !binary |-
13
+ OTZmZTg0MjBhMmY0N2M3NWQ2YWJhMmNjZGI0NWFjOWJiYjFlNTE4ZjFhYWRh
14
+ MmZkZDZmMTlmZTIwMzcyMzRmYWVmZDk2NzFkODFjNmM5MjJkYzdiODljMDQ2
15
+ MzY4N2I4MGEzYmEzNjQxNWQzOGFmZjdiYzEzZmMxYTVkYzFlOTQ=
@@ -63,9 +63,10 @@ module Honeybadger
63
63
  elsif !config.valid?
64
64
  config.logger.warn('Unable to start Honeybadger -- api_key is missing or invalid.')
65
65
  return false
66
- elsif !config.ping
67
- config.logger.warn('Unable to start Honeybadger -- failed to connect to server.')
68
- return false
66
+ end
67
+
68
+ unless config.ping
69
+ config.logger.warn('Failed to connect to Honeybadger service -- please verify that api.honeybadger.io is reachable (connection will be retried).')
69
70
  end
70
71
 
71
72
  config.logger.info("Starting Honeybadger version #{VERSION}")
@@ -147,8 +148,15 @@ module Honeybadger
147
148
  init_metrics
148
149
 
149
150
  at_exit do
150
- stop
151
+ # Fix for https://bugs.ruby-lang.org/issues/5218
152
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' && RUBY_VERSION =~ /1\.9/
153
+ exit_status = $!.status if $!.is_a?(SystemExit)
154
+ end
155
+
156
+ stop if config[:'send_data_at_exit']
151
157
  self.class.at_exit.call if self.class.at_exit
158
+
159
+ exit(exit_status) if exit_status
152
160
  end
153
161
  end
154
162
 
@@ -6,7 +6,7 @@ module Honeybadger
6
6
  true
7
7
  end
8
8
 
9
- def shutdown(timeout = nil)
9
+ def shutdown
10
10
  true
11
11
  end
12
12
 
@@ -48,12 +48,10 @@ module Honeybadger
48
48
  end
49
49
  end
50
50
 
51
- # Internal: Shutdown the worker.
51
+ # Internal: Shutdown the worker after sending remaining data.
52
52
  #
53
- # timeout - The Integer timeout to wait before killing thread.
54
- #
55
- # Returns false if timeout reached, otherwise true.
56
- def shutdown(timeout = 3)
53
+ # Returns true.
54
+ def shutdown
57
55
  mutex.synchronize do
58
56
  @shutdown = true
59
57
  @pid = nil
@@ -65,7 +63,7 @@ module Honeybadger
65
63
  r = true
66
64
  unless Thread.current.eql?(thread)
67
65
  begin
68
- r = !!thread.join(timeout)
66
+ r = !!thread.join
69
67
  ensure
70
68
  shutdown! unless r
71
69
  end
@@ -141,10 +141,10 @@ module Honeybadger
141
141
  begin
142
142
  r.disable_clear_and_finalize = true
143
143
  r.clear!
144
- ::Rails.application.routes_reloader.paths.each{ |path| load(path) }
145
144
  r.draw do
146
145
  match 'verify' => 'honeybadger/test#verify', :as => 'verify', :via => :get
147
146
  end
147
+ ::Rails.application.routes_reloader.paths.each{ |path| load(path) }
148
148
  ::ActiveSupport.on_load(:action_controller) { r.finalize! }
149
149
  ensure
150
150
  r.disable_clear_and_finalize = d
@@ -29,10 +29,10 @@ module Honeybadger
29
29
  exit(1)
30
30
  end
31
31
 
32
- command = %Q(heroku addons:add deployhooks:http --url="https://api.honeybadger.io/v1/deploys?deploy[environment]=#{rails_env}&deploy[local_username]={{user}}&deploy[revision]={{head}}&api_key=#{api_key}"#{app ? " --app #{app}" : ''})
32
+ cmd = %Q(heroku addons:add deployhooks:http --url="https://api.honeybadger.io/v1/deploys?deploy[environment]=#{rails_env}&deploy[local_username]={{user}}&deploy[revision]={{head}}&api_key=#{api_key}"#{app ? " --app #{app}" : ''})
33
33
 
34
- say("Running: `#{command}`")
35
- say(`#{command}`)
34
+ say("Running: `#{cmd}`")
35
+ say(run(cmd))
36
36
  end
37
37
 
38
38
  desc 'install API_KEY', 'Install Honeybadger on Heroku using API_KEY'
@@ -115,16 +115,20 @@ module Honeybadger
115
115
  end
116
116
  end
117
117
 
118
+ def run(cmd)
119
+ Bundler.with_clean_env { `#{cmd}` }
120
+ end
121
+
118
122
  def heroku_var(var, app_name, default = nil)
119
123
  app = app_name ? "--app #{app_name}" : ''
120
- result = Bundler.with_clean_env { `heroku config:get #{var} #{app} 2> /dev/null`.strip }
124
+ result = run("heroku config:get #{var} #{app} 2> /dev/null").strip
121
125
  result.split.find(lambda { default }) {|x| x =~ /\S/ }
122
126
  end
123
127
 
124
128
  def read_heroku_env(app = nil)
125
129
  cmd = ['heroku config']
126
130
  cmd << "--app #{app}" if app
127
- output = Bundler.with_clean_env { `#{cmd.join("\s")}` }
131
+ output = run(cmd.join("\s"))
128
132
  return false unless $?.to_i == 0
129
133
  Hash[output.scan(/(HONEYBADGER_[^:]+):\s*(\S.*)\s*$/)]
130
134
  end
@@ -140,7 +144,7 @@ module Honeybadger
140
144
  cmd = ["heroku config:set"]
141
145
  Hash(env).each_pair {|k,v| cmd << "#{k}=#{v}" }
142
146
  cmd << "--app #{app}" if app
143
- Bundler.with_clean_env { `#{cmd.join("\s")}` }
147
+ run(cmd.join("\s"))
144
148
  $?.to_i == 0
145
149
  end
146
150
  end
@@ -123,7 +123,7 @@ module Honeybadger
123
123
  ENV['HONEYBADGER_REPORT_DATA'] = 'true'
124
124
 
125
125
  config = Config.new(rails_framework_opts)
126
- config[:api_key] = api_key
126
+ config[:api_key] = api_key.to_s
127
127
 
128
128
  if (path = config.config_path).exist?
129
129
  say("You're already on Honeybadger, so you're all set.", :yellow)
@@ -98,7 +98,7 @@ module Honeybadger
98
98
  end
99
99
 
100
100
  def valid?
101
- self[:api_key] =~ /\S/
101
+ self[:api_key].to_s =~ /\S/
102
102
  end
103
103
 
104
104
  def debug?
@@ -204,7 +204,7 @@ module Honeybadger
204
204
  File.open(path, 'w+') do |file|
205
205
  file.write(<<-CONFIG)
206
206
  ---
207
- api_key: #{self[:api_key]}
207
+ api_key: '#{self[:api_key]}'
208
208
  CONFIG
209
209
  end
210
210
  end
@@ -49,6 +49,10 @@ module Honeybadger
49
49
  description: 'Environments which will not report data by default (use report_data to enable/disable explicitly).',
50
50
  default: ['development'.freeze, 'test'.freeze, 'cucumber'.freeze].freeze
51
51
  },
52
+ :'send_data_at_exit' => {
53
+ description: 'Send remaining data when Ruby exits.',
54
+ default: true
55
+ },
52
56
  plugins: {
53
57
  description: 'An optional list of plugins to load. Default is to load all plugins.',
54
58
  default: nil
@@ -42,7 +42,7 @@ module Honeybadger
42
42
  def http_headers(headers = nil)
43
43
  {}.tap do |hash|
44
44
  hash.merge!(HEADERS)
45
- hash.merge!({'X-API-Key' => config[:api_key]})
45
+ hash.merge!({'X-API-Key' => config[:api_key].to_s})
46
46
  hash.merge!(headers) if headers
47
47
  end
48
48
  end
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '2.0.0.beta.11'.freeze
3
+ VERSION = '2.0.0.beta.12'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta.11
4
+ version: 2.0.0.beta.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -117,33 +117,28 @@ homepage: https://github.com/honeybadger-io/honeybadger-ruby
117
117
  licenses:
118
118
  - MIT
119
119
  metadata: {}
120
- post_install_message: |2+
121
-
122
- Thanks for installing honeybadger version 2.0! If you're upgrading from 1.x,
123
- please note that there may be a few configuration changes required. Read the
124
- upgrade instructions at:
125
-
126
- https://www.honeybadger.io/s/gem-upgrade
127
-
120
+ post_install_message: ! "\n Thanks for installing honeybadger version 2.0! If you're
121
+ upgrading from 1.x,\n please note that there may be a few configuration changes
122
+ required. Read the\n upgrade instructions at:\n\n https://www.honeybadger.io/s/gem-upgrade\n\n"
128
123
  rdoc_options:
129
- - "--markup=tomdoc"
130
- - "--main=README.md"
124
+ - --markup=tomdoc
125
+ - --main=README.md
131
126
  require_paths:
132
127
  - lib
133
128
  - vendor/capistrano-honeybadger/lib
134
129
  required_ruby_version: !ruby/object:Gem::Requirement
135
130
  requirements:
136
- - - ">="
131
+ - - ! '>='
137
132
  - !ruby/object:Gem::Version
138
133
  version: 1.9.3
139
134
  required_rubygems_version: !ruby/object:Gem::Requirement
140
135
  requirements:
141
- - - ">"
136
+ - - ! '>'
142
137
  - !ruby/object:Gem::Version
143
138
  version: 1.3.1
144
139
  requirements: []
145
140
  rubyforge_project:
146
- rubygems_version: 2.4.5
141
+ rubygems_version: 2.4.4
147
142
  signing_key:
148
143
  specification_version: 4
149
144
  summary: Error reports you can be happy about.