Module: Handlebars::Source

Defined in:
lib/handlebars.rb

Class Method Summary collapse

Class Method Details

.contentsObject



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

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

.contextObject



20
21
22
# File 'lib/handlebars.rb', line 20

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

.pathObject



7
8
9
# File 'lib/handlebars.rb', line 7

def self.path
  @path ||= bundled_path
end

.versionObject



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

def self.version
  # var VERSION = "1.3.0";
  @version ||= contents[/var\sVERSION\s=\s\'([\d.]+)\'/, 1]
end