Class: HTTPAccess2::DebugSocket
- Inherits:
-
TCPSocket
- Object
- TCPSocket
- HTTPAccess2::DebugSocket
- Defined in:
- lib/reap/vendor/http-access2.rb
Overview
HTTPAccess2::DebugSocket – debugging support
Instance Attribute Summary collapse
-
#debug_dev ⇒ Object
Device for logging.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(str) ⇒ Object
- #close ⇒ Object
- #gets(*args) ⇒ Object
-
#initialize(*args) ⇒ DebugSocket
constructor
A new instance of DebugSocket.
- #log_connect ⇒ Object
- #read(*args) ⇒ Object
Constructor Details
#initialize(*args) ⇒ DebugSocket
Returns a new instance of DebugSocket.
1110 1111 1112 1113 |
# File 'lib/reap/vendor/http-access2.rb', line 1110 def initialize(*args) super @debug_dev = nil end |
Instance Attribute Details
#debug_dev ⇒ Object
Device for logging.
1096 1097 1098 |
# File 'lib/reap/vendor/http-access2.rb', line 1096 def debug_dev @debug_dev end |
Class Method Details
.create_socket(host, port, debug_dev) ⇒ Object
1099 1100 1101 1102 1103 1104 1105 |
# File 'lib/reap/vendor/http-access2.rb', line 1099 def create_socket(host, port, debug_dev) debug_dev << "! CONNECT TO #{host}:#{port}\n" socket = new(host, port) socket.debug_dev = debug_dev socket.log_connect socket end |
Instance Method Details
#<<(str) ⇒ Object
1136 1137 1138 1139 |
# File 'lib/reap/vendor/http-access2.rb', line 1136 def <<(str) super @debug_dev << str end |
#close ⇒ Object
1119 1120 1121 1122 |
# File 'lib/reap/vendor/http-access2.rb', line 1119 def close super @debug_dev << '! CONNECTION CLOSED' << "\n" end |
#gets(*args) ⇒ Object
1124 1125 1126 1127 1128 |
# File 'lib/reap/vendor/http-access2.rb', line 1124 def gets(*args) str = super @debug_dev << str if str str end |
#log_connect ⇒ Object
1115 1116 1117 |
# File 'lib/reap/vendor/http-access2.rb', line 1115 def log_connect @debug_dev << '! CONNECTION ESTABLISHED' << "\n" end |
#read(*args) ⇒ Object
1130 1131 1132 1133 1134 |
# File 'lib/reap/vendor/http-access2.rb', line 1130 def read(*args) str = super @debug_dev << str if str str end |