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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b91a9e01056e5ee44ce5a8726152a023023285f
4
- data.tar.gz: 3043cc0f99e7dedee6c0878f09e41ff71f042923
3
+ metadata.gz: acbb02d7ef9a06d124b77534e5976fb5e3f23378
4
+ data.tar.gz: 69ca8a5ce320a2ece935d527a6512fdf47b4df8b
5
5
  SHA512:
6
- metadata.gz: e0ea6720ac947da1b0ad1fda376fa288ae3ea58953c8b5cb239b22e08e410df49fd6f89ca8cd3bcd546148c413a29a16de4b7f65dd1a2eb7b10ecf3739a3830a
7
- data.tar.gz: ccec5c11e607f1c3faf657edff070cfff0ba61b6641b135e7f97078290d452a34f0f808ec936ecdc525e08a65d2156cc1b0540aa527f29e6057e445b81076cb0
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 inside the Wraith directory to create a template snap.js and config file:
67
+ You can then run the following to create a template snap.js and config file:
68
68
 
69
- gem setup
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
- 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)
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 24/01/14
187
- New features include some refactoring and the start of additional cli work. We have removed the webdriver features for the time being, this will return in a more capable and fully feature state.
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 :grabber, [:yaml] do |t, custom|
15
+ task :config, [:yaml] do |t, custom|
15
16
  custom.with_defaults(:yaml => "config")
16
17
  @config = "#{custom[:yaml]}"
17
- Rake::Task["grab"].invoke
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(@save_images.directory)
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(@save_images.directory)
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
- sh "ruby lib/wraith/gallery.rb #{@save_images.directory}"
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="<%=path%>/<%=file[:filename]%>">
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="<%=path%>/<%=files[:diff][:filename]%>">
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 %>
@@ -1,3 +1,3 @@
1
1
  module Wraith
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.3'
3
3
  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.1.2
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-08 00:00:00.000000000 Z
12
+ date: 2014-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake