Sha256: 49cc1487bba56b8776645a99c406286e03f636b747e933029c529deee38b312f

Contents?: true

Size: 687 Bytes

Versions: 16

Compression:

Stored size: 687 Bytes

Contents

module Nautilus
  
  class Shell
    
    def run(command, options = {})
      sh build_command(command, options)
    end

    def build_command(command, options = {})
      actual_command = command.kind_of?(Array) ? command.join(" ") : command
      if options[:background]
        if windows?
          actual_command = "start /wait /b " + command
        elsif options[:background]
          actual_command << " &"
        end
      end      
      actual_command
    end
            
    def windows?
      PLATFORM['win32']
    end
    
    def sh(command)
      successful = system(command)
      raise "Error while running >>#{command}<<" unless successful
    end
    
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
selenium-client-1.2.12 lib/nautilus/shell.rb
selenium-client-1.2.7 lib/nautilus/shell.rb
selenium-client-1.2.3 lib/nautilus/shell.rb
selenium-client-1.2 lib/nautilus/shell.rb
selenium-client-1.2.11 lib/nautilus/shell.rb
selenium-client-1.2.13 lib/nautilus/shell.rb
selenium-client-1.2.6 lib/nautilus/shell.rb
selenium-client-1.2.8 lib/nautilus/shell.rb
selenium-client-1.2.10 lib/nautilus/shell.rb
selenium-client-1.2.1 lib/nautilus/shell.rb
selenium-client-1.2.2 lib/nautilus/shell.rb
selenium-client-1.2.4 lib/nautilus/shell.rb
selenium-client-1.2.15 lib/nautilus/shell.rb
selenium-client-1.2.14 lib/nautilus/shell.rb
selenium-client-1.2.9 lib/nautilus/shell.rb
selenium-client-1.2.5 lib/nautilus/shell.rb