class NativePackageInstaller::Platform::RedHatEnterpriseLinux

Public Class Methods

current_platform?() click to toggle source
# File lib/native-package-installer/platform/red-hat-enterprise-linux.rb, line 22
def current_platform?
  os_release = OSRelease.new
  os_release.id_like.include?("rhel")
end

Public Instance Methods

install_command() click to toggle source
# File lib/native-package-installer/platform/red-hat-enterprise-linux.rb, line 32
def install_command
  if major_version >= 9
    "dnf install --enablerepo=crb -y"
  elsif major_version >= 8
    "dnf install --enablerepo=powertools -y"
  else
    "yum install -y"
  end
end
need_super_user_priviledge?() click to toggle source
# File lib/native-package-installer/platform/red-hat-enterprise-linux.rb, line 42
def need_super_user_priviledge?
  true
end
package(spec) click to toggle source
# File lib/native-package-installer/platform/red-hat-enterprise-linux.rb, line 28
def package(spec)
  spec[:rhel] || spec[:redhat]
end

Private Instance Methods

major_version() click to toggle source
# File lib/native-package-installer/platform/red-hat-enterprise-linux.rb, line 47
def major_version
  major_version_string = File.read("/etc/redhat-release")[/(\d+)/, 0]
  Integer(major_version_string, 10)
end