# File lib/cucumber/wire_support/connection.rb, line 15 15: def call_remote(request_handler, message, params) 16: packet = WirePacket.new(message, params) 17: 18: begin 19: send_data_to_socket(packet.to_json) 20: response = fetch_data_from_socket(@config.timeout(message)) 21: response.handle_with(request_handler) 22: rescue Timeout::Error => e 23: backtrace = e.backtrace ; backtrace.shift # because Timeout puts some wierd stuff in there 24: raise Timeout::Error, "Timed out calling wire server with message '#{message}'", backtrace 25: end 26: end
# File lib/cucumber/wire_support/connection.rb, line 38 38: def fetch_data_from_socket(timeout) 39: raw_response = 40: if timeout == :never 41: socket.gets 42: else 43: Timeout.timeout(timeout) { socket.gets } 44: end 45: WirePacket.parse(raw_response) 46: end
# File lib/cucumber/wire_support/connection.rb, line 34 34: def send_data_to_socket(data) 35: Timeout.timeout(@config.timeout) { socket.puts(data) } 36: end
# File lib/cucumber/wire_support/connection.rb, line 48 48: def socket 49: @socket ||= TCPSocket.new(@config.host, @config.port) 50: rescue Errno::ECONNREFUSED => exception 51: raise(ConnectionError, "Unable to contact the wire server at #{@config.host}:#{@config.port}. Is it up?") 52: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.