Class: Opal::Builder::Processor::RubyERBProcessor
- Inherits:
-
RubyProcessor
- Object
- Opal::Builder::Processor
- RubyProcessor
- Opal::Builder::Processor::RubyERBProcessor
- Defined in:
- opal/lib/opal/builder/processor.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 Opal::Builder::Processor
#abs_path, #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 Opal::Builder::Processor
handles, #initialize, #mark_as_required, match?, match_regexp, #to_s
Constructor Details
This class inherits a constructor from Opal::Builder::Processor
Instance Method Details
#compiled ⇒ Object
151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'opal/lib/opal/builder/processor.rb', line 151 def compiled @compiled ||= begin erb = ::ERB.new(@source.to_s) erb.filename = @abs_path @source = erb.result compiler = compiler_for(@source, file: @filename) compiler.compile compiler end end |