Sha256: efb1d353aa8e3d52a4dfa966cff684bd927eead3ad376cbffd4fd716394e2ee4

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

class Specinfra::Command::Redhat::Base::Package < Specinfra::Command::Linux::Base::Package
  class << self
    def check_is_installed(package, version=nil)
      cmd = "rpm -q #{escape(package)}"
      if version
        cmd = "#{cmd} | grep -w -- #{escape(version)}"
      end
      cmd
    end

    alias :check_is_installed_by_rpm :check_is_installed

    def get_version(package, opts=nil)
      "rpm -qi #{package} | grep Version | awk '{print $3}'"
    end

    def install(package, version=nil)
      if version
        full_package = "#{package}-#{version}"
      else
        full_package = package
      end
      cmd = "yum -y install #{full_package}"
    end
  end
end









Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta40 lib/specinfra/command/redhat/base/package.rb
specinfra-2.0.0.beta39 lib/specinfra/command/redhat/base/package.rb
specinfra-2.0.0.beta38 lib/specinfra/command/redhat/base/package.rb