Permalink
Browse files

binary can come from anywhere

  • Loading branch information...
1 parent 62a561f commit 2298ce03607e2427a5c69743f18fbb3d318e39df @maxwell committed Jun 14, 2012
Showing with 16 additions and 2 deletions.
  1. +0 −1 Gemfile
  2. +7 −0 lib/screencap.rb
  3. +7 −0 lib/screencap/fetcher.rb
  4. +2 −1 lib/screencap/phantom.rb
View
@@ -4,5 +4,4 @@ source 'https://rubygems.org'
gem 'guard'
gem 'guard-rspec'
gem 'guard-bundler'
-gem 'phantomjs.rb', :git => 'git://github.com/westoque/phantomjs.rb.git'
gemspec
View
@@ -6,6 +6,13 @@
module Screencap
SCREENCAP_ROOT = Pathname.new(File.dirname(__FILE__))
# TMP_DIRECTORY = SCREENCAP_ROOT.join('..', 'tmp')
+ def self.binary=(location)
+ @@binary = location
+ end
+
+ def binary
+ @@binary
+ end
end
#config
View
@@ -1,4 +1,11 @@
module Screencap
+
+ def self.binary=()
+ @@binary_location = location
+ end
+
+
+
class Fetcher
def initialize(url)
@url = url
View
@@ -4,7 +4,8 @@ class Phantom
def self.rasterize(url, path, *args)
# puts RASTERIZE.to_s, url, path, *args # Your code goes here...
- Phantomjs.run(RASTERIZE.to_s, url, path, *args)
+ system("#{Screencap.binary} #{RASTERIZE.to_s} #{url} #{path} #{quoted_args(*args)}")
+ # Phantomjs.run(RASTERIZE.to_s, url, path, *args)
end

0 comments on commit 2298ce0

Please sign in to comment.