X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmcollective%2Fvendor%2Fsystemu%2Fsamples%2Fb.rb;fp=lib%2Fmcollective%2Fvendor%2Fsystemu%2Fsamples%2Fb.rb;h=951dce1149564a168b969e0a4cb2307af1925b0f;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/lib/mcollective/vendor/systemu/samples/b.rb b/lib/mcollective/vendor/systemu/samples/b.rb new file mode 100644 index 0000000..951dce1 --- /dev/null +++ b/lib/mcollective/vendor/systemu/samples/b.rb @@ -0,0 +1,12 @@ +# +# quite a few keys can be passed to the command to alter it's behaviour. if +# either stdout or stderr is supplied those objects should respond_to? '<<' +# and only status will be returned +# + require 'systemu' + + date = %q( ruby -e" t = Time.now; STDOUT.puts t; STDERR.puts t " ) + + stdout, stderr = '', '' + status = systemu date, 'stdout' => stdout, 'stderr' => stderr + p [ status, stdout, stderr ]