update phantomjs and screencap

This commit is contained in:
Kyle Drake 2015-07-20 15:41:45 -07:00
parent 233265f8ab
commit 91640d87b6
3 changed files with 10 additions and 6 deletions

View file

@ -16,7 +16,7 @@ gem 'google-api-client', require: 'google/api_client'
gem 'tilt'
gem 'erubis'
gem 'stripe' #, source: 'https://code.stripe.com/'
gem 'screencap'
gem 'screencap', '~> 0.1.4'
gem 'cocaine'
gem 'zipruby'
gem 'sass', require: nil

View file

@ -125,7 +125,7 @@ GEM
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
pg (0.17.1)
phantomjs (1.9.7.1)
phantomjs (1.9.8.0)
poltergeist (1.6.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
@ -180,7 +180,7 @@ GEM
sysinfo (>= 0.8.1)
safe_yaml (1.0.4)
sass (3.3.8)
screencap (0.1.1)
screencap (0.1.4)
phantomjs
scrypt (2.0.0)
ffi-compiler (>= 0.0.2)
@ -300,7 +300,7 @@ DEPENDENCIES
ruby-debug
rye
sass
screencap
screencap (~> 0.1.4)
scrypt
sequel (= 4.8.0)
sequel_pg

View file

@ -5,6 +5,7 @@ require 'thread'
require 'open3'
# Don't judge - Ruby handling of timeouts is a joke..
=begin
module Phantomjs
def self.run(*args, &block)
pid = nil
@ -27,6 +28,7 @@ module Phantomjs
# :nocov:
end
end
=end
class ScreenshotWorker
SCREENSHOTS_PATH = Site::SCREENSHOTS_ROOT
@ -44,9 +46,11 @@ class ScreenshotWorker
f.fetch(
output: screenshot_output_path,
width: 1280,
height: 960
height: 960,
maxRenderWait: 25000,
cutoffWait: 30000
)
rescue Timeout::Error
rescue => e
# :nocov:
puts "#{username}/#{path} is timing out, discontinuing"
site = Site[username: username]