Sha256: 2c4ca8ddba5fa1356a3aa9b3f758cd1ef72dafa42c5218bf4b368f5e3081b1a3
Contents?: true
Size: 491 Bytes
Versions: 101
Compression:
Stored size: 491 Bytes
Contents
class Knj::Sysuser def initialize(data) @data = data end def self.list(paras = {}) cont = File.read("/etc/passwd") list = [] cont.split("\n").each do |line| linearr = line.split(":") list << Knj::Sysuser.new( "nick" => linearr[0], "home" => linearr[5], "shell" => linearr[6] ) end return list end def [](key) raise "No such key: " + key if !@data.key?(key) return @data[key] end end
Version data entries
101 entries across 101 versions & 1 rubygems