Class: Lanes::API::CjsxProcessor

Inherits:
CoffeeScriptProcessor show all
Defined in:
lib/lanes/api/coffeescript_processor.rb

Constant Summary

Constants inherited from CoffeeScriptProcessor

Lanes::API::CoffeeScriptProcessor::CONSTRUCTOR, Lanes::API::CoffeeScriptProcessor::EXTENDING_CLASS_DEFINITION, Lanes::API::CoffeeScriptProcessor::REACT_CLASS_MATCH

Instance Attribute Summary

Attributes inherited from CoffeeScriptProcessor

#contents

Instance Method Summary collapse

Methods inherited from CoffeeScriptProcessor

#cleaned

Methods inherited from JsAssetCompiler

#get_js_aliases, #get_wrapping_vars, #prepare, register, #wrap_js

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
# File 'lib/lanes/api/coffeescript_processor.rb', line 97

def evaluate(scope, locals, &block)
    begin
        coffee = CoffeeReact.transform(cleaned)
        js = ::CoffeeScript.compile(coffee, bare: true)
        wrap_js scope, js
    rescue => e
        Lanes.logger.warn e
        Lanes.logger.warn cleaned
        raise e
    end
end