dribble 0.0.2 → 0.0.3
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.rdoc +11 -9
 - data/Rakefile +2 -2
 - data/VERSION +1 -1
 - data/dribble.gemspec +8 -8
 - data/examples/player.rb +18 -3
 - data/examples/shot.rb +1 -15
 - data/lib/dribble/player.rb +2 -1
 - metadata +14 -12
 
    
        data/README.rdoc
    CHANGED
    
    | 
         @@ -1,24 +1,26 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            = Dribble
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            This is the unofficial dribble api. 
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            There is a very thin wrapper for the Dribble API that is labeled as Dribble::API. This uses the bare minimum to get the desired data from Dribble and returns a symbolized hash. This implementation is focused on simplicity and speed. However, I have yet to really work on the speed aspect.
         
     | 
| 
      
 3 
     | 
    
         
            +
            This is the unofficial dribble api. For more examples look in the examples/ directory. There are examples for the both styles (object notation and hash implementation.)
         
     | 
| 
       6 
4 
     | 
    
         | 
| 
       7 
5 
     | 
    
         
             
            == Dribble::API
         
     | 
| 
       8 
6 
     | 
    
         | 
| 
      
 7 
     | 
    
         
            +
            There is a very thin wrapper for the Dribble API that is labeled as Dribble::API. This uses the bare minimum to get the desired data from Dribble and returns a hash. This implementation is focused on simplicity and speed. However, I have yet to really work on the speed aspect.
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       9 
9 
     | 
    
         
             
              Dribble::API::Player.profile('simplebits')
         
     | 
| 
       10 
10 
     | 
    
         
             
              Dribble::API::Shot.popular
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
            Dribble::Player and Dribble::Shot is another layer on-top of the API to add that object look and feel. This is more for convenience and ease of use.
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
            This is meant for convenience and ease of use. 
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
13 
     | 
    
         
             
            == Dribble::Player && Dribble::Shot
         
     | 
| 
       19 
14 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 15 
     | 
    
         
            +
            Dribble::Player and Dribble::Shot is another layer on-top of the API to add that object look and feel. This is more for convenience and ease of use.
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            This is meant for convenience and ease of use.
         
     | 
| 
      
 18 
     | 
    
         
            +
              
         
     | 
| 
       21 
19 
     | 
    
         
             
              Dribble::Shot.popular
         
     | 
| 
      
 20 
     | 
    
         
            +
              
         
     | 
| 
      
 21 
     | 
    
         
            +
              player = Dribble::Player.profile('simplebits')
         
     | 
| 
      
 22 
     | 
    
         
            +
              player.following  # => the shots that this player is following
         
     | 
| 
      
 23 
     | 
    
         
            +
              player.shots      # => the players shots
         
     | 
| 
       22 
24 
     | 
    
         | 
| 
       23 
25 
     | 
    
         
             
            == Note on Patches/Pull Requests
         
     | 
| 
       24 
26 
     | 
    
         | 
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -10,8 +10,8 @@ begin 
     | 
|
| 
       10 
10 
     | 
    
         
             
                gem.email = "robert@codewranglers.org"
         
     | 
| 
       11 
11 
     | 
    
         
             
                gem.homepage = "http://github.com/revans/dribble"
         
     | 
| 
       12 
12 
     | 
    
         
             
                gem.authors = ["Robert R Evans"]
         
     | 
| 
       13 
     | 
    
         
            -
                gem.add_development_dependency "rspec", " 
     | 
| 
       14 
     | 
    
         
            -
                gem.add_development_dependency "yard", 
     | 
| 
      
 13 
     | 
    
         
            +
                gem.add_development_dependency "rspec", "= 1.3.0"
         
     | 
| 
      
 14 
     | 
    
         
            +
                gem.add_development_dependency "yard",  "= 0.5.8"
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                gem.add_dependency 'yajl-ruby', '= 0.7.7'
         
     | 
| 
       17 
17 
     | 
    
         | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.0. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.0.3
         
     | 
    
        data/dribble.gemspec
    CHANGED
    
    | 
         @@ -5,11 +5,11 @@ 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.name = %q{dribble}
         
     | 
| 
       8 
     | 
    
         
            -
              s.version = "0.0. 
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "0.0.3"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.authors = ["Robert R Evans"]
         
     | 
| 
       12 
     | 
    
         
            -
              s.date = %q{2010-08- 
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = %q{2010-08-05}
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.description = %q{API Wrapper for the awesome Dribble Site}
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.email = %q{robert@codewranglers.org}
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.extra_rdoc_files = [
         
     | 
| 
         @@ -61,17 +61,17 @@ Gem::Specification.new do |s| 
     | 
|
| 
       61 
61 
     | 
    
         
             
                s.specification_version = 3
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
       63 
63 
     | 
    
         
             
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         
     | 
| 
       64 
     | 
    
         
            -
                  s.add_development_dependency(%q<rspec>, [" 
     | 
| 
       65 
     | 
    
         
            -
                  s.add_development_dependency(%q<yard>, [" 
     | 
| 
      
 64 
     | 
    
         
            +
                  s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
         
     | 
| 
      
 65 
     | 
    
         
            +
                  s.add_development_dependency(%q<yard>, ["= 0.5.8"])
         
     | 
| 
       66 
66 
     | 
    
         
             
                  s.add_runtime_dependency(%q<yajl-ruby>, ["= 0.7.7"])
         
     | 
| 
       67 
67 
     | 
    
         
             
                else
         
     | 
| 
       68 
     | 
    
         
            -
                  s.add_dependency(%q<rspec>, [" 
     | 
| 
       69 
     | 
    
         
            -
                  s.add_dependency(%q<yard>, [" 
     | 
| 
      
 68 
     | 
    
         
            +
                  s.add_dependency(%q<rspec>, ["= 1.3.0"])
         
     | 
| 
      
 69 
     | 
    
         
            +
                  s.add_dependency(%q<yard>, ["= 0.5.8"])
         
     | 
| 
       70 
70 
     | 
    
         
             
                  s.add_dependency(%q<yajl-ruby>, ["= 0.7.7"])
         
     | 
| 
       71 
71 
     | 
    
         
             
                end
         
     | 
| 
       72 
72 
     | 
    
         
             
              else
         
     | 
| 
       73 
     | 
    
         
            -
                s.add_dependency(%q<rspec>, [" 
     | 
| 
       74 
     | 
    
         
            -
                s.add_dependency(%q<yard>, [" 
     | 
| 
      
 73 
     | 
    
         
            +
                s.add_dependency(%q<rspec>, ["= 1.3.0"])
         
     | 
| 
      
 74 
     | 
    
         
            +
                s.add_dependency(%q<yard>, ["= 0.5.8"])
         
     | 
| 
       75 
75 
     | 
    
         
             
                s.add_dependency(%q<yajl-ruby>, ["= 0.7.7"])
         
     | 
| 
       76 
76 
     | 
    
         
             
              end
         
     | 
| 
       77 
77 
     | 
    
         
             
            end
         
     | 
    
        data/examples/player.rb
    CHANGED
    
    | 
         @@ -12,7 +12,22 @@ require File.join(dir, 'dribble') 
     | 
|
| 
       12 
12 
     | 
    
         
             
            # puts player.inspect
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         | 
| 
      
 15 
     | 
    
         
            +
            # puts
         
     | 
| 
      
 16 
     | 
    
         
            +
            # puts "Find the shots that a specific Player is following"
         
     | 
| 
      
 17 
     | 
    
         
            +
            # player3 = Dribble::Player.following_shots('simplebits')
         
     | 
| 
      
 18 
     | 
    
         
            +
            # puts player3.inspect
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       15 
22 
     | 
    
         
             
            puts
         
     | 
| 
       16 
     | 
    
         
            -
            puts " 
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
            puts  
     | 
| 
      
 23 
     | 
    
         
            +
            puts "Get a Player's Profile"
         
     | 
| 
      
 24 
     | 
    
         
            +
            player = Dribble::Player.find(1)
         
     | 
| 
      
 25 
     | 
    
         
            +
            puts player.inspect
         
     | 
| 
      
 26 
     | 
    
         
            +
            # puts
         
     | 
| 
      
 27 
     | 
    
         
            +
            # puts "Take this player and see what shots they are following"
         
     | 
| 
      
 28 
     | 
    
         
            +
            # following_shots = player.following
         
     | 
| 
      
 29 
     | 
    
         
            +
            # puts following_shots.inspect
         
     | 
| 
      
 30 
     | 
    
         
            +
            # puts
         
     | 
| 
      
 31 
     | 
    
         
            +
            # puts "Take this player and see what shots they've put up"
         
     | 
| 
      
 32 
     | 
    
         
            +
            # my_shots = player.shots
         
     | 
| 
      
 33 
     | 
    
         
            +
            # puts my_shots.inspect
         
     | 
    
        data/examples/shot.rb
    CHANGED
    
    | 
         @@ -30,18 +30,4 @@ require File.join(dir, 'dribble') 
     | 
|
| 
       30 
30 
     | 
    
         
             
            # puts following.inspect
         
     | 
| 
       31 
31 
     | 
    
         
             
            # puts
         
     | 
| 
       32 
32 
     | 
    
         
             
            # following_page_2 = following.next_page
         
     | 
| 
       33 
     | 
    
         
            -
            # puts following_page_2.inspect
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
            puts
         
     | 
| 
       37 
     | 
    
         
            -
            puts "Get a Player's Profile"
         
     | 
| 
       38 
     | 
    
         
            -
            player = Dribble::Player.find(1)
         
     | 
| 
       39 
     | 
    
         
            -
            puts player.inspect
         
     | 
| 
       40 
     | 
    
         
            -
            puts
         
     | 
| 
       41 
     | 
    
         
            -
            puts "Take this player and see what shots they are following"
         
     | 
| 
       42 
     | 
    
         
            -
            following_shots = player.following
         
     | 
| 
       43 
     | 
    
         
            -
            puts following_shots.inspect
         
     | 
| 
       44 
     | 
    
         
            -
            puts
         
     | 
| 
       45 
     | 
    
         
            -
            puts "Take this player and see what shots they've put up"
         
     | 
| 
       46 
     | 
    
         
            -
            my_shots = player.shots
         
     | 
| 
       47 
     | 
    
         
            -
            puts my_shots.inspect
         
     | 
| 
      
 33 
     | 
    
         
            +
            # puts following_page_2.inspect
         
     | 
    
        data/lib/dribble/player.rb
    CHANGED
    
    | 
         @@ -1,7 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Dribble
         
     | 
| 
       2 
2 
     | 
    
         
             
              class Player
         
     | 
| 
       3 
3 
     | 
    
         
             
                attr_reader :id, :name, :url, :avatar_url, :location, :created_at, :draftees_count,
         
     | 
| 
       4 
     | 
    
         
            -
                            :following_count, :shots_count, :followers_count, :following, :shots
         
     | 
| 
      
 4 
     | 
    
         
            +
                            :following_count, :shots_count, :followers_count, :following, :shots,
         
     | 
| 
      
 5 
     | 
    
         
            +
                            :drafted_by_player_id, :draftees_count
         
     | 
| 
       5 
6 
     | 
    
         | 
| 
       6 
7 
     | 
    
         | 
| 
       7 
8 
     | 
    
         
             
                def initialize(attr={})
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: dribble
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 25
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 3
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.0.3
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - Robert R Evans
         
     | 
| 
         @@ -15,7 +15,7 @@ autorequire: 
     | 
|
| 
       15 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            date: 2010-08- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2010-08-05 00:00:00 -07:00
         
     | 
| 
       19 
19 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       20 
20 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       21 
21 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -24,14 +24,14 @@ dependencies: 
     | 
|
| 
       24 
24 
     | 
    
         
             
              requirement: &id001 !ruby/object:Gem::Requirement 
         
     | 
| 
       25 
25 
     | 
    
         
             
                none: false
         
     | 
| 
       26 
26 
     | 
    
         
             
                requirements: 
         
     | 
| 
       27 
     | 
    
         
            -
                - - " 
     | 
| 
      
 27 
     | 
    
         
            +
                - - "="
         
     | 
| 
       28 
28 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       29 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 29 
     | 
    
         
            +
                    hash: 27
         
     | 
| 
       30 
30 
     | 
    
         
             
                    segments: 
         
     | 
| 
       31 
31 
     | 
    
         
             
                    - 1
         
     | 
| 
       32 
     | 
    
         
            -
                    -  
     | 
| 
       33 
     | 
    
         
            -
                    -  
     | 
| 
       34 
     | 
    
         
            -
                    version: 1. 
     | 
| 
      
 32 
     | 
    
         
            +
                    - 3
         
     | 
| 
      
 33 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 34 
     | 
    
         
            +
                    version: 1.3.0
         
     | 
| 
       35 
35 
     | 
    
         
             
              type: :development
         
     | 
| 
       36 
36 
     | 
    
         
             
              version_requirements: *id001
         
     | 
| 
       37 
37 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -40,12 +40,14 @@ dependencies: 
     | 
|
| 
       40 
40 
     | 
    
         
             
              requirement: &id002 !ruby/object:Gem::Requirement 
         
     | 
| 
       41 
41 
     | 
    
         
             
                none: false
         
     | 
| 
       42 
42 
     | 
    
         
             
                requirements: 
         
     | 
| 
       43 
     | 
    
         
            -
                - - " 
     | 
| 
      
 43 
     | 
    
         
            +
                - - "="
         
     | 
| 
       44 
44 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       45 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 45 
     | 
    
         
            +
                    hash: 27
         
     | 
| 
       46 
46 
     | 
    
         
             
                    segments: 
         
     | 
| 
       47 
47 
     | 
    
         
             
                    - 0
         
     | 
| 
       48 
     | 
    
         
            -
                     
     | 
| 
      
 48 
     | 
    
         
            +
                    - 5
         
     | 
| 
      
 49 
     | 
    
         
            +
                    - 8
         
     | 
| 
      
 50 
     | 
    
         
            +
                    version: 0.5.8
         
     | 
| 
       49 
51 
     | 
    
         
             
              type: :development
         
     | 
| 
       50 
52 
     | 
    
         
             
              version_requirements: *id002
         
     | 
| 
       51 
53 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     |