Class: Middleman::Renderers::CoffeeScript::DebuggingCoffeeScriptTemplate

Inherits:
Tilt::CoffeeScriptTemplate
  • Object
show all
Defined in:
lib/middleman-core/renderers/coffee_script.rb

Overview

A Template for Tilt which outputs debug messages

Instance Method Summary collapse

Instance Method Details

#evaluate(context, locals, &block) ⇒ String

Add exception messaging

Parameters:

  • context (Class)
  • locals (Hash)

Returns:

  • (String)


35
36
37
38
39
40
41
42
43
44
45
# File 'lib/middleman-core/renderers/coffee_script.rb', line 35

def evaluate(context, locals, &block)
  return super if middleman_app.build?

  begin
    super
  rescue ::ExecJS::RuntimeError => e
    e.to_s
  rescue => e
    e.to_s
  end
end