Sha256: 36d11b91726309d4de203a1e982015fb555b6665f89ce763be9c31985856ae9e

Contents?: true

Size: 365 Bytes

Versions: 3

Compression:

Stored size: 365 Bytes

Contents

# -*- coding: utf-8 -*-
module Keystone::Os
  class Linux < Unix
    def self.get
      Dir.glob("/etc/*{-release,_version}").each do |file|
        content = File.open(file).read
        if content =~ /CentOS release (\d*)/
          os = Centos.new
          os.version = $1.to_i
          return os
        end
      end
      return Linux.new
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
keystone-0.0.32 lib/keystone/os/linux.rb
keystone-0.0.31 lib/keystone/os/linux.rb
keystone-0.0.30 lib/keystone/os/linux.rb