myflickr 0.1.2 → 0.1.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.
@@ -1,3 +1,8 @@
1
+ == 0.1.3 2008-01-18
2
+
3
+ * Machine tags aren't included in the tags for a photo any longer
4
+ *
5
+
1
6
  == 0.1.2 2008-01-15
2
7
 
3
8
  * Removed inbuilt memcached cache mechanism and replaced with my new gem `openuri_memcached`
@@ -12,6 +12,7 @@ lib/myflickr/query.rb
12
12
  lib/myflickr/set.rb
13
13
  lib/myflickr/size.rb
14
14
  lib/myflickr/tag.rb
15
+ lib/myflickr/user.rb
15
16
  lib/myflickr/version.rb
16
17
  lib/vendor/parallel/parallel.rb
17
18
  spec/machine_tag_spec.rb
@@ -21,3 +22,4 @@ spec/set_spec.rb
21
22
  spec/size_spec.rb
22
23
  spec/spec_helper.rb
23
24
  spec/tag_spec.rb
25
+ spec/user_spec.rb
@@ -10,6 +10,6 @@ module Myflickr
10
10
  MAX_THREADS = 100
11
11
  end
12
12
 
13
- %w(query photo tag size set machine_tag version).each do |r|
13
+ %w(query photo tag size set machine_tag user version).each do |r|
14
14
  require File.join(File.dirname(__FILE__), './myflickr/' + r)
15
15
  end
@@ -20,7 +20,7 @@ module Myflickr
20
20
  photo = Photo.new(id, *%w(title description).map {|a| (photo_call/a).inner_text })
21
21
 
22
22
  # Set tags for photo
23
- photo.tags = (photo_call/:tag).map{|tag| Tag.new tag.inner_text}
23
+ photo.tags = (photo_call/:tag).map{|tag| Tag.new tag.inner_text unless /(.*)\:(.*)\=(.*)/ }
24
24
  photo.machine_tags = (photo_call/"tag[@machine_tag=1]").map{|tag| MachineTag.from_s tag.inner_text }
25
25
 
26
26
  return photo
@@ -0,0 +1,10 @@
1
+ module Myflickr
2
+ class User < Struct.new :username, :realname
3
+ class << self
4
+ def find
5
+ user_lookup = Query.api_call("flickr.people.getInfo")
6
+ User.new(*%w(username realname).map {|a| (user_lookup/a).inner_text.to_s })
7
+ end
8
+ end
9
+ end
10
+ end
@@ -2,7 +2,7 @@ module Myflickr
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,14 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe User, "class" do
4
+ before :each do
5
+ @user = User.find
6
+ end
7
+ it "should have a username" do
8
+ @user.username.should eql "Ben Schwarz"
9
+ end
10
+
11
+ it "should have a realname" do
12
+ @user.realname.should eql "Ben Schwarz"
13
+ end
14
+ end
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.2
4
+ version: 0.1.3
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-17 00:00:00 +11:00
12
+ date: 2008-01-18 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -56,6 +56,7 @@ files:
56
56
  - lib/myflickr/set.rb
57
57
  - lib/myflickr/size.rb
58
58
  - lib/myflickr/tag.rb
59
+ - lib/myflickr/user.rb
59
60
  - lib/myflickr/version.rb
60
61
  - lib/vendor/parallel/parallel.rb
61
62
  - spec/machine_tag_spec.rb
@@ -65,6 +66,7 @@ files:
65
66
  - spec/size_spec.rb
66
67
  - spec/spec_helper.rb
67
68
  - spec/tag_spec.rb
69
+ - spec/user_spec.rb
68
70
  has_rdoc: true
69
71
  homepage: http://germanforblack.com/
70
72
  post_install_message: