Renamed W3DHub.captured_command to simply W3DHub.command, replace usages of system with W3DHub.command, resolves command prompt's popping up on Windows under rubyw.

This commit is contained in:
2022-10-30 22:02:20 -05:00
parent 388c3a2606
commit ab73b62c4b
3 changed files with 18 additions and 15 deletions

View File

@@ -49,7 +49,7 @@ class W3DHub
lambda do
@ping = -1
W3DHub.captured_commmand("ping #{@address} #{W3DHub.windows? ? '-n 3' : '-c 3'}") do |line|
W3DHub.command("ping #{@address} #{W3DHub.windows? ? '-n 3' : '-c 3'}") do |line|
if W3DHub.windows? && line =~ /Minimum|Maximum|Maximum/i
@ping = line.strip.split(",").last.split("=").last.sub("ms", "").to_i
elsif W3DHub.unix? && line.start_with?("rtt min/avg/max/mdev")