Class: Machinery::MountPoints
Constant Summary collapse
- REMOTE_FILE_SYSTEMS =
["autofs", "cifs", "nfs", "nfs4"]
- SPECIAL_FILE_SYSTEMS =
["proc", "sysfs", "devtmpfs", "tmpfs", "fuse.gvfs-fuse-daemon"]
- LOCAL_FILE_SYSTEMS =
["ext2", "ext3", "ext4", "reiserfs", "btrfs", "vfat", "xfs", "jfs"]
Instance Attribute Summary collapse
-
#mounts ⇒ Object
readonly
Returns the value of attribute mounts.
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(system) ⇒ MountPoints
constructor
A new instance of MountPoints.
- #local ⇒ Object
- #remote ⇒ Object
- #special ⇒ Object
Constructor Details
#initialize(system) ⇒ MountPoints
Returns a new instance of MountPoints.
39 40 41 |
# File 'lib/mountpoints.rb', line 39 def initialize(system) @mounts = parse_mounts(system.read_file("/proc/mounts")) end |
Instance Attribute Details
#mounts ⇒ Object (readonly)
Returns the value of attribute mounts.
35 36 37 |
# File 'lib/mountpoints.rb', line 35 def mounts @mounts end |
Instance Method Details
#all ⇒ Object
55 56 57 |
# File 'lib/mountpoints.rb', line 55 def all @mounts.keys end |
#local ⇒ Object
51 52 53 |
# File 'lib/mountpoints.rb', line 51 def local @mounts.select { |_fs_file, fs_vfstype| local_fs?(fs_vfstype) }.keys end |
#remote ⇒ Object
47 48 49 |
# File 'lib/mountpoints.rb', line 47 def remote @mounts.select { |_fs_file, fs_vfstype| remote_fs?(fs_vfstype) }.keys end |
#special ⇒ Object
43 44 45 |
# File 'lib/mountpoints.rb', line 43 def special @mounts.select { |_fs_file, fs_vfstype| special_fs?(fs_vfstype) }.keys end |