flickr 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/flickr.rb +7 -1
  3. metadata +2 -2
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ Rake::RDocTask.new { |rdoc|
18
18
  spec = Gem::Specification.new do |s|
19
19
  s.add_dependency('xml-simple', '>= 1.0.7')
20
20
  s.name = 'flickr'
21
- s.version = "1.0.1"
21
+ s.version = "1.0.2"
22
22
  s.platform = Gem::Platform::RUBY
23
23
  s.summary = "An insanely easy interface to the Flickr photo-sharing service. By Scott Raymond. Maintainer: Patrick Plattes"
24
24
  s.requirements << 'Flickr developers API key'
data/flickr.rb CHANGED
@@ -100,7 +100,13 @@ class Flickr
100
100
  # Implements flickr.photos.getRecent and flickr.photos.search
101
101
  def photos(*criteria)
102
102
  photos = (criteria[0]) ? photos_search(criteria[0]) : photos_getRecent
103
- photos['photos']['photo'].collect { |photo| Photo.new(photo['id'], @api_key) }
103
+ # At this point, search criterias with pet_page => has structure
104
+ # {"photos => {"photo" => {...}}"}
105
+ # While per_page values with > 1 have
106
+ # {"photos => {"photo" => [{...}]}"}
107
+ collection = photos['photos']['photo']
108
+ collection = [collection] if collection.is_a? Hash
109
+ collection.collect { |photo| Photo.new(photo['id'], @api_key) }
104
110
  end
105
111
 
106
112
  # Gets public photos with a given tag
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: flickr
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.1
7
- date: 2008-02-25 00:00:00 +01:00
6
+ version: 1.0.2
7
+ date: 2008-02-27 00:00:00 +01:00
8
8
  summary: "An insanely easy interface to the Flickr photo-sharing service. By Scott Raymond. Maintainer: Patrick Plattes"
9
9
  require_paths:
10
10
  - .