Sha256: 988b57407d6beff7c0719b44ba222413c4a88dafb268ab25d3e6cb48b539a31d

Contents?: true

Size: 874 Bytes

Versions: 2

Compression:

Stored size: 874 Bytes

Contents

# frozen_string_literal: true

require "tocer"

module Rubysmith
  module Extensions
    # Ensures project skeleton documentation has table of contents.
    class Tocer
      def self.call(...) = new(...).call

      def initialize configuration,
                     client: ::Tocer::Runner.new,
                     content: ::Tocer::Configuration::Content
        @configuration = configuration
        @client = client
        @content = content
      end

      def call
        client.call(settings) if configuration.build_readme
        configuration
      end

      private

      attr_reader :configuration, :client, :content

      def settings
        content[
          includes: configuration.extensions_tocer_includes,
          label: configuration.extensions_tocer_label,
          root_dir: configuration.project_root
        ]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubysmith-1.1.0 lib/rubysmith/extensions/tocer.rb
rubysmith-1.0.0 lib/rubysmith/extensions/tocer.rb