Class: Opal::BuilderProcessors::RubyERBProcessor

Inherits:
RubyProcessor show all
Defined in:
opal/lib/opal/builder_processors.rb

Overview

This handler is for files named ".rb.erb", which ought to first get preprocessed via ERB, then via Opal.

Instance Attribute Summary

Attributes inherited from Processor

#autoloads, #filename, #options, #required_trees, #requires, #source

Instance Method Summary collapse

Methods inherited from RubyProcessor

#autoloads, #cache_key, #compiler_for, match?, #required_trees, #requires, #source, #source_map

Methods inherited from Processor

handles, #initialize, #mark_as_required, match?, match_regexp, #to_s

Constructor Details

This class inherits a constructor from Opal::BuilderProcessors::Processor

Instance Method Details

#compiledObject



147
148
149
150
151
152
153
154
155
# File 'opal/lib/opal/builder_processors.rb', line 147

def compiled
  @compiled ||= begin
    @source = ::ERB.new(@source.to_s).result

    compiler = compiler_for(@source, file: @filename)
    compiler.compile
    compiler
  end
end