wraith 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -8
- data/Rakefile +16 -6
- data/lib/wraith/gallery_template/gallery_template.erb +2 -2
- data/lib/wraith/version.rb +1 -1
- 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: acbb02d7ef9a06d124b77534e5976fb5e3f23378
|
4
|
+
data.tar.gz: 69ca8a5ce320a2ece935d527a6512fdf47b4df8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c4892a2d3a69ed520c17ea82d2e5e79b045eb1c9bbcfcb7fa7e519484f645132163e577d78b3e7137dee5fa59f57a71434888a08727e9b3ccb566279106dad5
|
7
|
+
data.tar.gz: bf101e7b2b614d183dfdb2743674c23fb27e6e806240577aee535b8bd0905414e6fd2119eb51c35bd1373ff9bf6b8757fe79a4579d26d59870ec78c82f7fd31f
|
data/README.md
CHANGED
@@ -64,12 +64,11 @@ Open terminal and run
|
|
64
64
|
|
65
65
|
gem install wraith
|
66
66
|
|
67
|
-
You can then run the following
|
67
|
+
You can then run the following to create a template snap.js and config file:
|
68
68
|
|
69
|
-
|
69
|
+
wraith setup
|
70
70
|
|
71
|
-
|
72
|
-
Alternatively you can download the install script via curl, this will not create a git repo though.
|
71
|
+
Alternatively you can clone the repo.
|
73
72
|
|
74
73
|
git clone https://github.com/BBC-News/wraith
|
75
74
|
cd wraith
|
@@ -87,7 +86,7 @@ browser:
|
|
87
86
|
# gecko: "slimerjs"
|
88
87
|
|
89
88
|
# If you want to have multiple snapping files, set the file name here
|
90
|
-
snap_file: "snap.js"
|
89
|
+
snap_file: "path/to/snap.js"
|
91
90
|
|
92
91
|
# Type the name of the directory that shots will be stored in
|
93
92
|
directory:
|
@@ -136,8 +135,30 @@ phantomjs_options: "--ignore-ssl-errors=true"
|
|
136
135
|
```
|
137
136
|
|
138
137
|
## Using Wraith
|
138
|
+
### Wraith Gem
|
139
|
+
You can type `wraith` into terminal to bring up the list of commands, but the one to start Wraith is
|
139
140
|
|
140
|
-
|
141
|
+
```sh
|
142
|
+
wraith capture config_name
|
143
|
+
```
|
144
|
+
|
145
|
+
This assumes that your snap.js and config.yaml are in the folders that were created on setup. There are other commands also available, these all expect a config_name to be passed as an option.
|
146
|
+
|
147
|
+
```sh
|
148
|
+
wraith capture config_name # A full Wraith job
|
149
|
+
wraith compare_images # compares images to generate diffs
|
150
|
+
wraith crop_images # crops images to the same height
|
151
|
+
wraith folders # create folders for images
|
152
|
+
wraith generate_gallery # create page for viewing images
|
153
|
+
wraith generate_thumbnails # create thumbnails for gallery
|
154
|
+
wraith reset_shots # removes all the files in the shots folder
|
155
|
+
wraith save_images # captures screenshots
|
156
|
+
wraith setup # creates config folder and default config
|
157
|
+
```
|
158
|
+
|
159
|
+
### Wraith Rake tasks
|
160
|
+
|
161
|
+
If you want to use the rake task instead of the gem, you can use the following.
|
141
162
|
|
142
163
|
There are two ways of using Wraith, the fastest is to simply type rake.
|
143
164
|
|
@@ -154,6 +175,7 @@ rake config[config_name]
|
|
154
175
|
On Windows before running the rake command you will need to make a small edit to the wraith.rb file.
|
155
176
|
Locate lines 60 and 70 and switch the commenting as described.
|
156
177
|
|
178
|
+
If you are new to ruby, rake and PhantomJS, [here is a great screencast](http://www.youtube.com/watch?v=gE_19L0l2q0) about how to use Wraith by [Kevin Lamping](https://twitter.com/klamping)
|
157
179
|
|
158
180
|
## Output
|
159
181
|
|
@@ -183,8 +205,8 @@ If you want to add functionality to this project, pull requests are welcome.
|
|
183
205
|
|
184
206
|
**Please raise any issues with this project as a GitHub issue.**
|
185
207
|
|
186
|
-
## Changelog - updated
|
187
|
-
|
208
|
+
## Changelog - updated 2014-02-09
|
209
|
+
We have released Wraith as a Ruby Gem!! There is a new CLI to better interact with Wraith and it's commands.
|
188
210
|
|
189
211
|
## License
|
190
212
|
|
data/Rakefile
CHANGED
@@ -8,16 +8,17 @@ require 'wraith/folder'
|
|
8
8
|
require 'wraith/thumbnails'
|
9
9
|
require 'wraith/compare_images'
|
10
10
|
require 'wraith/images'
|
11
|
+
require 'wraith/gallery'
|
11
12
|
|
12
13
|
@config = ('config')
|
13
14
|
|
14
|
-
task :
|
15
|
+
task :config, [:yaml] do |t, custom|
|
15
16
|
custom.with_defaults(:yaml => "config")
|
16
17
|
@config = "#{custom[:yaml]}"
|
17
|
-
Rake::Task["
|
18
|
+
Rake::Task["default"].invoke
|
18
19
|
end
|
19
20
|
|
20
|
-
task :default => [:reset_shots_folder, :check_for_paths, :setup_folders, :save_images, :generate_thumbnails, :generate_gallery] do
|
21
|
+
task :default => [:reset_shots_folder, :check_for_paths, :setup_folders, :save_images, :check_images, :crop_images, :compare_images, :generate_thumbnails, :generate_gallery] do
|
21
22
|
puts 'Done!';
|
22
23
|
end
|
23
24
|
|
@@ -47,12 +48,12 @@ task :save_images do
|
|
47
48
|
end
|
48
49
|
|
49
50
|
task :crop_images do
|
50
|
-
crop = Wraith::CropImages.new(@
|
51
|
+
crop = Wraith::CropImages.new(@config)
|
51
52
|
crop.crop_images
|
52
53
|
end
|
53
54
|
|
54
55
|
task :check_images do
|
55
|
-
image = Wraith::Images.new(@
|
56
|
+
image = Wraith::Images.new(@config)
|
56
57
|
image.files
|
57
58
|
end
|
58
59
|
|
@@ -62,7 +63,16 @@ task :generate_thumbnails do
|
|
62
63
|
end
|
63
64
|
|
64
65
|
task :generate_gallery do
|
65
|
-
|
66
|
+
gallery = Wraith::GalleryGenerator.new(@config)
|
67
|
+
gallery.generate_gallery
|
66
68
|
end
|
67
69
|
|
70
|
+
task :grabber, [:yaml] do |t, custom|
|
71
|
+
custom.with_defaults(:yaml => "config")
|
72
|
+
@config = "#{custom[:yaml]}"
|
73
|
+
Rake::Task["grab"].invoke
|
74
|
+
end
|
68
75
|
|
76
|
+
task :grab => [:reset_shots_folder, :check_for_paths, :setup_folders, :save_images, :generate_thumbnails, :generate_gallery] do
|
77
|
+
puts 'Done!';
|
78
|
+
end
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<h3 class="col-lg-1 text-muted"><%=size%>px</h3>
|
38
38
|
<% files[:variants].each do |file| %>
|
39
39
|
<div class="col-lg-3">
|
40
|
-
<a href="<%=
|
40
|
+
<a href="<%=file[:filename]%>">
|
41
41
|
<img class="short-screenshot img-thumbnail" src="<%=path%><%=file[:thumb]%>">
|
42
42
|
</a>
|
43
43
|
<p class="text-center"><%=file[:name]%></p>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<% end %>
|
46
46
|
<div class="col-lg-3">
|
47
47
|
<% if files[:diff] %>
|
48
|
-
<a href="<%=
|
48
|
+
<a href="<%=files[:diff][:filename]%>">
|
49
49
|
<img class="short-screenshot img-thumbnail" src="<%=path%><%=files[:diff][:thumb]%>">
|
50
50
|
</a>
|
51
51
|
<% end %>
|
data/lib/wraith/version.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.3
|
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-02-
|
12
|
+
date: 2014-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|