commonthread-flickr_fu 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/flickr_fu.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "flickr_fu"
3
- s.version = "0.2.1"
3
+ s.version = "0.2.2"
4
4
  s.date = "2008-12-30"
5
5
  s.summary = "Provides a ruby interface to flickr via the REST api"
6
6
  s.email = "ben@commonthread.com"
data/lib/flickr/photo.rb CHANGED
@@ -76,7 +76,7 @@ class Flickr::Photos::Photo
76
76
  # :original - original image, either a jpg, gif or png, depending on source format
77
77
  #
78
78
  def save_as(filename, size = :medium)
79
- format = size.to_sym == :original ? self.original_format : 'jpg'
79
+ format = size.to_sym == :original ? (self.original_format || 'jpg') : 'jpg'
80
80
  filename = "#{filename}.#{format}"
81
81
 
82
82
  if File.exists?(filename) or not self.url(size)
@@ -186,12 +186,10 @@ class Flickr::Photos::Photo
186
186
  @comments ||= begin
187
187
  if @comment_count == 0
188
188
  self.comments = []
189
- self.comments_added = true
190
- elsif not self.comments_added
189
+ else
191
190
  rsp = @flickr.send_request('flickr.photos.comments.getList', :photo_id => self.id)
192
191
 
193
192
  self.comments = []
194
- self.comments_added = true
195
193
 
196
194
  rsp.comments.comment.each do |comment|
197
195
  self.comments << Flickr::Photos::Comment.new(:id => comment[:id],
@@ -201,7 +199,9 @@ class Flickr::Photos::Photo
201
199
  :permalink => comment[:permalink],
202
200
  :created_at => (Time.at(comment[:datecreate].to_i) rescue nil))
203
201
  end
204
- end
202
+ end
203
+
204
+ self.comments
205
205
  end
206
206
  end
207
207
 
data/lib/flickr_fu.rb CHANGED
@@ -3,6 +3,7 @@ require 'xml_magic'
3
3
  require 'net/http'
4
4
  require 'cgi'
5
5
  require 'uri'
6
+ require 'open-uri'
6
7
  require 'mime/types'
7
8
  require 'digest/md5'
8
9
  require 'yaml'
@@ -22,4 +23,4 @@ class Object
22
23
  yield(value)
23
24
  value
24
25
  end
25
- end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonthread-flickr_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Wyrosdick