Project

General

Profile

Bug #10563 » caller.rb

Runner script for calling callee.rb - Maturin (Lars Benner), 12/02/2014 08:36 PM

 


# Uncomment only one of the two RUBY assignments

# Causing system() call to hang.
# On my system RUBY looked like this: C:/Projects/Head.Dev/Extern/ruby/mri/bin/ruby.exe
RUBY = RbConfig.ruby

# With this commnand the system() call works
#RUBY = RbConfig.ruby.gsub('/', '\\')

args = []
args << RUBY

# Script to start, only prints the given command line arguments on stdout
args << 'callee.rb'

500.times do |n|
# Increasing the length of the command line each iteration
args << "\"ThisIsARatherLongArgument##{n}\""
cmd = args.join(' ')
puts "------------------------------------------------------"
puts "command length #{cmd.size} characters."
system(cmd)
end

puts "======================================================"
puts "Done."
(1-1/2)