Method: Inspec::Resources::Mount#method_missing

Defined in:
lib/resources/mount.rb

#method_missing(name) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/resources/mount.rb', line 39

def method_missing(name)
  return nil if !file.mounted?

  mounted = file.mounted
  return nil if mounted.nil? || mounted.stdout.nil?

  line = mounted.stdout
  # if we got multiple lines, only use the last entry
  line = mounted.stdout.lines.to_a.last if mounted.stdout.lines.count > 1

  # parse content if we are on linux
  @mount_options ||= @mount_manager.parse_mount_options(line)
  @mount_options[name]
end