Class: DInstaller::DBus::Clients::Manager

Inherits:
Base
  • Object
show all
Includes:
WithServiceStatus, WithProgress
Defined in:
lib/dinstaller/dbus/clients/manager.rb

Overview

D-Bus client for manager service

Instance Attribute Summary

Attributes included from WithProgress

#progress

Instance Method Summary collapse

Methods included from WithProgress

#on_progress_change, #on_progress_finish, #start_progress

Methods included from WithServiceStatus

#on_service_status_change, #service_status, #to_service_status

Methods inherited from Base

#service

Constructor Details

#initializeManager

Returns a new instance of Manager.



36
37
38
39
40
41
# File 'lib/dinstaller/dbus/clients/manager.rb', line 36

def initialize
  super

  @dbus_object = service["/org/opensuse/DInstaller/Manager1"]
  @dbus_object.introspect
end

Instance Method Details

#commitObject

Starts the installation



52
53
54
# File 'lib/dinstaller/dbus/clients/manager.rb', line 52

def commit
  dbus_object.Commit
end

#current_installation_phaseObject



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/dinstaller/dbus/clients/manager.rb', line 56

def current_installation_phase
  dbus_phase = dbus_object["org.opensuse.DInstaller.Manager1"]["CurrentInstallationPhase"]

  case dbus_phase
  when DBus::Manager::STARTUP_PHASE
    InstallationPhase::STARTUP
  when DBus::Manager::CONFIG_PHASE
    InstallationPhase::CONFIG
  when DBus::Manager::INSTALL_PHASE
    InstallationPhase::INSTALL
  end
end

#probeObject



47
48
49
# File 'lib/dinstaller/dbus/clients/manager.rb', line 47

def probe
  dbus_object.Probe
end

#service_nameObject



43
44
45
# File 'lib/dinstaller/dbus/clients/manager.rb', line 43

def service_name
  @service_name ||= "org.opensuse.DInstaller"
end