X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fmcollective%2Fvendor%2Fsystemu%2Fsamples%2Fa.rb;fp=lib%2Fmcollective%2Fvendor%2Fsystemu%2Fsamples%2Fa.rb;h=37af06ab97801f3022a7e447eb3acb45daafb945;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/lib/mcollective/vendor/systemu/samples/a.rb b/lib/mcollective/vendor/systemu/samples/a.rb new file mode 100644 index 0000000..37af06a --- /dev/null +++ b/lib/mcollective/vendor/systemu/samples/a.rb @@ -0,0 +1,11 @@ +# +# systemu can be used on any platform to return status, stdout, and stderr of +# any command. unlike other methods like open3/popen4 there is zero danger of +# full pipes or threading issues hanging your process or subprocess. +# + require 'systemu' + + date = %q( ruby -e" t = Time.now; STDOUT.puts t; STDERR.puts t " ) + + status, stdout, stderr = systemu date + p [ status, stdout, stderr ]