class Datacenter::OS
Attributes
shell[R]
Public Class Methods
new(shell=nil)
click to toggle source
# File lib/datacenter/os.rb, line 4 def initialize(shell=nil) @shell = shell || Shell::Localhost.new end
Public Instance Methods
distribution()
click to toggle source
# File lib/datacenter/os.rb, line 12 def distribution shell.run('lsb_release -i').split(':')[1].strip end
kernel()
click to toggle source
# File lib/datacenter/os.rb, line 20 def kernel shell.run 'uname -r' end
name()
click to toggle source
# File lib/datacenter/os.rb, line 8 def name shell.run 'uname -o' end
platform()
click to toggle source
# File lib/datacenter/os.rb, line 24 def platform shell.run 'uname -i' end
version()
click to toggle source
# File lib/datacenter/os.rb, line 16 def version shell.run('lsb_release -r').split(':')[1].strip end