Module: Repla::Dependencies::Tester

Defined in:
lib/repla/dependencies/lib/tester.rb

Overview

Tester

Class Method Summary collapse

Class Method Details

.check(name, type) ⇒ Object



5
6
7
8
9
10
# File 'lib/repla/dependencies/lib/tester.rb', line 5

def self.check(name, type)
  case type
  when :shell_command
    check_shell_command(name)
  end
end

.check_shell_command(name) ⇒ Object

TODO: ‘self.check_shell_command` should be private but now all of a sudden instances method can’t call private class methods?



16
17
18
19
# File 'lib/repla/dependencies/lib/tester.rb', line 16

def self.check_shell_command(name)
  command = "type -a #{Shellwords.escape(name)} > /dev/null 2>&1"
  system(command)
end