myflickr 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/lib/myflickr.rb +1 -0
- data/lib/myflickr/photo.rb +3 -2
- data/lib/myflickr/version.rb +1 -1
- data/spec/photo_spec.rb +5 -0
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
== 0.1.4 2008-01-18
|
2
|
+
|
3
|
+
* Added a user class for retrieval of username, realname
|
4
|
+
* Changed the way machine tags are associated with a photo, no api change
|
5
|
+
* Added a taken time to photos
|
6
|
+
|
1
7
|
== 0.1.3 2008-01-18
|
2
8
|
|
3
9
|
* Machine tags aren't included in the tags for a photo any longer
|
4
|
-
*
|
5
10
|
|
6
11
|
== 0.1.2 2008-01-15
|
7
12
|
|
data/lib/myflickr.rb
CHANGED
data/lib/myflickr/photo.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Myflickr
|
2
|
-
class Photo < Struct.new :id, :title, :description, :tags, :machine_tags
|
2
|
+
class Photo < Struct.new :id, :title, :description, :tags, :machine_tags, :taken
|
3
3
|
attr_reader :sizes
|
4
4
|
|
5
5
|
# Get recent photos
|
@@ -18,9 +18,10 @@ module Myflickr
|
|
18
18
|
|
19
19
|
# Set basic attributes
|
20
20
|
photo = Photo.new(id, *%w(title description).map {|a| (photo_call/a).inner_text })
|
21
|
+
photo.taken = Time.parse(photo_call.at(:dates)['taken'])
|
21
22
|
|
22
23
|
# Set tags for photo
|
23
|
-
photo.tags = (photo_call
|
24
|
+
photo.tags = (photo_call/"tag[@machine_tag=0]").map{|tag| Tag.new tag.inner_text }
|
24
25
|
photo.machine_tags = (photo_call/"tag[@machine_tag=1]").map{|tag| MachineTag.from_s tag.inner_text }
|
25
26
|
|
26
27
|
return photo
|
data/lib/myflickr/version.rb
CHANGED
data/spec/photo_spec.rb
CHANGED
@@ -24,6 +24,11 @@ describe Photo, "class" do
|
|
24
24
|
tags.first.should be_an_instance_of(Tag)
|
25
25
|
end
|
26
26
|
|
27
|
+
it "should have a taken time" do
|
28
|
+
photo = Photo.find("252091410")
|
29
|
+
photo.taken.should be_an_instance_of(Time)
|
30
|
+
end
|
31
|
+
|
27
32
|
it "should have machine_tags" do
|
28
33
|
Photo.public_instance_methods.should include "machine_tags"
|
29
34
|
machine_tags = Photo.find("252091410").machine_tags
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myflickr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Schwarz
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-01-
|
12
|
+
date: 2008-01-19 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|