Sha256: f69ae72bf01e772793fe794d9b85d7497884b8dc0c6f7081edec41e5cba86de8

Contents?: true

Size: 470 Bytes

Versions: 12

Compression:

Stored size: 470 Bytes

Contents

provides 'etc', 'current_user'

require 'etc'

unless etc
  etc Mash.new

  etc[:passwd] = Mash.new
  etc[:group] = Mash.new
  
  Etc.passwd do |entry|
    etc[:passwd][entry.name] = Mash.new(:dir => entry.dir, :gid => entry.gid, :uid => entry.uid, :shell => entry.shell, :gecos => entry.gecos)
  end
  
  Etc.group do |entry|
    etc[:group][entry.name] = Mash.new(:gid => entry.gid, :members => entry.mem)
  end
end

unless current_user
  current_user Etc.getlogin
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ohai-0.6.4 lib/ohai/plugins/passwd.rb
ohai-0.6.2 lib/ohai/plugins/passwd.rb
ohai-0.6.2.rc.0 lib/ohai/plugins/passwd.rb
ohai-0.6.0 lib/ohai/plugins/passwd.rb
ohai-0.6.0.beta.0 lib/ohai/plugins/passwd.rb
ohai-0.5.8 lib/ohai/plugins/passwd.rb
ohai-0.5.8.rc.0 lib/ohai/plugins/passwd.rb
ohai-0.5.6 lib/ohai/plugins/passwd.rb
ohai-0.5.4 lib/ohai/plugins/passwd.rb
ohai-0.5.2 lib/ohai/plugins/passwd.rb
ohai-0.5.0 lib/ohai/plugins/passwd.rb
ohai-0.4.0 lib/ohai/plugins/passwd.rb