Created
August 25, 2011 17:36
-
-
Save robi42/1171239 to your computer and use it in GitHub Desktop.
CoffeeScript compiler fun on Ringo
This file contains hidden or 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
$ wget --no-check-certificate https://raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js | |
$ ringo --optlevel -1 | |
>> fs = require('fs') | |
>> coffee = fs.read('./coffee-script.js').replace(/this\.CoffeeScript/, 'exports.CoffeeScript') | |
>> fs.write('./coffee-script.js', coffee) | |
>> var {CoffeeScript} = require('./coffee-script') | |
>> code = CoffeeScript.compile("do -> 'Hello, Ringo world!'", {bare: true}) | |
'(function() { | |
return \'Hello, Ringo world!\'; | |
})();' | |
>> eval(code) | |
'Hello, Ringo world!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment