flickraw 0.6.1 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +1 -1
  2. data/lib/flickraw.rb +7 -7
  3. data/rakefile +0 -1
  4. metadata +3 -3
data/README.rdoc CHANGED
@@ -40,5 +40,5 @@ See the _examples_ directory to find more examples.
40
40
  = Notes
41
41
  If you want to use the api authenticated with several user at the same time, you must pass the authentication token explicitely each time.
42
42
  This is because it is keeping the authentication token internally.
43
- As an alternative, you can create new Flickr objects besides Object.flickr which is created for you. Use Flickr.new to this effect.
43
+ As an alternative, you can create new Flickr objects besides Kernel.flickr which is created for you. Use Flickr.new to this effect.
44
44
 
data/lib/flickraw.rb CHANGED
@@ -26,7 +26,7 @@ require 'json'
26
26
  require 'cgi'
27
27
 
28
28
  module FlickRaw
29
- VERSION='0.6.1'
29
+ VERSION='0.7'
30
30
 
31
31
  FLICKR_HOST='api.flickr.com'.freeze
32
32
 
@@ -103,7 +103,7 @@ module FlickRaw
103
103
  if method_nesting.size > 1
104
104
  name = method_nesting.first
105
105
  class_name = name.capitalize
106
- if const_defined?(class_name, false)
106
+ if flickr_objects.include? name
107
107
  klass = const_get(class_name)
108
108
  else
109
109
  klass = Class.new Request
@@ -135,7 +135,10 @@ module FlickRaw
135
135
 
136
136
  # Root class of the flickr api hierarchy.
137
137
  class Flickr < Request
138
+ def self.build(methods); methods.each { |m| build_request m } end
139
+
138
140
  def initialize # :nodoc:
141
+ Flickr.build(call('flickr.reflection.getMethods')) if Flickr.flickr_objects.empty?
139
142
  super self
140
143
  @token = nil
141
144
  end
@@ -233,9 +236,6 @@ module FlickRaw
233
236
  Digest::MD5.hexdigest(FlickRaw.shared_secret + hsh.sort{|a, b| a[0].to_s <=> b[0].to_s }.flatten.join).to_s
234
237
  end
235
238
  end
236
-
237
- methods = Flickr.new.call 'flickr.reflection.getMethods'
238
- methods.each { |method| Flickr.build_request method }
239
239
  end
240
240
 
241
241
  # Use this to access the flickr API easily. You can type directly the flickr requests as they are described on the flickr website.
@@ -243,5 +243,5 @@ end
243
243
  #
244
244
  # recent_photos = flickr.photos.getRecent
245
245
  # puts recent_photos[0].title
246
- def flickr; $flickraw ||= FlickRaw::Flickr.new end
247
-
246
+ def flickr; $flickraw end
247
+ $flickraw = FlickRaw::Flickr.new
data/rakefile CHANGED
@@ -18,7 +18,6 @@ spec = Gem::Specification.new do |s|
18
18
  s.version = FlickRaw::VERSION
19
19
  s.files = PKG_FILES
20
20
  s.test_files = FileList["test/*.rb"].to_a
21
- s.required_ruby_version = '>= 1.9'
22
21
  end
23
22
 
24
23
  Rake::RDocTask.new do |rd|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickraw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: "0.7"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mael Clerambault
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-06 00:00:00 +02:00
12
+ date: 2009-07-26 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -43,7 +43,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: "1.9"
46
+ version: "0"
47
47
  version:
48
48
  required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  requirements: