Class: Rubysmith::Extensions::Tocer

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/extensions/tocer.rb

Overview

Ensures project skeleton documentation has table of content.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, client: ::Tocer::Runner.new) ⇒ Tocer

Returns a new instance of Tocer.



14
15
16
17
# File 'lib/rubysmith/extensions/tocer.rb', line 14

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

Class Method Details

.callObject



12
# File 'lib/rubysmith/extensions/tocer.rb', line 12

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

Instance Method Details

#callObject



19
20
21
22
23
24
# File 'lib/rubysmith/extensions/tocer.rb', line 19

def call
  return configuration unless configuration.build_readme

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