Module: Asciidoctor::Reducer::Extensions
- Defined in:
- lib/asciidoctor/reducer/extensions.rb
Class Method Summary collapse
- .group ⇒ Object
- .key ⇒ Object
- .prepare_registry(registry = nil) ⇒ Object
- .register ⇒ Object
- .unregister ⇒ Object
Class Method Details
.group ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/asciidoctor/reducer/extensions.rb', line 11 def group proc do next if document.[:reduced] preprocessor Preprocessor tree_processor TreeProcessor end end |
.key ⇒ Object
19 20 21 |
# File 'lib/asciidoctor/reducer/extensions.rb', line 19 def key :reducer end |
.prepare_registry(registry = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/asciidoctor/reducer/extensions.rb', line 23 def prepare_registry registry = nil registry = ::Asciidoctor::Extensions.create(®istry) if ::Proc === registry return registry if ::Asciidoctor::Extensions.groups[key] if registry registry.groups[key] = group registry else ::Asciidoctor::Extensions.create key, &group end end |
.register ⇒ Object
34 35 36 |
# File 'lib/asciidoctor/reducer/extensions.rb', line 34 def register ::Asciidoctor::Extensions.register key, &group end |
.unregister ⇒ Object
38 39 40 |
# File 'lib/asciidoctor/reducer/extensions.rb', line 38 def unregister ::Asciidoctor::Extensions.groups.delete key # NOTE `Extensions.unregister key` fails if groups is not initialized end |