Class: Chef::Provider::Package::Yum::YumCache
- Inherits:
-
Object
- Object
- Chef::Provider::Package::Yum::YumCache
- Includes:
- Singleton
- Defined in:
- lib/chef/provider/package/yum/yum_cache.rb
Instance Method Summary collapse
- #available_version(name, arch = nil) ⇒ Object
- #installed_version(name, arch = nil) ⇒ Object
- #package_available?(name, arch = nil) ⇒ Boolean
- #python_helper ⇒ Object private
- #refresh ⇒ Object
- #reload ⇒ Object
- #reload_installed ⇒ Object
- #reload_provides ⇒ Object
- #reset ⇒ Object
- #reset_installed ⇒ Object
-
#version_available?(name, version, arch = nil) ⇒ Boolean
NOTE that it is the responsibility of the python_helper to get these APIs correct and we do not do any validation here that the e.g.
Instance Method Details
#available_version(name, arch = nil) ⇒ Object
60 61 62 63 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 60 def available_version(name, arch = nil) p = python_helper.package_query(:whatavailable, name, arch: arch) "#{p.version}.#{p.arch}" unless p.version.nil? end |
#installed_version(name, arch = nil) ⇒ Object
65 66 67 68 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 65 def installed_version(name, arch = nil) p = python_helper.package_query(:whatinstalled, name, arch: arch) "#{p.version}.#{p.arch}" unless p.version.nil? end |
#package_available?(name, arch = nil) ⇒ Boolean
70 71 72 73 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 70 def package_available?(name, arch = nil) p = python_helper.package_query(:whatavailable, name, arch: arch) !p.version.nil? end |
#python_helper ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
85 86 87 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 85 def python_helper @python_helper ||= PythonHelper.instance end |
#refresh ⇒ Object
36 37 38 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 36 def refresh python_helper.restart end |
#reload ⇒ Object
40 41 42 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 40 def reload python_helper.restart end |
#reload_installed ⇒ Object
44 45 46 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 44 def reload_installed python_helper.restart end |
#reload_provides ⇒ Object
48 49 50 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 48 def reload_provides python_helper.restart end |
#reset ⇒ Object
52 53 54 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 52 def reset python_helper.restart end |
#reset_installed ⇒ Object
56 57 58 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 56 def reset_installed python_helper.restart end |
#version_available?(name, version, arch = nil) ⇒ Boolean
NOTE that it is the responsibility of the python_helper to get these APIs correct and we do not do any validation here that the e.g. version or arch matches the requested value (because the bigger issue there is a buggy+broken python_helper -- so don't try to fix those kinds of bugs here)
79 80 81 82 |
# File 'lib/chef/provider/package/yum/yum_cache.rb', line 79 def version_available?(name, version, arch = nil) p = python_helper.package_query(:whatavailable, name, version: version, arch: arch) !p.version.nil? end |