Class: Zypper::Package
Defined Under Namespace
Classes: Status
Constant Summary collapse
Constants inherited from Update
Update::DEFALUT_TYPE, Update::KNOWN_TYPES
Constants included from ZypperUtils
ZypperUtils::ATTRIBUTE_STARTS_WITH, ZypperUtils::PARAMS_FOR_TYPES, ZypperUtils::XML_COMMANDS_GET
Instance Attribute Summary
Attributes included from ZypperUtils
#config, #last_error_message, #last_exit_status, #last_message
Instance Method Summary collapse
-
#available(options = {}) ⇒ Object
Returns all available packages (that are not installed yet).
-
#find(options = {}) ⇒ Object
Returns packages found using given parameters.
-
#info(options = {}) ⇒ Object
Returns hash of information on a package given as parameter (string) :package.
-
#install(options = {}) ⇒ Object
Installs packages given as parmeter (array) :packages.
-
#installed(options = {}) ⇒ Object
Returns all installed packages.
-
#installed?(options = {}) ⇒ Boolean
returns whether a package given as parameter is installed (string) :package.
-
#remove(options = {}) ⇒ Object
Removes packages given as parmeter (array) :packages.
-
#updates(options = {}) ⇒ Object
Finds all package updates.
Methods inherited from Update
Methods included from ZypperUtils
Instance Method Details
#available(options = {}) ⇒ Object
Returns all available packages (that are not installed yet)
61 62 63 |
# File 'lib/zypper/package.rb', line 61 def available( = {}) find(.merge(:status => Status::AVAILABLE)) end |
#find(options = {}) ⇒ Object
Returns packages found using given parameters
47 48 49 50 51 52 53 |
# File 'lib/zypper/package.rb', line 47 def find( = {}) = {:cmd_options => ['--type package'], :quiet => true} if (run (build_command('search', .merge()))) convert_packages() end end |
#info(options = {}) ⇒ Object
Returns hash of information on a package given as parameter
(string) :package
30 31 32 33 34 |
# File 'lib/zypper/package.rb', line 30 def info( = {}) if (run(build_command('info', ))) convert_info() end end |
#install(options = {}) ⇒ Object
Installs packages given as parmeter
(array) :packages
18 19 20 |
# File 'lib/zypper/package.rb', line 18 def install( = {}) run build_command('install', ) end |
#installed(options = {}) ⇒ Object
Returns all installed packages
56 57 58 |
# File 'lib/zypper/package.rb', line 56 def installed( = {}) find(.merge(:status => Status::INSTALLED)) end |
#installed?(options = {}) ⇒ Boolean
returns whether a package given as parameter is installed
(string) :package
38 39 40 |
# File 'lib/zypper/package.rb', line 38 def installed?( = {}) info().fetch(Status::INSTALLED, 'No') == 'Yes' end |
#remove(options = {}) ⇒ Object
Removes packages given as parmeter
(array) :packages
24 25 26 |
# File 'lib/zypper/package.rb', line 24 def remove( = {}) run build_command('remove', ) end |
#updates(options = {}) ⇒ Object
Finds all package updates
66 67 68 |
# File 'lib/zypper/package.rb', line 66 def updates( = {}) find_updates(.merge(:type => :package)) end |