class Opal::TiltTemplate
Public Class Methods
compiler_options()
click to toggle source
# File lib/tilt/opal.rb, line 24 def self.compiler_options Opal::Config.compiler_options.merge(requirable: true) end
engine_initialized?()
click to toggle source
# File lib/tilt/opal.rb, line 16 def self.engine_initialized? true end
inherited(subclass)
click to toggle source
# File lib/tilt/opal.rb, line 12 def self.inherited(subclass) subclass.default_mime_type = 'application/javascript' end
version()
click to toggle source
# File lib/tilt/opal.rb, line 20 def self.version ::Opal::VERSION end
Public Instance Methods
compiler_options()
click to toggle source
# File lib/tilt/opal.rb, line 48 def compiler_options self.class.compiler_options end
evaluate(_scope, _locals)
click to toggle source
# File lib/tilt/opal.rb, line 36 def evaluate(_scope, _locals) if builder = @options[:builder] builder.dup.build(file).to_s elsif @options[:build] Opal::Builder.build(file).to_s else compiler_options = (compiler_options || {}).merge!(file: file) compiler = Compiler.new(data, compiler_options) compiler.compile.to_s end end
initialize_engine()
click to toggle source
# File lib/tilt/opal.rb, line 28 def initialize_engine require_template_library 'opal' end
prepare()
click to toggle source
# File lib/tilt/opal.rb, line 32 def prepare # stub end