Module: Card::Set::Abstract::CoffeeScript::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod019-script/abstract/02_coffee_script.rb

Instance Method Summary collapse

Instance Method Details

#bare_compileObject



25
26
27
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/02_coffee_script.rb', line 25

def bare_compile
  false
end

#compile_coffee(script) ⇒ Object



33
34
35
36
37
38
39
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/02_coffee_script.rb', line 33

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

#view: coreObject



29
30
31
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/02_coffee_script.rb', line 29

view :core do
  compile_coffee _render_raw
end