Class: Opal::TiltTemplate
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Opal::TiltTemplate
- Defined in:
- opal/lib/tilt/opal.rb
Class Method Summary collapse
- .compiler_options ⇒ Object
- .engine_initialized? ⇒ Boolean
- .inherited(subclass) ⇒ Object
- .version ⇒ Object
Instance Method Summary collapse
- #compiler_options ⇒ Object
- #evaluate(_, _, &block) ⇒ Object
- #initialize_engine ⇒ Object
- #prepare ⇒ Object
Class Method Details
.compiler_options ⇒ Object
25 26 27 |
# File 'opal/lib/tilt/opal.rb', line 25 def self. Opal::Config..merge(requirable: true) end |
.engine_initialized? ⇒ Boolean
17 18 19 |
# File 'opal/lib/tilt/opal.rb', line 17 def self.engine_initialized? true end |
.inherited(subclass) ⇒ Object
13 14 15 |
# File 'opal/lib/tilt/opal.rb', line 13 def self.inherited(subclass) subclass.default_mime_type = 'application/javascript' end |
Instance Method Details
#compiler_options ⇒ Object
48 49 50 |
# File 'opal/lib/tilt/opal.rb', line 48 def self.class. end |
#evaluate(_, _, &block) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'opal/lib/tilt/opal.rb', line 36 def evaluate(_, _, &block) if builder = @options[:builder] builder.dup.build(file).to_s elsif @options[:build] Opal::Builder.build(file).to_s else = ( || {}).merge!(file: file) compiler = Compiler.new(data, ) compiler.compile.to_s end end |
#initialize_engine ⇒ Object
29 30 31 |
# File 'opal/lib/tilt/opal.rb', line 29 def initialize_engine require_template_library 'opal' end |
#prepare ⇒ Object
33 34 |
# File 'opal/lib/tilt/opal.rb', line 33 def prepare end |