We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4e67d2a + 87c725d commit c70baf3Copy full SHA for c70baf3
Formula/g/gping.rb
@@ -41,13 +41,12 @@ def install
41
require "pty"
42
require "io/console"
43
44
- r, w, = PTY.spawn("#{bin}/gping google.com")
45
- r.winsize = [80, 130]
46
- sleep 10
47
- w.write "q"
+ PTY.spawn(bin/"gping", "google.com") do |r, w, _pid|
+ r.winsize = [80, 130]
+ sleep 10
+ w.write "q"
48
49
- begin
50
- screenlog = r.read
+ screenlog = r.read_nonblock(1024)
51
# remove ANSI colors
52
screenlog.encode!("UTF-8", "binary",
53
invalid: :replace,
@@ -56,8 +55,6 @@ def install
56
55
screenlog.gsub!(/\e\[([;\d]+)?m/, "")
57
58
assert_match "google.com (", screenlog
59
- rescue Errno::EIO
60
- # GNU/Linux raises EIO when read is done on closed pty
61
end
62
63
0 commit comments