Skip to content
This repository
tree: 38da099438
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 14 lines (12 sloc) 0.411 kb
1 2 3 4 5 6 7 8 9 10 11 12 13
require 'rbconfig'

module RubyForker
  # Forks a ruby interpreter with same type as ourself.
  # jruby 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
Something went wrong with that request. Please try again.