examples/example_waitid.rb in proc-wait3-1.9.1 vs examples/example_waitid.rb in proc-wait3-1.9.2
- old
+ new
@@ -1,14 +1,17 @@
+# frozen_string_literal: true
+
#######################################################################
# example_waitid.rb
#
# Simple demonstration of the Process.waitid method. You can run this
# code via the 'rake example_waitid' task.
#
# Modify as you see fit.
#######################################################################
+require 'English'
require 'proc/wait3'
-pid = fork{ sleep 2 }
+pid = fork { sleep 2 }
p Time.now
Process.waitid(Process::P_PID, pid, Process::WEXITED)
-p $?
+p $CHILD_STATUS