Class: NativePackageInstaller::Platform::RedHatEnterpriseLinux

Inherits:
Object
  • Object
show all
Defined in:
lib/native-package-installer/platform/red-hat-enterprise-linux.rb

Direct Known Subclasses

AmazonLinux2

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.current_platform?Boolean

Returns:

  • (Boolean)


22
23
24
25
# 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

Instance Method Details

#install_commandObject



32
33
34
35
36
37
38
39
40
# 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?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/native-package-installer/platform/red-hat-enterprise-linux.rb', line 42

def need_super_user_priviledge?
  true
end

#package(spec) ⇒ Object



28
29
30
# File 'lib/native-package-installer/platform/red-hat-enterprise-linux.rb', line 28

def package(spec)
  spec[:rhel] || spec[:redhat]
end