flickr-objects 0.4.0 → 0.4.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.
- checksums.yaml +4 -4
- data/README.md +20 -2
- data/lib/flickr/client/data.rb +1 -5
- data/lib/flickr/client/upload.rb +1 -5
- data/lib/flickr/object/list.rb +1 -1
- data/lib/flickr/object.rb +3 -8
- data/lib/flickr/version.rb +1 -1
- metadata +41 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7de03cf589dcbc788d7f5379898849697d77727a
|
4
|
+
data.tar.gz: 6e5ecd527db406c9d5c04b32941f16f74c05a925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaf84c71ca0dd4ec410f392d39982e4a6a69eca500acd225cde9378bfbdb26223151a733783301ef39b74eca6aaf518a7ac80b913d6bf8aa6bb9811fce4b528e
|
7
|
+
data.tar.gz: 391211fca29b2f3a713cc6e8fa343d76b8d067830300be0c9040fcadd8f8769f56a7c7254aaf8af80fc4d72ff5b24715bbc522551df172657cad8095ee89126e
|
data/README.md
CHANGED
@@ -157,16 +157,34 @@ photo.title #=> "Dandelions"
|
|
157
157
|
|
158
158
|
See [`Flickr.upload`](http://rubydoc.info/github/janko-m/flickr-objects/master/Flickr/Api/General#upload-instance_method).
|
159
159
|
|
160
|
+
## Pagination
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
Flickr.configure do |config|
|
164
|
+
config.pagination = :will_paginate
|
165
|
+
end
|
166
|
+
```
|
167
|
+
```ruby
|
168
|
+
@photos = Flickr.photos.search(user_id: "78733179@N04", page: params[:page], per_page: 10)
|
169
|
+
```
|
170
|
+
```erb
|
171
|
+
<%= will_paginate @photos %>
|
172
|
+
```
|
173
|
+
|
174
|
+
Flickr gives you pagination on almost every request that returns a collection of objects.
|
175
|
+
This gem supports both [WillPaginate](https://github.com/mislav/will_paginate) (`:will_paginate`)
|
176
|
+
and [Kaminari](https://github.com/amatsuda/kaminari) (`:kaminari`).
|
177
|
+
|
160
178
|
## Few words
|
161
179
|
|
162
180
|
Many of the API methods are not covered yet (because they are so many).
|
163
181
|
I believe I covered all the important ones, but if you wish for me to
|
164
|
-
cover certain new ones, feel free to contact me via [Twitter](https://twitter.com/
|
182
|
+
cover certain new ones, feel free to contact me via [Twitter](https://twitter.com/jankomarohnic).
|
165
183
|
I also wouldn't mind getting a pull request ;)
|
166
184
|
|
167
185
|
## Social
|
168
186
|
|
169
|
-
You can follow me on Twitter, I'm [@
|
187
|
+
You can follow me on Twitter, I'm [@jankomarohnic](https://twitter.com/jankomarohnic).
|
170
188
|
|
171
189
|
## License
|
172
190
|
|
data/lib/flickr/client/data.rb
CHANGED
data/lib/flickr/client/upload.rb
CHANGED
data/lib/flickr/object/list.rb
CHANGED
@@ -65,7 +65,7 @@ module Flickr
|
|
65
65
|
end
|
66
66
|
|
67
67
|
##
|
68
|
-
# @deprecated It provides
|
68
|
+
# @deprecated It provides `#find_by_<attribute>` methods, but they are now
|
69
69
|
# deprecated in favor of the obviously superior {#find_by} (repeating
|
70
70
|
# ActiveRecord's mistake :P).
|
71
71
|
#
|
data/lib/flickr/object.rb
CHANGED
@@ -15,13 +15,6 @@ module Flickr
|
|
15
15
|
:List, :Photo, :Person, :Set, :UploadTicket, :Permissions, :Location,
|
16
16
|
:Visibility
|
17
17
|
|
18
|
-
##
|
19
|
-
# @private
|
20
|
-
#
|
21
|
-
def self.api_class
|
22
|
-
Flickr::Api.const_get(name.match(/^Flickr::Object::/).post_match)
|
23
|
-
end
|
24
|
-
|
25
18
|
##
|
26
19
|
# Overriding Flickr::Attributes#attribute to add a default location.
|
27
20
|
# This means that `:<attribute>` will always first be searched in
|
@@ -133,7 +126,9 @@ module Flickr
|
|
133
126
|
private
|
134
127
|
|
135
128
|
def api
|
136
|
-
self.class.
|
129
|
+
api_name = self.class.name.match(/^Flickr::Object::/).post_match
|
130
|
+
api_class = Flickr::Api.const_get(api_name)
|
131
|
+
api_class.new(@access_token)
|
137
132
|
end
|
138
133
|
end
|
139
134
|
|
data/lib/flickr/version.rb
CHANGED
metadata
CHANGED
@@ -1,181 +1,181 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr-objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.7.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.7.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0.8'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.8'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: simple_oauth
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: multi_xml
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0.4'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.4'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '2'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: vcr
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '2'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '2'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: activesupport
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '3'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '3'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: will_paginate
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '3'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '3'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: kaminari
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0.14'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.14'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: capybara
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '2.1'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '2.1'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: selenium-webdriver
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: 2.35.1
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 2.35.1
|
181
181
|
description: This gem is an object-oriented wrapper for the Flickr API.
|
@@ -185,59 +185,59 @@ executables: []
|
|
185
185
|
extensions: []
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
|
-
- README.md
|
189
188
|
- LICENSE
|
190
|
-
-
|
189
|
+
- README.md
|
190
|
+
- lib/flickr-objects.rb
|
191
|
+
- lib/flickr.rb
|
192
|
+
- lib/flickr/api.rb
|
191
193
|
- lib/flickr/api/abstract.rb
|
194
|
+
- lib/flickr/api/abstract/params_processor.rb
|
192
195
|
- lib/flickr/api/general.rb
|
193
196
|
- lib/flickr/api/person.rb
|
194
197
|
- lib/flickr/api/photo.rb
|
195
198
|
- lib/flickr/api/set.rb
|
196
199
|
- lib/flickr/api/upload_ticket.rb
|
197
|
-
- lib/flickr/api.rb
|
198
200
|
- lib/flickr/attributes.rb
|
199
201
|
- lib/flickr/base_converter.rb
|
202
|
+
- lib/flickr/client.rb
|
200
203
|
- lib/flickr/client/data.rb
|
201
204
|
- lib/flickr/client/oauth.rb
|
202
205
|
- lib/flickr/client/upload.rb
|
203
|
-
- lib/flickr/client.rb
|
204
206
|
- lib/flickr/configuration.rb
|
205
207
|
- lib/flickr/error.rb
|
206
208
|
- lib/flickr/middleware.rb
|
207
209
|
- lib/flickr/oauth.rb
|
210
|
+
- lib/flickr/object.rb
|
208
211
|
- lib/flickr/object/attribute_locations/list.rb
|
209
212
|
- lib/flickr/object/attribute_locations/location.rb
|
210
213
|
- lib/flickr/object/attribute_locations/permissions.rb
|
211
|
-
- lib/flickr/object/attribute_locations/person/upload_status.rb
|
212
214
|
- lib/flickr/object/attribute_locations/person.rb
|
215
|
+
- lib/flickr/object/attribute_locations/person/upload_status.rb
|
216
|
+
- lib/flickr/object/attribute_locations/photo.rb
|
213
217
|
- lib/flickr/object/attribute_locations/photo/exif.rb
|
214
218
|
- lib/flickr/object/attribute_locations/photo/note.rb
|
215
219
|
- lib/flickr/object/attribute_locations/photo/tag.rb
|
216
|
-
- lib/flickr/object/attribute_locations/photo.rb
|
217
220
|
- lib/flickr/object/attribute_locations/set.rb
|
218
221
|
- lib/flickr/object/attribute_locations/upload_ticket.rb
|
219
222
|
- lib/flickr/object/attribute_locations/visibility.rb
|
223
|
+
- lib/flickr/object/list.rb
|
220
224
|
- lib/flickr/object/list/kaminari.rb
|
221
225
|
- lib/flickr/object/list/normal.rb
|
222
226
|
- lib/flickr/object/list/will_paginate.rb
|
223
|
-
- lib/flickr/object/list.rb
|
224
227
|
- lib/flickr/object/location.rb
|
225
228
|
- lib/flickr/object/permissions.rb
|
226
|
-
- lib/flickr/object/person/upload_status.rb
|
227
229
|
- lib/flickr/object/person.rb
|
230
|
+
- lib/flickr/object/person/upload_status.rb
|
231
|
+
- lib/flickr/object/photo.rb
|
228
232
|
- lib/flickr/object/photo/exif.rb
|
229
233
|
- lib/flickr/object/photo/note.rb
|
230
234
|
- lib/flickr/object/photo/size.rb
|
231
235
|
- lib/flickr/object/photo/tag.rb
|
232
|
-
- lib/flickr/object/photo.rb
|
233
236
|
- lib/flickr/object/set.rb
|
234
237
|
- lib/flickr/object/upload_ticket.rb
|
235
238
|
- lib/flickr/object/visibility.rb
|
236
|
-
- lib/flickr/object.rb
|
237
239
|
- lib/flickr/sanitized_file.rb
|
238
240
|
- lib/flickr/version.rb
|
239
|
-
- lib/flickr-objects.rb
|
240
|
-
- lib/flickr.rb
|
241
241
|
homepage: http://janko-m.github.com/flickr-objects
|
242
242
|
licenses:
|
243
243
|
- MIT
|
@@ -248,17 +248,17 @@ require_paths:
|
|
248
248
|
- lib
|
249
249
|
required_ruby_version: !ruby/object:Gem::Requirement
|
250
250
|
requirements:
|
251
|
-
- -
|
251
|
+
- - ">="
|
252
252
|
- !ruby/object:Gem::Version
|
253
253
|
version: 1.9.2
|
254
254
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
255
|
requirements:
|
256
|
-
- -
|
256
|
+
- - ">="
|
257
257
|
- !ruby/object:Gem::Version
|
258
258
|
version: '0'
|
259
259
|
requirements: []
|
260
260
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
261
|
+
rubygems_version: 2.2.2
|
262
262
|
signing_key:
|
263
263
|
specification_version: 4
|
264
264
|
summary: This gem is an object-oriented wrapper for the Flickr API.
|