cambio 0.1.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/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +57 -0
- data/Rakefile +10 -0
- data/cambio.gemspec +24 -0
- data/lib/cambio.rb +102 -0
- data/lib/cambio/configuration.rb +31 -0
- data/lib/cambio/error.rb +13 -0
- data/lib/cambio/version.rb +3 -0
- data/lib/faraday/raise_on_error.rb +32 -0
- data/spec/cambio/configuration_spec.rb +51 -0
- data/spec/cambio_spec.rb +195 -0
- data/spec/fixtures/currencies.yml +198 -0
- data/spec/fixtures/currencies_unauth.yml +40 -0
- data/spec/fixtures/historical_date.yml +205 -0
- data/spec/fixtures/historical_missing.yml +40 -0
- data/spec/fixtures/historical_string.yml +205 -0
- data/spec/fixtures/historical_unauth.yml +40 -0
- data/spec/fixtures/latest.yml +205 -0
- data/spec/fixtures/latest_unauth.yml +40 -0
- data/spec/spec_helper.rb +12 -0
- metadata +133 -0
| @@ -0,0 +1,40 @@ | |
| 1 | 
            +
            --- 
         | 
| 2 | 
            +
            http_interactions: 
         | 
| 3 | 
            +
            - request: 
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: http://openexchangerates.org/api/latest.json?app_id=wrong
         | 
| 6 | 
            +
                body: 
         | 
| 7 | 
            +
                  encoding: US-ASCII
         | 
| 8 | 
            +
                  string: ""
         | 
| 9 | 
            +
                headers: 
         | 
| 10 | 
            +
                  Accept-Encoding: 
         | 
| 11 | 
            +
                  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
         | 
| 12 | 
            +
                  Accept: 
         | 
| 13 | 
            +
                  - "*/*"
         | 
| 14 | 
            +
                  User-Agent: 
         | 
| 15 | 
            +
                  - Ruby
         | 
| 16 | 
            +
              response: 
         | 
| 17 | 
            +
                status: 
         | 
| 18 | 
            +
                  code: 401
         | 
| 19 | 
            +
                  message: Unauthorized
         | 
| 20 | 
            +
                headers: 
         | 
| 21 | 
            +
                  Date: 
         | 
| 22 | 
            +
                  - Fri, 17 Aug 2012 01:01:46 GMT
         | 
| 23 | 
            +
                  Server: 
         | 
| 24 | 
            +
                  - Apache/2
         | 
| 25 | 
            +
                  X-Powered-By: 
         | 
| 26 | 
            +
                  - PHP/5.3.10
         | 
| 27 | 
            +
                  Access-Control-Allow-Origin: 
         | 
| 28 | 
            +
                  - "*"
         | 
| 29 | 
            +
                  Connection: 
         | 
| 30 | 
            +
                  - close
         | 
| 31 | 
            +
                  Transfer-Encoding: 
         | 
| 32 | 
            +
                  - chunked
         | 
| 33 | 
            +
                  Content-Type: 
         | 
| 34 | 
            +
                  - application/json; charset=utf-8
         | 
| 35 | 
            +
                body: 
         | 
| 36 | 
            +
                  encoding: US-ASCII
         | 
| 37 | 
            +
                  string: "{\"error\":true,\"status\":401,\"message\":\"invalid_app_id\",\"description\":\"Invalid App ID - please sign up at https://openexchangerates.org/signup, or contact support@openexchangerates.org.\"}"
         | 
| 38 | 
            +
                http_version: 
         | 
| 39 | 
            +
              recorded_at: Fri, 17 Aug 2012 01:01:46 GMT
         | 
| 40 | 
            +
            recorded_with: VCR 2.2.4
         | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | @@ -0,0 +1,12 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'minitest/autorun'
         | 
| 3 | 
            +
            require 'webmock/minitest'
         | 
| 4 | 
            +
            require 'vcr'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            require File.join(File.dirname(__FILE__), '..', 'lib', 'cambio')
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            VCR.configure do |c|
         | 
| 9 | 
            +
              c.cassette_library_dir = 'spec/fixtures'
         | 
| 10 | 
            +
              c.hook_into :webmock
         | 
| 11 | 
            +
              c.default_cassette_options = { :record => :new_episodes }
         | 
| 12 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,133 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: cambio
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 | 
            +
              prerelease: 
         | 
| 6 | 
            +
            platform: ruby
         | 
| 7 | 
            +
            authors:
         | 
| 8 | 
            +
            - Phil Nash
         | 
| 9 | 
            +
            autorequire: 
         | 
| 10 | 
            +
            bindir: bin
         | 
| 11 | 
            +
            cert_chain: []
         | 
| 12 | 
            +
            date: 2012-08-17 00:00:00.000000000Z
         | 
| 13 | 
            +
            dependencies:
         | 
| 14 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            +
              name: vcr
         | 
| 16 | 
            +
              requirement: &70228047022800 !ruby/object:Gem::Requirement
         | 
| 17 | 
            +
                none: false
         | 
| 18 | 
            +
                requirements:
         | 
| 19 | 
            +
                - - ~>
         | 
| 20 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            +
                    version: 2.2.4
         | 
| 22 | 
            +
              type: :development
         | 
| 23 | 
            +
              prerelease: false
         | 
| 24 | 
            +
              version_requirements: *70228047022800
         | 
| 25 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 26 | 
            +
              name: webmock
         | 
| 27 | 
            +
              requirement: &70228047021620 !ruby/object:Gem::Requirement
         | 
| 28 | 
            +
                none: false
         | 
| 29 | 
            +
                requirements:
         | 
| 30 | 
            +
                - - ~>
         | 
| 31 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            +
                    version: 1.8.8
         | 
| 33 | 
            +
              type: :development
         | 
| 34 | 
            +
              prerelease: false
         | 
| 35 | 
            +
              version_requirements: *70228047021620
         | 
| 36 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 37 | 
            +
              name: faraday
         | 
| 38 | 
            +
              requirement: &70228047019900 !ruby/object:Gem::Requirement
         | 
| 39 | 
            +
                none: false
         | 
| 40 | 
            +
                requirements:
         | 
| 41 | 
            +
                - - ~>
         | 
| 42 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 43 | 
            +
                    version: 0.8.1
         | 
| 44 | 
            +
              type: :runtime
         | 
| 45 | 
            +
              prerelease: false
         | 
| 46 | 
            +
              version_requirements: *70228047019900
         | 
| 47 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 48 | 
            +
              name: faraday_middleware
         | 
| 49 | 
            +
              requirement: &70228047018180 !ruby/object:Gem::Requirement
         | 
| 50 | 
            +
                none: false
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - ~>
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: 0.8.8
         | 
| 55 | 
            +
              type: :runtime
         | 
| 56 | 
            +
              prerelease: false
         | 
| 57 | 
            +
              version_requirements: *70228047018180
         | 
| 58 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 59 | 
            +
              name: hashie
         | 
| 60 | 
            +
              requirement: &70228047016240 !ruby/object:Gem::Requirement
         | 
| 61 | 
            +
                none: false
         | 
| 62 | 
            +
                requirements:
         | 
| 63 | 
            +
                - - ~>
         | 
| 64 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 65 | 
            +
                    version: 1.2.0
         | 
| 66 | 
            +
              type: :runtime
         | 
| 67 | 
            +
              prerelease: false
         | 
| 68 | 
            +
              version_requirements: *70228047016240
         | 
| 69 | 
            +
            description: A simple wrapper for the Open Exchange Rates API
         | 
| 70 | 
            +
            email:
         | 
| 71 | 
            +
            - philnash@gmail.com
         | 
| 72 | 
            +
            executables: []
         | 
| 73 | 
            +
            extensions: []
         | 
| 74 | 
            +
            extra_rdoc_files: []
         | 
| 75 | 
            +
            files:
         | 
| 76 | 
            +
            - .gitignore
         | 
| 77 | 
            +
            - Gemfile
         | 
| 78 | 
            +
            - LICENSE
         | 
| 79 | 
            +
            - README.md
         | 
| 80 | 
            +
            - Rakefile
         | 
| 81 | 
            +
            - cambio.gemspec
         | 
| 82 | 
            +
            - lib/cambio.rb
         | 
| 83 | 
            +
            - lib/cambio/configuration.rb
         | 
| 84 | 
            +
            - lib/cambio/error.rb
         | 
| 85 | 
            +
            - lib/cambio/version.rb
         | 
| 86 | 
            +
            - lib/faraday/raise_on_error.rb
         | 
| 87 | 
            +
            - spec/cambio/configuration_spec.rb
         | 
| 88 | 
            +
            - spec/cambio_spec.rb
         | 
| 89 | 
            +
            - spec/fixtures/currencies.yml
         | 
| 90 | 
            +
            - spec/fixtures/currencies_unauth.yml
         | 
| 91 | 
            +
            - spec/fixtures/historical_date.yml
         | 
| 92 | 
            +
            - spec/fixtures/historical_missing.yml
         | 
| 93 | 
            +
            - spec/fixtures/historical_string.yml
         | 
| 94 | 
            +
            - spec/fixtures/historical_unauth.yml
         | 
| 95 | 
            +
            - spec/fixtures/latest.yml
         | 
| 96 | 
            +
            - spec/fixtures/latest_unauth.yml
         | 
| 97 | 
            +
            - spec/spec_helper.rb
         | 
| 98 | 
            +
            homepage: http://github.com/philnash/cambio
         | 
| 99 | 
            +
            licenses: []
         | 
| 100 | 
            +
            post_install_message: 
         | 
| 101 | 
            +
            rdoc_options: []
         | 
| 102 | 
            +
            require_paths:
         | 
| 103 | 
            +
            - lib
         | 
| 104 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 105 | 
            +
              none: false
         | 
| 106 | 
            +
              requirements:
         | 
| 107 | 
            +
              - - ! '>='
         | 
| 108 | 
            +
                - !ruby/object:Gem::Version
         | 
| 109 | 
            +
                  version: '0'
         | 
| 110 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 111 | 
            +
              none: false
         | 
| 112 | 
            +
              requirements:
         | 
| 113 | 
            +
              - - ! '>='
         | 
| 114 | 
            +
                - !ruby/object:Gem::Version
         | 
| 115 | 
            +
                  version: '0'
         | 
| 116 | 
            +
            requirements: []
         | 
| 117 | 
            +
            rubyforge_project: 
         | 
| 118 | 
            +
            rubygems_version: 1.8.10
         | 
| 119 | 
            +
            signing_key: 
         | 
| 120 | 
            +
            specification_version: 3
         | 
| 121 | 
            +
            summary: A simple wrapper for the Open Exchange Rates API
         | 
| 122 | 
            +
            test_files:
         | 
| 123 | 
            +
            - spec/cambio/configuration_spec.rb
         | 
| 124 | 
            +
            - spec/cambio_spec.rb
         | 
| 125 | 
            +
            - spec/fixtures/currencies.yml
         | 
| 126 | 
            +
            - spec/fixtures/currencies_unauth.yml
         | 
| 127 | 
            +
            - spec/fixtures/historical_date.yml
         | 
| 128 | 
            +
            - spec/fixtures/historical_missing.yml
         | 
| 129 | 
            +
            - spec/fixtures/historical_string.yml
         | 
| 130 | 
            +
            - spec/fixtures/historical_unauth.yml
         | 
| 131 | 
            +
            - spec/fixtures/latest.yml
         | 
| 132 | 
            +
            - spec/fixtures/latest_unauth.yml
         | 
| 133 | 
            +
            - spec/spec_helper.rb
         |