Sha256: 470dff24921ddcba949d314a98a27e70802d72ec8260d126884b54d33ffe3047

Contents?: true

Size: 730 Bytes

Versions: 10

Compression:

Stored size: 730 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(package)}-#{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, option='')
      if version
        full_package = "#{package}-#{version}"
      else
        full_package = package
      end
      cmd = "yum -y #{option} install #{full_package}"
    end
  end
end









Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
specinfra-2.18.1 lib/specinfra/command/redhat/base/package.rb
specinfra-2.18.0 lib/specinfra/command/redhat/base/package.rb
specinfra-2.17.1 lib/specinfra/command/redhat/base/package.rb
specinfra-2.17.0 lib/specinfra/command/redhat/base/package.rb
specinfra-2.16.0 lib/specinfra/command/redhat/base/package.rb
specinfra-2.15.2 lib/specinfra/command/redhat/base/package.rb
specinfra-2.15.1 lib/specinfra/command/redhat/base/package.rb
specinfra-2.15.0 lib/specinfra/command/redhat/base/package.rb
specinfra-2.14.4 lib/specinfra/command/redhat/base/package.rb
specinfra-2.14.3 lib/specinfra/command/redhat/base/package.rb