flickraw 0.9.4 → 0.9.5
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.
- data/lib/flickraw.rb +1 -1
- data/lib/flickraw/api.rb +1 -0
- data/lib/flickraw/oauth.rb +8 -3
- data/rakefile +3 -1
- data/test/helper.rb +1 -0
- data/test/test.rb +3 -3
- metadata +2 -2
data/lib/flickraw.rb
CHANGED
data/lib/flickraw/api.rb
CHANGED
@@ -39,6 +39,7 @@ module FlickRaw
|
|
39
39
|
@oauth_consumer = OAuthClient.new(FlickRaw.api_key, FlickRaw.shared_secret)
|
40
40
|
@oauth_consumer.proxy = FlickRaw.proxy
|
41
41
|
@oauth_consumer.user_agent = USER_AGENT
|
42
|
+
@access_token = @access_secret = nil
|
42
43
|
|
43
44
|
Flickr.build(call('flickr.reflection.getMethods')) if Flickr.flickr_objects.empty?
|
44
45
|
super self
|
data/lib/flickraw/oauth.rb
CHANGED
@@ -10,11 +10,16 @@ module FlickRaw
|
|
10
10
|
super(@response['oauth_problem'])
|
11
11
|
end
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
class << self
|
15
|
-
def escape(
|
15
|
+
def escape(s)
|
16
|
+
s.to_s.dup.gsub(/[^a-zA-Z0-9\-\.\_\~]/) {
|
17
|
+
sprintf("%%%02X", $&.unpack("C")[0])
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
16
21
|
def parse_response(text); Hash[text.split("&").map {|s| s.split("=")}] end
|
17
|
-
|
22
|
+
|
18
23
|
def signature_base_string(method, url, params)
|
19
24
|
params_norm = params.map {|k,v| escape(k) + "=" + escape(v)}.sort.join("&")
|
20
25
|
method.to_s.upcase + "&" + escape(url) + "&" + escape(params_norm)
|
data/rakefile
CHANGED
data/test/helper.rb
CHANGED
data/test/test.rb
CHANGED
@@ -258,7 +258,7 @@ class Basic < Test::Unit::TestCase
|
|
258
258
|
assert_equal ["ling ling", "hsing hsing", "wang wang"], pandas.to_a
|
259
259
|
end
|
260
260
|
|
261
|
-
def
|
261
|
+
def test_panda_getPhotos
|
262
262
|
pandas = flickr.panda.getPhotos :panda_name => "wang wang"
|
263
263
|
assert_equal "wang wang", pandas.panda
|
264
264
|
assert_respond_to pandas[0], :title
|
@@ -333,9 +333,9 @@ class Basic < Test::Unit::TestCase
|
|
333
333
|
info = flickr.photos.getSizes :photo_id => "3839885270"
|
334
334
|
assert_equal "http://www.flickr.com/photos/41650587@N02/3839885270/sizes/l/", info.find {|f| f.label == "Large"}.url
|
335
335
|
if FlickRaw.secure
|
336
|
-
source = "https://farm3.
|
336
|
+
source = "https://farm3.staticflickr.com/2485/3839885270_6fb8b54e06_b.jpg"
|
337
337
|
else
|
338
|
-
source = "http://farm3.
|
338
|
+
source = "http://farm3.staticflickr.com/2485/3839885270_6fb8b54e06_b.jpg"
|
339
339
|
end
|
340
340
|
|
341
341
|
assert_equal source, info.find {|f| f.label == "Large"}.source
|
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.9.
|
4
|
+
version: 0.9.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: maelclerambault@yahoo.fr
|