flickr-objects 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flickr/client.rb +2 -7
- data/lib/flickr/configuration.rb +0 -4
- data/lib/flickr/object/attribute_locations/photo.rb +1 -1
- data/lib/flickr/object/photo.rb +13 -15
- data/lib/flickr/object/set.rb +1 -0
- data/lib/flickr/sanitized_file.rb +4 -4
- data/lib/flickr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4f95d067768c10e04a1fb7203b1f3cd56e8bffd
|
4
|
+
data.tar.gz: 3ff31499a4b3488adbbbc7637bf60102dc935c0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bec77a91adb2e1dce4af3d7b824af6ca9ad3a3497407966aff7142545f7573285a4cabcddd8642ffa529d4bfc31b0a44a6e4e1da4f050dcac12c4a559c09b70
|
7
|
+
data.tar.gz: 0fad102f3f9318886421298b64cb2fff2a0f0c77047e1d407a3c8875c693d8c5e023f09f7ba1cecfd21b7892168ed4f26f1f234ccf700e9514450432b3840951
|
data/lib/flickr/client.rb
CHANGED
@@ -24,11 +24,6 @@ module Flickr
|
|
24
24
|
:Upload => "upload",
|
25
25
|
:OAuth => "oauth"
|
26
26
|
|
27
|
-
DEFAULTS = {
|
28
|
-
open_timeout: 8,
|
29
|
-
timeout: 10,
|
30
|
-
}
|
31
|
-
|
32
27
|
def initialize
|
33
28
|
@connection = Faraday.new(url, connection_options) do |builder|
|
34
29
|
builder.use Flickr::Middleware::CatchTimeout
|
@@ -82,11 +77,11 @@ module Flickr
|
|
82
77
|
end
|
83
78
|
|
84
79
|
def open_timeout
|
85
|
-
Flickr.open_timeout
|
80
|
+
Flickr.open_timeout
|
86
81
|
end
|
87
82
|
|
88
83
|
def timeout
|
89
|
-
Flickr.timeout
|
84
|
+
Flickr.timeout
|
90
85
|
end
|
91
86
|
|
92
87
|
def use_ssl?
|
data/lib/flickr/configuration.rb
CHANGED
@@ -50,15 +50,11 @@ module Flickr
|
|
50
50
|
# Time to wait for the connection to Flickr to open. After that
|
51
51
|
# {Flickr::TimeoutError} is thrown.
|
52
52
|
#
|
53
|
-
# Default is `5` seconds.
|
54
|
-
#
|
55
53
|
attr_accessor :open_timeout
|
56
54
|
##
|
57
55
|
# Time to wait for the first block of response from Flickr. After that
|
58
56
|
# {Flickr::TimeoutError} is thrown.
|
59
57
|
#
|
60
|
-
# Default is `10` seconds.
|
61
|
-
#
|
62
58
|
attr_accessor :timeout
|
63
59
|
|
64
60
|
##
|
data/lib/flickr/object/photo.rb
CHANGED
@@ -213,6 +213,19 @@ module Flickr
|
|
213
213
|
dup.largest!
|
214
214
|
end
|
215
215
|
|
216
|
+
##
|
217
|
+
# Changes the size of the photo.
|
218
|
+
#
|
219
|
+
def size!(name)
|
220
|
+
if name != nil and not Size.exists?(name)
|
221
|
+
raise ArgumentError, "\"#{name}\" isn't a valid photo size"
|
222
|
+
end
|
223
|
+
|
224
|
+
@size = Size.new(name)
|
225
|
+
|
226
|
+
self
|
227
|
+
end
|
228
|
+
|
216
229
|
##
|
217
230
|
# @return [self]
|
218
231
|
# @see Flickr::Api::Photo#get_info
|
@@ -330,21 +343,6 @@ module Flickr
|
|
330
343
|
api.set_license(id, license_id, params)
|
331
344
|
end
|
332
345
|
|
333
|
-
private
|
334
|
-
|
335
|
-
##
|
336
|
-
# Changes the size of the photo.
|
337
|
-
#
|
338
|
-
def size!(name)
|
339
|
-
if name != nil and not Size.exists?(name)
|
340
|
-
raise ArgumentError, "\"#{name}\" isn't a valid photo size"
|
341
|
-
end
|
342
|
-
|
343
|
-
@size = Size.new(name)
|
344
|
-
|
345
|
-
self
|
346
|
-
end
|
347
|
-
|
348
346
|
end
|
349
347
|
|
350
348
|
end
|
data/lib/flickr/object/set.rb
CHANGED
@@ -36,10 +36,10 @@ module Flickr
|
|
36
36
|
@file = @original[:tempfile]
|
37
37
|
@content_type = @original[:type]
|
38
38
|
@path = @original[:tempfile].path
|
39
|
-
elsif
|
39
|
+
elsif io?
|
40
40
|
@file = @original
|
41
41
|
@content_type = @original.content_type if @original.respond_to?(:content_type)
|
42
|
-
@path = @original.path
|
42
|
+
@path = @original.path if @original.respond_to?(:path)
|
43
43
|
elsif string?
|
44
44
|
@file = File.open(@original)
|
45
45
|
@content_type = nil
|
@@ -57,8 +57,8 @@ module Flickr
|
|
57
57
|
defined?(Sinatra) and @original.is_a?(Hash)
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
61
|
-
@original.respond_to?(:read)
|
60
|
+
def io?
|
61
|
+
@original.respond_to?(:read)
|
62
62
|
end
|
63
63
|
|
64
64
|
def string?
|
data/lib/flickr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr-objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.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: 2015-
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|