<commit_before>require_relative '../util/diagram'
require_relative 'generator'

module Asciidoctor
  module Diagram
    module ShaapeBase
      include ShaapeGenerator

      private

      def register_formats
        register_format(:png, :image) do |c, p|
          shaape(p, c, :png)
        end

        register_format(:svg, :image) do |c, p|
          shaape(p, c, :svg)
        end
      end
    end

    class ShaapeBlock < Asciidoctor::Extensions::BlockProcessor
      include DiagramProcessorBase
      include ShaapeBase

      def initialize(context, document, opts = {})
        super
        register_formats
      end
    end

    class ShaapeBlockMacro < Asciidoctor::Extensions::BlockMacroProcessor
      include DiagramProcessorBase
      include ShaapeBase

      def initialize(context, document, opts = {})
        super
        register_formats
      end
    end
  end
end<commit_msg>Make shaape extension class constructor asciidoctor 1.5 compatible<commit_after>require_relative '../util/diagram'
require_relative 'generator'

module Asciidoctor
  module Diagram
    module ShaapeBase
      include ShaapeGenerator

      private

      def register_formats
        register_format(:png, :image) do |c, p|
          shaape(p, c, :png)
        end

        register_format(:svg, :image) do |c, p|
          shaape(p, c, :svg)
        end
      end
    end

    class ShaapeBlock < Asciidoctor::Extensions::BlockProcessor
      include DiagramProcessorBase
      include ShaapeBase

      def initialize name = nil, config = {}
        super
        register_formats
      end
    end

    class ShaapeBlockMacro < Asciidoctor::Extensions::BlockMacroProcessor
      include DiagramProcessorBase
      include ShaapeBase

      def initialize name = nil, config = {}
        super
        register_formats
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06415094339622641, 'fraction_numerical': 0.001078167115902965, 'mean_word_length': 2.3806921675774135, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2879173', 'n_tokens_mistral': 525, 'n_tokens_neox': 511, 'n_words': 142}