gif2lgtm 1.0.4 → 1.0.5

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
  SHA256:
3
- metadata.gz: a6d48328e2f40b0a65d08bdab9aaaa76d711d3ecfcbc744d3e85ecd09fff504a
4
- data.tar.gz: 138d496fee9283897d2f2315971847aa4e0000584e441a31860b831e5644b853
3
+ metadata.gz: 147366a739140e0c0a5ffa2c0fe6b94c0a11c39a123fb40b152583af88b580b1
4
+ data.tar.gz: 557aaca25a43545122a89df3d62a3a44d7bf077f6d6cd1a7e17e32c603f11202
5
5
  SHA512:
6
- metadata.gz: 5da90af58d7e27519a4a4ddab31599089a1425c84cfe32b23f74e97885b1bed11f0f3b352ccdea65534c80bcb39789dc45023cdd0ae44bfb7a188287777a4b17
7
- data.tar.gz: bd60f9233778b959c26744048a40c5189eaccc070042471c39ce7a36c4c6ea600b20d93c5cdd9c8df74a3cedbdc3769c68c097aec440a6d89c4f3ea7e2a8bc90
6
+ metadata.gz: 5e0ca29a91dd26a0afb0be2c42ebf6c3dda186398715ea69ac70eb374daa56b5c9ecfac19809980ffe2089f129b2505c0fa1a3a1f55f6b64896c4cfa45ab4e27
7
+ data.tar.gz: cc1414ee30976b8d0d556ce0f62564906740ae59e2ddc1482d41f935dd7195493fce1d1d6064075561f802536d15402cb25718cca608466f8b3821d39926f341
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gif2lgtm (1.0.3)
4
+ gif2lgtm (1.0.5)
5
5
  rmagick
6
6
  thor
7
7
 
data/lib/gif2lgtm/main.rb CHANGED
@@ -3,15 +3,18 @@ module Gif2lgtm
3
3
  module_function
4
4
  LOOP_COUNT = 0
5
5
 
6
- def start(image_path)
7
- gif = compsite!(image_path)
8
- create!(gif, image_path)
6
+ def start(img_path)
7
+ gif = compsite!(img_path)
8
+ create!(gif, img_path)
9
9
  end
10
10
 
11
- def compsite!(image_path)
11
+ def compsite!(img_path)
12
12
  gif = Magick::ImageList.new
13
- images = Magick::ImageList.new(image_path)
14
- original_size_lgtm = Magick::ImageList.new("#{Dir.pwd}/images/lgtm.png")
13
+ images = Magick::ImageList.new(img_path)
14
+
15
+ dir_path = caller[0][/^(.+?):\d+?:in.*/, 1].split('/')
16
+ dir_path.pop(3)
17
+ original_size_lgtm = Magick::ImageList.new(dir_path.join('/') + '/images/lgtm.png')
15
18
  lgtm = original_size_lgtm.resize_to_fit(images.first.columns, images.first.rows)
16
19
 
17
20
  images.each do |image|
@@ -27,11 +30,9 @@ module Gif2lgtm
27
30
  gif
28
31
  end
29
32
 
30
- def create!(gif, image_path)
33
+ def create!(gif, img_path)
31
34
  gif.iterations = LOOP_COUNT
32
- random = SecureRandom.hex(5)
33
- dir_path = File.dirname(image_path)
34
- result_path = "#{dir_path}/lgtm_#{random}_#{File.basename(image_path)}"
35
+ result_path = "#{File.dirname(img_path)}/lgtm#{SecureRandom.hex(5)}_#{File.basename(img_path)}"
35
36
 
36
37
  gif.optimize_layers(Magick::OptimizeLayer).write(result_path)
37
38
  puts <<~MESSAGE
@@ -1,3 +1,3 @@
1
1
  module Gif2lgtm
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gif2lgtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - iavivai
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-18 00:00:00.000000000 Z
11
+ date: 2019-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler