Skip to content

Commit 2064c9a

Browse files
committed
We do not need this monkey-patching
1 parent 0eefd18 commit 2064c9a

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

lib/ruby-debug-ide/interface.rb

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
require 'thread'
22

3-
class TCPSocket
4-
5-
# Workaround for JRuby issue http://jira.codehaus.org/browse/JRUBY-2063
6-
def non_blocking_gets
7-
loop do
8-
result, _, _ = IO.select( [self], nil, nil, 0.2 )
9-
next unless result
10-
return result[0].gets
11-
end
12-
end
13-
14-
end
15-
16-
module Debugger
3+
module Debugger
174
class Interface
185
end
196

@@ -30,7 +17,7 @@ def initialize(socket)
3017
end
3118

3219
def read_command
33-
result = @socket.non_blocking_gets
20+
result = non_blocking_gets
3421
raise IOError unless result
3522
result.chomp
3623
end
@@ -43,7 +30,16 @@ def close
4330
@socket.close
4431
rescue IOError
4532
end
46-
33+
34+
# Workaround for JRuby issue http://jira.codehaus.org/browse/JRUBY-2063
35+
def non_blocking_gets
36+
loop do
37+
result, _, _ = IO.select( [@socket], nil, nil, 0.2 )
38+
next unless result
39+
return result[0].gets
40+
end
41+
end
42+
4743
end
4844

4945
end

0 commit comments

Comments
 (0)