flickrage 0.1.4 → 0.1.5
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/lib/flickrage/cli.rb +3 -4
- data/lib/flickrage/service/downloader.rb +1 -1
- data/lib/flickrage/version.rb +1 -1
- data/lib/flickrage/worker/compose.rb +1 -2
- data/lib/flickrage/worker/resize.rb +1 -2
- data/lib/flickrage/worker/search.rb +1 -3
- data/lib/flickrage.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9ee1a397bd1661afccb8def2e52abca69b50eec
|
4
|
+
data.tar.gz: 763e29b08d260383ca77c1b6ed45c9884bc44dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59850dd2bd9e17027df0c114328830fe78f97f965077c71af40747864844f3b8ff308244f114a707af5cfc7c6506f68b112b7487046e344f4597cd6a90fb945d
|
7
|
+
data.tar.gz: c4208d19727f769550235a01c9f8f637a08785b39be5dad142d56011b8c99eeabb688a85e38da4eb746233e59d9aebf6ec78b0adf99b77f9550dcc1acfe05b20
|
data/lib/flickrage/cli.rb
CHANGED
@@ -147,7 +147,7 @@ module Flickrage
|
|
147
147
|
type: :string,
|
148
148
|
required: true,
|
149
149
|
aliases: %w(-o),
|
150
|
-
banner: './some
|
150
|
+
banner: './some'
|
151
151
|
def clean
|
152
152
|
cleanup
|
153
153
|
end
|
@@ -174,7 +174,7 @@ module Flickrage
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def cleanup
|
177
|
-
return logger.
|
177
|
+
return logger.info('Output directory not exists, cleanup skipped') unless cleanup?
|
178
178
|
FileUtils.rm_rf("#{options['output']}/.", secure: true)
|
179
179
|
end
|
180
180
|
|
@@ -223,8 +223,7 @@ module Flickrage
|
|
223
223
|
logger.debug 'Checking Flickr Key\'s.'
|
224
224
|
|
225
225
|
return if Flickrage.api_keys?
|
226
|
-
|
227
|
-
exit
|
226
|
+
raise Flickrage::NoKeysError, 'You must provide Flickr API credentials via --flickr-api-key, --flickr-shared-secret via options. or have it in the environment'
|
228
227
|
end
|
229
228
|
end
|
230
229
|
end
|
@@ -19,7 +19,7 @@ module Flickrage
|
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
|
-
def download_file(uri, path, limit =
|
22
|
+
def download_file(uri, path, limit = Flickrage.config.download_timeout)
|
23
23
|
raise Flickrage::DownloadError, 'Redirect limit arrived' if limit.zero?
|
24
24
|
|
25
25
|
Net::HTTP.start(uri.host, uri.port,
|
data/lib/flickrage/version.rb
CHANGED
@@ -28,8 +28,7 @@ module Flickrage
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def service
|
31
|
-
|
32
|
-
@service = Service::Composer.new(opts['file_name'],
|
31
|
+
@service ||= Service::Composer.new(opts['file_name'],
|
33
32
|
Flickrage.config.width,
|
34
33
|
Flickrage.config.height)
|
35
34
|
end
|
@@ -55,8 +55,7 @@ module Flickrage
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def service
|
58
|
-
|
59
|
-
@service = Service::Resizer.new(Flickrage.config.width, Flickrage.config.height)
|
58
|
+
@service ||= Service::Resizer.new(Flickrage.config.width, Flickrage.config.height)
|
60
59
|
end
|
61
60
|
|
62
61
|
def init_crop_value(name)
|
@@ -4,8 +4,6 @@ module Flickrage
|
|
4
4
|
class Search < Base
|
5
5
|
include Flickrage::Helpers::Dict
|
6
6
|
|
7
|
-
SYSTEM_TIMEOUT = 20
|
8
|
-
|
9
7
|
def call
|
10
8
|
keywords = opts['keywords'] || %w()
|
11
9
|
|
@@ -53,7 +51,7 @@ module Flickrage
|
|
53
51
|
end
|
54
52
|
|
55
53
|
def timeout?
|
56
|
-
(Time.now.to_i - time) >
|
54
|
+
(Time.now.to_i - time) > Flickrage.config.search_timeout
|
57
55
|
end
|
58
56
|
|
59
57
|
def service
|
data/lib/flickrage.rb
CHANGED