Class: DInstaller::DBus::Manager
- Inherits:
-
BaseObject
- Object
- DBus::Object
- BaseObject
- DInstaller::DBus::Manager
- Defined in:
- lib/dinstaller/dbus/manager.rb
Overview
D-Bus object to manage the installation process
Constant Summary collapse
- STARTUP_PHASE =
0- CONFIG_PHASE =
1- INSTALL_PHASE =
2
Constants included from Interfaces::ServiceStatus
Interfaces::ServiceStatus::SERVICE_STATUS_BUSY, Interfaces::ServiceStatus::SERVICE_STATUS_IDLE, Interfaces::ServiceStatus::SERVICE_STATUS_INTERFACE
Constants included from Interfaces::Progress
Interfaces::Progress::PROGRESS_INTERFACE
Instance Method Summary collapse
-
#busy_services ⇒ Array<String>
Name of the services that are currently busy.
-
#config_phase ⇒ Object
Runs the config phase.
-
#current_installation_phase ⇒ Integer
Current value of the installation phase.
-
#initialize(backend, logger) ⇒ Manager
constructor
Constructor.
-
#install_phase ⇒ Object
Runs the install phase.
-
#installation_phases ⇒ Array<Hash>
Description of all possible installation phase values.
Methods included from Interfaces::ServiceStatus
included, #register_service_status_callbacks, #service_status_all, #service_status_current
Methods included from Interfaces::Progress
included, #progress_current_step, #progress_finished, #progress_properties, #progress_total_steps, #register_progress_callbacks
Methods included from WithServiceStatus
Methods inherited from BaseObject
Constructor Details
#initialize(backend, logger) ⇒ Manager
Constructor
44 45 46 47 48 49 50 |
# File 'lib/dinstaller/dbus/manager.rb', line 44 def initialize(backend, logger) super(PATH, logger: logger) @backend = backend register_callbacks register_progress_callbacks register_service_status_callbacks end |
Instance Method Details
#busy_services ⇒ Array<String>
Name of the services that are currently busy
104 105 106 |
# File 'lib/dinstaller/dbus/manager.rb', line 104 def busy_services backend.busy_services end |
#config_phase ⇒ Object
Runs the config phase
68 69 70 71 72 |
# File 'lib/dinstaller/dbus/manager.rb', line 68 def config_phase safe_run do busy_while { backend.config_phase } end end |
#current_installation_phase ⇒ Integer
Current value of the installation phase
95 96 97 98 99 |
# File 'lib/dinstaller/dbus/manager.rb', line 95 def current_installation_phase return STARTUP_PHASE if backend.installation_phase.startup? return CONFIG_PHASE if backend.installation_phase.config? return INSTALL_PHASE if backend.installation_phase.install? end |
#install_phase ⇒ Object
Runs the install phase
75 76 77 78 79 |
# File 'lib/dinstaller/dbus/manager.rb', line 75 def install_phase safe_run do busy_while { backend.install_phase } end end |
#installation_phases ⇒ Array<Hash>
Description of all possible installation phase values
84 85 86 87 88 89 90 |
# File 'lib/dinstaller/dbus/manager.rb', line 84 def installation_phases [ { "id" => STARTUP_PHASE, "label" => "startup" }, { "id" => CONFIG_PHASE, "label" => "config" }, { "id" => INSTALL_PHASE, "label" => "install" } ] end |