Class: EC2::Platform::Linux::System
- Inherits:
-
Base::System
- Object
- Base::System
- EC2::Platform::Linux::System
- Defined in:
- lib/ec2/platform/linux.rb
Constant Summary collapse
- BUNDLING_ARCHITECTURE =
EC2::Platform::Linux::Architecture.bundling
Constants inherited from Base::System
Class Method Summary collapse
-
.distribution ⇒ Object
———————————————————————#.
-
.superuser? ⇒ Boolean
———————————————————————#.
Methods inherited from Base::System
Class Method Details
.distribution ⇒ Object
———————————————————————#
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
———————————————————————#
77 78 79 |
# File 'lib/ec2/platform/linux.rb', line 77 def self.superuser?() return `id -u`.strip == '0' end |