wraith 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/README.md +1 -1
- data/configs/test_config.yaml +2 -4
- data/lib/wraith/cli.rb +0 -1
- data/lib/wraith/folder.rb +9 -9
- data/lib/wraith/gallery.rb +10 -1
- data/lib/wraith/version.rb +1 -1
- data/spec/wraith_spec.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d2d6ee9fae5134b1d49d7a676668d2061adc76
|
4
|
+
data.tar.gz: 8059a9c46cb989cb4cdd7170040e119dea0fdb2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa6062ac558cad8bd0c5d0dee90d53d129ed3ac98722b2614a6741b8a823b011dc9c8a6360f6351828e2f2ed280f5ae3667b73c6a8cc8ba571c44fde2df6ff60
|
7
|
+
data.tar.gz: 847aa419b46d19450a9340191d72d68f1691f63bf44de78684ca4e04b711e4b8c225ff1cce1cf397e048db38c486e790ce18bdda6deaa6d2465f4739e9fcb02a
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -17,7 +17,7 @@ and then creates a diff of the two images, the affected areas are highlighted in
|
|
17
17
|
blue
|
18
18
|
|
19
19
|
![Photo of BBC News with a
|
20
|
-
diff](http://bbc-news.github.io/wraith/img/
|
20
|
+
diff](http://bbc-news.github.io/wraith/img/wraith.png)
|
21
21
|
|
22
22
|
|
23
23
|
## Requirements
|
data/configs/test_config.yaml
CHANGED
@@ -11,15 +11,13 @@ directory: 'shots'
|
|
11
11
|
|
12
12
|
# Add only 2 domains, key will act as a label
|
13
13
|
domains:
|
14
|
-
english: "http://
|
15
|
-
russian: "http://
|
14
|
+
english: "http://www.bbc.co.uk/russian"
|
15
|
+
russian: "http://www.bbc.co.uk/russian"
|
16
16
|
|
17
17
|
#Type screen widths below, here are a couple of examples
|
18
18
|
screen_widths:
|
19
19
|
- 320
|
20
20
|
- 600
|
21
|
-
- 768
|
22
|
-
- 1024
|
23
21
|
- 1280
|
24
22
|
|
25
23
|
#Type page URL paths below, here are a couple of examples
|
data/lib/wraith/cli.rb
CHANGED
data/lib/wraith/folder.rb
CHANGED
@@ -55,17 +55,17 @@ class Wraith::FolderManager
|
|
55
55
|
puts 'Creating Folders'
|
56
56
|
end
|
57
57
|
|
58
|
-
# Tidy up the shots folder, removing uncessary files
|
59
|
-
#
|
60
58
|
def tidy_shots_folder(dirs)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
dirs.each do |folder_name, shot_info|
|
60
|
+
if shot_info.none? { |_k, v| v[:data] > 0 }
|
61
|
+
if wraith.mode == 'diffs_only'
|
62
|
+
FileUtils.rm_rf("#{wraith.directory}/#{folder_name}")
|
63
|
+
dirs.delete(folder_name)
|
64
|
+
else
|
65
|
+
return true
|
68
66
|
end
|
67
|
+
else
|
68
|
+
return false
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
data/lib/wraith/gallery.rb
CHANGED
@@ -45,7 +45,7 @@ class Wraith::GalleryGenerator
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
@folder_manager.tidy_shots_folder(@dirs)
|
48
|
+
@failed_shots = @folder_manager.tidy_shots_folder(@dirs)
|
49
49
|
sorting_dirs(@dirs)
|
50
50
|
end
|
51
51
|
|
@@ -122,6 +122,15 @@ class Wraith::GalleryGenerator
|
|
122
122
|
directories = parse_directories(@location)
|
123
123
|
generate_html(@location, directories, TEMPLATE_BY_DOMAIN_LOCATION, dest, withPath)
|
124
124
|
FileUtils.cp(BOOTSTRAP_LOCATION, "#{@location}/bootstrap.min.css")
|
125
|
+
puts 'Gallery generated'
|
126
|
+
check_failed_shots
|
127
|
+
end
|
128
|
+
|
129
|
+
def check_failed_shots
|
130
|
+
if @failed_shots == false
|
131
|
+
puts 'Failures detected'
|
132
|
+
exit 1
|
133
|
+
end
|
125
134
|
end
|
126
135
|
|
127
136
|
class ErbBinding < OpenStruct
|
data/lib/wraith/version.rb
CHANGED
data/spec/wraith_spec.rb
CHANGED
@@ -6,13 +6,13 @@ describe Wraith do
|
|
6
6
|
Given { Wraith::FolderManager.new(config_name).clear_shots_folder }
|
7
7
|
Given { Dir.mkdir('shots/test') }
|
8
8
|
let(:config_name) { 'test_config' }
|
9
|
-
let(:test_url1) { 'http://www.
|
10
|
-
let(:test_url2) { 'http://www.
|
9
|
+
let(:test_url1) { 'http://www.bbc.co.uk/russian' }
|
10
|
+
let(:test_url2) { 'http://www.bbc.co.uk/russian' }
|
11
11
|
let(:test_image1) { 'shots/test/test1.png' }
|
12
12
|
let(:test_image2) { 'shots/test/test2.png' }
|
13
13
|
let(:diff_image) { 'shots/test/test_diff.png' }
|
14
14
|
let(:data_txt) { 'shots/test/test.txt' }
|
15
|
-
let(:selector) { ''}
|
15
|
+
let(:selector) { '' }
|
16
16
|
let(:saving) { Wraith::SaveImages.new(config_name) }
|
17
17
|
|
18
18
|
When(:wraith) { Wraith::Wraith.new(config_name) }
|
@@ -21,9 +21,9 @@ describe Wraith do
|
|
21
21
|
context 'When creating a wraith worker' do
|
22
22
|
|
23
23
|
Then { wraith.config.keys.size == 7 }
|
24
|
-
Then { wraith.widths == [320, 600,
|
25
|
-
Then { wraith.base_domain == 'http://
|
26
|
-
Then { wraith.comp_domain == 'http://
|
24
|
+
Then { wraith.widths == [320, 600, 1280] }
|
25
|
+
Then { wraith.base_domain == 'http://www.bbc.co.uk/russian' }
|
26
|
+
Then { wraith.comp_domain == 'http://www.bbc.co.uk/russian' }
|
27
27
|
Then { wraith.base_domain_label == 'english' }
|
28
28
|
Then { wraith.comp_domain_label == 'russian' }
|
29
29
|
Then { wraith.paths == { 'home' => '/', 'uk_index' => '/uk' } }
|
@@ -62,7 +62,7 @@ describe Wraith do
|
|
62
62
|
Wraith::CropImages.new(config_name).crop_images
|
63
63
|
Wraith::CompareImages.new(config_name).compare_task(test_image1, test_image2, diff_image, data_txt)
|
64
64
|
Wraith::Thumbnails.new(config_name).generate_thumbnails
|
65
|
-
|
65
|
+
end
|
66
66
|
Then { File.exist?('shots/thumbnails/test/test1.png') && File.exist?('shots/thumbnails/test/test2.png') && File.exist?('shots/thumbnails/test/test_diff.png') }
|
67
67
|
end
|
68
68
|
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
|
+
version: 2.2.0
|
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: 2014-
|
12
|
+
date: 2014-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|