airbrake-api 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/airbrake-api/client.rb +11 -13
- data/lib/airbrake-api/version.rb +1 -1
- data/spec/airbrake_api/client_spec.rb +3 -2
- metadata +3 -3
data/lib/airbrake-api/client.rb
CHANGED
@@ -98,28 +98,26 @@ module AirbrakeAPI
|
|
98
98
|
hash.notice
|
99
99
|
end
|
100
100
|
|
101
|
-
def notices(error_id,
|
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
|
-
|
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
|
-
|
116
|
-
|
117
|
-
|
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
|
-
|
117
|
+
data.notices
|
121
118
|
else
|
122
|
-
|
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
|
data/lib/airbrake-api/version.rb
CHANGED
@@ -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
|
180
|
-
notices
|
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.
|
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:
|
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:
|
306
|
+
hash: 1722762776779864920
|
307
307
|
requirements: []
|
308
308
|
rubyforge_project:
|
309
309
|
rubygems_version: 1.8.24
|