module CoffeeScript::Source
Public Class Methods
bare_option()
click to toggle source
# File lib/coffee_script.rb, line 27 def self.bare_option @bare_option ||= contents.match(/noWrap/) ? 'noWrap' : 'bare' end
contents()
click to toggle source
# File lib/coffee_script.rb, line 19 def self.contents @contents ||= File.read(path) end
context()
click to toggle source
# File lib/coffee_script.rb, line 31 def self.context @context ||= ExecJS.compile(contents) end
path()
click to toggle source
# File lib/coffee_script.rb, line 10 def self.path @path ||= ENV['COFFEESCRIPT_SOURCE_PATH'] || bundled_path end
path=(path)
click to toggle source
# File lib/coffee_script.rb, line 14 def self.path=(path) @contents = @version = @bare_option = @context = nil @path = path end
version()
click to toggle source
# File lib/coffee_script.rb, line 23 def self.version @version ||= contents[/CoffeeScript Compiler v([\d.]+)/, 1] end