flickr 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +11 -0
- data/CHANGELOG.md +21 -0
- data/Gemfile +2 -0
- data/README.md +233 -0
- data/examples/sinatra.rb +4 -4
- data/flickr.gemspec +33 -0
- data/flickr_rdoc.rb +7 -7
- data/lib/flickr/response.rb +5 -3
- data/lib/flickr/version.rb +1 -1
- data/lib/flickr.rb +21 -19
- data/rakefile +19 -6
- metadata +77 -17
- data/README.rdoc +0 -185
- data/test/test.rb +0 -471
- data/test/test_cache.rb +0 -45
- data/test/test_request.rb +0 -36
- data/test/test_response.rb +0 -30
- data/test/test_upload.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f0cdb71210b22543b9bb1ccea0f424f01c755aac6e381dcc004acbd07cc6437
|
4
|
+
data.tar.gz: 6475827a161382a260a24a26c410d8e1a989fc718adef34c954a841badb2c702
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acaba2309c9c501a4f1445ef6d8f73d1eac37f066fe660808cad18d2f8325beb6328cac49a7dc8348df438ce8783b965a5ef36410112581910a04f5fdf98e42d
|
7
|
+
data.tar.gz: efcc14ec4b79d757c424b63fb2abde56e222c198d89a25772d3b8e229ece03c42d6dd0f4ab7eef9c275426550a0fe64ffa7a93d951ebaa076fcb40f7ea7e04b1
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## 2.1.0 - 2022-05-20
|
8
|
+
### Added
|
9
|
+
- Handle new response format without blowing up
|
10
|
+
|
11
|
+
## 2.0.2 - 2019-06-05
|
12
|
+
### Added
|
13
|
+
- Updated upload and replace endpoints
|
14
|
+
|
15
|
+
## 2.0.1 - 2019-03-17
|
16
|
+
### Added
|
17
|
+
- Better documentation
|
18
|
+
|
19
|
+
## 2.0.0 - 2019-03-13
|
20
|
+
### Changes
|
21
|
+
- Initial migration of FlickRaw to Flickr
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,233 @@
|
|
1
|
+
# Flickr
|
2
|
+
|
3
|
+
Flickr (formerly FlickRaw) is a library to access the [Flickr](https://flickr.com) API in a simple way.
|
4
|
+
It maps exactly the methods described in [the official API documentation](https://www.flickr.com/services/api/).
|
5
|
+
It also tries to present the data returned in a simple and intuitive way.
|
6
|
+
The methods are fetched from Flickr when loading the library by using introspection capabilities.
|
7
|
+
So it is always up-to-date with regards to new methods added by Flickr.
|
8
|
+
|
9
|
+
The github repository: https://github.com/cyclotron3k/flickr
|
10
|
+
|
11
|
+
# Upgrading from FlickRaw?
|
12
|
+
|
13
|
+
If you're upgrading from FlickRaw 0.9.x there are a few breaking changes to be aware of:
|
14
|
+
* Instantiate a new object with `client = Flickr.new` instead of `FlickRaw::Flickr.new`.
|
15
|
+
* The global `flickr` variable is no longer created.
|
16
|
+
* Local caching of the Flickr API specification is no longer achieved with a separate gem.
|
17
|
+
|
18
|
+
|
19
|
+
# Installation
|
20
|
+
Type this in a console (you might need to be superuser)
|
21
|
+
|
22
|
+
gem install flickr
|
23
|
+
|
24
|
+
This will recreate the documentation by fetching the method descriptions from Flickr and then virtually plugging them in standard rdoc documentation.
|
25
|
+
|
26
|
+
$ cd flickr
|
27
|
+
$ rake rdoc
|
28
|
+
|
29
|
+
# Features
|
30
|
+
|
31
|
+
* Minimal dependencies
|
32
|
+
* Complete support of Flickr API. This doesn't require an update of the library
|
33
|
+
* Ruby syntax similar to the Flickr API
|
34
|
+
* Flickr authentication
|
35
|
+
* HTTPS Support
|
36
|
+
* Photo upload
|
37
|
+
* Proxy support
|
38
|
+
* Flickr URLs helpers
|
39
|
+
|
40
|
+
|
41
|
+
# Usage
|
42
|
+
|
43
|
+
## Getting started
|
44
|
+
|
45
|
+
To use the Flickr API, you must first obtain an API key and shared secret from Flickr.
|
46
|
+
You can do this by logging in to Flickr and creating an application [here](https://www.flickr.com/services/apps/create/apply).
|
47
|
+
API keys are usually granted automatically and instantly.
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
require 'flickr'
|
51
|
+
|
52
|
+
# The credentials can be provided as parameters:
|
53
|
+
|
54
|
+
flickr = Flickr.new "YOUR API KEY", "YOUR SHARED SECRET"
|
55
|
+
|
56
|
+
# Alternatively, if the API key and Shared Secret are not provided, Flickr will attempt to read them
|
57
|
+
# from environment variables:
|
58
|
+
# ENV['FLICKR_API_KEY']
|
59
|
+
# ENV['FLICKR_SHARED_SECRET']
|
60
|
+
|
61
|
+
flickr = Flickr.new
|
62
|
+
|
63
|
+
# Flickr will raise an error if either parameter is not explicitly provided, or available via environment variables.
|
64
|
+
```
|
65
|
+
|
66
|
+
## Simple
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
list = flickr.photos.getRecent
|
70
|
+
|
71
|
+
id = list[0].id
|
72
|
+
secret = list[0].secret
|
73
|
+
info = flickr.photos.getInfo :photo_id => id, :secret => secret
|
74
|
+
|
75
|
+
puts info.title # => "PICT986"
|
76
|
+
puts info.dates.taken # => "2006-07-06 15:16:18"
|
77
|
+
|
78
|
+
sizes = flickr.photos.getSizes :photo_id => id
|
79
|
+
|
80
|
+
original = sizes.find { |s| s.label == 'Original' }
|
81
|
+
puts original.width # => "800" -- may fail if they have no original marked image
|
82
|
+
```
|
83
|
+
|
84
|
+
## Authentication
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
token = flickr.get_request_token
|
88
|
+
auth_url = flickr.get_authorize_url(token['oauth_token'], :perms => 'delete')
|
89
|
+
|
90
|
+
puts "Open this url in your browser to complete the authentication process: #{auth_url}"
|
91
|
+
puts "Copy here the number given when you complete the process."
|
92
|
+
verify = gets.strip
|
93
|
+
|
94
|
+
begin
|
95
|
+
flickr.get_access_token(token['oauth_token'], token['oauth_token_secret'], verify)
|
96
|
+
login = flickr.test.login
|
97
|
+
puts "You are now authenticated as #{login.username} with token #{flickr.access_token} and secret #{flickr.access_secret}"
|
98
|
+
rescue Flickr::FailedResponse => e
|
99
|
+
puts "Authentication failed : #{e.msg}"
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
103
|
+
If the user has already been authenticated, you can reuse the access token and access secret:
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
flickr.access_token = "... Your access token ..."
|
107
|
+
flickr.access_secret = "... Your access secret ..."
|
108
|
+
|
109
|
+
# From here you are logged:
|
110
|
+
login = flickr.test.login
|
111
|
+
puts "You are now authenticated as #{login.username}"
|
112
|
+
```
|
113
|
+
|
114
|
+
If you need to have several users authenticated at the same time in your application (ex: a public web application) you need to create separate Flickr objects since it keeps the authentication data internally.
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
flickr = Flickr.new
|
118
|
+
```
|
119
|
+
|
120
|
+
## Upload
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
PHOTO_PATH = 'photo.jpg'
|
124
|
+
|
125
|
+
# You need to be authenticated to do that, see the previous examples.
|
126
|
+
flickr.upload_photo PHOTO_PATH, :title => "Title", :description => "This is the description"
|
127
|
+
```
|
128
|
+
|
129
|
+
## Caching
|
130
|
+
|
131
|
+
The first time the Flickr object is instantiated, it will download the current Flickr API definition and dynamically create all the required classes and
|
132
|
+
objects.
|
133
|
+
This is how the gem remains up-to-date without requiring updates.
|
134
|
+
|
135
|
+
Unfortunately this adds a significant delay to startup, but the Flickr gem can be configured to cache the API definition to a local file.
|
136
|
+
Just set a file location before the Flickr class is instantiated:
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
Flickr.cache = '/tmp/flickr-api.yml'
|
140
|
+
flickr = Flickr.new
|
141
|
+
```
|
142
|
+
|
143
|
+
## Proxy
|
144
|
+
|
145
|
+
```ruby
|
146
|
+
require 'flickr'
|
147
|
+
Flickr.proxy = "https://user:pass@proxy.example.com:3129/"
|
148
|
+
```
|
149
|
+
|
150
|
+
### Server Certificate Verification
|
151
|
+
|
152
|
+
Server certificate verification is enabled by default. If you don't want to check the server certificate:
|
153
|
+
|
154
|
+
```ruby
|
155
|
+
require 'flickr'
|
156
|
+
Flickr.check_certificate = false
|
157
|
+
```
|
158
|
+
|
159
|
+
### CA Certificate File Path
|
160
|
+
|
161
|
+
`OpenSSL::X509::DEFAULT_CERT_FILE` is used as a CA certificate file. If you want to change the path:
|
162
|
+
|
163
|
+
```ruby
|
164
|
+
require 'flickr'
|
165
|
+
Flickr.ca_file = '/path/to/cacert.pem'
|
166
|
+
```
|
167
|
+
|
168
|
+
You can also specify a path to a directory with a number of certifications:
|
169
|
+
|
170
|
+
```ruby
|
171
|
+
Flickr.ca_path = '/path/to/certificates'
|
172
|
+
```
|
173
|
+
|
174
|
+
## Flickr URL Helpers
|
175
|
+
|
176
|
+
There are some helpers to build Flickr urls:
|
177
|
+
|
178
|
+
### url, url_m, url_s, url_t, url_b, url_z, url_q, url_n, url_c, url_o
|
179
|
+
|
180
|
+
```ruby
|
181
|
+
# url_s : Square
|
182
|
+
# url_q : Large Square
|
183
|
+
# url_t : Thumbnail
|
184
|
+
# url_m : Small
|
185
|
+
# url_n : Small 320
|
186
|
+
# url : Medium
|
187
|
+
# url_z : Medium 640
|
188
|
+
# url_c : Medium 800
|
189
|
+
# url_b : Large
|
190
|
+
# url_o : Original
|
191
|
+
|
192
|
+
info = flickr.photos.getInfo(:photo_id => "3839885270")
|
193
|
+
Flickr.url_b(info) # => "https://farm3.static.flickr.com/2485/3839885270_6fb8b54e06_b.jpg"
|
194
|
+
```
|
195
|
+
|
196
|
+
### url_profile
|
197
|
+
|
198
|
+
```ruby
|
199
|
+
info = flickr.photos.getInfo(:photo_id => "3839885270")
|
200
|
+
Flickr.url_profile(info) # => "https://www.flickr.com/people/41650587@N02/"
|
201
|
+
```
|
202
|
+
|
203
|
+
### url_photopage
|
204
|
+
|
205
|
+
```ruby
|
206
|
+
info = flickr.photos.getInfo(:photo_id => "3839885270")
|
207
|
+
Flickr.url_photopage(info) # => "https://www.flickr.com/photos/41650587@N02/3839885270"
|
208
|
+
```
|
209
|
+
|
210
|
+
### url_photoset, url_photosets
|
211
|
+
|
212
|
+
```ruby
|
213
|
+
info = flickr.photos.getInfo(:photo_id => "3839885270")
|
214
|
+
Flickr.url_photosets(info) # => "https://www.flickr.com/photos/41650587@N02/sets/"
|
215
|
+
```
|
216
|
+
|
217
|
+
### url_short, url_short_m, url_short_s, url_short_t
|
218
|
+
|
219
|
+
```ruby
|
220
|
+
info = flickr.photos.getInfo(:photo_id => "3839885270")
|
221
|
+
Flickr.url_short(info) # => "https://flic.kr/p/6Rjq7s"
|
222
|
+
```
|
223
|
+
|
224
|
+
### url_photostream
|
225
|
+
|
226
|
+
```ruby
|
227
|
+
info = flickr.photos.getInfo(:photo_id => "3839885270")
|
228
|
+
Flickr.url_photostream(info) # => "https://www.flickr.com/photos/41650587@N02/"
|
229
|
+
```
|
230
|
+
|
231
|
+
## Examples
|
232
|
+
|
233
|
+
See the *examples* directory to find more examples.
|
data/examples/sinatra.rb
CHANGED
@@ -24,8 +24,8 @@ get '/authenticated' do
|
|
24
24
|
@auth_flickr = session[:auth_flickr]
|
25
25
|
|
26
26
|
login = @auth_flickr.test.login
|
27
|
-
|
28
|
-
You are now authenticated as <em>#{login.username}</em>
|
29
|
-
with token <strong>#{@auth_flickr.access_token}</strong> and secret <strong>#{@auth_flickr.access_secret}</strong>.
|
30
|
-
|
27
|
+
<<~HTML
|
28
|
+
You are now authenticated as <em>#{login.username}</em>
|
29
|
+
with token <strong>#{@auth_flickr.access_token}</strong> and secret <strong>#{@auth_flickr.access_secret}</strong>.
|
30
|
+
HTML
|
31
31
|
end
|
data/flickr.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
require 'flickr/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "flickr"
|
6
|
+
s.summary = "Flickr (formerly FlickRaw) is full-featured client for the Flickr API"
|
7
|
+
s.authors = ["Mael Clerambault", "Aidan Samuel"]
|
8
|
+
s.email = "aidan.samuel@gmail.com"
|
9
|
+
s.license = "MIT"
|
10
|
+
s.version = Flickr::VERSION
|
11
|
+
s.homepage = "https://github.com/cyclotron3k/flickr"
|
12
|
+
s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
13
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
14
|
+
end
|
15
|
+
|
16
|
+
s.metadata = {
|
17
|
+
"bug_tracker_uri" => "https://github.com/cyclotron3k/flickr/issues",
|
18
|
+
"changelog_uri" => "https://github.com/cyclotron3k/flickr/blob/master/CHANGELOG.md",
|
19
|
+
"documentation_uri" => "https://github.com/cyclotron3k/flickr/blob/v#{Flickr::VERSION}/README.md",
|
20
|
+
"source_code_uri" => "https://github.com/cyclotron3k/flickr",
|
21
|
+
}
|
22
|
+
|
23
|
+
s.add_development_dependency "rake", "~> 13.0"
|
24
|
+
s.add_development_dependency "pry", "~> 0.14"
|
25
|
+
s.add_development_dependency "nokogiri", "~> 1.0"
|
26
|
+
s.add_development_dependency "webmock", "~> 3.0"
|
27
|
+
s.add_development_dependency "minitest", "~> 5.0"
|
28
|
+
s.add_development_dependency "bundler-audit", "~> 0.9"
|
29
|
+
s.add_development_dependency "vcr", "~> 6.0"
|
30
|
+
|
31
|
+
s.required_ruby_version = '>= 2.3'
|
32
|
+
|
33
|
+
end
|
data/flickr_rdoc.rb
CHANGED
@@ -55,14 +55,14 @@ module RDoc
|
|
55
55
|
m.singleton = false
|
56
56
|
|
57
57
|
m.start_collecting_tokens
|
58
|
-
m.add_token FakedToken.new(
|
59
|
-
# Generated automatically from flickr api
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
m.add_token FakedToken.new(<<~HEREDOC)
|
59
|
+
# Generated automatically from flickr api
|
60
|
+
def #{name}(*args)
|
61
|
+
@flickr.call '#{flickr_method}', *args
|
62
|
+
end
|
63
|
+
HEREDOC
|
64
64
|
doc.add_method m
|
65
|
-
|
65
|
+
@stats.add_method m
|
66
66
|
}
|
67
67
|
end
|
68
68
|
|
data/lib/flickr/response.rb
CHANGED
@@ -7,7 +7,7 @@ class Flickr
|
|
7
7
|
if h.is_a? Response
|
8
8
|
h
|
9
9
|
elsif type =~ /s$/ and (a = h[$`]).is_a? Array
|
10
|
-
ResponseList.new(h, type, a.
|
10
|
+
ResponseList.new(h, type, a.map { |e| Response.build(e, $`) })
|
11
11
|
elsif h.keys == ['_content']
|
12
12
|
h['_content']
|
13
13
|
else
|
@@ -20,8 +20,10 @@ class Flickr
|
|
20
20
|
methods = 'class << self;'
|
21
21
|
h.each do |k, v|
|
22
22
|
@h[k] = case v
|
23
|
-
when Hash
|
24
|
-
|
23
|
+
when Hash
|
24
|
+
Response.build(v, k)
|
25
|
+
when Array
|
26
|
+
v.all? { |e| String === e } ? v : v.map { |e| Response.build(e, k) }
|
25
27
|
else v
|
26
28
|
end
|
27
29
|
methods << "def #{k}; @h['#{k}'] end;" if Util.safe_for_eval?(k)
|
data/lib/flickr/version.rb
CHANGED
data/lib/flickr.rb
CHANGED
@@ -10,14 +10,15 @@ require 'flickr/response_list'
|
|
10
10
|
|
11
11
|
class Flickr
|
12
12
|
|
13
|
-
USER_AGENT = "Flickr/#{VERSION} (+https://github.com/
|
13
|
+
USER_AGENT = "Flickr/#{VERSION} (+https://github.com/cyclotron3k/flickr)".freeze
|
14
14
|
END_POINT = 'https://api.flickr.com/services'.freeze
|
15
|
+
UPLOAD_END_POINT = 'https://up.flickr.com/services'.freeze
|
15
16
|
FLICKR_OAUTH_REQUEST_TOKEN = (END_POINT + '/oauth/request_token').freeze
|
16
17
|
FLICKR_OAUTH_AUTHORIZE = (END_POINT + '/oauth/authorize').freeze
|
17
18
|
FLICKR_OAUTH_ACCESS_TOKEN = (END_POINT + '/oauth/access_token').freeze
|
18
19
|
REST_PATH = (END_POINT + '/rest/').freeze
|
19
|
-
UPLOAD_PATH = (
|
20
|
-
REPLACE_PATH = (
|
20
|
+
UPLOAD_PATH = (UPLOAD_END_POINT + '/upload/').freeze
|
21
|
+
REPLACE_PATH = (UPLOAD_END_POINT + '/replace/').freeze
|
21
22
|
PHOTO_SOURCE_URL = 'https://farm%s.staticflickr.com/%s/%s_%s%s.%s'.freeze
|
22
23
|
URL_PROFILE = 'https://www.flickr.com/people/'.freeze
|
23
24
|
URL_PHOTOSTREAM = 'https://www.flickr.com/photos/'.freeze
|
@@ -54,7 +55,7 @@ class Flickr
|
|
54
55
|
# This is the central method. It does the actual request to the Flickr server.
|
55
56
|
#
|
56
57
|
# Raises FailedResponse if the response status is _failed_.
|
57
|
-
def call(req, args={}, &block)
|
58
|
+
def call(req, args = {}, &block)
|
58
59
|
oauth_args = args.delete(:oauth) || {}
|
59
60
|
http_response = @oauth_consumer.post_form(REST_PATH, @access_secret, {:oauth_token => @access_token}.merge(oauth_args), build_args(args, req))
|
60
61
|
process_response(req, http_response.body)
|
@@ -88,7 +89,7 @@ class Flickr
|
|
88
89
|
# flickr.upload_photo '/path/to/the/photo', :title => 'Title', :description => 'This is the description'
|
89
90
|
#
|
90
91
|
# See https://www.flickr.com/services/api/upload.api.html for more information on the arguments.
|
91
|
-
def upload_photo(file, args={})
|
92
|
+
def upload_photo(file, args = {})
|
92
93
|
upload_flickr(UPLOAD_PATH, file, args)
|
93
94
|
end
|
94
95
|
|
@@ -97,7 +98,7 @@ class Flickr
|
|
97
98
|
# flickr.replace_photo '/path/to/the/photo', :photo_id => id
|
98
99
|
#
|
99
100
|
# See https://www.flickr.com/services/api/replace.api.html for more information on the arguments.
|
100
|
-
def replace_photo(file, args={})
|
101
|
+
def replace_photo(file, args = {})
|
101
102
|
upload_flickr(REPLACE_PATH, file, args)
|
102
103
|
end
|
103
104
|
|
@@ -157,7 +158,7 @@ class Flickr
|
|
157
158
|
|
158
159
|
end
|
159
160
|
|
160
|
-
def build_args(args={}, method_name=nil)
|
161
|
+
def build_args(args = {}, method_name = nil)
|
161
162
|
args['method'] = method_name if method_name
|
162
163
|
args.merge('format' => 'json', 'nojsoncallback' => '1')
|
163
164
|
end
|
@@ -189,7 +190,7 @@ class Flickr
|
|
189
190
|
end
|
190
191
|
end
|
191
192
|
|
192
|
-
def upload_flickr(method, file, args={})
|
193
|
+
def upload_flickr(method, file, args = {})
|
193
194
|
oauth_args = args.delete(:oauth) || {}
|
194
195
|
args = build_args(args)
|
195
196
|
if file.respond_to? :read
|
@@ -242,17 +243,18 @@ class Flickr
|
|
242
243
|
r
|
243
244
|
end
|
244
245
|
|
245
|
-
def
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
def
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
246
|
+
def gen_url(r, type)
|
247
|
+
PHOTO_SOURCE_URL % [r.farm, r.server, r.id, r.secret, type, 'jpg']
|
248
|
+
end
|
249
|
+
|
250
|
+
def url(r); gen_url(r, '') end
|
251
|
+
|
252
|
+
%W{m s t b z q n c h k}.each do |chr|
|
253
|
+
define_method "url_#{chr}" do |r|
|
254
|
+
gen_url r, "_#{chr}"
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
256
258
|
def url_o(r); PHOTO_SOURCE_URL % [r.farm, r.server, r.id, r.originalsecret, '_o', r.originalformat] end
|
257
259
|
def url_profile(r); URL_PROFILE + (r.owner.respond_to?(:nsid) ? r.owner.nsid : r.owner) + '/' end
|
258
260
|
def url_photopage(r); url_photostream(r) + r.id end
|
data/rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/clean"
|
3
|
+
require "rdoc/task"
|
4
|
+
require "rake/testtask"
|
4
5
|
|
5
6
|
lib = File.expand_path('../lib/', __FILE__)
|
6
7
|
$:.unshift lib unless $:.include?(lib)
|
@@ -13,10 +14,22 @@ Rake::RDocTask.new do |rd|
|
|
13
14
|
rd.rdoc_files.include "README.rdoc", "lib/flickr.rb"
|
14
15
|
end
|
15
16
|
|
16
|
-
Rake::TestTask.new do |t|
|
17
|
-
t.
|
17
|
+
Rake::TestTask.new(:unit_tests) do |t|
|
18
|
+
t.description = "Run the unit tests"
|
19
|
+
t.libs << "test/unit_tests"
|
20
|
+
t.pattern = "test/unit_tests/*_test.rb"
|
21
|
+
t.warning = true
|
22
|
+
end
|
23
|
+
|
24
|
+
Rake::TestTask.new(:integration_tests) do |t|
|
25
|
+
t.description = "Run the integration tests"
|
26
|
+
t.libs << "test/integration_tests"
|
27
|
+
t.pattern = "test/integration_tests/*_test.rb"
|
28
|
+
t.warning = true
|
18
29
|
end
|
19
30
|
|
20
31
|
task :console do
|
21
|
-
exec
|
32
|
+
exec "pry -I ./lib -r flickr"
|
22
33
|
end
|
34
|
+
|
35
|
+
task default: :unit_tests
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mael Clerambault
|
8
|
+
- Aidan Samuel
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2022-05-20 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rake
|
@@ -16,28 +17,28 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
+
version: '13.0'
|
20
21
|
type: :development
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
25
|
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
+
version: '13.0'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: pry
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
32
|
- - "~>"
|
32
33
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
34
|
+
version: '0.14'
|
34
35
|
type: :development
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
39
|
- - "~>"
|
39
40
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
41
|
+
version: '0.14'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
43
|
name: nokogiri
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +53,80 @@ dependencies:
|
|
52
53
|
- - "~>"
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '1.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: webmock
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: minitest
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '5.0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '5.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: bundler-audit
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0.9'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0.9'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: vcr
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '6.0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '6.0'
|
55
112
|
description:
|
56
|
-
email:
|
113
|
+
email: aidan.samuel@gmail.com
|
57
114
|
executables: []
|
58
115
|
extensions: []
|
59
116
|
extra_rdoc_files: []
|
60
117
|
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- CHANGELOG.md
|
120
|
+
- Gemfile
|
61
121
|
- LICENSE
|
62
|
-
- README.
|
122
|
+
- README.md
|
63
123
|
- examples/auth.rb
|
64
124
|
- examples/interestingness.rb
|
65
125
|
- examples/search.rb
|
66
126
|
- examples/sinatra.rb
|
67
127
|
- examples/upload.rb
|
68
128
|
- examples/web_oauth.rb
|
129
|
+
- flickr.gemspec
|
69
130
|
- flickr_rdoc.rb
|
70
131
|
- lib/flickr.rb
|
71
132
|
- lib/flickr/errors.rb
|
@@ -76,15 +137,14 @@ files:
|
|
76
137
|
- lib/flickr/util.rb
|
77
138
|
- lib/flickr/version.rb
|
78
139
|
- rakefile
|
79
|
-
|
80
|
-
- test/test_cache.rb
|
81
|
-
- test/test_request.rb
|
82
|
-
- test/test_response.rb
|
83
|
-
- test/test_upload.rb
|
84
|
-
homepage: https://hanklords.github.io/flickraw/
|
140
|
+
homepage: https://github.com/cyclotron3k/flickr
|
85
141
|
licenses:
|
86
142
|
- MIT
|
87
|
-
metadata:
|
143
|
+
metadata:
|
144
|
+
bug_tracker_uri: https://github.com/cyclotron3k/flickr/issues
|
145
|
+
changelog_uri: https://github.com/cyclotron3k/flickr/blob/master/CHANGELOG.md
|
146
|
+
documentation_uri: https://github.com/cyclotron3k/flickr/blob/v2.1.0/README.md
|
147
|
+
source_code_uri: https://github.com/cyclotron3k/flickr
|
88
148
|
post_install_message:
|
89
149
|
rdoc_options: []
|
90
150
|
require_paths:
|
@@ -100,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
160
|
- !ruby/object:Gem::Version
|
101
161
|
version: '0'
|
102
162
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
163
|
+
rubygems_version: 3.3.7
|
104
164
|
signing_key:
|
105
165
|
specification_version: 4
|
106
|
-
summary: Flickr
|
166
|
+
summary: Flickr (formerly FlickRaw) is full-featured client for the Flickr API
|
107
167
|
test_files: []
|