Class: Factorix::CLI::Commands::MOD::Check

Inherits:
Base show all
Defined in:
lib/factorix/cli/commands/mod/check.rb,
sig/factorix/cli/commands/mod/check.rbs

Overview

Validate MOD dependencies without making changes

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

backup_support!, confirmable!, inherited, require_game_stopped!

Instance Attribute Details

#logger ⇒ Dry::Logger::Dispatcher (readonly)

Returns the value of attribute logger.



10
11
12
# File 'sig/factorix/cli/commands/mod/check.rbs', line 10

def logger
  @logger
end

#runtime ⇒ Runtime (readonly)

Returns the value of attribute runtime.

Returns:



11
12
13
# File 'sig/factorix/cli/commands/mod/check.rbs', line 11

def runtime
  @runtime
end

Instance Method Details

#call ⇒ void

This method returns an undefined value.

Execute the check command

Parameters:

  • quiet: (Boolean)

Raises:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/factorix/cli/commands/mod/check.rb', line 25

def call(**)
  mod_list = MODList.load
  presenter = Progress::Presenter.new(title: "\u{1F50D}\u{FE0E} Scanning MOD(s)", output: err)
  handler = Progress::ScanHandler.new(presenter)
  installed_mods = InstalledMOD.all(handler:)
  graph = Dependency::Graph::Builder.build(installed_mods:, mod_list:)

  validator = Dependency::Validator.new(graph:, mod_list:, installed_mods:)
  result = validator.validate

  display_result(result, graph)

  raise ValidationError, "MOD dependency validation failed" unless result.valid?
end