changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/ruby_forker.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require 'rbconfig'
2
3module RubyForker
4 # Forks a ruby interpreter with same type as ourself.
5 # juby will fork jruby, ruby will fork ruby etc.
6 def ruby(args, stderr=nil)
7 config = ::Config::CONFIG
8 interpreter = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
9 cmd = "#{interpreter} #{args}"
10 cmd << " 2> #{stderr}" unless stderr.nil?
11 `#{cmd}`
12 end
13end