Enhance Tubes#63
Conversation
| s = '' | ||
| objs.map(&:to_s).each do |elem| | ||
| s << elem | ||
| s << context.newline if elem.empty? || !elem.end_with?(context.newline) |
There was a problem hiding this comment.
Why need to check elem.empty??
| $stdout.write(s) | ||
| end | ||
| end | ||
| rescue |
There was a problem hiding this comment.
Should only rescue EOFError.
There was a problem hiding this comment.
Future work: Use our own Exception class
| module Tubes | ||
| # Things common to all tubes (sockets, tty, ...) | ||
| # @!macro [new] drop_definition | ||
| # @param [Boalean] drop |
| # @!macro timeout_definition | ||
| # | ||
| # @return [String] | ||
| # The next "line". |
There was a problem hiding this comment.
add examples to clarify its recvuntil-like functionality
| $stdout.write(s) | ||
| end | ||
| end | ||
| rescue |
There was a problem hiding this comment.
Future work: Use our own Exception class
|
Review status: 0 of 2 files reviewed at latest revision, 4 unresolved discussions. lib/pwnlib/tubes/tube.rb, line 13 at r1 (raw file): Previously, david942j (david942j) wrote…
Done. lib/pwnlib/tubes/tube.rb, line 206 at r1 (raw file): Previously, david942j (david942j) wrote…
Done. lib/pwnlib/tubes/tube.rb, line 263 at r1 (raw file): Previously, ShikChen wrote…
Done. lib/pwnlib/tubes/tube.rb, line 284 at r1 (raw file): Previously, david942j (david942j) wrote…
Done. Comments from Reviewable |
| # The difference with IO#gets is using +context.newline+ as default newline. | ||
| # | ||
| # @param [Integer, String] sep | ||
| # The separator. |
There was a problem hiding this comment.
describe the behavior when an integer is passed
| alias gets recvline | ||
|
|
||
| # Receives the next "line" from the tube; lines are separated by +sep+. | ||
| # The difference with IO#gets is using +context.newline+ as default newline. |
| end | ||
|
|
||
| # Sends the given object(s) to the tube. | ||
| # The difference with IO#puts is using +context.newline+ as default newline. |
|
Review status: 0 of 2 files reviewed at latest revision, 7 unresolved discussions. lib/pwnlib/tubes/tube.rb, line 198 at r2 (raw file): Previously, david942j (david942j) wrote…
Done. lib/pwnlib/tubes/tube.rb, line 201 at r2 (raw file): Previously, david942j (david942j) wrote…
Done. lib/pwnlib/tubes/tube.rb, line 274 at r2 (raw file): Previously, david942j (david942j) wrote…
Done. Comments from Reviewable |
| # s.puts | ||
| # puts client.recv | ||
| # # | ||
| # |
There was a problem hiding this comment.
add #=> nil, otherwise it looks weird
| # The difference with +IO#puts+ is using +context.newline+ as default newline. | ||
| # | ||
| # @param [Array<Object>] objs | ||
| # The objects to send. |
| # Receive a single line from the tube. | ||
| # Receives a single line from the tube. | ||
| # A "line" is any sequence of bytes terminated by the byte sequence set in +context.newline+, | ||
| # which defaults to +"\n"+. |
There was a problem hiding this comment.
+"\n"+ broken in parsed doc
|
Review status: 0 of 2 files reviewed at latest revision, 10 unresolved discussions. lib/pwnlib/tubes/tube.rb, line 185 at r3 (raw file): Previously, david942j (david942j) wrote…
Done. lib/pwnlib/tubes/tube.rb, line 282 at r3 (raw file): Previously, david942j (david942j) wrote…
Done. lib/pwnlib/tubes/tube.rb, line 290 at r3 (raw file): Previously, david942j (david942j) wrote…
Done. Comments from Reviewable |
|
Reviewed 1 of 2 files at r3, 1 of 1 files at r4. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from Reviewable |
This change is