Class: Datacenter::OS
- Inherits:
-
Object
- Object
- Datacenter::OS
- Defined in:
- lib/datacenter/os.rb
Instance Method Summary collapse
- #distribution ⇒ Object
-
#initialize(shell = nil) ⇒ OS
constructor
A new instance of OS.
- #kernel ⇒ Object
- #name ⇒ Object
- #platform ⇒ Object
- #version ⇒ Object
Constructor Details
Instance Method Details
#distribution ⇒ Object
12 13 14 |
# File 'lib/datacenter/os.rb', line 12 def distribution shell.run('lsb_release -i').split(':')[1].strip end |
#kernel ⇒ Object
20 21 22 |
# File 'lib/datacenter/os.rb', line 20 def kernel shell.run 'uname -r' end |
#name ⇒ Object
8 9 10 |
# File 'lib/datacenter/os.rb', line 8 def name shell.run 'uname -o' end |
#platform ⇒ Object
24 25 26 |
# File 'lib/datacenter/os.rb', line 24 def platform shell.run 'uname -i' end |
#version ⇒ Object
16 17 18 |
# File 'lib/datacenter/os.rb', line 16 def version shell.run('lsb_release -r').split(':')[1].strip end |