diff options
Diffstat (limited to 'samples/b.rb')
-rw-r--r-- | samples/b.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/samples/b.rb b/samples/b.rb new file mode 100644 index 0000000..951dce1 --- /dev/null +++ b/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 ] |