wraith 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +5 -5
- data/configs/component.yaml +2 -0
- data/configs/config.yaml +0 -11
- data/configs/config_nojs.yaml +1 -1
- data/lib/wraith/folder.rb +13 -7
- data/lib/wraith/gallery.rb +4 -2
- data/lib/wraith/gallery_template/gallery_template.erb +8 -3
- data/lib/wraith/version.rb +1 -1
- data/lib/wraith/wraith.rb +4 -0
- data/templates/configs/component.yaml +2 -0
- data/templates/configs/config.yaml +3 -12
- 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: b3735eab07e34d5a2e488049294f8fe6575a0d21
|
4
|
+
data.tar.gz: 3a6941bc0b2585405ad105a7c859e0a5119df216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d09341a03356355aec1ab2deda45bfd66c1b21f3f0e7e124167927df15df2f25897e10ea8230244ba5b71659294c1b6351521c82d9a64431904cbab046f0b09c
|
7
|
+
data.tar.gz: b050424d3765a08775990554b641ac650453365987dfa5d5ec10f480b09345407aeb80ee8e9f6e3366b59fc638a9419c95c62404be8695483ca360a8543d7cf6
|
data/.travis.yml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
6
5
|
script: bundle exec rspec
|
7
|
-
|
8
6
|
notifications:
|
9
7
|
email:
|
10
8
|
recipients:
|
11
|
-
|
9
|
+
- david.blooman@bbc.co.uk
|
12
10
|
on_failure: change
|
13
11
|
on_success: never
|
12
|
+
slack:
|
13
|
+
secure: BgRAqwHabAtIBgtApDjyUiND2SNxd4sHMgq4ffnJ+EoMme6RSUAeK0G6LLyaGAk6YcpCeWRGOccEpzai87R3ckv6uycUVGxFcTvPmCEClakbUelWovVEyVT3hPLWznxJ8pz3EVB2+5aJnAsTg5M2ZnYtk3a5C1mrPS+WKceE/Ls=
|
data/configs/component.yaml
CHANGED
data/configs/config.yaml
CHANGED
@@ -30,21 +30,10 @@ paths:
|
|
30
30
|
#Amount of fuzz ImageMagick will use
|
31
31
|
fuzz: '20%'
|
32
32
|
|
33
|
-
#Set the filename of the spider file to use, if not specified it will fallback to spider.txt
|
34
|
-
# spider_file: bbc_co_uk_spider.txt
|
35
|
-
|
36
33
|
#Set the number of days to keep the site spider file
|
37
34
|
spider_days:
|
38
35
|
- 10
|
39
36
|
|
40
|
-
#A list of URLs to skip when spidering. Ruby regular expressions can be
|
41
|
-
#used, if prefixed with !ruby/regexp as defined in the YAML Cookbook
|
42
|
-
#http://www.yaml.org/YAML_for_ruby.html#regexps
|
43
|
-
#
|
44
|
-
# spider_skips:
|
45
|
-
# - /foo/bar.html # Matches /foo/bar.html explcitly
|
46
|
-
# - !ruby/regexp /^\/baz\// # Matches any URLs that start with /baz
|
47
|
-
|
48
37
|
#Choose how results are displayed, by default alphanumeric. Different screen widths are always grouped.
|
49
38
|
#alphanumeric - all paths (with, and without, a difference) are shown, sorted by path
|
50
39
|
#diffs_first - all paths (with, and without, a difference) are shown, sorted by difference size (largest first)
|
data/configs/config_nojs.yaml
CHANGED
@@ -34,7 +34,7 @@ fuzz: '20%'
|
|
34
34
|
spider_days:
|
35
35
|
- 10
|
36
36
|
|
37
|
-
|
37
|
+
#A list of URLs to skip when spidering. Ruby regular expressions can be
|
38
38
|
#used, if prefixed with !ruby/regexp as defined in the YAML Cookbook
|
39
39
|
#http://www.yaml.org/YAML_for_ruby.html#regexps
|
40
40
|
#
|
data/lib/wraith/folder.rb
CHANGED
@@ -56,16 +56,22 @@ class Wraith::FolderManager
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def tidy_shots_folder(dirs)
|
59
|
-
|
60
|
-
|
61
|
-
if
|
59
|
+
if wraith.mode == 'diffs_only'
|
60
|
+
dirs.each do |folder_name, shot_info|
|
61
|
+
if shot_info.none? { |_k, v| v[:data] > 0 }
|
62
62
|
FileUtils.rm_rf("#{wraith.directory}/#{folder_name}")
|
63
63
|
dirs.delete(folder_name)
|
64
|
-
else
|
65
|
-
return true
|
66
64
|
end
|
67
|
-
|
68
|
-
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def threshold_rate(dirs)
|
70
|
+
dirs.each do |_folder_name, shot_info|
|
71
|
+
shot_info.each do |_k, v|
|
72
|
+
if v[:data] > wraith.threshold
|
73
|
+
return false
|
74
|
+
end
|
69
75
|
end
|
70
76
|
end
|
71
77
|
end
|
data/lib/wraith/gallery.rb
CHANGED
@@ -45,7 +45,8 @@ class Wraith::GalleryGenerator
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
@
|
48
|
+
@folder_manager.tidy_shots_folder(@dirs)
|
49
|
+
@failed_shots = @folder_manager.threshold_rate(@dirs)
|
49
50
|
sorting_dirs(@dirs)
|
50
51
|
end
|
51
52
|
|
@@ -109,7 +110,8 @@ class Wraith::GalleryGenerator
|
|
109
110
|
locals = {
|
110
111
|
location: location,
|
111
112
|
directories: directories,
|
112
|
-
path: path
|
113
|
+
path: path,
|
114
|
+
threshold: wraith.threshold
|
113
115
|
}
|
114
116
|
html = ERB.new(template).result(ErbBinding.new(locals).get_binding)
|
115
117
|
File.open(destination, 'w') do |outf|
|
@@ -28,11 +28,16 @@
|
|
28
28
|
</div>
|
29
29
|
<div class="col-lg-10">
|
30
30
|
<% directories.each do |dir, sizes| %>
|
31
|
+
<% sizes.to_a.sort.each do |size, files| %>
|
31
32
|
<div class="row">
|
32
|
-
|
33
|
-
|
33
|
+
<a name="<%= dir %>"></a>
|
34
|
+
<% if files[:data] > threshold %>
|
35
|
+
<h2 style="color:#CC0101"><%= dir.gsub('__', '/') %> <span class="glyphicon glyphicon-remove"></span></h2>
|
36
|
+
<% else %>
|
37
|
+
<h2><%= dir.gsub('__', '/') %></h2>
|
38
|
+
<% end %>
|
34
39
|
</div>
|
35
|
-
|
40
|
+
|
36
41
|
<div class="row">
|
37
42
|
<h3 class="col-lg-1 text-muted"><%=size%>px</h3>
|
38
43
|
<% files[:variants].each do |file| %>
|
data/lib/wraith/version.rb
CHANGED
data/lib/wraith/wraith.rb
CHANGED
@@ -30,23 +30,14 @@ paths:
|
|
30
30
|
#Amount of fuzz ImageMagick will use
|
31
31
|
fuzz: '20%'
|
32
32
|
|
33
|
-
#Set the filename of the spider file to use, if not specified it will fallback to spider.txt
|
34
|
-
# spider_file: bbc_co_uk_spider.txt
|
35
|
-
|
36
33
|
#Set the number of days to keep the site spider file
|
37
34
|
spider_days:
|
38
35
|
- 10
|
39
36
|
|
40
|
-
#A list of URLs to skip when spidering. Ruby regular expressions can be
|
41
|
-
#used, if prefixed with !ruby/regexp as defined in the YAML Cookbook
|
42
|
-
#http://www.yaml.org/YAML_for_ruby.html#regexps
|
43
|
-
#
|
44
|
-
# spider_skips:
|
45
|
-
# - /foo/bar.html # Matches /foo/bar.html explcitly
|
46
|
-
# - !ruby/regexp /^\/baz\// # Matches any URLs that start with /baz
|
47
|
-
|
48
37
|
#Choose how results are displayed, by default alphanumeric. Different screen widths are always grouped.
|
49
38
|
#alphanumeric - all paths (with, and without, a difference) are shown, sorted by path
|
50
39
|
#diffs_first - all paths (with, and without, a difference) are shown, sorted by difference size (largest first)
|
51
40
|
#diffs_only - only paths with a difference are shown, sorted by difference size (largest first)
|
52
|
-
|
41
|
+
mode: diffs_first
|
42
|
+
|
43
|
+
threshold: 5
|
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.3.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-
|
12
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|