Class: EC2::Platform::Linux::Mtab
- Inherits:
-
Object
- Object
- EC2::Platform::Linux::Mtab
- Defined in:
- lib/ec2/platform/linux/mtab.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- LOCATION =
'/etc/mtab'
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename = LOCATION) ⇒ Mtab
constructor
A new instance of Mtab.
Constructor Details
#initialize(filename = LOCATION) ⇒ Mtab
Returns a new instance of Mtab.
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ec2/platform/linux/mtab.rb', line 55 def initialize(filename = LOCATION) begin f = File.new(filename, File::RDONLY) rescue SystemCallError => e raise FileError(filename, "could not open #{filename} to read mount table", e) end @entries = Hash.new f.readlines.each do |line| entry = Entry.parse(line) @entries[entry.mpoint] = entry unless entry.nil? end end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
52 53 54 |
# File 'lib/ec2/platform/linux/mtab.rb', line 52 def entries @entries end |
Class Method Details
.load ⇒ Object
68 69 70 |
# File 'lib/ec2/platform/linux/mtab.rb', line 68 def self.load self.new() end |