Sha256: 996636b657ceeff80ff4d8da7e2909629e14959d5f6871b47a30d3c2e0ad0562

Contents?: true

Size: 859 Bytes

Versions: 23

Compression:

Stored size: 859 Bytes

Contents

#!/usr/bin/env ruby
require 'tempfile'
require 'logger'
$:.unshift '.', '..', 'lib', File.join('..','lib')
require 'session'

DIV = ('=' * 79) << "\n"


# start session with bash
bash = Session::Bash.new


# create two tempory external programs to drive
prog_a = Tempfile.new('prog_a_')
prog_a.write <<-code
  puts $0
  puts 42
code
prog_a.close
prog_a = prog_a.path

prog_b = Tempfile.new('prog_b_')
prog_b.write <<-code
  puts $0
  puts 'forty-two' 
code
prog_b.close
prog_b = prog_b.path


# set up logging
logger = Logger.new STDOUT


# run both programs redirect the stdout into the log
logger.info{ 'running program a' }
logger << DIV
bash.execute "ruby #{ prog_a}", :stdout => logger, :stderr => STDERR
logger << DIV

logger.info{ 'running program b' }
logger << DIV
bash.execute "ruby #{ prog_b}", :stdout => logger, :stderr => STDERR
logger << DIV


Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
session-3.2.0 sample/driver.rb
session-3.1.2 sample/driver.rb
session-3.1.1 sample/driver.rb
redcar-0.5.1 plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5 plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5.6dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5.5dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5.4dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5.3dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5.2dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.5.1dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.4.1 plugins/runnables/vendor/session/sample/driver.rb
redcar-0.4 plugins/runnables/vendor/session/sample/driver.rb
redcar-0.3.10.1dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.3.10.0dev plugins/runnables/vendor/session/sample/driver.rb
redcar-0.3.9 plugins/runnables/vendor/session-2.4.0/sample/driver.rb
redcar-0.3.9.0dev plugins/runnables/vendor/session-2.4.0/sample/driver.rb
redcar-0.3.8.4 plugins/runnables/vendor/session-2.4.0/sample/driver.rb
redcar-0.3.8.3 plugins/runnables/vendor/session-2.4.0/sample/driver.rb
redcar-0.3.8.2 plugins/runnables/vendor/session-2.4.0/sample/driver.rb