Method: Inspec::Utils::PasswdParser#parse_passwd

Defined in:
lib/inspec/utils/parser.rb

#parse_passwd(content) ⇒ Array

Parse /etc/passwd files.

Parameters:

  • content (String)

    the raw content of /etc/passwd

Returns:

  • (Array)

    Collection of passwd entries



10
11
12
13
14
15
16
# File 'lib/inspec/utils/parser.rb', line 10

def parse_passwd(content)
  content.to_s.split("\n").map do |line|
    next if line[0] == "#"

    parse_passwd_line(line)
  end.compact
end