51: def define
52: desc "Launch Selenium Remote Control"
53: task @name do
54: puts "Starting Selenium Remote Control at 0.0.0.0:#{@port}..."
55: raise "Could not find jar file '#{@jar_file}'. Expected it under #{JAR_FILE_PATTERN}" unless @jar_file && File.exists?(@jar_file)
56: remote_control = Selenium::RemoteControl::RemoteControl.new("0.0.0.0", @port, :timeout => @timeout_in_seconds)
57: remote_control.jar_file = @jar_file
58: remote_control.additional_args = @additional_args
59: remote_control.log_to = @log_to
60: remote_control.start :background => @background
61: if @background && @wait_until_up_and_running
62: puts "Waiting for Remote Control to be up and running..."
63: TCPSocket.wait_for_service :host => @host, :port => @port
64: end
65: puts "Selenium Remote Control at 0.0.0.0:#{@port} ready"
66: end
67: end