Class: VivlioStarter::CLI::DoctorCommands::ToolUpgrader::Tool

Inherits:
Data
  • Object
show all
Defined in:
lib/vivlio_starter/cli/doctor/tool_upgrader.rb

Overview

ツール定義。checks は doctor.rb の診断ラベル(missing 判定との突き合わせ用)。 brew formula / npm パッケージ名の正典はこの表であり、--fix のインストール処理も brew_install_packages 経由でここを参照する(doctor.rb 側と二重管理しない・spec §4-1)。

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#checksObject (readonly)

Returns the value of attribute checks

Returns:

  • (Object)

    the current value of checks



52
53
54
# File 'lib/vivlio_starter/cli/doctor/tool_upgrader.rb', line 52

def checks
  @checks
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



52
53
54
# File 'lib/vivlio_starter/cli/doctor/tool_upgrader.rb', line 52

def kind
  @kind
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



52
53
54
# File 'lib/vivlio_starter/cli/doctor/tool_upgrader.rb', line 52

def label
  @label
end

#packageObject (readonly)

Returns the value of attribute package

Returns:

  • (Object)

    the current value of package



52
53
54
# File 'lib/vivlio_starter/cli/doctor/tool_upgrader.rb', line 52

def package
  @package
end

Instance Method Details

#matches_formula?(name) ⇒ Boolean

brew の導入記録との突き合わせ。node はバージョン付き別名(node@20 等)で 導入されていることがあるため前方一致相当で拾う

Returns:

  • (Boolean)


55
56
57
58
59
# File 'lib/vivlio_starter/cli/doctor/tool_upgrader.rb', line 55

def matches_formula?(name)
  return name.match?(/\Anode(@\d+)?\z/) if package == 'node'

  name == package
end