Class: OSC::Machete::Process Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/osc/machete/process.rb

Overview

Deprecated.

Please use OodSupport::Process instead.

Class that maintains the User and additional methods for the process. Helper methods provided use the Process module underneath.

Instance Method Summary collapse

Constructor Details

#initializeProcess

Returns a new instance of Process.



7
8
9
10
11
# File 'lib/osc/machete/process.rb', line 7

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

  warn "[DEPRECATION] `OSC::Machete::Process` is deprecated. Please use `OodSupport::Process` instead (see ood_support gem)."
end

Instance Method Details

#group_membership_changed?Boolean

has the group membership changed since this process started?

Returns:

  • (Boolean)


24
25
26
# File 'lib/osc/machete/process.rb', line 24

def group_membership_changed?
  Process.groups.uniq.sort != @user.groups
end

#groupnameObject

use gid not egid



19
20
21
# File 'lib/osc/machete/process.rb', line 19

def groupname
  Etc.getgrgid(Process.gid).name
end

#homeString

The home directory path of the process user.

Returns:

  • (String)

    The directory path.



31
32
33
# File 'lib/osc/machete/process.rb', line 31

def home
  @user.home
end

#usernameObject

The system name of the process user



14
15
16
# File 'lib/osc/machete/process.rb', line 14

def username
  @user.name
end