Method: Mdoc::Document#apply!

Defined in:
lib/mdoc/document.rb

#apply!(pn) ⇒ Object

apply processors by processor name (if corresponding processor) class defined. rubocop:disable MethodLength



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mdoc/document.rb', line 68

def apply!(pn)
  prc = Mdoc.get_processor(pn)
  if performed[prc]
    if prc.new.repeatable?
      prc.new.process! self
      performed[prc] += 1
      # error if performed too many times (prevent dead loop)
      raise "loop max reached: #{prc}" if performed[prc] > LOOP_MAX
    end
  else # not performed
    prc.new.process! self
    performed[prc] = 1
  end
end