Method: XinetdParser#xinetd_include_dir

Defined in:
lib/utils/parser.rb

#xinetd_include_dir(dir) ⇒ Object



216
217
218
219
220
221
222
223
224
225
# File 'lib/utils/parser.rb', line 216

def xinetd_include_dir(dir)
  return [] if dir.nil?

  unless inspec.file(dir).directory?
    raise Inspec::Exceptions::ResourceSkipped, "Can't find folder: #{dir}"
  end

  files = inspec.command("find #{dir} -type f").stdout.split("\n")
  files.map { |file| parse_xinetd(read_content(file)) }
end