Sha256: 504d7b26869394f8cd421d0226d310f5e662bd698a7ed4859ace7ebd2a4d6f6c

Contents?: true

Size: 491 Bytes

Versions: 2

Compression:

Stored size: 491 Bytes

Contents

#!/usr/bin/env irb

begin
  require 'subprocess'
rescue LoadError
  require 'rubygems'
  require 'subprocess'
end

# a process to get the current version of ruby from ruby command
ruby_version = Subprocess::Popen.new('ruby -v')
# run the process
ruby_version.run
# wait on process to complete (blocking method)
ruby_version.wait
# the process will have stdout
ruby_version.stdout
# and in this case no stderr
ruby_version.stderr
# the complete process info is in status
ruby_version.status

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
subprocess-0.1.6 examples/simple.irb
subprocess-0.1.6 examples/simple_timeout.irb