Module: OS::Linux::Cask::Caskroom::ClassMethods Private

Defined in:
extend/os/linux/cask/caskroom.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Instance Method Summary collapse

Instance Method Details

#expected_caskroom_group ⇒ String

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Unlike macOS (which uses the admin group), Homebrew on Linux is run in a variety of distributions, so use the current user's primary group as the group of the Caskroom directory. This avoids a sudo prompt to chgrp the directory after creation.

Returns:



19
20
21
22
23
24
25
26
27
28
# File 'extend/os/linux/cask/caskroom.rb', line 19

def expected_caskroom_group
  @expected_caskroom_group ||= T.let(
    begin
      Etc.getgrgid(Process.egid)&.name || "root"
    rescue ArgumentError
      "root"
    end,
    T.nilable(String),
  )
end

#shared_caskroom_group ⇒ String?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



10
11
12
# File 'extend/os/linux/cask/caskroom.rb', line 10

def shared_caskroom_group
  nil
end