Skip to content

Commit 0ca54ab

Browse files
committed
use IO#gets
`Kernel#gets` read from ARGV if it is not empty.
1 parent f07b9b7 commit 0ca54ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/debug/client.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def connect
222222
when /^ask (\d+) (.*)/
223223
pid = $1
224224
print $2
225-
send "answer #{pid} #{gets || ''}"
225+
send "answer #{pid} #{$stdin.gets || ''}"
226226

227227
when /^quit/
228228
raise 'quit'
@@ -231,8 +231,8 @@ def connect
231231
puts "(unknown) #{line.inspect}"
232232
end
233233
end
234-
rescue
235-
STDERR.puts "disconnected (#{$!})"
234+
rescue => e
235+
STDERR.puts "disconnected (#{e})"
236236
exit
237237
ensure
238238
deactivate

0 commit comments

Comments
 (0)