jashkenas--coffeescript/lib/coffee-script.rb

21 lines
539 B
Ruby
Raw Normal View History

$LOAD_PATH.unshift(File.dirname(__FILE__))
require "coffee_script/lexer"
require "coffee_script/parser"
require "coffee_script/nodes"
2009-12-17 15:04:43 +00:00
require "coffee_script/value"
require "coffee_script/scope"
require "coffee_script/parse_error"
# Namespace for all CoffeeScript internal classes.
module CoffeeScript
2009-12-24 19:59:19 +00:00
VERSION = '0.1.1' # Keep in sync with the gemspec.
2009-12-18 02:57:21 +00:00
# Compile a script (String or IO) to JavaScript.
def self.compile(script)
script = script.read if script.respond_to?(:read)
Parser.new.parse(script).compile
end
end