class Inspec::Resources::EtcFstab

def home_mount_options

def home_mount_options
  return nil unless where { mount_point == '/home' }.configured?
  where { mount_point == '/home' }.entries[0].mount_options
end

def initialize(fstab_path = nil)

def initialize(fstab_path = nil)
  @conf_path      = fstab_path || '/etc/fstab'
  @files_contents = {}
  @content        = nil
  @params         = nil
  read_content
end

def nfs_file_systems

def nfs_file_systems
  where { file_system_type.match(/nfs/) }
end

def parse_conf(content)

def parse_conf(content)
  content.map do |line|
    data, = parse_comment_line(line, comment_char: '#', standalone_comments: false)
    parse_line(data) unless data == ''
  end.compact
end

def parse_line(line)

def parse_line(line)
  attributes = line.split
  {
    'device_name'         => attributes[0],
    'mount_point'         => attributes[1],
    'file_system_type'    => attributes[2],
    'mount_options'       => attributes[3].split(','),
    'dump_options'        => attributes[4].to_i,
    'file_system_options' => attributes[5].to_i,
  }
end

def read_content

def read_content
  @content = ''
  @params  = {}
  @content = read_file(@conf_path)
  @params  = parse_conf(@content)
end

def read_file(conf_path = @conf_path)

def read_file(conf_path = @conf_path)
  read_file_content(conf_path).lines
end