Class: Vivlio::Starter::CLI::TocCommands::TocCommandExecutor
- Inherits:
-
Object
- Object
- Vivlio::Starter::CLI::TocCommands::TocCommandExecutor
- Defined in:
- lib/vivlio/starter/cli/toc.rb
Overview
toc コマンドのエントリ処理を統括する
Constant Summary collapse
- BASE_DIR =
Pathname.new('.').
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options, htmls) ⇒ TocCommandExecutor
constructor
A new instance of TocCommandExecutor.
Constructor Details
#initialize(options, htmls) ⇒ TocCommandExecutor
Returns a new instance of TocCommandExecutor.
35 36 37 38 |
# File 'lib/vivlio/starter/cli/toc.rb', line 35 def initialize(, htmls) @options = || {} @resolver = HtmlTargetResolver.new(htmls, base_dir: BASE_DIR) end |
Instance Method Details
#call ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/vivlio/starter/cli/toc.rb', line 40 def call apply_verbose targets = resolver.resolve return warn_no_targets if targets.empty? log_targets(targets) entry_map = build_entry_map(targets) document = TocDocumentBuilder.new(entry_map, base_dir: BASE_DIR).build TocOutputWriter.new(document, base_dir: BASE_DIR).write end |