airbrake-api 4.1.1 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,8 +56,12 @@ module AirbrakeAPI
56
56
 
57
57
  # errors
58
58
 
59
+ def unformatted_error_path(error_id)
60
+ "/errors/#{error_id}"
61
+ end
62
+
59
63
  def error_path(error_id)
60
- "/errors/#{error_id}.xml"
64
+ "#{unformatted_error_path(error_id)}.xml"
61
65
  end
62
66
 
63
67
  def errors_path
@@ -65,7 +69,7 @@ module AirbrakeAPI
65
69
  end
66
70
 
67
71
  def update(error, options = {})
68
- results = request(:put, error_path(error), :body => options)
72
+ results = request(:put, unformatted_error_path(error), options)
69
73
  results.group
70
74
  end
71
75
 
@@ -140,14 +144,12 @@ module AirbrakeAPI
140
144
  raise AirbrakeError.new('API Token cannot be nil') if @auth_token.nil?
141
145
  raise AirbrakeError.new('Account cannot be nil') if @account.nil?
142
146
 
143
- params.merge!(:auth_token => @auth_token)
144
-
145
147
  response = connection(options).run_request(method, nil, nil, nil) do |request|
146
- case method.to_sym
148
+ case method
147
149
  when :delete, :get
148
- request.url(path, params)
150
+ request.url(path, params.merge(:auth_token => @auth_token))
149
151
  when :post, :put
150
- request.path = path
152
+ request.url(path, :auth_token => @auth_token)
151
153
  request.body = params unless params.empty?
152
154
  end
153
155
  end
@@ -1,3 +1,3 @@
1
1
  module AirbrakeAPI
2
- VERSION = '4.1.1'
2
+ VERSION = '4.1.2'
3
3
  end
@@ -28,7 +28,7 @@ end
28
28
  fixture_request :get, 'http://myapp.airbrake.io/errors.xml?auth_token=abcdefg123456', 'errors.xml'
29
29
  fixture_request :get, "http://myapp.airbrake.io/errors.xml?auth_token=abcdefg123456&page=2", 'paginated_errors.xml'
30
30
  fixture_request :get, "http://myapp.airbrake.io/errors/1696170.xml?auth_token=abcdefg123456", 'individual_error.xml'
31
- fixture_request :put, 'http://myapp.airbrake.io/errors/1696170.xml', 'update_error.xml'
31
+ fixture_request :put, 'http://myapp.airbrake.io/errors/1696170?auth_token=abcdefg123456', 'update_error.xml'
32
32
  fixture_request :get, 'https://anapp.airbrake.io/errors/1696170.xml?auth_token=abcdefg', 'individual_error.xml'
33
33
 
34
34
  # notices
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-14 00:00:00.000000000 Z
12
+ date: 2012-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
@@ -294,7 +294,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
294
  version: '0'
295
295
  segments:
296
296
  - 0
297
- hash: 1414346195279665603
297
+ hash: -2675705766631480725
298
298
  required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  none: false
300
300
  requirements:
@@ -303,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
303
  version: '0'
304
304
  segments:
305
305
  - 0
306
- hash: 1414346195279665603
306
+ hash: -2675705766631480725
307
307
  requirements: []
308
308
  rubyforge_project:
309
309
  rubygems_version: 1.8.24