Sha256: e1cde9e0909a19ce983355775a3acc77144c1a5d0000a930d622229bdc8df65b

Contents?: true

Size: 410 Bytes

Versions: 9

Compression:

Stored size: 410 Bytes

Contents

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dm-rest-adapter-0.9.9 spec/ruby_forker.rb
dm-rest-adapter-0.9.10 spec/ruby_forker.rb
dm-rest-adapter-0.9.11 spec/ruby_forker.rb
dm-rest-adapter-0.9.2 spec/ruby_forker.rb
dm-rest-adapter-0.9.4 spec/ruby_forker.rb
dm-rest-adapter-0.9.5 spec/ruby_forker.rb
dm-rest-adapter-0.9.6 spec/ruby_forker.rb
dm-rest-adapter-0.9.7 spec/ruby_forker.rb
dm-rest-adapter-0.9.8 spec/ruby_forker.rb