honeybadger 2.1.0.beta.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c15d3c01298686c17a3a9d7e3bff2ea5e8f9c405
4
- data.tar.gz: 1adcb986179de4841b049ca5e4ad32991abf6d20
3
+ metadata.gz: 0e792f463bd86a18b5499b2e995407f014db4e82
4
+ data.tar.gz: 868f7529ee321a42dc00f783ab41cf6182262308
5
5
  SHA512:
6
- metadata.gz: 3703b084a51b6b101c203ab1eb3a858a0fad93af5f65bf4fe4b2a8a661b9211feb0515f8c18dbc50663090870701b6494f17f220e76e4df78bd2389ec2f9c716
7
- data.tar.gz: 59f5fe48854c4ee55b9ac424ffa86a2f99141aeaed3dfd66efaa873ea64b429612d06faa15ea9dbacdc73c829155f9c839bac835f8ad66090b66d3d58ae20a4f
6
+ metadata.gz: da5baa248b75404411f27261afa1821d7dd721257498a9a5edf299016bf14e28860aa86897c9f71cb0d8becb2e3e089148bdddcf89a32115c363b3340cfafe46
7
+ data.tar.gz: 47ca59a742c15f5a69df9604483e2c79fd7f8e5cd219ce72440f800dc28584b1676d301e842b293ac92a052aeb01e0dd552c934dbb08e774e7a888017a1c6add
@@ -1,3 +1,7 @@
1
+ * Allow API key to be overridden from `Honeybadger.notify`.
2
+
3
+ *Joshua Wood*
4
+
1
5
  * Trim all sanitized strings to 2k.
2
6
 
3
7
  *Joshua Wood*
@@ -40,12 +40,27 @@ module Honeybadger
40
40
  # Returns Response.
41
41
  def notify(feature, payload)
42
42
  ENDPOINTS[feature] or raise(BackendError, "Unknown feature: #{feature}")
43
- Response.new(@http.post(ENDPOINTS[feature], payload))
43
+ Response.new(@http.post(ENDPOINTS[feature], payload, payload_headers(payload)))
44
44
  rescue *HTTP_ERRORS => e
45
45
  Response.new(:error, nil, "HTTP Error: #{e.class}").tap do |response|
46
46
  error { sprintf('http error class=%s message=%s', e.class, e.message.dump) }
47
47
  end
48
48
  end
49
+
50
+ private
51
+
52
+ # Internal: Construct headers for supported payloads.
53
+ #
54
+ # payload - The payload object.
55
+ #
56
+ # Returns Hash headers if supported, otherwise nil.
57
+ def payload_headers(payload)
58
+ if payload.respond_to?(:api_key) && payload.api_key
59
+ {
60
+ 'X-API-Key' => payload.api_key
61
+ }
62
+ end
63
+ end
49
64
  end
50
65
  end
51
66
  end
@@ -91,6 +91,9 @@ module Honeybadger
91
91
  # Public: Local variables are extracted from first frame of backtrace.
92
92
  attr_reader :local_variables
93
93
 
94
+ # Public: The API key used to deliver this notice.
95
+ attr_reader :api_key
96
+
94
97
  # Internal: Cache project path substitutions for backtrace lines.
95
98
  PROJECT_ROOT_CACHE = {}
96
99
 
@@ -220,7 +223,7 @@ module Honeybadger
220
223
 
221
224
  private
222
225
 
223
- attr_reader :config, :opts, :context, :stats, :api_key, :now, :pid, :causes, :sanitizer
226
+ attr_reader :config, :opts, :context, :stats, :now, :pid, :causes, :sanitizer
224
227
 
225
228
  def ignore_by_origin?
226
229
  opts[:origin] == :rake && !config[:'exceptions.rescue_rake']
@@ -25,7 +25,7 @@ module Honeybadger
25
25
  @config = config
26
26
  end
27
27
 
28
- def post(endpoint, payload, headers = {})
28
+ def post(endpoint, payload, headers = nil)
29
29
  response = http_connection.post(endpoint, compress(payload.to_json), http_headers(headers))
30
30
  debug { sprintf("http method=POST path=%s code=%d", endpoint.dump, response.code) }
31
31
  response
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '2.1.0.beta.1'.freeze
3
+ VERSION = '2.1.0'.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.1.0.beta.1
4
+ version: 2.1.0
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: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -141,9 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
141
  version: 1.9.3
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">"
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
- version: 1.3.1
146
+ version: '0'
147
147
  requirements: []
148
148
  rubyforge_project:
149
149
  rubygems_version: 2.4.5