openstreetmap-website/vendor/gems/rspec-1.1.2/spec/ruby_forker.rb
2008-01-22 16:39:09 +00:00

13 lines
No EOL
409 B
Ruby

require 'rbconfig'
module RubyForker
# Forks a ruby interpreter with same type as ourself.
# juby will fork jruby, ruby will fork ruby etc.
def ruby(args, stderr=nil)
config = ::Config::CONFIG
interpreter = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
cmd = "#{interpreter} #{args}"
cmd << " 2> #{stderr}" unless stderr.nil?
`#{cmd}`
end
end