Class: Asciidoctor::Rubyeval::InlineMacro

Inherits:
Extensions::InlineMacroProcessor
  • Object
show all
Defined in:
lib/asciidoctor-rubyeval/inlinemacro.rb

Overview

inline macro rubyeval:[]

Instance Method Summary collapse

Instance Method Details

#process(parent, _target, attrs) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/asciidoctor-rubyeval/inlinemacro.rb', line 20

def process(parent, _target, attrs)
  create_inline(
    parent,
    :quoted,
    SafeRuby.eval(attrs['text'])
  )
rescue RuntimeError => e
  warn("Error - Trying to eval a forbiden statement (#{attrs['text']})")
  raise(e)
end