Class: Requirejs::Compiler
- Inherits:
-
Object
- Object
- Requirejs::Compiler
- Defined in:
- lib/requirejs/compiler.rb
Instance Attribute Summary collapse
-
#build_script_path ⇒ Object
Returns the value of attribute build_script_path.
-
#data ⇒ Object
Returns the value of attribute data.
-
#file ⇒ Object
Returns the value of attribute file.
-
#scope ⇒ Object
Returns the value of attribute scope.
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(options = {}) ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize(options = {}) ⇒ Compiler
Returns a new instance of Compiler.
5 6 7 8 |
# File 'lib/requirejs/compiler.rb', line 5 def initialize( ={}) Requirejs.config.ensure_cache_location_exists @scope, @data, @file = [:scope], [:data], [:file] end |
Instance Attribute Details
#build_script_path ⇒ Object
Returns the value of attribute build_script_path.
3 4 5 |
# File 'lib/requirejs/compiler.rb', line 3 def build_script_path @build_script_path end |
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/requirejs/compiler.rb', line 3 def data @data end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/requirejs/compiler.rb', line 3 def file @file end |
#scope ⇒ Object
Returns the value of attribute scope.
3 4 5 |
# File 'lib/requirejs/compiler.rb', line 3 def scope @scope end |
Instance Method Details
#exec ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/requirejs/compiler.rb', line 10 def exec if Requirejs.config.optimize? OptimizedBuild.new(@scope, @file, @data).data elsif Requirejs.config.digest? Build.new(@scope, @file, @data).data else @data end end |