Class: EtcFstab
- Inherits:
-
Object
- Object
- EtcFstab
- Includes:
- CommentParser
- Defined in:
- lib/resources/etc_fstab.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #home_mount_options ⇒ Object
-
#initialize(fstab_path = nil) ⇒ EtcFstab
constructor
A new instance of EtcFstab.
- #nfs_file_systems ⇒ Object
Methods included from CommentParser
Constructor Details
#initialize(fstab_path = nil) ⇒ EtcFstab
Returns a new instance of EtcFstab.
36 37 38 39 40 41 42 43 |
# File 'lib/resources/etc_fstab.rb', line 36 def initialize(fstab_path = nil) return skip_resource 'The `etc_fstab` resource is not supported on your OS.' unless inspec.os.linux? @conf_path = fstab_path || '/etc/fstab' @files_contents = {} @content = nil @params = nil read_content end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
32 33 34 |
# File 'lib/resources/etc_fstab.rb', line 32 def params @params end |
Instance Method Details
#home_mount_options ⇒ Object
62 63 64 65 |
# File 'lib/resources/etc_fstab.rb', line 62 def return nil unless where { mount_point == '/home' }.configured? where { mount_point == '/home' }.entries[0]. end |
#nfs_file_systems ⇒ Object
58 59 60 |
# File 'lib/resources/etc_fstab.rb', line 58 def nfs_file_systems where { file_system_type.match(/nfs/) } end |