Sha256: f8a4779502ee368d49669f7e22065259980a0ae690057625c6c03d4abaace6bc
Contents?: true
Size: 539 Bytes
Versions: 2
Compression:
Stored size: 539 Bytes
Contents
## Worked on osx class Users @@users def initialize @@users = `/usr/bin/awk -F: '{ if ($3<=499) print "system,"$1","$6; else print "user,"$1","$6; }' < /etc/passwd` end def parse $users = @@users.split("\n") $i = 0 $return_users = {} $users.each do |user_block| $i += 1 user_block = user_block.split(",") $return_users[$i] = { 'platform' => user_block[0], 'user' => user_block[1], 'directory' => user_block[2] } end $return_users end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
miranda-0.0.3 | lib/miranda/system/linux/users.rb |
miranda-0.0.2 | lib/miranda/system/linux/users.rb |