airbrake-api 4.2.0 → 4.2.1

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.
@@ -98,28 +98,26 @@ module AirbrakeAPI
98
98
  hash.notice
99
99
  end
100
100
 
101
- def notices(error_id, notice_options = {}, &block)
102
- options = {}
103
- notices = []
104
- page = notice_options[:page]
105
- page_count = 0
106
-
101
+ def notices(error_id, options = {}, &block)
107
102
  # a specific page is requested, only return that page
108
103
  # if no page is specified, start on page 1
109
- if page
110
- notice_options[:pages] = 1
104
+ if options[:page]
105
+ page = options[:page]
106
+ options[:pages] = 1
111
107
  else
112
108
  page = 1
113
109
  end
114
110
 
115
- while !notice_options[:pages] || (page_count + 1) <= notice_options[:pages]
116
- options[:page] = page + page_count
117
- hash = request(:get, notices_path(error_id), options)
111
+ notices = []
112
+ page_count = 0
113
+ while !options[:pages] || (page_count + 1) <= options[:pages]
114
+ data = request(:get, notices_path(error_id), :page => page + page_count)
118
115
 
119
116
  batch = if options[:raw]
120
- hash.notices
117
+ data.notices
121
118
  else
122
- Parallel.map(hash.notices, :in_threads => PARALLEL_WORKERS) do |notice_stub|
119
+ # get info like backtraces by doing another api call to notice
120
+ Parallel.map(data.notices, :in_threads => PARALLEL_WORKERS) do |notice_stub|
123
121
  notice(notice_stub.id, error_id)
124
122
  end
125
123
  end
@@ -1,3 +1,3 @@
1
1
  module AirbrakeAPI
2
- VERSION = '4.2.0'
2
+ VERSION = '4.2.1'
3
3
  end
@@ -157,6 +157,7 @@ describe AirbrakeAPI::Client do
157
157
  it "finds error notices for a specific page" do
158
158
  notices = @client.notices(1696170, :page => 1)
159
159
  notices.size.should == 30
160
+ notices.first.backtrace.should_not == nil
160
161
  notices.first.id.should == 1234
161
162
  end
162
163
 
@@ -176,8 +177,8 @@ describe AirbrakeAPI::Client do
176
177
 
177
178
  it "can return raw results" do
178
179
  notices = @client.notices(1696170, :raw => true)
179
- notices[0].line.should == nil
180
- notices[0].id.should == 1234
180
+ notices.first.backtrace.should == nil
181
+ notices.first.id.should == 1234
181
182
  end
182
183
  end
183
184
 
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.2.0
4
+ version: 4.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -294,7 +294,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
294
  version: '0'
295
295
  segments:
296
296
  - 0
297
- hash: 3073464586304613395
297
+ hash: 1722762776779864920
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: 3073464586304613395
306
+ hash: 1722762776779864920
307
307
  requirements: []
308
308
  rubyforge_project:
309
309
  rubygems_version: 1.8.24