Created
November 12, 2013 03:26
-
-
Save davidpelaez/7424979 to your computer and use it in GitHub Desktop.
Shows how to compile jade from ruby without node available in the system using binary gem the ruby racer, a V8 port for Ruby.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming you have jade's browserified version: | |
# as of the time of writing lives in: https://github.com/visionmedia/jade/blob/master/jade.js | |
#!/usr/bin/env ruby | |
puts "Compiling hellow world, expected output is <h1>Hellow world</h1>" | |
require 'rubygems' | |
require 'v8' #therubyracer | |
cxt = V8::Context.new | |
cxt.eval 'var window = {}' | |
cxt.load File.expand_path '../jade.js', __FILE__ | |
puts cxt.eval 'window.jade.compile("h1 Hello World")()' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment