class Sys::Mount

Attributes

dev[RW]
options[RW]
type[RW]

Public Class Methods

new(line) click to toggle source
# File lib/epitools/sys/mounts.rb, line 18
def initialize(line)
  @path, @dev, @type, @options = line.strip.split(' ')
  @options = @options.split(",")
end

Public Instance Methods

dirname() click to toggle source
# File lib/epitools/sys/mounts.rb, line 40
def dirname
  path.dirs.last
end
inspect() click to toggle source
# File lib/epitools/sys/mounts.rb, line 27
def inspect
  "#{type}: #{path} (#{dev})"
end
path() click to toggle source
# File lib/epitools/sys/mounts.rb, line 35
def path
  # Unescape findmnt's hex codes
  Path.new "#{eval %{"#{@path}"}}/"
end
system?() click to toggle source
# File lib/epitools/sys/mounts.rb, line 23
def system?
  (path =~ %r{^/(sys|dev|proc|run/user|tmp)}) or dev == "systemd-1"
end
to_s() click to toggle source
# File lib/epitools/sys/mounts.rb, line 31
def to_s
  "#{path} (#{dev})"
end