Sha256: 0e28f014e4f1f25caa7c56b8d30ac4e3a1802e47792d36b5327f0d32bf577dff

Contents?: true

Size: 965 Bytes

Versions: 11

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

require "refinements/structs"
require "tocer"

module Rubysmith
  module Extensions
    # Ensures project skeleton documentation has table of content.
    class Tocer
      using Refinements::Structs

      def self.call(...) = new(...).call

      def initialize configuration,
                     client: ::Tocer::Runner.new,
                     record: ::Tocer::Configuration::Model.new
        @configuration = configuration
        @client = client
        @record = record
      end

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

      private

      attr_reader :configuration, :client, :record

      def settings
        record.merge(root_dir: configuration.project_root)
              .transmute! configuration,
                          label: :extensions_tocer_label,
                          patterns: :extensions_tocer_patterns
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rubysmith-5.9.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.8.1 lib/rubysmith/extensions/tocer.rb
rubysmith-5.8.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.7.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.6.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.5.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.4.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.3.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.2.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.1.0 lib/rubysmith/extensions/tocer.rb
rubysmith-5.0.1 lib/rubysmith/extensions/tocer.rb