Module: IcedCoffeeScript

Defined in:
lib/iced_coffee_script.rb

Defined Under Namespace

Modules: Source

Constant Summary collapse

EngineError =
ExecJS::RuntimeError
CompilationError =
ExecJS::ProgramError

Class Method Summary collapse

Class Method Details

.compile(script, options = {}) ⇒ Object

Compile a script (String or IO) to JavaScript.



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/iced_coffee_script.rb', line 47

def compile(script, options = {})
  script = script.read if script.respond_to?(:read)

  if options.key?(:bare)
  elsif options.key?(:no_wrap)
    options[:bare] = options[:no_wrap]
  else
    options[:bare] = false
  end

  Source.context.call("CoffeeScript.compile", script, options)
end

.engineObject



36
37
# File 'lib/iced_coffee_script.rb', line 36

def engine
end

.engine=(engine) ⇒ Object



39
40
# File 'lib/iced_coffee_script.rb', line 39

def engine=(engine)
end

.versionObject



42
43
44
# File 'lib/iced_coffee_script.rb', line 42

def version
  Source.version
end