Sha256: 0f8b707a4c4f0825a56c984fd3f5aafc5ea52543007da72bde4ec95cbb940646

Contents?: true

Size: 376 Bytes

Versions: 3

Compression:

Stored size: 376 Bytes

Contents

module WebConsole::Dependencies
  module Tester
    def self.check(name, type)
      case type
      when :shell_command
        return check_shell_command(name)
      end
    end
    
    private
    
    require 'shellwords'
    def self.check_shell_command(name)
      command = "type -a #{Shellwords.escape(name)} > /dev/null 2>&1"
      system(command)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webconsole-0.2.1 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.2.0 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.19 lib/webconsole/dependencies/lib/tester.rb