Sha256: 3cb3cc62c99b3d816ef78ade59c7fa75d5498613d6593a651618a58fcdb9f213

Contents?: true

Size: 699 Bytes

Versions: 7

Compression:

Stored size: 699 Bytes

Contents

# frozen_string_literal: true

require "refinements/pathname"
require "tocer"

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

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

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

      def call
        return configuration unless configuration.build_readme

        configuration.project_root.change_dir { client.call ::Tocer::Container[:configuration] }
        configuration
      end

      private

      attr_reader :configuration, :client
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubysmith-6.10.0 lib/rubysmith/extensions/tocer.rb
rubysmith-6.9.0 lib/rubysmith/extensions/tocer.rb
rubysmith-6.6.0 lib/rubysmith/extensions/tocer.rb
rubysmith-6.5.0 lib/rubysmith/extensions/tocer.rb
rubysmith-6.4.0 lib/rubysmith/extensions/tocer.rb
rubysmith-6.3.0 lib/rubysmith/extensions/tocer.rb
rubysmith-6.2.1 lib/rubysmith/extensions/tocer.rb