Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Addressing typos and undefined references #615

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/invalid3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions lib/wraith/save_images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def parallel_task(jobs)
end
rescue => e
logger.error "#{e}\n URL = #{url}"
create_invalid_image(filename, width, invalid_image_name)
create_invalid_image(filename, width)
end
end
end
Expand Down Expand Up @@ -143,7 +143,7 @@ def capture_image_selenium(screen_sizes, url, file_name, selector, global_before
crop_selector(driver, selector, new_file_name) if selector && selector.length > 0
break
rescue Net::ReadTimeout => e
logger.error "Got #{e} on attempt #{attempt} at screen size #{screensize}. URL = #{url}"
logger.error "Got #{e} on attempt #{attempt} at screen size #{screen_size}. URL = #{url}"
end
end
end
Expand Down Expand Up @@ -177,9 +177,9 @@ def image_was_created(filename)
wraith.resize or File.exist? filename
end

def create_invalid_image(filename, width, invalid_image_name)
def create_invalid_image(filename, width)
logger.warn "Using fallback image instead"
invalid = File.expand_path("../../assets/#{invalid_image_name}", File.dirname(__FILE__))
invalid = File.expand_path("../../assets/invalid3.jpg", File.dirname(__FILE__))
FileUtils.cp invalid, filename

set_image_width(filename, width)
Expand Down