Class: Capybara::Webkit::SocketDebugger

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/webkit/socket_debugger.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(socket) ⇒ SocketDebugger

Returns a new instance of SocketDebugger.



10
11
12
# File 'lib/capybara/webkit/socket_debugger.rb', line 10

def initialize(socket)
  @socket = socket
end

Class Method Details

.open(host, port) ⇒ Object



5
6
7
8
# File 'lib/capybara/webkit/socket_debugger.rb', line 5

def self.open(host, port)
  real_socket = TCPSocket.open(host, port)
  new(real_socket)
end

Instance Method Details

#getsObject



28
29
30
# File 'lib/capybara/webkit/socket_debugger.rb', line 28

def gets
  received @socket.gets
end


23
24
25
26
# File 'lib/capybara/webkit/socket_debugger.rb', line 23

def print(content)
  sent content
  @socket.print(content)
end

#puts(line) ⇒ Object



18
19
20
21
# File 'lib/capybara/webkit/socket_debugger.rb', line 18

def puts(line)
  sent line
  @socket.puts(line)
end

#read(length) ⇒ Object



14
15
16
# File 'lib/capybara/webkit/socket_debugger.rb', line 14

def read(length)
  received @socket.read(length)
end