flickraw 0.3 → 0.3.1

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.
Files changed (3) hide show
  1. data/flickraw_rdoc.rb +14 -2
  2. data/lib/flickraw.rb +5 -4
  3. metadata +1 -1
data/flickraw_rdoc.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require "rdoc/parsers/parserfactory"
2
2
  require "rdoc/parsers/parse_rb"
3
- require "cgi"
4
3
 
5
4
  FLICKR_API_URL='http://www.flickr.com/services/api'
6
5
 
@@ -71,7 +70,7 @@ END
71
70
  end
72
71
 
73
72
  def flickr_method_comment(info)
74
- description = CGI.unescapeHTML(info.method.description.to_s)
73
+ description = unescapeHTML(info.method.description.to_s)
75
74
  # description.gsub!( /<\/?(\w+)>/ ) {|b|
76
75
  # return b if ['em', 'b', 'tt'].include? $1
77
76
  # return ''
@@ -131,5 +130,18 @@ END
131
130
  end
132
131
  str
133
132
  end
133
+
134
+ def unescapeHTML(string)
135
+ string.gsub(/&(.*?);/n) do
136
+ match = $1.dup
137
+ case match
138
+ when /\Aamp\z/ni then '&'
139
+ when /\Aquot\z/ni then '"'
140
+ when /\Agt\z/ni then '>'
141
+ when /\Alt\z/ni then '<'
142
+ else "&#{match};"
143
+ end
144
+ end
145
+ end
134
146
  end
135
147
  end
data/lib/flickraw.rb CHANGED
@@ -25,16 +25,17 @@ require 'open-uri'
25
25
  require 'md5'
26
26
 
27
27
  module FlickRaw
28
- VERSION='0.3'
28
+ VERSION='0.3.1'
29
29
 
30
30
  FLICKR_HOST='api.flickr.com'.freeze
31
31
 
32
- # Path of the flickr REST api
32
+ # Path of flickr REST API
33
33
  REST_PATH='/services/rest/?'.freeze
34
34
 
35
- # Path of the flickr auth page
35
+ # Path of flickr auth page
36
36
  AUTH_PATH='/services/auth/?'.freeze
37
37
 
38
+ # Path of flickr upload
38
39
  UPLOAD_PATH='/services/upload/'.freeze
39
40
 
40
41
  @api_key = '7b124df89b638e545e3165293883ef62'
@@ -217,7 +218,7 @@ module FlickRaw
217
218
  end
218
219
 
219
220
  def lookup_token(req, res)
220
- token_reqs = ['flickr.auth.getToken', 'flickr.auth.getFullToken']
221
+ token_reqs = ['flickr.auth.getToken', 'flickr.auth.getFullToken', 'flickr.auth.checkToken']
221
222
  @token = res.token if token_reqs.include?(req) and res.respond_to?( :token)
222
223
  end
223
224
  end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: flickraw
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.3"
6
+ version: 0.3.1
7
7
  date: 2006-09-02 00:00:00 +02:00
8
8
  summary: Flickr library with a syntax close to the syntax described on http://www.flickr.com/services/api
9
9
  require_paths: