sicily 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7094d97b1de208a0611c56df43b83fd88e4c8b13
4
- data.tar.gz: f53c938f8af3acb212eeb532b673bb7deeec62e9
3
+ metadata.gz: 70bb2d43669b0807d55b8c644f3b95b715b1d9bb
4
+ data.tar.gz: a921436bfcbf10a7db3f6fd8afdff8a8f5b8c34d
5
5
  SHA512:
6
- metadata.gz: caa5b53a90727e9df8300b7ad288dd865c58f6e82f0b0f664d550d400adbee72c4c1d101ded387f03c05887760325dda7e9ccee8381699a13851a3c031418731
7
- data.tar.gz: 7c6dd99942a135234e7ba9392f30daca58c422cd2402d7a6d1b4aff42149b9fb40a396c5de54c92027a0fb56f980467c5ec8758f8a2809a54657f07bb7376426
6
+ metadata.gz: b8ef718a271e3aa4e9d9e3270d26b480c2138ccfdca8c5c032ff6c9e1f4849e5f1a83d53dc48b0fa9ae323c7839e0c9b8cd63221600a77af1a4d5a5acc4931c9
7
+ data.tar.gz: 3ca60539bd1cd84dae1b8e1af101b2bd124faa0d054da572602115a467ed60ad92580f993d916e92376cb577de67f8951bdad4fa5b7168320370e9cb3f22ce1a
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.8
4
+ * Fix a bug that cannot resize image when rotation info at exif is not normal.
5
+
3
6
  ## 0.1.7
4
7
  * Fix a bug that getting wrong creation time of file.
5
8
 
@@ -1,38 +1,33 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sicily (0.1.7)
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
- fastimage_resize (2.0.3)
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.2)
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
- And install a node package as:
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
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'sicily/version'
4
+ require 'sicily/path_helper'
4
5
  require 'sicily/logger'
5
6
  require 'sicily/config'
6
7
  require 'sicily/monitor'
@@ -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 "#{File.dirname(__FILE__)}/../../config/#{generator.filename}"
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
@@ -20,9 +20,8 @@ module Sicily
20
20
  end
21
21
 
22
22
  def self.load_generators
23
- Dir["#{File.dirname(__FILE__)}/../../generator/*.rb"].each do |file|
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 = 10
11
- config.delay_on_file_monitoring = 10
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
@@ -40,7 +40,7 @@ module Sicily
40
40
 
41
41
  def create_logger
42
42
  @logger = if $SICILY_LOG_TO_FILE
43
- Logger.new File.join(File.dirname(__FILE__), '../../monitor.log')
43
+ Logger.new File.join(Dir.pwd, './monitor.log')
44
44
  else
45
45
  Logger.new STDOUT
46
46
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sicily
4
+ def self.user_config_path
5
+ "#{Dir.pwd}/config"
6
+ end
7
+
8
+ def self.lib_path
9
+ File.expand_path(File.join(File.dirname(__FILE__), '..'))
10
+ end
11
+ end
@@ -1,26 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'sicily/util/image_util'
4
- require 'fastimage_resize'
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
- size = Util::ImageUtil.get_size(@path)
22
- dest_size = SizeCalculator.size_to_fit container_width, container_height, size[0], size[1]
23
- FastImage.resize(@path, dest_size[0], dest_size[1], outfile: @path)
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
@@ -30,7 +30,7 @@ module Sicily
30
30
  end
31
31
 
32
32
  def list_all_files
33
- Dir["#{File.dirname(__FILE__)}/task/*.rb"]
33
+ Dir["#{Sicily.lib_path}/sicily/task/*.rb"]
34
34
  end
35
35
 
36
36
  def camelize(str)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sicily
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
@@ -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 Libgd is required for this gem. Please install it like the following:
27
- $ brew install gd
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 'fastimage_resize', '~> 2.0.3'
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.7
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-02-28 00:00:00.000000000 Z
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: fastimage_resize
56
+ name: mini_magick
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.3
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: 2.0.3
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 Libgd is required for this gem. Please install it like the following:
225
- $ brew install gd
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