Class: Wright::Provider::Package::Yum

Inherits:
Wright::Provider::Package show all
Defined in:
lib/wright/provider/package/yum.rb

Overview

Yum package provider. Used as a provider for Resource::Package on Fedora-based systems.

Constant Summary

Constants inherited from Wright::Provider

Wright::Provider::PROVIDER_DIR

Instance Method Summary collapse

Methods inherited from Wright::Provider::Package

#install, #installed?, #remove

Methods inherited from Wright::Provider

#initialize, #updated?

Constructor Details

This class inherits a constructor from Wright::Provider

Instance Method Details

#installed_versionsArray<String>

Returns the installed package versions.

Returns:

  • (Array<String>)

    the installed package versions


13
14
15
16
17
18
# File 'lib/wright/provider/package/yum.rb', line 13

def installed_versions
  version_format = '%{VERSION}-%{RELEASE}'
  rpm_args = %W(-q #{package_name} --qf #{version_format})
  stdout, _, status = Open3.capture3(env, 'rpm', *rpm_args)
  status.success? ? [stdout] : []
end