api_client 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 +8 -0
- data/.rspec +1 -0
- data/Gemfile +12 -0
- data/LICENSE +22 -0
- data/README.md +13 -0
- data/Rakefile +1 -0
- data/api_client.gemspec +24 -0
- data/examples/digg.rb +31 -0
- data/examples/flickr.rb +37 -0
- data/examples/github.rb +52 -0
- data/examples/highrise.rb +41 -0
- data/examples/twitter.rb +34 -0
- data/examples/twitter_oauth.rb +36 -0
- data/lib/api_client.rb +45 -0
- data/lib/api_client/base.rb +52 -0
- data/lib/api_client/connection/abstract.rb +73 -0
- data/lib/api_client/connection/basic.rb +105 -0
- data/lib/api_client/connection/middlewares/request/logger.rb +17 -0
- data/lib/api_client/connection/middlewares/request/oauth.rb +22 -0
- data/lib/api_client/connection/oauth.rb +18 -0
- data/lib/api_client/errors.rb +16 -0
- data/lib/api_client/mixins/configuration.rb +24 -0
- data/lib/api_client/mixins/connection_hooks.rb +24 -0
- data/lib/api_client/mixins/delegation.rb +23 -0
- data/lib/api_client/mixins/inheritance.rb +19 -0
- data/lib/api_client/mixins/instantiation.rb +35 -0
- data/lib/api_client/mixins/scoping.rb +49 -0
- data/lib/api_client/resource/base.rb +63 -0
- data/lib/api_client/resource/scope.rb +73 -0
- data/lib/api_client/scope.rb +101 -0
- data/lib/api_client/utils.rb +18 -0
- data/lib/api_client/version.rb +3 -0
- data/spec/api_client/base/connection_hook_spec.rb +18 -0
- data/spec/api_client/base/delegation_spec.rb +15 -0
- data/spec/api_client/base/inheritance_spec.rb +44 -0
- data/spec/api_client/base/instantiation_spec.rb +54 -0
- data/spec/api_client/base/parsing_spec.rb +36 -0
- data/spec/api_client/base/scoping_spec.rb +60 -0
- data/spec/api_client/base_spec.rb +17 -0
- data/spec/api_client/connection/abstract_spec.rb +21 -0
- data/spec/api_client/connection/basic_spec.rb +135 -0
- data/spec/api_client/connection/oauth_spec.rb +27 -0
- data/spec/api_client/connection/request/logger_spec.rb +19 -0
- data/spec/api_client/connection/request/oauth_spec.rb +26 -0
- data/spec/api_client/resource/base_spec.rb +78 -0
- data/spec/api_client/resource/scope_spec.rb +96 -0
- data/spec/api_client/scope_spec.rb +170 -0
- data/spec/api_client/utils_spec.rb +32 -0
- data/spec/spec_helper.rb +13 -0
- data/spec/support/fake_logger.rb +15 -0
- data/spec/support/matchers.rb +5 -0
- metadata +148 -0
    
        data/spec/spec_helper.rb
    ADDED
    
    | @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            require "rubygems"
         | 
| 2 | 
            +
            require "bundler/setup"
         | 
| 3 | 
            +
            $:.push File.expand_path("../../lib", __FILE__)
         | 
| 4 | 
            +
            require "rspec"
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            require 'simplecov'
         | 
| 7 | 
            +
            SimpleCov.start do
         | 
| 8 | 
            +
              add_filter '/spec'
         | 
| 9 | 
            +
            end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            require "api_client"
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            Dir.glob("#{File.dirname(__FILE__)}/support/*.rb").each { |f| require f }
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,148 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: api_client
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 | 
            +
              prerelease: 
         | 
| 6 | 
            +
            platform: ruby
         | 
| 7 | 
            +
            authors:
         | 
| 8 | 
            +
            - Marcin Bunsch
         | 
| 9 | 
            +
            autorequire: 
         | 
| 10 | 
            +
            bindir: bin
         | 
| 11 | 
            +
            cert_chain: []
         | 
| 12 | 
            +
            date: 2011-12-19 00:00:00.000000000 Z
         | 
| 13 | 
            +
            dependencies:
         | 
| 14 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 15 | 
            +
              name: faraday
         | 
| 16 | 
            +
              requirement: &70345425497600 !ruby/object:Gem::Requirement
         | 
| 17 | 
            +
                none: false
         | 
| 18 | 
            +
                requirements:
         | 
| 19 | 
            +
                - - =
         | 
| 20 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            +
                    version: 0.7.5
         | 
| 22 | 
            +
              type: :runtime
         | 
| 23 | 
            +
              prerelease: false
         | 
| 24 | 
            +
              version_requirements: *70345425497600
         | 
| 25 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 26 | 
            +
              name: hashie
         | 
| 27 | 
            +
              requirement: &70345425497040 !ruby/object:Gem::Requirement
         | 
| 28 | 
            +
                none: false
         | 
| 29 | 
            +
                requirements:
         | 
| 30 | 
            +
                - - =
         | 
| 31 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            +
                    version: 1.2.0
         | 
| 33 | 
            +
              type: :runtime
         | 
| 34 | 
            +
              prerelease: false
         | 
| 35 | 
            +
              version_requirements: *70345425497040
         | 
| 36 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 37 | 
            +
              name: yajl-ruby
         | 
| 38 | 
            +
              requirement: &70345425496640 !ruby/object:Gem::Requirement
         | 
| 39 | 
            +
                none: false
         | 
| 40 | 
            +
                requirements:
         | 
| 41 | 
            +
                - - ! '>='
         | 
| 42 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 43 | 
            +
                    version: '0'
         | 
| 44 | 
            +
              type: :runtime
         | 
| 45 | 
            +
              prerelease: false
         | 
| 46 | 
            +
              version_requirements: *70345425496640
         | 
| 47 | 
            +
            description: API client builder
         | 
| 48 | 
            +
            email:
         | 
| 49 | 
            +
            - marcin@futuresimple.com
         | 
| 50 | 
            +
            executables: []
         | 
| 51 | 
            +
            extensions: []
         | 
| 52 | 
            +
            extra_rdoc_files: []
         | 
| 53 | 
            +
            files:
         | 
| 54 | 
            +
            - .gitignore
         | 
| 55 | 
            +
            - .rspec
         | 
| 56 | 
            +
            - Gemfile
         | 
| 57 | 
            +
            - LICENSE
         | 
| 58 | 
            +
            - README.md
         | 
| 59 | 
            +
            - Rakefile
         | 
| 60 | 
            +
            - api_client.gemspec
         | 
| 61 | 
            +
            - examples/digg.rb
         | 
| 62 | 
            +
            - examples/flickr.rb
         | 
| 63 | 
            +
            - examples/github.rb
         | 
| 64 | 
            +
            - examples/highrise.rb
         | 
| 65 | 
            +
            - examples/twitter.rb
         | 
| 66 | 
            +
            - examples/twitter_oauth.rb
         | 
| 67 | 
            +
            - lib/api_client.rb
         | 
| 68 | 
            +
            - lib/api_client/base.rb
         | 
| 69 | 
            +
            - lib/api_client/connection/abstract.rb
         | 
| 70 | 
            +
            - lib/api_client/connection/basic.rb
         | 
| 71 | 
            +
            - lib/api_client/connection/middlewares/request/logger.rb
         | 
| 72 | 
            +
            - lib/api_client/connection/middlewares/request/oauth.rb
         | 
| 73 | 
            +
            - lib/api_client/connection/oauth.rb
         | 
| 74 | 
            +
            - lib/api_client/errors.rb
         | 
| 75 | 
            +
            - lib/api_client/mixins/configuration.rb
         | 
| 76 | 
            +
            - lib/api_client/mixins/connection_hooks.rb
         | 
| 77 | 
            +
            - lib/api_client/mixins/delegation.rb
         | 
| 78 | 
            +
            - lib/api_client/mixins/inheritance.rb
         | 
| 79 | 
            +
            - lib/api_client/mixins/instantiation.rb
         | 
| 80 | 
            +
            - lib/api_client/mixins/scoping.rb
         | 
| 81 | 
            +
            - lib/api_client/resource/base.rb
         | 
| 82 | 
            +
            - lib/api_client/resource/scope.rb
         | 
| 83 | 
            +
            - lib/api_client/scope.rb
         | 
| 84 | 
            +
            - lib/api_client/utils.rb
         | 
| 85 | 
            +
            - lib/api_client/version.rb
         | 
| 86 | 
            +
            - spec/api_client/base/connection_hook_spec.rb
         | 
| 87 | 
            +
            - spec/api_client/base/delegation_spec.rb
         | 
| 88 | 
            +
            - spec/api_client/base/inheritance_spec.rb
         | 
| 89 | 
            +
            - spec/api_client/base/instantiation_spec.rb
         | 
| 90 | 
            +
            - spec/api_client/base/parsing_spec.rb
         | 
| 91 | 
            +
            - spec/api_client/base/scoping_spec.rb
         | 
| 92 | 
            +
            - spec/api_client/base_spec.rb
         | 
| 93 | 
            +
            - spec/api_client/connection/abstract_spec.rb
         | 
| 94 | 
            +
            - spec/api_client/connection/basic_spec.rb
         | 
| 95 | 
            +
            - spec/api_client/connection/oauth_spec.rb
         | 
| 96 | 
            +
            - spec/api_client/connection/request/logger_spec.rb
         | 
| 97 | 
            +
            - spec/api_client/connection/request/oauth_spec.rb
         | 
| 98 | 
            +
            - spec/api_client/resource/base_spec.rb
         | 
| 99 | 
            +
            - spec/api_client/resource/scope_spec.rb
         | 
| 100 | 
            +
            - spec/api_client/scope_spec.rb
         | 
| 101 | 
            +
            - spec/api_client/utils_spec.rb
         | 
| 102 | 
            +
            - spec/spec_helper.rb
         | 
| 103 | 
            +
            - spec/support/fake_logger.rb
         | 
| 104 | 
            +
            - spec/support/matchers.rb
         | 
| 105 | 
            +
            homepage: ''
         | 
| 106 | 
            +
            licenses: []
         | 
| 107 | 
            +
            post_install_message: 
         | 
| 108 | 
            +
            rdoc_options: []
         | 
| 109 | 
            +
            require_paths:
         | 
| 110 | 
            +
            - lib
         | 
| 111 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 112 | 
            +
              none: false
         | 
| 113 | 
            +
              requirements:
         | 
| 114 | 
            +
              - - ! '>='
         | 
| 115 | 
            +
                - !ruby/object:Gem::Version
         | 
| 116 | 
            +
                  version: '0'
         | 
| 117 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 118 | 
            +
              none: false
         | 
| 119 | 
            +
              requirements:
         | 
| 120 | 
            +
              - - ! '>='
         | 
| 121 | 
            +
                - !ruby/object:Gem::Version
         | 
| 122 | 
            +
                  version: '0'
         | 
| 123 | 
            +
            requirements: []
         | 
| 124 | 
            +
            rubyforge_project: api_client
         | 
| 125 | 
            +
            rubygems_version: 1.8.10
         | 
| 126 | 
            +
            signing_key: 
         | 
| 127 | 
            +
            specification_version: 3
         | 
| 128 | 
            +
            summary: API client builder
         | 
| 129 | 
            +
            test_files:
         | 
| 130 | 
            +
            - spec/api_client/base/connection_hook_spec.rb
         | 
| 131 | 
            +
            - spec/api_client/base/delegation_spec.rb
         | 
| 132 | 
            +
            - spec/api_client/base/inheritance_spec.rb
         | 
| 133 | 
            +
            - spec/api_client/base/instantiation_spec.rb
         | 
| 134 | 
            +
            - spec/api_client/base/parsing_spec.rb
         | 
| 135 | 
            +
            - spec/api_client/base/scoping_spec.rb
         | 
| 136 | 
            +
            - spec/api_client/base_spec.rb
         | 
| 137 | 
            +
            - spec/api_client/connection/abstract_spec.rb
         | 
| 138 | 
            +
            - spec/api_client/connection/basic_spec.rb
         | 
| 139 | 
            +
            - spec/api_client/connection/oauth_spec.rb
         | 
| 140 | 
            +
            - spec/api_client/connection/request/logger_spec.rb
         | 
| 141 | 
            +
            - spec/api_client/connection/request/oauth_spec.rb
         | 
| 142 | 
            +
            - spec/api_client/resource/base_spec.rb
         | 
| 143 | 
            +
            - spec/api_client/resource/scope_spec.rb
         | 
| 144 | 
            +
            - spec/api_client/scope_spec.rb
         | 
| 145 | 
            +
            - spec/api_client/utils_spec.rb
         | 
| 146 | 
            +
            - spec/spec_helper.rb
         | 
| 147 | 
            +
            - spec/support/fake_logger.rb
         | 
| 148 | 
            +
            - spec/support/matchers.rb
         |