Module: Steering::Source

Defined in:
lib/steering.rb

Class Method Summary collapse

Class Method Details

.contentsObject



15
16
17
# File 'lib/steering.rb', line 15

def self.contents
  @contents ||= File.read(path)
end

.contextObject



19
20
21
# File 'lib/steering.rb', line 19

def self.context
  @context ||= ExecJS.compile(contents)
end

.pathObject



6
7
8
# File 'lib/steering.rb', line 6

def self.path
  @path ||= ENV["HANDLEBARS_SOURCE_PATH"] || bundled_path
end

.path=(path) ⇒ Object



10
11
12
13
# File 'lib/steering.rb', line 10

def self.path=(path)
  @contents = @version = @context = nil
  @path = path
end

.runtimeObject



32
33
34
# File 'lib/steering.rb', line 32

def self.runtime
  @runtime_contents ||= File.read(runtime_path)
end

.runtime_pathObject



23
24
25
# File 'lib/steering.rb', line 23

def self.runtime_path
  @runtime_path ||= ENV["HANDLEBARS_RUNTIME_PATH"] || bundled_runtime_path
end

.runtime_path=(runtime_path) ⇒ Object



27
28
29
30
# File 'lib/steering.rb', line 27

def self.runtime_path=(runtime_path)
  @runtime = nil
  @runtime_path = runtime_path
end

.versionObject



36
37
38
# File 'lib/steering.rb', line 36

def self.version
  @version ||= context.eval("Handlebars.VERSION")
end