enigma_io 0.0.1 → 0.0.2
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 +2 -2
- data/lib/enigma/download.rb +10 -0
- data/lib/enigma/endpoints/export.rb +1 -1
- data/lib/enigma/version.rb +1 -1
- metadata +22 -19
    
        data/README.md
    CHANGED
    
    | @@ -10,7 +10,7 @@ Note that you need api key to use their api. | |
| 10 10 |  | 
| 11 11 | 
             
            Add this line to your application's Gemfile:
         | 
| 12 12 |  | 
| 13 | 
            -
                gem ' | 
| 13 | 
            +
                gem 'enigma_io'
         | 
| 14 14 |  | 
| 15 15 | 
             
            And then execute:
         | 
| 16 16 |  | 
| @@ -18,7 +18,7 @@ And then execute: | |
| 18 18 |  | 
| 19 19 | 
             
            Or install it yourself as:
         | 
| 20 20 |  | 
| 21 | 
            -
                $ gem install  | 
| 21 | 
            +
                $ gem install enigma_io
         | 
| 22 22 |  | 
| 23 23 | 
             
            ## Usage
         | 
| 24 24 |  | 
    
        data/lib/enigma/download.rb
    CHANGED
    
    | @@ -15,6 +15,9 @@ module Enigma | |
| 15 15 | 
             
                  self.response = res
         | 
| 16 16 | 
             
                end
         | 
| 17 17 |  | 
| 18 | 
            +
                # This url is where the file will eventually be available. Returns
         | 
| 19 | 
            +
                # a 404 until then
         | 
| 20 | 
            +
                #
         | 
| 18 21 | 
             
                def download_url
         | 
| 19 22 | 
             
                  response.export_url
         | 
| 20 23 | 
             
                end
         | 
| @@ -23,8 +26,15 @@ module Enigma | |
| 23 26 | 
             
                  response.datapath
         | 
| 24 27 | 
             
                end
         | 
| 25 28 |  | 
| 29 | 
            +
                # Actually goes and fetches the download. Don't return the
         | 
| 30 | 
            +
                # raw_download because it's a massive amount of data that will
         | 
| 31 | 
            +
                # take over your terminal in IRB mode.
         | 
| 32 | 
            +
                #
         | 
| 33 | 
            +
                # @return true on success
         | 
| 34 | 
            +
                #
         | 
| 26 35 | 
             
                def get
         | 
| 27 36 | 
             
                  @raw_download ||= do_download
         | 
| 37 | 
            +
                  true
         | 
| 28 38 | 
             
                end
         | 
| 29 39 |  | 
| 30 40 | 
             
                def write(io)
         | 
| @@ -2,7 +2,7 @@ | |
| 2 2 | 
             
            module Enigma
         | 
| 3 3 | 
             
              # The export endpoint has no filtering, but it returns a URL where
         | 
| 4 4 | 
             
              # the download will eventually be available. This client will
         | 
| 5 | 
            -
              #  | 
| 5 | 
            +
              # return a `Download` object which can be asked to go get the file
         | 
| 6 6 | 
             
              #
         | 
| 7 7 | 
             
              class Export < Endpoint
         | 
| 8 8 | 
             
                attr_accessor :download, :unzip
         | 
    
        data/lib/enigma/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: enigma_io
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.2
         | 
| 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: 2014-01- | 
| 12 | 
            +
            date: 2014-01-28 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: bundler
         | 
| @@ -191,33 +191,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 191 191 | 
             
              - - ! '>='
         | 
| 192 192 | 
             
                - !ruby/object:Gem::Version
         | 
| 193 193 | 
             
                  version: '0'
         | 
| 194 | 
            +
                  segments:
         | 
| 195 | 
            +
                  - 0
         | 
| 196 | 
            +
                  hash: -2110614023640464768
         | 
| 194 197 | 
             
            requirements: []
         | 
| 195 198 | 
             
            rubyforge_project: 
         | 
| 196 | 
            -
            rubygems_version: 1.8. | 
| 199 | 
            +
            rubygems_version: 1.8.24
         | 
| 197 200 | 
             
            signing_key: 
         | 
| 198 201 | 
             
            specification_version: 3
         | 
| 199 202 | 
             
            summary: Ruby client for the Enigma API
         | 
| 200 203 | 
             
            test_files:
         | 
| 201 | 
            -
            - test/export_test.rb
         | 
| 202 | 
            -
            - test/endpoint_test.rb
         | 
| 203 | 
            -
            - test/stats_test.rb
         | 
| 204 | 
            -
            - test/response_test.rb
         | 
| 205 | 
            -
            - test/test_helper.rb
         | 
| 206 | 
            -
            - test/meta_test.rb
         | 
| 207 | 
            -
            - test/data_test.rb
         | 
| 208 204 | 
             
            - test/client_test.rb
         | 
| 209 | 
            -
            - test/ | 
| 205 | 
            +
            - test/data_test.rb
         | 
| 206 | 
            +
            - test/endpoint_test.rb
         | 
| 207 | 
            +
            - test/export_test.rb
         | 
| 210 208 | 
             
            - test/fixtures/download.csv
         | 
| 211 | 
            -
            - test/fixtures/ | 
| 212 | 
            -
            - test/fixtures/vcr_cassettes/page_data.yml
         | 
| 213 | 
            -
            - test/fixtures/vcr_cassettes/simple_stats.yml
         | 
| 214 | 
            -
            - test/fixtures/vcr_cassettes/sorted_data.yml
         | 
| 215 | 
            -
            - test/fixtures/vcr_cassettes/filtered_data.yml
         | 
| 216 | 
            -
            - test/fixtures/vcr_cassettes/sorted_data_descending.yml
         | 
| 209 | 
            +
            - test/fixtures/download.zip
         | 
| 217 210 | 
             
            - test/fixtures/vcr_cassettes/compound_average.yml
         | 
| 218 211 | 
             
            - test/fixtures/vcr_cassettes/data_with_error.yml
         | 
| 219 | 
            -
            - test/fixtures/vcr_cassettes/simple_data.yml
         | 
| 220 | 
            -
            - test/fixtures/vcr_cassettes/limit_data.yml
         | 
| 221 212 | 
             
            - test/fixtures/vcr_cassettes/export.yml
         | 
| 213 | 
            +
            - test/fixtures/vcr_cassettes/filtered_data.yml
         | 
| 214 | 
            +
            - test/fixtures/vcr_cassettes/limit_data.yml
         | 
| 215 | 
            +
            - test/fixtures/vcr_cassettes/page_data.yml
         | 
| 216 | 
            +
            - test/fixtures/vcr_cassettes/selected_data.yml
         | 
| 217 | 
            +
            - test/fixtures/vcr_cassettes/simple_data.yml
         | 
| 222 218 | 
             
            - test/fixtures/vcr_cassettes/simple_metadata.yml
         | 
| 219 | 
            +
            - test/fixtures/vcr_cassettes/simple_stats.yml
         | 
| 220 | 
            +
            - test/fixtures/vcr_cassettes/sorted_data.yml
         | 
| 221 | 
            +
            - test/fixtures/vcr_cassettes/sorted_data_descending.yml
         | 
| 222 | 
            +
            - test/meta_test.rb
         | 
| 223 | 
            +
            - test/response_test.rb
         | 
| 224 | 
            +
            - test/stats_test.rb
         | 
| 225 | 
            +
            - test/test_helper.rb
         | 
| 223 226 | 
             
            has_rdoc: 
         |