airbrake-api 4.1.3 → 4.2.0
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.
- data/README.md +4 -1
 - data/lib/airbrake-api/client.rb +7 -3
 - data/lib/airbrake-api/version.rb +1 -1
 - data/spec/airbrake_api/client_spec.rb +7 -1
 - data/spec/spec_helper.rb +0 -2
 - metadata +4 -4
 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,4 +1,7 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Airbrake API []( 
     | 
| 
      
 1 
     | 
    
         
            +
            # Airbrake API [][travis] [][gemnasium]
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            [travis]: http://travis-ci.org/spagalloco/airbrake-api
         
     | 
| 
      
 4 
     | 
    
         
            +
            [gemnasium]: https://gemnasium.com/spagalloco/airbrake-api
         
     | 
| 
       2 
5 
     | 
    
         | 
| 
       3 
6 
     | 
    
         
             
            A ruby client for the [Airbrake API](http://help.airbrake.io/kb/api-2/api-overview)
         
     | 
| 
       4 
7 
     | 
    
         | 
    
        data/lib/airbrake-api/client.rb
    CHANGED
    
    | 
         @@ -37,7 +37,7 @@ module AirbrakeAPI 
     | 
|
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
                def deploys(project_id, options = {})
         
     | 
| 
       39 
39 
     | 
    
         
             
                  results = request(:get, deploys_path(project_id), options)
         
     | 
| 
       40 
     | 
    
         
            -
                  results.projects.respond_to?(:deploy) ? results.projects. 
     | 
| 
      
 40 
     | 
    
         
            +
                  results.projects.respond_to?(:deploy) ? results.projects.deploy : []
         
     | 
| 
       41 
41 
     | 
    
         
             
                end
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
43 
     | 
    
         
             
                def deploys_path(project_id)
         
     | 
| 
         @@ -116,8 +116,12 @@ module AirbrakeAPI 
     | 
|
| 
       116 
116 
     | 
    
         
             
                    options[:page] = page + page_count
         
     | 
| 
       117 
117 
     | 
    
         
             
                    hash = request(:get, notices_path(error_id), options)
         
     | 
| 
       118 
118 
     | 
    
         | 
| 
       119 
     | 
    
         
            -
                    batch =  
     | 
| 
       120 
     | 
    
         
            -
                       
     | 
| 
      
 119 
     | 
    
         
            +
                    batch = if options[:raw]
         
     | 
| 
      
 120 
     | 
    
         
            +
                      hash.notices
         
     | 
| 
      
 121 
     | 
    
         
            +
                    else
         
     | 
| 
      
 122 
     | 
    
         
            +
                      Parallel.map(hash.notices, :in_threads => PARALLEL_WORKERS) do |notice_stub|
         
     | 
| 
      
 123 
     | 
    
         
            +
                        notice(notice_stub.id, error_id)
         
     | 
| 
      
 124 
     | 
    
         
            +
                      end
         
     | 
| 
       121 
125 
     | 
    
         
             
                    end
         
     | 
| 
       122 
126 
     | 
    
         
             
                    yield batch if block_given?
         
     | 
| 
       123 
127 
     | 
    
         
             
                    batch.each{|n| notices << n }
         
     | 
    
        data/lib/airbrake-api/version.rb
    CHANGED
    
    
| 
         @@ -173,6 +173,12 @@ describe AirbrakeAPI::Client do 
     | 
|
| 
       173 
173 
     | 
    
         
             
                    notices.size.should == 60
         
     | 
| 
       174 
174 
     | 
    
         
             
                    batches.map(&:size).should == [30,30]
         
     | 
| 
       175 
175 
     | 
    
         
             
                  end
         
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
                  it "can return raw results" do
         
     | 
| 
      
 178 
     | 
    
         
            +
                    notices = @client.notices(1696170, :raw => true)
         
     | 
| 
      
 179 
     | 
    
         
            +
                    notices[0].line.should == nil
         
     | 
| 
      
 180 
     | 
    
         
            +
                    notices[0].id.should == 1234
         
     | 
| 
      
 181 
     | 
    
         
            +
                  end
         
     | 
| 
       176 
182 
     | 
    
         
             
                end
         
     | 
| 
       177 
183 
     | 
    
         | 
| 
       178 
184 
     | 
    
         
             
                describe '#connection' do
         
     | 
| 
         @@ -218,4 +224,4 @@ describe AirbrakeAPI::Client do 
     | 
|
| 
       218 
224 
     | 
    
         
             
                  lambda { @client.url_for(:foo) }.should raise_error(ArgumentError)
         
     | 
| 
       219 
225 
     | 
    
         
             
                end
         
     | 
| 
       220 
226 
     | 
    
         
             
              end
         
     | 
| 
       221 
     | 
    
         
            -
            end
         
     | 
| 
      
 227 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 4.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-09- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-09-25 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:  
     | 
| 
      
 297 
     | 
    
         
            +
                  hash: 3073464586304613395
         
     | 
| 
       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: 3073464586304613395
         
     | 
| 
       307 
307 
     | 
    
         
             
            requirements: []
         
     | 
| 
       308 
308 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       309 
309 
     | 
    
         
             
            rubygems_version: 1.8.24
         
     |