Sha256: 88ff7865187d47ddfdd9a2162fa5cac306c80ca560d5e595390faac8203d04c7

Contents?: true

Size: 383 Bytes

Versions: 15

Compression:

Stored size: 383 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"
      return system(command)
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webconsole-0.1.18 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.17 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.16 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.15 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.14 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.13 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.12 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.11 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.10 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.5 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.4 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.3 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.2 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.1 lib/webconsole/dependencies/lib/tester.rb
webconsole-0.1.0 lib/webconsole/dependencies/lib/tester.rb