swish 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -8,6 +8,13 @@ Swish is just a Ruby gem:
8
8
 
9
9
  gem install swish
10
10
 
11
+ Not playing in the Ruby league? Here are the others we know of so far:
12
+
13
+ * ExpressionEngine: http://olivierbon.com/projects/dreebbble
14
+ * JSONP: http://apppi.heroku.com/
15
+ * PHP: http://github.com/martinbean/dribbble-php
16
+ * Python: http://bitbucket.org/sjl/python-dribbble/src
17
+
11
18
  == Examples
12
19
 
13
20
  require 'swish'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/lib/dribbble/base.rb CHANGED
@@ -5,10 +5,12 @@ module Dribbble
5
5
 
6
6
  base_uri 'api.dribbble.com'
7
7
 
8
+ attr_accessor :created_at
9
+
8
10
  def initialize(attributes={})
9
11
  attributes ||= {}
10
12
  attributes.each do |key, value|
11
- instance_variable_set "@#{key}", value
13
+ self.send "#{key}=", value
12
14
  end
13
15
 
14
16
  after_initialize(attributes)
@@ -23,6 +25,10 @@ module Dribbble
23
25
  self == other
24
26
  end
25
27
 
28
+ def created_at=(timestamp)
29
+ @created_at = parse_time(timestamp)
30
+ end
31
+
26
32
  protected
27
33
 
28
34
  def after_initialize(attributes)
@@ -38,5 +44,9 @@ module Dribbble
38
44
  new(attributes)
39
45
  end
40
46
  end
47
+
48
+ def parse_time(time_string)
49
+ Time.parse(time_string)
50
+ end
41
51
  end
42
52
  end
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.1.0"
8
+ s.version = "0.2.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-29}
12
+ s.date = %q{2010-07-31}
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
@@ -7,6 +7,7 @@ class PlayerTest < Test::Unit::TestCase
7
7
  assert_equal 'Dan Cederholm', player.name
8
8
  assert_equal 'http://dribbble.com/players/simplebits', player.url
9
9
  assert_equal 'Salem, MA', player.location
10
+ assert_not_nil player.created_at
10
11
  end
11
12
 
12
13
  def test_shots
data/test/shot_test.rb CHANGED
@@ -9,7 +9,8 @@ class ShotTest < Test::Unit::TestCase
9
9
  'image_url' => 'http://image_url',
10
10
  'image_teaser_url' => 'http://image_teaser_url',
11
11
  'width' => 3,
12
- 'height' => 2)
12
+ 'height' => 2,
13
+ 'created_at' => '2010/05/21 16:34:42 -0400')
13
14
 
14
15
  assert_equal 999, shot.id
15
16
  assert_equal 'Title', shot.title
@@ -18,6 +19,7 @@ class ShotTest < Test::Unit::TestCase
18
19
  assert_equal 'http://image_teaser_url', shot.image_teaser_url
19
20
  assert_equal 3, shot.width
20
21
  assert_equal 2, shot.height
22
+ assert_equal Time.parse('2010/05/21 16:34:42 -0400'), shot.created_at
21
23
  end
22
24
 
23
25
  def test_find
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: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.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-29 00:00:00 -04:00
18
+ date: 2010-07-31 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency