Module: OodSupport::Process

Defined in:
lib/ood_support/process.rb

Overview

A helper module that describes the current running process

Class Method Summary collapse

Class Method Details

.groupGroup

Primary group of current process

Returns:

  • (Group)

    group of process



12
13
14
# File 'lib/ood_support/process.rb', line 12

def self.group
  Group.new ::Process.gid
end

.groupsArray<Group>

List of groups current process is in

Returns:

  • (Array<Group>)

    list of groups for process



18
19
20
# File 'lib/ood_support/process.rb', line 18

def self.groups
  ::Process.groups.map {|g| Group.new g}
end

.groups_changed?Boolean

Whether user’s groups changed since running process

Returns:

  • (Boolean)

    whether groups changed



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

def self.groups_changed?
  groups.sort != user.groups.sort
end

.userUser

Owner of current process

Returns:

  • (User)

    owner of process



6
7
8
# File 'lib/ood_support/process.rb', line 6

def self.user
  User.new ::Process.uid
end