Class: Vivlio::Starter::CLI::BuildCommands::UnifiedBuildPipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/vivlio/starter/cli/build/pipeline.rb

Overview


UnifiedBuildPipeline: フル/単章ビルド統合パイプライン


  • BuildCommands#build から利用し、各 Step の処理と計時を一元管理する。

  • mode: :full(全章ビルド)または :single(単章/複数章ビルド)

  • single mode では Step 6〜12, 14 をスキップし、Step 5 で entries.js + pdf を生成


Defined Under Namespace

Classes: Step

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, entries: [], mode: :full) ⇒ UnifiedBuildPipeline

Returns a new instance of UnifiedBuildPipeline.

Parameters:

  • command (Samovar::Command)

    ビルドコマンドインスタンス

  • entries (Array<TokenResolver::Entry>) (defaults to: [])

    ビルド対象の Entry 配列

  • mode (:full, :single) (defaults to: :full)

    ビルドモード



31
32
33
34
35
36
37
38
39
40
# File 'lib/vivlio/starter/cli/build/pipeline.rb', line 31

def initialize(command, entries: [], mode: :full)
  @command = command
  @entries = Array(entries)
  @mode = mode
  @options = command.options
  @timings = []
  @steps = []
  @generated_pdf_name = nil
  register_steps
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



26
27
28
# File 'lib/vivlio/starter/cli/build/pipeline.rb', line 26

def entries
  @entries
end

#generated_pdf_nameObject (readonly)

Returns the value of attribute generated_pdf_name.



26
27
28
# File 'lib/vivlio/starter/cli/build/pipeline.rb', line 26

def generated_pdf_name
  @generated_pdf_name
end

#modeObject (readonly)

Returns the value of attribute mode.



26
27
28
# File 'lib/vivlio/starter/cli/build/pipeline.rb', line 26

def mode
  @mode
end

#timingsObject (readonly)

Returns the value of attribute timings.



26
27
28
# File 'lib/vivlio/starter/cli/build/pipeline.rb', line 26

def timings
  @timings
end

Instance Method Details

#runObject

登録済みステップを順に実行し、経過時間を収集する



43
44
45
46
47
48
49
# File 'lib/vivlio/starter/cli/build/pipeline.rb', line 43

def run
  Common.reset_vivliostyle_build_timings
  @steps.each do |step|
    execute(step)
  end
  timings
end