Sha256: f39cfb2ba477b785b57756eb605a9f4a8260474e909ea569b7586134b00fbfda
Contents?: true
Size: 760 Bytes
Versions: 6
Compression:
Stored size: 760 Bytes
Contents
require 'tilt' require 'sprockets' require 'opal/sprockets/processor' module Opal module ERB class Processor < ::Opal::Processor def initialize_engine super require_template_library 'opal/erb' end def evaluate(context, locals, &block) compiler = Opal::ERB::Compiler.new(@data, context.logical_path.sub(/#{REGEXP_START}templates\//, '')) @data = compiler.prepared_source super end end end end Tilt.register 'opalerb', Opal::ERB::Processor if Sprockets.respond_to? :register_transformer Sprockets.register_engine '.opalerb', Opal::ERB::Processor, mime_type: 'application/javascript', silence_deprecation: true else Sprockets.register_engine '.opalerb', Opal::ERB::Processor end
Version data entries
6 entries across 6 versions & 1 rubygems