Module: DInstallerCli::Commands::EnsureConfigPhase
Overview
Note:
Requires a #manager_client method that returns an instance of DInstaller::DBus::Clients::Manager.
Mixin that provides methods to ensure a specific installation phase while running code
Instance Method Summary collapse
-
#config_phase? ⇒ Boolean
Whether the manager client is in config phase.
-
#ensure_config_phase(&block) ⇒ Object
Ensures the config phase is executed before calling the given block.
Instance Method Details
#config_phase? ⇒ Boolean
Whether the manager client is in config phase
42 43 44 |
# File 'lib/dinstaller_cli/commands/ensure_config_phase.rb', line 42 def config_phase? manager_client.current_installation_phase == DInstaller::InstallationPhase::CONFIG end |
#ensure_config_phase(&block) ⇒ Object
Ensures the config phase is executed before calling the given block
34 35 36 37 |
# File 'lib/dinstaller_cli/commands/ensure_config_phase.rb', line 34 def ensure_config_phase(&block) manager_client.probe unless config_phase? block.call end |