allomov
12/18/2013 - 5:22 PM

prove that system commands that was executed within ruby process have this process as a parent and have all its environment variables

prove that system commands that was executed within ruby process have this process as a parent and have all its environment variables

puts 'System variable TEST_VAR is ' +  ENV['TEST_VAR'].inspect
ENV['TEST_VAR'] = 'variable from scrip'
puts 'Now TEST_VAR is ' + ENV['TEST_VAR'].inspect
if ENV['RUBY_ENV_TEST_STATUS'].nil? # need this to avoid recursion :)
  ENV['RUBY_ENV_TEST_STATUS'] = "1" 
  puts 'running new process with system call.'
  system('ruby env_test.rb') # env_test.rb is this file
end