Created
June 24, 2013 07:00
-
-
Save JonathonMA/5848204 to your computer and use it in GitHub Desktop.
Wrap coffeescript in a closure
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
require 'coffee-script' | |
code = DATA.read | |
magic_code = <<_EOJS_ | |
_magic_code = ($) -> | |
#{code} | |
_magic_code(jQuery); | |
_EOJS_ | |
puts CoffeeScript.compile magic_code | |
__END__ | |
$ -> alert "hi from coffee script town" |
Author
JonathonMA
commented
Jun 24, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment