flickraw 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ require 'flickraw/response'
5
5
  require 'flickraw/api'
6
6
 
7
7
  module FlickRaw
8
- VERSION='0.9.4'
8
+ VERSION='0.9.5'
9
9
  USER_AGENT = "FlickRaw/#{VERSION}"
10
10
  end
11
11
 
@@ -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
@@ -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(v); URI.escape(v.to_s, /[^a-zA-Z0-9\-\.\_\~]/) end
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
@@ -16,4 +16,6 @@ Rake::RDocTask.new do |rd|
16
16
  rd.rdoc_files.include "README.rdoc", "lib/flickraw.rb"
17
17
  end
18
18
 
19
- Rake::TestTask.new
19
+ Rake::TestTask.new do |t|
20
+ t.warning = true
21
+ end
@@ -5,6 +5,7 @@ require 'flickraw'
5
5
 
6
6
  FlickRaw.api_key = ENV['FLICKRAW_API_KEY']
7
7
  FlickRaw.shared_secret = ENV['FLICKRAW_SHARED_SECRET']
8
+ #FlickRaw.secure = true
8
9
 
9
10
  flickr.access_token = ENV['FLICKRAW_ACCESS_TOKEN']
10
11
  flickr.access_secret = ENV['FLICKRAW_ACCESS_SECRET']
@@ -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 test_panda_getList
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.static.flickr.com/2485/3839885270_6fb8b54e06_b.jpg"
336
+ source = "https://farm3.staticflickr.com/2485/3839885270_6fb8b54e06_b.jpg"
337
337
  else
338
- source = "http://farm3.static.flickr.com/2485/3839885270_6fb8b54e06_b.jpg"
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
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-11-09 00:00:00.000000000 Z
12
+ date: 2011-12-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: maelclerambault@yahoo.fr