Class: Babushka::PathChecker

Inherits:
Object
  • Object
show all
Extended by:
ShellHelpers
Defined in:
lib/babushka/path_checker.rb

Class Method Summary collapse

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

.in_path?(provided_list) ⇒ Boolean

Returns:

  • (Boolean)

5
6
7
8
9
10
11
# File 'lib/babushka/path_checker.rb', line 5

def self.in_path? provided_list
  commands = [provided_list].flatten(1).versions

  cmds_in_path?(commands) and matching_versions?(commands) {|cmd|
    shell("#{cmd.name} --version 2>&1")
  }
end