Class: Temple::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoctor/templates_compiler/temple_ext.rb

Overview

Monkey-patch Temple::Generator to fix bugs/inconviences waiting to be merged into upstream.

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Generator

XXX: Remove after github.com/judofyr/temple/pull/113 is merged.



10
11
12
13
# File 'lib/asciidoctor/templates_compiler/temple_ext.rb', line 10

def initialize(opts = {})
  self.class.options[:capture_generator] = self.class
  super
end

Instance Method Details

#on_capture(name, exp) ⇒ Object

XXX: Remove after github.com/judofyr/temple/pull/112 is merged.



16
17
18
# File 'lib/asciidoctor/templates_compiler/temple_ext.rb', line 16

def on_capture(name, exp)
  capture_generator.new(**options, buffer: name).call(exp)
end