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)


28
29
30
31
32
33
34
35
36
37
38
# File 'lib/middleman-core/renderers/coffee_script.rb', line 28

def evaluate(context, locals, &block)
  return super unless middleman_app.server?

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