swish 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -10,8 +10,9 @@ Swish is just a Ruby gem:
10
10
 
11
11
  Not playing in the Ruby league? Here are the others we know of so far:
12
12
 
13
- * ExpressionEngine: http://olivierbon.com/projects/dreebbble
14
- * JSONP: http://apppi.heroku.com/
13
+ * AS3: http://github.com/markstar/StarDribbbleLib
14
+ * ExpressionEngine 1.6.8+: http://ninefour.co.uk/labs/dribbble
15
+ * ExpressionEngine 2: http://olivierbon.com/projects/dreebbble
15
16
  * PHP: http://github.com/martinbean/dribbble-php
16
17
  * Python: http://bitbucket.org/sjl/python-dribbble/src
17
18
 
@@ -27,6 +28,11 @@ Not playing in the Ruby league? Here are the others we know of so far:
27
28
  shot.image_url
28
29
  shot.url
29
30
  shot.player.name
31
+ shot.views_count
32
+ shot.likes_count
33
+ shot.comments_count
34
+ shot.rebounds_count
35
+
30
36
 
31
37
  # Find more shots
32
38
  inspiring = Dribbble::Shot.popular
@@ -38,6 +44,7 @@ Not playing in the Ruby league? Here are the others we know of so far:
38
44
  Dribbble::Shot.everyone(:page => 10, :per_page => 5)
39
45
  Dribbble::Shot.debuts(:page => 5, :per_page => 30)
40
46
 
47
+
41
48
  # Find a player
42
49
  player = Dribbble::Player.find('jeremy')
43
50
 
@@ -46,6 +53,12 @@ Not playing in the Ruby league? Here are the others we know of so far:
46
53
  player.avatar_url
47
54
  player.url
48
55
  player.location
56
+
57
+ # Player stats
58
+ player.shots_count
59
+ player.draftees_count
60
+ player.followers_count
61
+ player.following_count
49
62
 
50
63
  # List a player's shots
51
64
  player.shots
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/lib/dribbble/base.rb CHANGED
@@ -10,7 +10,8 @@ module Dribbble
10
10
  def initialize(attributes={})
11
11
  attributes ||= {}
12
12
  attributes.each do |key, value|
13
- self.send "#{key}=", value
13
+ setter = "#{key}="
14
+ self.send setter, value if self.respond_to?(setter)
14
15
  end
15
16
 
16
17
  after_initialize(attributes)
@@ -1,6 +1,7 @@
1
1
  module Dribbble
2
2
  class Player < Base
3
- attr_accessor :id, :name, :url, :avatar_url, :location
3
+ attr_accessor :id, :name, :url, :avatar_url, :location,
4
+ :shots_count, :draftees_count, :followers_count, :following_count
4
5
 
5
6
  def self.find(id)
6
7
  new(get("/players/#{id}"))
data/lib/dribbble/shot.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Dribbble
2
2
  class Shot < Base
3
- attr_accessor :id, :title, :url, :image_url, :image_teaser_url, :width, :height, :player
3
+ attr_accessor :id, :title, :url, :image_url, :image_teaser_url, :width, :height, :player,
4
+ :views_count, :likes_count, :comments_count, :rebounds_count
4
5
 
5
6
  def after_initialize(attributes)
6
7
  @player = Dribbble::Player.new(attributes['player'])
data/swish.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{swish}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeremy Weiskotten"]
12
- s.date = %q{2010-07-31}
12
+ s.date = %q{2010-08-03}
13
13
  s.description = %q{A Ruby wrapper for the Dribbble API}
14
14
  s.email = %q{jeremy@weiskotten.com}
15
15
  s.extra_rdoc_files = [
data/test/player_test.rb CHANGED
@@ -8,6 +8,11 @@ class PlayerTest < Test::Unit::TestCase
8
8
  assert_equal 'http://dribbble.com/players/simplebits', player.url
9
9
  assert_equal 'Salem, MA', player.location
10
10
  assert_not_nil player.created_at
11
+
12
+ assert_kind_of Numeric, player.shots_count
13
+ assert_kind_of Numeric, player.draftees_count
14
+ assert_kind_of Numeric, player.followers_count
15
+ assert_kind_of Numeric, player.following_count
11
16
  end
12
17
 
13
18
  def test_shots
data/test/shot_test.rb CHANGED
@@ -33,6 +33,11 @@ class ShotTest < Test::Unit::TestCase
33
33
  assert_equal 400, shot.width
34
34
  assert_equal 300, shot.height
35
35
 
36
+ assert_kind_of Numeric, shot.views_count
37
+ assert_kind_of Numeric, shot.likes_count
38
+ assert_kind_of Numeric, shot.comments_count
39
+ assert_kind_of Numeric, shot.rebounds_count
40
+
36
41
  assert_kind_of Dribbble::Player, shot.player
37
42
  end
38
43
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swish
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Weiskotten
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-31 00:00:00 -04:00
18
+ date: 2010-08-03 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency