Ruby wrapper for phantomjs
Ruby JavaScript
Pull request Compare This branch is 2 commits ahead, 39 commits behind westoque:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.autotest
.gitignore
.travis.yml
CHANGELOG
Gemfile
MIT-LICENSE
README.md
Rakefile
phantomjs.rb.gemspec

README.md

phantomjs.rb

Build Status

A ruby wrapper for phantomjs. The binaries are in vendor and it will automatically detect what OS you are using and will try to use the appropriate binaries.

Install

gem install phantomjs.rb

Usage

script = File.expand_path('./my_runner.js')
output = Phantomjs.run(script, 'myarg1', 'myarg2')
p output # Whatever it outputs from stdout

The equivalent code above will generate:

/absolute/path/to/phantomjs /absolute/my_runner.js myarg1 myarg2