Class: EC2::Platform::Linux::System

Inherits:
Base::System show all
Defined in:
lib/ec2/platform/linux.rb

Constant Summary collapse

BUNDLING_ARCHITECTURE =
EC2::Platform::Linux::Architecture.bundling

Constants inherited from Base::System

Base::System::MOUNT_POINT

Class Method Summary collapse

Methods inherited from Base::System

exec

Class Method Details

.distributionObject

———————————————————————#



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/ec2/platform/linux.rb', line 63

def self.distribution
  Distribution::IDENTITIES.each do |file, distro, regex|
    if File.exists? file 
      if regex.is_a? Regexp
        return distro if regex.match((IO.read file rescue nil))
      else              
        return distro
      end
    end
  end
  return Distribution::UNKNOWN
end

.superuser?Boolean

———————————————————————#

Returns:

  • (Boolean)


77
78
79
# File 'lib/ec2/platform/linux.rb', line 77

def self.superuser?()
  return `id -u`.strip == '0'
end