From 4989c8ac894556351826cb58d666c926ec705a3d Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Wed, 2 Dec 2015 13:54:55 +0000 Subject: [PATCH] attempted to fix 3.0.1 --- lib/wraith/javascript/_helper.js | 2 ++ lib/wraith/save_images.rb | 15 ++++++++++++--- lib/wraith/version.rb | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/wraith/javascript/_helper.js b/lib/wraith/javascript/_helper.js index 377bb0d4..644c93a9 100644 --- a/lib/wraith/javascript/_helper.js +++ b/lib/wraith/javascript/_helper.js @@ -1,4 +1,6 @@ module.exports = function (commandLineDimensions) { + + commandLineDimensions = '' + commandLineDimensions; // cast to string // remove quotes from dimensions string commandLineDimensions = commandLineDimensions.replace(/'/gi, ''); diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index 5ff7a4c8..3a3cef27 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -31,7 +31,7 @@ def define_jobs check_paths.each do |label, options| settings = CaptureOptions.new(options, wraith) - if wraith.resize + if settings.resize jobs = jobs + define_individual_job(label, settings, wraith.widths) else wraith.widths.each do |width| @@ -66,7 +66,7 @@ def capture_page_image(browser, url, width, file_name, selector, global_before_c command = "#{browser} #{wraith.phantomjs_options} '#{wraith.snap_file}' '#{url}' \"#{width}\" '#{file_name}' '#{selector}' '#{global_before_capture}' '#{path_before_capture}'" # @TODO - uncomment the following line when we add a verbose mode - #puts command + # puts command run_command command end @@ -132,7 +132,16 @@ def path end def selector - options["selector"] || " " + options["selector"] || "body" + end + + def resize + # path level, or YAML-file level `resize_or_reload` property value + if @options["resize_or_reload"] + (@options["resize_or_reload"] == 'resize') + else + @wraith.resize + end end def before_capture diff --git a/lib/wraith/version.rb b/lib/wraith/version.rb index 653c02bc..79ba4193 100644 --- a/lib/wraith/version.rb +++ b/lib/wraith/version.rb @@ -1,3 +1,3 @@ module Wraith - VERSION = "3.0.1" + VERSION = "3.0.2" end