From ff38fcf9e42cddf298375032b7643e6001954329 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 19 Apr 2024 14:04:40 +0200 Subject: fix #6 (plugin fails to load) This plugin failed to load under Asciidoctor 2.0.22 due to a difference between the signature of the initialize method on the base Asciidoctor::Extensions::TreeProcessor class and the implemented initialize method in lib/asciidoctor/interdoc_reftext/processor.rb. This commit modifies the function signature, and makes it so the Processor class is now directly instantiated instead of by a reference passed to the initialize method. --- lib/asciidoctor/interdoc_reftext/processor.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/asciidoctor/interdoc_reftext/processor.rb b/lib/asciidoctor/interdoc_reftext/processor.rb index 22f6822..2aceba5 100644 --- a/lib/asciidoctor/interdoc_reftext/processor.rb +++ b/lib/asciidoctor/interdoc_reftext/processor.rb @@ -63,9 +63,8 @@ module Asciidoctor::InterdocReftext # @param resolver_class [#new] the {Resolver} class to use. # @param resolver_opts [Hash] options to be passed into # the resolver_class's initializer (see {Resolver#initialize}). - def initialize(resolver_class: Resolver, **resolver_opts) + def initialize(resolver_opts) super - @resolver_class = resolver_class @resolver_opts = resolver_opts # Monkey-patch Asciidoctor::Inline unless already patched. @@ -82,7 +81,7 @@ module Asciidoctor::InterdocReftext # @param document [Asciidoctor::Document] the document to process. def process(document) - resolver = @resolver_class.new(document, **@resolver_opts) + resolver = Resolver.new(document, **@resolver_opts) document.instance_variable_set(RESOLVER_VAR_NAME, resolver) nil end -- cgit v1.2.3