Sha256: 9eabd6cfd21d61eca95bcd312e9fdec065988b913de03d6975a62596ee9a71e1

Contents?: true

Size: 976 Bytes

Versions: 12

Compression:

Stored size: 976 Bytes

Contents

# frozen_string_literal: true

require "refinements/structs"
require "tocer"

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

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

      def initialize configuration,
                     client: ::Tocer::Runner.new,
                     content: ::Tocer::Configuration::Content.new
        @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.merge(root_dir: configuration.project_root)
               .transmute! configuration,
                           includes: :extensions_tocer_includes,
                           label: :extensions_tocer_label
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubysmith-4.9.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.8.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.7.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.6.1 lib/rubysmith/extensions/tocer.rb
rubysmith-4.6.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.5.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.4.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.3.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.2.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.1.0 lib/rubysmith/extensions/tocer.rb
rubysmith-4.0.1 lib/rubysmith/extensions/tocer.rb
rubysmith-4.0.0 lib/rubysmith/extensions/tocer.rb