Module: ZypperUtils

Included in:
Zypper::Repository, Zypper::Service, Zypper::Update
Defined in:
lib/zypper/utils.rb

Constant Summary collapse

XML_COMMANDS_GET =
'xml'
PARAMS_FOR_TYPES =
{
  :patch => [
    # ['attribute_key', :type_to_convert_to],
    [:interactive, :boolean],
    [:pkgmanager, :boolean],
    [:restart, :boolean],
  ],
  :repo => [
    [:autorefresh, :boolean],
    [:gpgcheck, :boolean],
    [:enabled, :boolean],
  ],
  :service => [
    [:autorefresh, :boolean],
    [:enabled, :boolean],
    # Treat :repo entry as :repo subitem
    [:repo, :subitem],
  ],
}
ATTRIBUTE_STARTS_WITH =

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Only getters are public



57
58
59
# File 'lib/zypper/utils.rb', line 57

def config
  @config
end

#last_error_messageObject

Only getters are public



57
58
59
# File 'lib/zypper/utils.rb', line 57

def last_error_message
  @last_error_message
end

#last_exit_statusObject

Only getters are public



57
58
59
# File 'lib/zypper/utils.rb', line 57

def last_exit_status
  @last_exit_status
end

#last_messageObject

Only getters are public



57
58
59
# File 'lib/zypper/utils.rb', line 57

def last_message
  @last_message
end

Instance Method Details

#initialize(params = {}) ⇒ Object

Constructor

See Zypper::Config new() for more info

Parameters:

  • either

    instance of Zypper::Config class or hash of options for new Zypper::Config class



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/zypper/utils.rb', line 65

def initialize(params = {})
  # Config is the given parameter
  if (params.instance_of?(Zypper::Config))
    self.config = params
  # Called directly
  elsif (params.is_a?(Hash))
    self.config = Zypper::Config.new params
  # Unknown call method
  else
    raise "Parameters #{params.inspect} is neither Zypper::Config nor Hash with options"
  end
end