Sha256: bdeb4f38941fbf4081f2a1810da7cb6bb5101362ee85b6817fcdadb5ffc0d69a

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

# Class that maintains the User and additional methods for the process.
# Helper methods provided use the Process module underneath.
#
class OSC::Machete::Process

  def initialize
    @user = OSC::Machete::User.from_uid(Process.uid)
  end

  # The system name of the process user
  def username
    @user.name
  end

  # use gid not egid
  def groupname
    Etc.getgrgid(Process.gid).name
  end

  # has the group membership changed since this process started?
  def group_membership_changed?
    Process.groups.uniq.sort != @user.groups
  end

  # The home directory path of the process user.
  #
  # @return [String] The directory path.
  def home
    @user.home
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
osc-machete-2.0.0.pre2 lib/osc/machete/process.rb
osc-machete-1.1.4 lib/osc/machete/process.rb
osc-machete-2.0.0.pre1 lib/osc/machete/process.rb
osc-machete-1.1.3 lib/osc/machete/process.rb