Module: LinuxAdmin::Distros
- Defined in:
- lib/linux_admin/distro.rb
Defined Under Namespace
Classes: Distro
Class Method Summary collapse
Class Method Details
.all ⇒ Object
26 27 28 |
# File 'lib/linux_admin/distro.rb', line 26 def self.all @distros ||= [rhel, fedora, ubuntu, generic] end |
.fedora ⇒ Object
18 19 20 |
# File 'lib/linux_admin/distro.rb', line 18 def self.fedora @fedora ||= Distro.new(:fedora, "/etc/fedora-release", ['Fedora'], LinuxAdmin::Rpm) end |
.generic ⇒ Object
10 11 12 |
# File 'lib/linux_admin/distro.rb', line 10 def self.generic @generic ||= Distro.new(:generic) end |
.local ⇒ Object
30 31 32 33 34 |
# File 'lib/linux_admin/distro.rb', line 30 def self.local @local ||= begin Distros.all.detect(&:detected?) || Distros.generic end end |
.rhel ⇒ Object
14 15 16 |
# File 'lib/linux_admin/distro.rb', line 14 def self.rhel @rhel ||= Distro.new(:rhel, '/etc/redhat-release', ['red hat', 'centos'], LinuxAdmin::Rpm) end |
.ubuntu ⇒ Object
22 23 24 |
# File 'lib/linux_admin/distro.rb', line 22 def self.ubuntu @ubuntu ||= Distro.new(:ubuntu, nil, ['ubuntu'], LinuxAdmin::Deb) end |