Sha256: 160fc1d68cae849e7f7fa7bfa181c64c19d5bd93303ef1421d4f4fda91c6e20b

Contents?: true

Size: 480 Bytes

Versions: 14

Compression:

Stored size: 480 Bytes

Contents

module Datacenter
  class OS

    def initialize(shell=nil)
      @shell = shell || Shell::Localhost.new
    end

    def name
      shell.run 'uname -o'
    end

    def distribution
      shell.run('lsb_release -i').split(':')[1].strip
    end

    def version
      shell.run('lsb_release -r').split(':')[1].strip
    end

    def kernel
      shell.run 'uname -r'
    end

    def platform
      shell.run 'uname -i'
    end

    private

    attr_reader :shell
    
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
datacenter-0.5.1 lib/datacenter/os.rb
datacenter-0.5.0 lib/datacenter/os.rb
datacenter-0.4.4 lib/datacenter/os.rb
datacenter-0.4.3 lib/datacenter/os.rb
datacenter-0.4.2 lib/datacenter/os.rb
datacenter-0.4.0 lib/datacenter/os.rb
datacenter-0.3.1 lib/datacenter/os.rb
datacenter-0.2.2 lib/datacenter/os.rb
datacenter-0.2.1 lib/datacenter/os.rb
datacenter-0.2.0 lib/datacenter/os.rb
datacenter-0.1.2 lib/datacenter/os.rb
datacenter-0.1.1 lib/datacenter/os.rb
datacenter-0.1.0 lib/datacenter/os.rb
datacenter-0.0.1 lib/datacenter/os.rb