Assist 0.0.1
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/Assist.gemspec +17 -0
 - data/Gemfile +14 -0
 - data/LICENSE +22 -0
 - data/README.md +29 -0
 - data/Rakefile +10 -0
 - data/lib/Assist.rb +9 -0
 - data/lib/Assist/player.rb +31 -0
 - data/lib/Assist/version.rb +3 -0
 - data/spec/fixtures/dish_cassettes/base.yml +41 -0
 - data/spec/fixtures/dish_cassettes/player.yml +41 -0
 - data/spec/lib/Assist/player_spec.rb +88 -0
 - data/spec/spec_helper.rb +19 -0
 - metadata +62 -0
 
    
        data/.gitignore
    ADDED
    
    
    
        data/Assist.gemspec
    ADDED
    
    | 
         @@ -0,0 +1,17 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # -*- encoding: utf-8 -*-
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.expand_path('../lib/Assist/version', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            Gem::Specification.new do |gem|
         
     | 
| 
      
 5 
     | 
    
         
            +
              gem.authors       = ["Evan Sparkman"]
         
     | 
| 
      
 6 
     | 
    
         
            +
              gem.email         = ["esparkman@esdezines.com"]
         
     | 
| 
      
 7 
     | 
    
         
            +
              gem.description   = %q{Simple API Wrapper for Dribbble}
         
     | 
| 
      
 8 
     | 
    
         
            +
              gem.summary       = %q{Simple API Wrapper for Dribbble}
         
     | 
| 
      
 9 
     | 
    
         
            +
              gem.homepage      = ""
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              gem.files         = `git ls-files`.split($\)
         
     | 
| 
      
 12 
     | 
    
         
            +
              gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
         
     | 
| 
      
 13 
     | 
    
         
            +
              gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
         
     | 
| 
      
 14 
     | 
    
         
            +
              gem.name          = "Assist"
         
     | 
| 
      
 15 
     | 
    
         
            +
              gem.require_paths = ["lib"]
         
     | 
| 
      
 16 
     | 
    
         
            +
              gem.version       = Assist::VERSION
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2012 Evan Sparkman
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            MIT License
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining
         
     | 
| 
      
 6 
     | 
    
         
            +
            a copy of this software and associated documentation files (the
         
     | 
| 
      
 7 
     | 
    
         
            +
            "Software"), to deal in the Software without restriction, including
         
     | 
| 
      
 8 
     | 
    
         
            +
            without limitation the rights to use, copy, modify, merge, publish,
         
     | 
| 
      
 9 
     | 
    
         
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         
     | 
| 
      
 10 
     | 
    
         
            +
            permit persons to whom the Software is furnished to do so, subject to
         
     | 
| 
      
 11 
     | 
    
         
            +
            the following conditions:
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be
         
     | 
| 
      
 14 
     | 
    
         
            +
            included in all copies or substantial portions of the Software.
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         
     | 
| 
      
 17 
     | 
    
         
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         
     | 
| 
      
 18 
     | 
    
         
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         
     | 
| 
      
 19 
     | 
    
         
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         
     | 
| 
      
 20 
     | 
    
         
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         
     | 
| 
      
 21 
     | 
    
         
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         
     | 
| 
      
 22 
     | 
    
         
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,29 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Assist
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            TODO: Write a gem description
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            Add this line to your application's Gemfile:
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                gem 'Assist'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            And then execute:
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                $ bundle
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            Or install it yourself as:
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                $ gem install Assist
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            TODO: Write usage instructions here
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ## Contributing
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            1. Fork it
         
     | 
| 
      
 26 
     | 
    
         
            +
            2. Create your feature branch (`git checkout -b my-new-feature`)
         
     | 
| 
      
 27 
     | 
    
         
            +
            3. Commit your changes (`git commit -am 'Added some feature'`)
         
     | 
| 
      
 28 
     | 
    
         
            +
            4. Push to the branch (`git push origin my-new-feature`)
         
     | 
| 
      
 29 
     | 
    
         
            +
            5. Create new Pull Request
         
     | 
    
        data/Rakefile
    ADDED
    
    
    
        data/lib/Assist.rb
    ADDED
    
    
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Assist
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Player
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
                attr_accessor :username
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                include HTTParty
         
     | 
| 
      
 7 
     | 
    
         
            +
                base_uri 'http://api.dribbble.com'
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                def method_missing(name, *args, &block)
         
     | 
| 
      
 10 
     | 
    
         
            +
                  profile.fetch(name.to_s) { super }
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                def initialize(username)
         
     | 
| 
      
 14 
     | 
    
         
            +
                  self.username = username
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                def profile
         
     | 
| 
      
 18 
     | 
    
         
            +
                  @get_profile ||= get_profile
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                def profile(force= false)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  force ? @profile = get_profile : @profile ||= get_profile
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                private
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                def get_profile
         
     | 
| 
      
 28 
     | 
    
         
            +
                  self.class.get "/players/#{self.username}"
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            http_interactions:
         
     | 
| 
      
 3 
     | 
    
         
            +
            - request:
         
     | 
| 
      
 4 
     | 
    
         
            +
                method: get
         
     | 
| 
      
 5 
     | 
    
         
            +
                uri: http://api.dribbble.com/players/simplebits
         
     | 
| 
      
 6 
     | 
    
         
            +
                body:
         
     | 
| 
      
 7 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 8 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 9 
     | 
    
         
            +
                headers: {}
         
     | 
| 
      
 10 
     | 
    
         
            +
              response:
         
     | 
| 
      
 11 
     | 
    
         
            +
                status:
         
     | 
| 
      
 12 
     | 
    
         
            +
                  code: 200
         
     | 
| 
      
 13 
     | 
    
         
            +
                  message: OK
         
     | 
| 
      
 14 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 15 
     | 
    
         
            +
                  Server:
         
     | 
| 
      
 16 
     | 
    
         
            +
                  - nginx/0.7.62
         
     | 
| 
      
 17 
     | 
    
         
            +
                  Date:
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - Thu, 29 Mar 2012 17:14:35 GMT
         
     | 
| 
      
 19 
     | 
    
         
            +
                  Content-Type:
         
     | 
| 
      
 20 
     | 
    
         
            +
                  - application/json; charset=utf-8
         
     | 
| 
      
 21 
     | 
    
         
            +
                  Connection:
         
     | 
| 
      
 22 
     | 
    
         
            +
                  - keep-alive
         
     | 
| 
      
 23 
     | 
    
         
            +
                  X-Powered-By:
         
     | 
| 
      
 24 
     | 
    
         
            +
                  - Phusion Passenger (mod_rails/mod_rack) 3.0.9
         
     | 
| 
      
 25 
     | 
    
         
            +
                  Etag:
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - ! '"70c75a42ec8f91ce7d5110b913bff703"'
         
     | 
| 
      
 27 
     | 
    
         
            +
                  X-Runtime:
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - '8'
         
     | 
| 
      
 29 
     | 
    
         
            +
                  Cache-Control:
         
     | 
| 
      
 30 
     | 
    
         
            +
                  - private, max-age=0, must-revalidate
         
     | 
| 
      
 31 
     | 
    
         
            +
                  Content-Length:
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - '593'
         
     | 
| 
      
 33 
     | 
    
         
            +
                  Status:
         
     | 
| 
      
 34 
     | 
    
         
            +
                  - '200'
         
     | 
| 
      
 35 
     | 
    
         
            +
                body:
         
     | 
| 
      
 36 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 37 
     | 
    
         
            +
                  string: ! '{"shots_count":189,"twitter_screen_name":"simplebits","avatar_url":"http://dribbble.s3.amazonaws.com/users/1/avatars/original/dc-2012.jpg?1331132114","likes_received_count":12313,"name":"Dan
         
     | 
| 
      
 38 
     | 
    
         
            +
                    Cederholm","created_at":"2009/07/07 21:51:22 -0400","location":"Salem, MA","following_count":1508,"likes_count":23881,"website_url":"http://simplebits.com","username":"simplebits","url":"http://dribbble.com/simplebits","rebounds_count":25,"draftees_count":133,"id":1,"drafted_by_player_id":null,"followers_count":14073,"comments_received_count":2527,"comments_count":2531,"rebounds_received_count":274}'
         
     | 
| 
      
 39 
     | 
    
         
            +
                http_version: 
         
     | 
| 
      
 40 
     | 
    
         
            +
              recorded_at: Thu, 29 Mar 2012 17:14:35 GMT
         
     | 
| 
      
 41 
     | 
    
         
            +
            recorded_with: VCR 2.0.0
         
     | 
| 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            http_interactions:
         
     | 
| 
      
 3 
     | 
    
         
            +
            - request:
         
     | 
| 
      
 4 
     | 
    
         
            +
                method: get
         
     | 
| 
      
 5 
     | 
    
         
            +
                uri: http://api.dribbble.com/players/simplebits
         
     | 
| 
      
 6 
     | 
    
         
            +
                body:
         
     | 
| 
      
 7 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 8 
     | 
    
         
            +
                  string: ''
         
     | 
| 
      
 9 
     | 
    
         
            +
                headers: {}
         
     | 
| 
      
 10 
     | 
    
         
            +
              response:
         
     | 
| 
      
 11 
     | 
    
         
            +
                status:
         
     | 
| 
      
 12 
     | 
    
         
            +
                  code: 200
         
     | 
| 
      
 13 
     | 
    
         
            +
                  message: OK
         
     | 
| 
      
 14 
     | 
    
         
            +
                headers:
         
     | 
| 
      
 15 
     | 
    
         
            +
                  Server:
         
     | 
| 
      
 16 
     | 
    
         
            +
                  - nginx/0.7.62
         
     | 
| 
      
 17 
     | 
    
         
            +
                  Date:
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - Thu, 29 Mar 2012 15:03:30 GMT
         
     | 
| 
      
 19 
     | 
    
         
            +
                  Content-Type:
         
     | 
| 
      
 20 
     | 
    
         
            +
                  - application/json; charset=utf-8
         
     | 
| 
      
 21 
     | 
    
         
            +
                  Connection:
         
     | 
| 
      
 22 
     | 
    
         
            +
                  - keep-alive
         
     | 
| 
      
 23 
     | 
    
         
            +
                  X-Powered-By:
         
     | 
| 
      
 24 
     | 
    
         
            +
                  - Phusion Passenger (mod_rails/mod_rack) 3.0.9
         
     | 
| 
      
 25 
     | 
    
         
            +
                  Etag:
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - ! '"ccb0a7f42f9caa391d47b2b32355c650"'
         
     | 
| 
      
 27 
     | 
    
         
            +
                  X-Runtime:
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - '8'
         
     | 
| 
      
 29 
     | 
    
         
            +
                  Cache-Control:
         
     | 
| 
      
 30 
     | 
    
         
            +
                  - private, max-age=0, must-revalidate
         
     | 
| 
      
 31 
     | 
    
         
            +
                  Content-Length:
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - '593'
         
     | 
| 
      
 33 
     | 
    
         
            +
                  Status:
         
     | 
| 
      
 34 
     | 
    
         
            +
                  - '200'
         
     | 
| 
      
 35 
     | 
    
         
            +
                body:
         
     | 
| 
      
 36 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 37 
     | 
    
         
            +
                  string: ! '{"shots_count":189,"twitter_screen_name":"simplebits","avatar_url":"http://dribbble.s3.amazonaws.com/users/1/avatars/original/dc-2012.jpg?1331132114","likes_received_count":12312,"name":"Dan
         
     | 
| 
      
 38 
     | 
    
         
            +
                    Cederholm","created_at":"2009/07/07 21:51:22 -0400","location":"Salem, MA","following_count":1508,"likes_count":23847,"website_url":"http://simplebits.com","username":"simplebits","url":"http://dribbble.com/simplebits","rebounds_count":25,"draftees_count":133,"id":1,"drafted_by_player_id":null,"followers_count":14071,"comments_received_count":2527,"comments_count":2531,"rebounds_received_count":274}'
         
     | 
| 
      
 39 
     | 
    
         
            +
                http_version: 
         
     | 
| 
      
 40 
     | 
    
         
            +
              recorded_at: Thu, 29 Mar 2012 15:03:32 GMT
         
     | 
| 
      
 41 
     | 
    
         
            +
            recorded_with: VCR 2.0.0
         
     | 
| 
         @@ -0,0 +1,88 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require_relative '../../spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
            # For Ruby < 1.9.3, use this instead of require_relative
         
     | 
| 
      
 3 
     | 
    
         
            +
            #require (File.expand_path('./../../../spec_helper', __FILE__))
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            describe Assist::Player do
         
     | 
| 
      
 6 
     | 
    
         
            +
              describe "default attributes" do
         
     | 
| 
      
 7 
     | 
    
         
            +
                it "must include httparty methods" do
         
     | 
| 
      
 8 
     | 
    
         
            +
                  Assist::Player.must_include HTTParty
         
     | 
| 
      
 9 
     | 
    
         
            +
                end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                it "must have the base url set to the Dribble API endpoint" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                  Assist::Player.base_uri.must_equal 'http://api.dribbble.com'
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              describe "default instance attributes" do
         
     | 
| 
      
 17 
     | 
    
         
            +
                let (:player) { Assist::Player.new('simplebits') }
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                it "must have an id attribute" do
         
     | 
| 
      
 20 
     | 
    
         
            +
                  player.must_respond_to :username
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                it "must have the right id" do
         
     | 
| 
      
 24 
     | 
    
         
            +
                  player.username.must_equal 'simplebits'
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              describe "GET profile" do
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                let(:player) { Assist::Player.new('simplebits') }
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                before do
         
     | 
| 
      
 33 
     | 
    
         
            +
                  VCR.insert_cassette 'player', record: :new_episodes
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                after do
         
     | 
| 
      
 37 
     | 
    
         
            +
                  VCR.eject_cassette
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                it "must have a profile method" do
         
     | 
| 
      
 41 
     | 
    
         
            +
                  player.must_respond_to :profile
         
     | 
| 
      
 42 
     | 
    
         
            +
                end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                it "must parse the api response from JSON to Hash" do
         
     | 
| 
      
 45 
     | 
    
         
            +
                  player.profile.must_be_instance_of Hash
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                it "must perform the request and get the data" do
         
     | 
| 
      
 49 
     | 
    
         
            +
                  player.profile["username"].must_equal 'simplebits'
         
     | 
| 
      
 50 
     | 
    
         
            +
                end
         
     | 
| 
      
 51 
     | 
    
         
            +
              end
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
              describe "caching" do
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                let(:player) { Assist::Player.new('simplebits') }
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                before do
         
     | 
| 
      
 58 
     | 
    
         
            +
                  player.profile
         
     | 
| 
      
 59 
     | 
    
         
            +
                  stub_request(:any, /api.dribbble.com/).to_timeout
         
     | 
| 
      
 60 
     | 
    
         
            +
                end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
                it "must cache the profile" do
         
     | 
| 
      
 63 
     | 
    
         
            +
                  player.profile.must_be_instance_of Hash
         
     | 
| 
      
 64 
     | 
    
         
            +
                end
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
                it "must refrssh the profile if forced" do
         
     | 
| 
      
 67 
     | 
    
         
            +
                  lambda { player.profile(true) }.must_raise Timeout::Error
         
     | 
| 
      
 68 
     | 
    
         
            +
                end
         
     | 
| 
      
 69 
     | 
    
         
            +
              end
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
              describe "dynamic attributes" do
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                let(:player) { Assist::Player.new('simplebits') }
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                before do
         
     | 
| 
      
 76 
     | 
    
         
            +
                  player.profile
         
     | 
| 
      
 77 
     | 
    
         
            +
                end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                it "must return the attribute value if present in profile" do
         
     | 
| 
      
 80 
     | 
    
         
            +
                  player.id.must_equal 1
         
     | 
| 
      
 81 
     | 
    
         
            +
                end
         
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
                it "must raise method missing if attribute is not present" do
         
     | 
| 
      
 84 
     | 
    
         
            +
                  lambda { player.foo_attribute }.must_raise NoMethodError
         
     | 
| 
      
 85 
     | 
    
         
            +
                end
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
              end
         
     | 
| 
      
 88 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # If using Ruby 1.9.3 use the below line in place of the 1.9.2 require
         
     | 
| 
      
 2 
     | 
    
         
            +
            require_relative '../lib/Assist'
         
     | 
| 
      
 3 
     | 
    
         
            +
            #require(File.expand_path('../../lib/Assist', __FILE__))
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            #dependencies
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'minitest/autorun'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'webmock/minitest'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'vcr'
         
     | 
| 
      
 9 
     | 
    
         
            +
            require 'turn'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Turn.config do |c|
         
     | 
| 
      
 12 
     | 
    
         
            +
              c.format  = :outline
         
     | 
| 
      
 13 
     | 
    
         
            +
            end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            VCR.configure do |c|
         
     | 
| 
      
 16 
     | 
    
         
            +
              c.allow_http_connections_when_no_cassette = true
         
     | 
| 
      
 17 
     | 
    
         
            +
              c.cassette_library_dir = 'spec/fixtures/dish_cassettes'
         
     | 
| 
      
 18 
     | 
    
         
            +
              c.stub_with :webmock
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,62 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: Assist
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.1
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
      
 6 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 7 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 8 
     | 
    
         
            +
            - Evan Sparkman
         
     | 
| 
      
 9 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 10 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 11 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-03-29 00:00:00.000000000 Z
         
     | 
| 
      
 13 
     | 
    
         
            +
            dependencies: []
         
     | 
| 
      
 14 
     | 
    
         
            +
            description: Simple API Wrapper for Dribbble
         
     | 
| 
      
 15 
     | 
    
         
            +
            email:
         
     | 
| 
      
 16 
     | 
    
         
            +
            - esparkman@esdezines.com
         
     | 
| 
      
 17 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 18 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 19 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 20 
     | 
    
         
            +
            files:
         
     | 
| 
      
 21 
     | 
    
         
            +
            - .gitignore
         
     | 
| 
      
 22 
     | 
    
         
            +
            - Assist.gemspec
         
     | 
| 
      
 23 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 24 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 25 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 26 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 27 
     | 
    
         
            +
            - lib/Assist.rb
         
     | 
| 
      
 28 
     | 
    
         
            +
            - lib/Assist/player.rb
         
     | 
| 
      
 29 
     | 
    
         
            +
            - lib/Assist/version.rb
         
     | 
| 
      
 30 
     | 
    
         
            +
            - spec/fixtures/dish_cassettes/base.yml
         
     | 
| 
      
 31 
     | 
    
         
            +
            - spec/fixtures/dish_cassettes/player.yml
         
     | 
| 
      
 32 
     | 
    
         
            +
            - spec/lib/Assist/player_spec.rb
         
     | 
| 
      
 33 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 34 
     | 
    
         
            +
            homepage: ''
         
     | 
| 
      
 35 
     | 
    
         
            +
            licenses: []
         
     | 
| 
      
 36 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 37 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 38 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 39 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 40 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 41 
     | 
    
         
            +
              none: false
         
     | 
| 
      
 42 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 43 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
      
 44 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 45 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 46 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 47 
     | 
    
         
            +
              none: false
         
     | 
| 
      
 48 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 49 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
      
 50 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 51 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 52 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 53 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 54 
     | 
    
         
            +
            rubygems_version: 1.8.19
         
     | 
| 
      
 55 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 56 
     | 
    
         
            +
            specification_version: 3
         
     | 
| 
      
 57 
     | 
    
         
            +
            summary: Simple API Wrapper for Dribbble
         
     | 
| 
      
 58 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 59 
     | 
    
         
            +
            - spec/fixtures/dish_cassettes/base.yml
         
     | 
| 
      
 60 
     | 
    
         
            +
            - spec/fixtures/dish_cassettes/player.yml
         
     | 
| 
      
 61 
     | 
    
         
            +
            - spec/lib/Assist/player_spec.rb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     |