Class: VivlioStarter::CLI::Guards::NodeCheck
- Defined in:
- lib/vivlio_starter/cli/guards/node_check.rb
Overview
Node.js が利用可能かを検証する(Vivliostyle CLI / VFM の実行に必須)。 詳細な環境診断・自動セットアップは vs doctor の責務のため、ここでは存在確認のみ。
Instance Method Summary collapse
-
#initialize(runner: Kernel) ⇒ NodeCheck
constructor
A new instance of NodeCheck.
- #validate ⇒ Object
Constructor Details
#initialize(runner: Kernel) ⇒ NodeCheck
Returns a new instance of NodeCheck.
10 11 12 13 |
# File 'lib/vivlio_starter/cli/guards/node_check.rb', line 10 def initialize(runner: Kernel) @runner = runner super() end |
Instance Method Details
#validate ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/vivlio_starter/cli/guards/node_check.rb', line 15 def validate return [] if @runner.system('node', '--version', out: File::NULL, err: File::NULL) [error( 'Node.js が見つかりません(PDF 生成に必須です)', detail: '対処: vs doctor --fix で必要ツールをセットアップできます' )] end |