wraith 1.3.6 → 1.3.7

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: dc38ae6e0abd45100f8acc5518a2016dd586766c
4
- data.tar.gz: 02ecf8c6df92278b7913c594d430f75d83bf32a3
3
+ metadata.gz: 4ef3702111da955cdc52b3cafc7393003ada3d73
4
+ data.tar.gz: 4c0a4caa2ab48825a3551fa574e3a7cb3aa9492d
5
5
  SHA512:
6
- metadata.gz: 0dc03f057c40ab10406c2e93316b04387d99da3c2ce5fa58f2c5fdc7e89fe7dc65fc56b4e5e3d8073593c681805f111211d609315da49794ffdf9e056f58ed2e
7
- data.tar.gz: 97ab8361213dda8d3d5e96fdcf6592d9b99b6e02d549d2f4406e407c166bc848961346fdfa590f2e5a3f628d054c7f1752e69b6c1a0727b135ade14ff9788f66
6
+ metadata.gz: e01746b3ad8b4327425c35c3cf49880a538b4380ac573a9aa280273613b26261d574f6fc11f70bbe8a5f8a14e89719205fd206f870d4c48d7cecf87d460cf612
7
+ data.tar.gz: b6d2f51c5c97eee922adbe00d34922d0cc96a8673f20643e81880e937557e23fe7977b3125fc368ad6710469c99093cd8afeae36d09ec83d87812361968b8d23
@@ -1,5 +1,6 @@
1
1
  require 'wraith'
2
2
  require 'parallel'
3
+ require 'fileutils'
3
4
 
4
5
  class Wraith::Thumbnails
5
6
  attr_reader :wraith
@@ -20,6 +21,10 @@ class Wraith::Thumbnails
20
21
  end
21
22
 
22
23
  def thumbnail_image(png_path, output_path)
24
+ unless File.directory?(File.dirname(output_path))
25
+ FileUtils.mkdir_p(File.dirname(output_path));
26
+ end
27
+
23
28
  `convert #{png_path} -thumbnail 200 -crop 200x200+0+0 #{output_path}`
24
29
  end
25
30
  end
@@ -1,3 +1,3 @@
1
1
  module Wraith
2
- VERSION = '1.3.6'
2
+ VERSION = '1.3.7'
3
3
  end
data/spec/wraith_spec.rb CHANGED
@@ -51,4 +51,17 @@ describe Wraith do
51
51
  end
52
52
  Then { diff_image_size[0] == 320 }
53
53
  end
54
+
55
+ context 'When generating tumbnails' do
56
+ When do
57
+ wraith.engine.each do |_type, engine|
58
+ saving.capture_page_image(engine, test_url1, 320, test_image1)
59
+ saving.capture_page_image(engine, test_url2, 320, test_image2)
60
+ end
61
+ Wraith::CropImages.new(config_name).crop_images
62
+ Wraith::CompareImages.new(config_name).compare_task(test_image1, test_image2, diff_image, data_txt)
63
+ Wraith::Thumbnails.new(config_name).generate_thumbnails()
64
+ end
65
+ Then { File.exists?('shots/thumbnails/test/test1.png') && File.exists?('shots/thumbnails/test/test2.png') && File.exists?('shots/thumbnails/test/test_diff.png') }
66
+ end
54
67
  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: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Blooman