Method: LinuxStat::User.list

Defined in:
lib/linux_stat/user.rb

.listObject

Returns an array of users as string

For example:

["root", "bin", "daemon", "mail", "ftp", "http", "nobody"]

But if the status isn’t available it will return an empty Array.



13
14
15
16
# File 'lib/linux_stat/user.rb', line 13

def list
  return [] unless passwd_readable?
  passwd.map { |x| x[/.+?:/][0..-2].freeze }
end