Project

phandoc

0.0
No commit activity in last 3 years
No release in over 3 years
Javascript + DOM in your ruby, based on PhantomJS. https://github.com/greatghoul/phandoc
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.9
 Project Readme

phandoc

Javascript + DOM in your ruby, based on PhantomJS

Installation

Add to your Gemfile

gem 'phandoc'

Or install from command line

gem install phandoc

Examples

require 'phandoc'

doc = Phandoc.new <<-HTML
  <html>
    <head></head>
    <body>
      <div id="test">foo</div>
    </body>
  </html>
HTML

result = doc.execute <<-SCRIPT
  document.getElementById("test").innerHTML = "bar";
  'baaaaaar!';
SCRIPT

puts doc.html # output: ... <div id="test">bar</div> ...
puts result   # output: baaaaaar!

License

MIT License, please read LICENSE file