Class: Barber::Ember::Precompiler

Inherits:
Precompiler show all
Defined in:
lib/barber/ember/precompiler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Precompiler

compile, #compile, compiler_version, #handlebars, handlebars_available?, #precompile_function

Constructor Details

#initializePrecompiler

Returns a new instance of Precompiler.


13
14
15
16
17
# File 'lib/barber/ember/precompiler.rb', line 13

def initialize
  super

  self.ember_template_compiler_path = ::Ember::Source.bundled_path_for("ember-template-compiler.js")
end

Instance Attribute Details

#ember_template_compiler_pathObject

Returns the value of attribute ember_template_compiler_path


11
12
13
# File 'lib/barber/ember/precompiler.rb', line 11

def ember_template_compiler_path
  @ember_template_compiler_path
end

Class Method Details

.ember_template_compiler_path=(path) ⇒ Object


6
7
8
# File 'lib/barber/ember/precompiler.rb', line 6

def ember_template_compiler_path=(path)
  instance.ember_template_compiler_path = path
end

Instance Method Details

#compiler_versionObject


37
38
39
40
41
42
43
# File 'lib/barber/ember/precompiler.rb', line 37

def compiler_version
  compiler_version = []
  compiler_version << "ember:#{ember_version}"
  compiler_version << "handlebars:#{handlebars_version}" if handlebars_version

  compiler_version.join('/')
end

#ember_template_precompilerObject


25
26
27
# File 'lib/barber/ember/precompiler.rb', line 25

def ember_template_precompiler
  @ember ||= File.new(@ember_template_compiler_path)
end

#precompilerObject


29
30
31
# File 'lib/barber/ember/precompiler.rb', line 29

def precompiler
  @precompiler = File.new(File.expand_path("../../javascripts/ember_precompiler.js", __FILE__))
end

#sourcesObject


33
34
35
# File 'lib/barber/ember/precompiler.rb', line 33

def sources
  super + [ember_template_precompiler]
end