Class: Wip::Doctor
- Inherits:
-
Object
- Object
- Wip::Doctor
- Defined in:
- lib/wip/doctor.rb
Overview
Runs environment diagnostics and reports pass/warn/fail results.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(loader:, resolver: CommandResolver.new, environment: Environment.new, compose_resolver: CommandResolver.new(candidates: [], label: 'compose command', install_hint: ComposeBridge::INSTALL_HINT)) ⇒ Doctor
constructor
A new instance of Doctor.
Constructor Details
#initialize(loader:, resolver: CommandResolver.new, environment: Environment.new, compose_resolver: CommandResolver.new(candidates: [], label: 'compose command', install_hint: ComposeBridge::INSTALL_HINT)) ⇒ Doctor
Returns a new instance of Doctor.
10 11 12 13 14 15 16 17 |
# File 'lib/wip/doctor.rb', line 10 def initialize(loader:, resolver: CommandResolver.new, environment: Environment.new, compose_resolver: CommandResolver.new(candidates: [], label: 'compose command', install_hint: ComposeBridge::INSTALL_HINT)) @loader = loader @resolver = resolver @environment = environment @compose_resolver = compose_resolver end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/wip/doctor.rb', line 19 def call results = [] results << result(@environment.wsl2? ? :ok : :fail, *) results << interop_result unless @environment.windows? results << Result.new(:ok, "Architecture: #{@environment.architecture}") config = load_config(results) check_wslc(config, results) if config check_compose(config, results) if config&.compose? results << result(command_available?('git') ? :ok : :warn, 'Git is available', 'Git is not available to the WSLC build environment') results end |