wraith 2.4.1 → 2.4.2

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: 6105542acd85653ababc6bdc76cb240aa4d26a54
4
- data.tar.gz: ffd81274f1516421b07c5ac56bec4d61ea1f5f27
3
+ metadata.gz: abf148396530bc09262f9c38f34e4c46fc7c8817
4
+ data.tar.gz: ebd5e8b158b1c637e1df682ecfe52e31b1bf1f3a
5
5
  SHA512:
6
- metadata.gz: 1b7f396ba01012498b57802889c9c3e978a4561fa89f34fc99903faacbd6150b61e6dfe2075f725c9764d844bcd657987defe801d6fb816f8da6bc3b526481d8
7
- data.tar.gz: 2a23a5c7a86196efc8dc4a639a9770329db9edcaf42301a7a36798944569448eb2193bf8e9b1e9677c5149de1d9bb0f386b58397da041f428dbf6af31d6d894f
6
+ metadata.gz: 4834c4d793c3182d93262625c8a90abcce9adbd82f3a238743e22129b8bed8071368ba8a1108ee79bb3508533db07056a9943af2095fbfe1fefb996d456c85e2
7
+ data.tar.gz: df0363c19211465311b44e45253ddb0e000632fd6bb455d6bc8e32b29b56a99680b208ec9bd45f40a6590ec59b5b35e6cc2452b2eac9bda427920258172e4f78
@@ -2,6 +2,7 @@ require "wraith"
2
2
  require "image_size"
3
3
  require "open3"
4
4
  require "parallel"
5
+ require "shellwords"
5
6
 
6
7
  class Wraith::CompareImages
7
8
  attr_reader :wraith
@@ -27,7 +28,7 @@ class Wraith::CompareImages
27
28
  end
28
29
 
29
30
  def compare_task(base, compare, output, info)
30
- cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{base} #{compare} #{output}"
31
+ cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{base} #{compare.shellescape} #{output}"
31
32
  px_value = Open3.popen3(cmdline) { |_stdin, _stdout, stderr, _wait_thr| stderr.read }.to_f
32
33
  begin
33
34
  img_size = ImageSize.path(output).size.inject(:*)
data/lib/wraith/crop.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "wraith"
2
2
  require "image_size"
3
3
  require "parallel"
4
+ require "shellwords"
4
5
 
5
6
  class Wraith::CropImages
6
7
  attr_reader :wraith
@@ -32,7 +33,7 @@ class Wraith::CropImages
32
33
  end
33
34
 
34
35
  def crop_task(crop, height, width)
35
- `convert #{crop} -background none -extent #{width}x#{height} #{crop}`
36
+ `convert #{crop.shellescape} -background none -extent #{width}x#{height} #{crop.shellescape}`
36
37
  end
37
38
 
38
39
  def image_dimensions(image)
@@ -1,5 +1,6 @@
1
1
  require "wraith"
2
2
  require "parallel"
3
+ require "shellwords"
3
4
 
4
5
  class Wraith::SaveImages
5
6
  attr_reader :wraith, :history, :meta
@@ -73,7 +74,7 @@ class Wraith::SaveImages
73
74
  end
74
75
 
75
76
  def set_image_width(image, width)
76
- `convert #{image} -background none -extent #{width}x0 #{image}`
77
+ `convert #{image.shellescape} -background none -extent #{width}x0 #{image.shellescape}`
77
78
  end
78
79
  end
79
80
 
@@ -131,7 +132,7 @@ class SaveMetadata
131
132
  end
132
133
 
133
134
  def engine_label
134
- wraith.engine.key(wraith.engine)
135
+ wraith.engine.key(engine)
135
136
  end
136
137
 
137
138
  def file_names(width, label, domain_label)
@@ -1,6 +1,7 @@
1
1
  require "wraith"
2
2
  require "parallel"
3
3
  require "fileutils"
4
+ require "shellwords"
4
5
 
5
6
  class Wraith::Thumbnails
6
7
  attr_reader :wraith
@@ -25,6 +26,6 @@ class Wraith::Thumbnails
25
26
  FileUtils.mkdir_p(File.dirname(output_path))
26
27
  end
27
28
 
28
- `convert #{png_path} -thumbnail 200 -crop 200x200+0+0 #{output_path}`
29
+ `convert #{png_path.shellescape} -thumbnail 200 -crop 200x200+0+0 #{output_path.shellescape}`
29
30
  end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module Wraith
2
- VERSION = "2.4.1"
2
+ VERSION = "2.4.2"
3
3
  end
data/spec/wraith_spec.rb CHANGED
@@ -7,7 +7,7 @@ describe Wraith do
7
7
  let(:test_url1) { "http://www.bbc.co.uk/russian" }
8
8
  let(:test_url2) { "http://www.bbc.co.uk/russian" }
9
9
  let(:test_image1) { "shots/test/test1.png" }
10
- let(:test_image2) { "shots/test/test2.png" }
10
+ let(:test_image2) { "shots/test/test(2).png" }
11
11
  let(:diff_image) { "shots/test/test_diff.png" }
12
12
  let(:data_txt) { "shots/test/test.txt" }
13
13
  let(:selector) { "" }
@@ -94,7 +94,7 @@ describe Wraith do
94
94
  Wraith::Thumbnails.new(config_name).generate_thumbnails
95
95
 
96
96
  expect(File).to exist("shots/thumbnails/test/test1.png")
97
- expect(File).to exist("shots/thumbnails/test/test2.png")
97
+ expect(File).to exist("shots/thumbnails/test/test(2).png")
98
98
  expect(File).to exist("shots/thumbnails/test/test_diff.png")
99
99
  end
100
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wraith
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Blooman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-19 00:00:00.000000000 Z
12
+ date: 2015-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry