Module: LiveScript::Source

Defined in:
lib/livescript/source.rb,
lib/livescript/source/version.rb

Constant Summary collapse

VERSION =
'1.5.0'

Class Method Summary collapse

Class Method Details

.bundled_pathObject



5
6
7
# File 'lib/livescript/source.rb', line 5

def self.bundled_path
  raise 'livescript-source >= 1.4.0 only work with livescript-ruby >= 2.3.0!'
end

.contentsObject

contents that expose LiveScript.compile



15
16
17
18
19
# File 'lib/livescript/source.rb', line 15

def self.contents
  filepath = File.expand_path('../livescript.js', __FILE__)
  # LiveScript >= 1.3 does not expose `LiveScript`
  File.read(filepath) + "var LiveScript = require('livescript');"
end

.raw_contentsObject



9
10
11
12
# File 'lib/livescript/source.rb', line 9

def self.raw_contents
  filepath = File.expand_path('../livescript.js', __FILE__)
  File.read filepath
end