Module: Eco::Source
- Defined in:
- lib/eco.rb
Class Method Summary collapse
- .combined_contents ⇒ Object
- .contents ⇒ Object
- .context ⇒ Object
- .path ⇒ Object
- .path=(path) ⇒ Object
- .version ⇒ Object
Class Method Details
.combined_contents ⇒ Object
20 21 22 |
# File 'lib/eco.rb', line 20 def self.combined_contents [CoffeeScript::Source.contents, contents].join(";\n") end |
.contents ⇒ Object
16 17 18 |
# File 'lib/eco.rb', line 16 def self.contents @contents ||= File.read(path) end |
.context ⇒ Object
28 29 30 |
# File 'lib/eco.rb', line 28 def self.context @context ||= ExecJS.compile(combined_contents) end |
.path ⇒ Object
7 8 9 |
# File 'lib/eco.rb', line 7 def self.path @path ||= ENV["ECO_SOURCE_PATH"] || bundled_path end |
.path=(path) ⇒ Object
11 12 13 14 |
# File 'lib/eco.rb', line 11 def self.path=(path) @contents = @version = @context = nil @path = path end |
.version ⇒ Object
24 25 26 |
# File 'lib/eco.rb', line 24 def self.version @version ||= contents[/Eco Compiler v(.*?)\s/, 1] end |