Class: Inspec::Resources::EtcFstab

Inherits:
Object
  • Object
show all
Includes:
CommentParser, FileReader
Defined in:
lib/resources/etc_fstab.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileReader

#read_file_content

Methods included from CommentParser

#parse_comment_line

Constructor Details

#initialize(fstab_path = nil) ⇒ EtcFstab

Returns a new instance of EtcFstab.



32
33
34
35
36
37
38
# File 'lib/resources/etc_fstab.rb', line 32

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

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



27
28
29
# File 'lib/resources/etc_fstab.rb', line 27

def params
  @params
end

Instance Method Details

#home_mount_optionsObject



55
56
57
58
# File 'lib/resources/etc_fstab.rb', line 55

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

#nfs_file_systemsObject



51
52
53
# File 'lib/resources/etc_fstab.rb', line 51

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