airbrake_cleanup 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/airbrake_cleanup.rb +3 -4
  2. metadata +2 -2
@@ -17,16 +17,15 @@ module AirbrakeCleanup
17
17
  def process
18
18
  nb = 0
19
19
 
20
- # RestClient.log = 'stdout'
21
- site = RestClient::Resource.new account_path, :payload => {:auth_token => @auth_token}, :auth_token => @auth_token
20
+ RestClient.log = 'stdout' if Rails.env.development?
22
21
  while true
23
- res = site['errors'].get
22
+ res = RestClient.get "#{account_path}/errors.xml?auth_token=#{self.auth_token}"
24
23
  list = (res.body.scan(/<id[^>]*>([0-9]+?)<\/id>/im) || []).flatten
25
24
  break if list.size == 0
26
25
 
27
26
  for item in list do
28
27
  begin
29
- site["errors/#{item}"].put :group => { :resolved => true}, :auth_token => @auth_token
28
+ RestClient.put "#{account_path}/errors/#{item}.xml?auth_token=#{self.auth_token}", :group => { :resolved => true}
30
29
  puts "Flagged error #{item} as resolved"
31
30
  nb += 1
32
31
  rescue RestClient::ResourceNotFound
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake_cleanup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
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-06-24 00:00:00.000000000 Z
12
+ date: 2012-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client