holistics 0.2.5 → 0.2.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/holistics.rb +8 -0
- data/lib/holistics/helpers/http_request.rb +2 -2
- data/lib/holistics/helpers/job_manager.rb +10 -0
- data/lib/holistics/version.rb +2 -2
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f9fb3b55061bda996463b5457b34288074c77b1d
         | 
| 4 | 
            +
              data.tar.gz: e71483052146db2964c65985601d12083ea154e8
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 7672b4b309d1d310cb884d41a64f9aca1cac83071a559cec6d022dda49d045cb02a1565f4098d5a08cd0ce13bed1cd2c9eb2d54b82256044a09e61cd9a48948f
         | 
| 7 | 
            +
              data.tar.gz: 2a4171ce380f169fe6cdd3f8963a28a608f03d6eec1cba3618f65ff0a3d3a55af051799431fb1e1d5585e753d224018b400341d5523368d8d5869c16942b2cb9
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/holistics.rb
    CHANGED
    
    
| @@ -14,9 +14,9 @@ module Holistics | |
| 14 14 |  | 
| 15 15 | 
             
                  def server_url
         | 
| 16 16 | 
             
                    host =
         | 
| 17 | 
            -
                        if  | 
| 17 | 
            +
                        if %w(development test).include?(ENV['HOLISTICS_ENV'])
         | 
| 18 18 | 
             
                          'http://localhost:3000'
         | 
| 19 | 
            -
                        elsif ENV['HOLISTICS_STAGING']
         | 
| 19 | 
            +
                        elsif ENV['HOLISTICS_STAGING'] || ENV['HOLISTICS_ENV'] == 'staging'
         | 
| 20 20 | 
             
                          'https://staging.holistics.io'
         | 
| 21 21 | 
             
                        elsif ENV['HOLISTICS_HOST']
         | 
| 22 22 | 
             
                          ENV['HOLISTICS_HOST']
         | 
| @@ -1,14 +1,24 @@ | |
| 1 1 | 
             
            module Holistics
         | 
| 2 2 | 
             
              module Helpers
         | 
| 3 3 | 
             
                class JobManager
         | 
| 4 | 
            +
                  MAX_RETRIES = 3
         | 
| 4 5 |  | 
| 5 6 | 
             
                  def auth_helper
         | 
| 6 7 | 
             
                    @auth_info ||= Helpers::AuthInfo.new
         | 
| 7 8 | 
             
                  end
         | 
| 8 9 |  | 
| 9 10 | 
             
                  def fetch_job_details(job_id, last_id = 0)
         | 
| 11 | 
            +
                    tries ||= MAX_RETRIES
         | 
| 10 12 | 
             
                    response = HTTParty.get(auth_helper.api_url_for("jobs/#{job_id}/logs.json", last_id: last_id))
         | 
| 11 13 | 
             
                    JSON.parse(response.body)
         | 
| 14 | 
            +
                  rescue JSON::ParserError => err
         | 
| 15 | 
            +
                    sleep 2 ** (MAX_RETRIES - tries) unless Holistics.test?
         | 
| 16 | 
            +
                    if (tries -= 1) >= 0
         | 
| 17 | 
            +
                      puts 'Retrying...'
         | 
| 18 | 
            +
                      retry
         | 
| 19 | 
            +
                    end
         | 
| 20 | 
            +
                    puts 'Retry exceeded... Raise error'
         | 
| 21 | 
            +
                    raise
         | 
| 12 22 | 
             
                  end
         | 
| 13 23 |  | 
| 14 24 | 
             
                  def job_show options
         | 
    
        data/lib/holistics/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: holistics
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Thanh Dinh Khac
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 12 | 
            +
            date: 2017-03-10 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: bundler
         | 
| @@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 128 128 | 
             
                  version: '0'
         | 
| 129 129 | 
             
            requirements: []
         | 
| 130 130 | 
             
            rubyforge_project: 
         | 
| 131 | 
            -
            rubygems_version: 2. | 
| 131 | 
            +
            rubygems_version: 2.6.10
         | 
| 132 132 | 
             
            signing_key: 
         | 
| 133 133 | 
             
            specification_version: 4
         | 
| 134 134 | 
             
            summary: CLI interface for Holistics
         |