Sha256: d74cca4fe1f766b4bd39164b8429f409a51e7ff107cff31bb05b44e714fa3a1b

Contents?: true

Size: 590 Bytes

Versions: 12

Compression:

Stored size: 590 Bytes

Contents

# -*- encoding : utf-8 -*-

require "coffee-script"

include_set Abstract::Script

format :html do
  def ace_mode
    :coffee
  end

  def bare_compile
    true
  end
end

format do
  def bare_compile
    false
  end

  view :core do
    compile_coffee _render_raw
  end

  def compile_coffee script
    ::CoffeeScript.compile script, no_wrap: bare_compile
  rescue StandardError => e
    line_nr = e.to_s.match(/\[stdin\]:(\d*)/)&.capture(0)&.to_i
    line = script.lines[line_nr - 1] if line_nr
    raise Card::Error, "CoffeeScript::Error (#{card.name}): #{e.message}: #{line}"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
card-mod-script-0.18.1 set/abstract/02_coffee_script.rb
card-mod-script-0.18.0 set/abstract/02_coffee_script.rb
card-mod-script-0.17.0 set/abstract/02_coffee_script.rb
card-mod-script-0.16.0 set/abstract/02_coffee_script.rb
card-mod-script-0.15.6 set/abstract/02_coffee_script.rb
card-mod-script-0.15.5 set/abstract/02_coffee_script.rb
card-mod-script-0.15.4 set/abstract/02_coffee_script.rb
card-mod-script-0.15.3 set/abstract/02_coffee_script.rb
card-mod-script-0.15.2.pre1 set/abstract/02_coffee_script.rb
card-mod-script-0.15.1.1 set/abstract/02_coffee_script.rb
card-mod-script-0.15.1 set/abstract/02_coffee_script.rb
card-mod-script-0.15.0 set/abstract/02_coffee_script.rb