sicily 0.1.7 → 0.1.8
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/CHANGELOG.md +3 -0
- data/Gemfile.lock +5 -10
- data/README.md +7 -1
- data/lib/sicily.rb +1 -0
- data/lib/sicily/config.rb +1 -1
- data/lib/sicily/generator.rb +1 -2
- data/{generator → lib/sicily/generator}/application.rb +2 -2
- data/{generator → lib/sicily/generator}/god.rb +0 -0
- data/{generator → lib/sicily/generator}/google_photo.rb +0 -0
- data/{generator → lib/sicily/generator}/rules.rb +0 -0
- data/{generator → lib/sicily/generator}/schedule.rb +0 -0
- data/lib/sicily/logger.rb +1 -1
- data/lib/sicily/path_helper.rb +11 -0
- data/lib/sicily/task/resize_task.rb +4 -14
- data/lib/sicily/task_loader.rb +1 -1
- data/lib/sicily/version.rb +1 -1
- data/sicily.gemspec +3 -3
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70bb2d43669b0807d55b8c644f3b95b715b1d9bb
|
4
|
+
data.tar.gz: a921436bfcbf10a7db3f6fd8afdff8a8f5b8c34d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ef718a271e3aa4e9d9e3270d26b480c2138ccfdca8c5c032ff6c9e1f4849e5f1a83d53dc48b0fa9ae323c7839e0c9b8cd63221600a77af1a4d5a5acc4931c9
|
7
|
+
data.tar.gz: 3ca60539bd1cd84dae1b8e1af101b2bd124faa0d054da572602115a467ed60ad92580f993d916e92376cb577de67f8951bdad4fa5b7168320370e9cb3f22ce1a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,38 +1,33 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sicily (0.1.
|
4
|
+
sicily (0.1.8)
|
5
5
|
concurrent-ruby (~> 1.0.5)
|
6
6
|
exifr (~> 1.3.3)
|
7
7
|
fastimage (~> 2.1.1)
|
8
|
-
fastimage_resize (~> 2.0.3)
|
9
8
|
god (~> 0.13.7)
|
10
9
|
listen (~> 3.1.5)
|
10
|
+
mini_magick (~> 4.8.0)
|
11
11
|
terminal-notifier (~> 2.0.0)
|
12
12
|
whenever (~> 0.10.0)
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
RubyInline (3.12.4)
|
18
|
-
ZenTest (~> 4.3)
|
19
|
-
ZenTest (4.11.1)
|
20
17
|
chronic (0.10.2)
|
21
18
|
concurrent-ruby (1.0.5)
|
22
19
|
diff-lcs (1.3)
|
23
20
|
exifr (1.3.3)
|
24
21
|
fastimage (2.1.1)
|
25
|
-
|
26
|
-
RubyInline (>= 3.8.2)
|
27
|
-
fastimage (>= 1.2.9)
|
28
|
-
ffi (1.9.21)
|
22
|
+
ffi (1.9.23)
|
29
23
|
god (0.13.7)
|
30
24
|
listen (3.1.5)
|
31
25
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
32
26
|
rb-inotify (~> 0.9, >= 0.9.7)
|
33
27
|
ruby_dep (~> 1.2)
|
28
|
+
mini_magick (4.8.0)
|
34
29
|
rake (10.5.0)
|
35
|
-
rb-fsevent (0.10.
|
30
|
+
rb-fsevent (0.10.3)
|
36
31
|
rb-inotify (0.9.10)
|
37
32
|
ffi (>= 0.5.0, < 2)
|
38
33
|
rspec (3.7.0)
|
data/README.md
CHANGED
@@ -21,9 +21,15 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
$ gem install sicily
|
23
23
|
|
24
|
-
|
24
|
+
### Install dependencies
|
25
|
+
|
26
|
+
Install a node package as:
|
25
27
|
|
26
28
|
$ npm install -g upload-gphotos
|
29
|
+
|
30
|
+
Install ImageMagick
|
31
|
+
|
32
|
+
$ brew install imagemagick
|
27
33
|
|
28
34
|
## Usage
|
29
35
|
|
data/lib/sicily.rb
CHANGED
data/lib/sicily/config.rb
CHANGED
@@ -30,7 +30,7 @@ module Sicily
|
|
30
30
|
|
31
31
|
Sicily.logger.debug "#{Sicily.generators.size} generators found."
|
32
32
|
Sicily.generators.each do |generator|
|
33
|
-
path = File.expand_path "#{
|
33
|
+
path = File.expand_path "#{Sicily.user_config_path}/#{generator.filename}"
|
34
34
|
next unless generator.load_on_start
|
35
35
|
Sicily.logger.debug "ConfigLoader : #{path}"
|
36
36
|
load path
|
data/lib/sicily/generator.rb
CHANGED
@@ -20,9 +20,8 @@ module Sicily
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.load_generators
|
23
|
-
Dir["#{
|
23
|
+
Dir["#{Sicily.lib_path}/sicily/generator/*.rb"].each do |file|
|
24
24
|
file = File.expand_path file
|
25
|
-
Sicily.logger.debug "Load generator : #{file}"
|
26
25
|
require file
|
27
26
|
end
|
28
27
|
end
|
@@ -7,8 +7,8 @@ module Sicily
|
|
7
7
|
generator.content = <<~CONTENT
|
8
8
|
Sicily.configure do |config|
|
9
9
|
config.forbid_new_file_in_subfolder = true
|
10
|
-
config.num_thread_pool =
|
11
|
-
config.delay_on_file_monitoring =
|
10
|
+
config.num_thread_pool = 1
|
11
|
+
config.delay_on_file_monitoring = 30
|
12
12
|
config.consume_on_start = true
|
13
13
|
end
|
14
14
|
CONTENT
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/sicily/logger.rb
CHANGED
@@ -1,26 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'sicily/util/image_util'
|
4
|
-
require '
|
4
|
+
require 'mini_magick'
|
5
5
|
|
6
6
|
module Sicily
|
7
7
|
module Task
|
8
|
-
class SizeCalculator
|
9
|
-
def self.size_to_fit(container_width, container_height, image_width, image_height)
|
10
|
-
if container_width * image_height > container_height * image_width
|
11
|
-
[(image_width * container_height / image_height).to_i, container_height]
|
12
|
-
else
|
13
|
-
[container_width, (image_height * container_width / image_width).to_i]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
8
|
module ResizeTask
|
19
9
|
def fit_if_photo(container_width, container_height)
|
20
10
|
info "fit_if_photo to #{container_width}x#{container_height}"
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
MiniMagick::Image.new(@path) do |image|
|
12
|
+
image.resize "#{container_width}x#{container_height}>"
|
13
|
+
end
|
24
14
|
end
|
25
15
|
end
|
26
16
|
end
|
data/lib/sicily/task_loader.rb
CHANGED
data/lib/sicily/version.rb
CHANGED
data/sicily.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
To finish installation, please execute the following:
|
24
24
|
$ npm install -g upload-gphotos
|
25
25
|
|
26
|
-
And
|
27
|
-
$ brew install
|
26
|
+
And ImageMagick is required for this gem. Please install it like the following:
|
27
|
+
$ brew install imagemagick
|
28
28
|
MESSAGE
|
29
29
|
|
30
30
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_dependency 'concurrent-ruby', '~> 1.0.5'
|
39
39
|
spec.add_dependency 'exifr', '~> 1.3.3'
|
40
40
|
spec.add_dependency 'fastimage', '~> 2.1.1'
|
41
|
-
spec.add_dependency '
|
41
|
+
spec.add_dependency 'mini_magick', '~> 4.8.0'
|
42
42
|
spec.add_dependency 'god', '~> 0.13.7'
|
43
43
|
spec.add_dependency 'listen', '~> 3.1.5'
|
44
44
|
spec.add_dependency 'terminal-notifier', '~> 2.0.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sicily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Eunjae Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -53,19 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.1.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: mini_magick
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 4.8.0
|
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
|
-
version:
|
68
|
+
version: 4.8.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: god
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,20 +187,21 @@ files:
|
|
187
187
|
- bin/console
|
188
188
|
- bin/setup
|
189
189
|
- exe/sicily
|
190
|
-
- generator/application.rb
|
191
|
-
- generator/god.rb
|
192
|
-
- generator/google_photo.rb
|
193
|
-
- generator/rules.rb
|
194
|
-
- generator/schedule.rb
|
195
190
|
- lib/sicily.rb
|
196
191
|
- lib/sicily/batch_processor.rb
|
197
192
|
- lib/sicily/config.rb
|
198
193
|
- lib/sicily/error/monitor_error.rb
|
199
194
|
- lib/sicily/file_processor.rb
|
200
195
|
- lib/sicily/generator.rb
|
196
|
+
- lib/sicily/generator/application.rb
|
197
|
+
- lib/sicily/generator/god.rb
|
198
|
+
- lib/sicily/generator/google_photo.rb
|
199
|
+
- lib/sicily/generator/rules.rb
|
200
|
+
- lib/sicily/generator/schedule.rb
|
201
201
|
- lib/sicily/logger.rb
|
202
202
|
- lib/sicily/monitor.rb
|
203
203
|
- lib/sicily/monitor_wrapper.rb
|
204
|
+
- lib/sicily/path_helper.rb
|
204
205
|
- lib/sicily/task/dummy_task.rb
|
205
206
|
- lib/sicily/task/file_task.rb
|
206
207
|
- lib/sicily/task/google_photo_task.rb
|
@@ -221,8 +222,8 @@ post_install_message: |
|
|
221
222
|
To finish installation, please execute the following:
|
222
223
|
$ npm install -g upload-gphotos
|
223
224
|
|
224
|
-
And
|
225
|
-
$ brew install
|
225
|
+
And ImageMagick is required for this gem. Please install it like the following:
|
226
|
+
$ brew install imagemagick
|
226
227
|
rdoc_options: []
|
227
228
|
require_paths:
|
228
229
|
- lib
|