Class: Babushka::BrewHelper

Inherits:
PkgHelper show all
Defined in:
lib/babushka/pkg_helpers/brew_helper.rb

Class Method Summary collapse

Methods inherited from PkgHelper

all_manager_keys, bin_path, handle_install!, has?, install!, pkg_binary, prefix, present?, update_pkg_lists

Methods included from ShellHelpers

cmd_dir, current_username, log_shell, login_shell, raw_shell, shell, shell!, shell?, shell_cmd, sudo, which

Methods included from LogHelpers

debug, deprecated!, log, log_block, log_error, log_ok, log_stderr, log_warn, removed!

Class Method Details

.brew_path_for(pkg_name) ⇒ Object


15
16
17
18
19
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 15

def brew_path_for pkg_name
  if active_version = active_version_of(pkg_name)
    installed_pkgs_path / pkg_name / active_version
  end
end

.manager_depObject


7
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 7

def manager_dep; 'core:homebrew' end

.manager_keyObject


6
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 6

def manager_key; :brew end

.pkg_cmdObject


5
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 5

def pkg_cmd; 'brew' end

.pkg_typeObject


4
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 4

def pkg_type; :brew end

.should_sudo?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 21

def should_sudo?
  super || !installed_pkgs_path.hypothetically_writable?
end

.update_pkg_lists_if_requiredObject


9
10
11
12
13
# File 'lib/babushka/pkg_helpers/brew_helper.rb', line 9

def update_pkg_lists_if_required
  super.tap {|result|
    pkg_list_dir.touch if result
  }
end