Class: Babushka::NpmHelper

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

Class Method Summary collapse

Methods inherited from PkgHelper

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

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

.manager_depObject


8
# File 'lib/babushka/pkg_helpers/npm_helper.rb', line 8

def manager_dep; 'core:npm' end

.manager_keyObject


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

def manager_key; :npm end

.pkg_binaryObject


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

def pkg_binary; "npm" end

.pkg_cmdObject


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

def pkg_cmd; "#{pkg_binary} --color false" end

.pkg_typeObject


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

def pkg_type; :npm end

.should_sudo?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'lib/babushka/pkg_helpers/npm_helper.rb', line 10

def should_sudo?
  !shell("npm config get prefix").p.writable_real?
end