File: b.rb

package info (click to toggle)
ruby-systemu 2.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: ruby: 525; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
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 ]