Sha256: 8f30db92705be00c062b5fe2fbaa6aac5c022df539b0746b3f5bb2cd7608cb5a

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 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

1 entries across 1 versions & 1 rubygems

Version Path
knjrbfw-0.0.8 lib/knj/sysuser.rb