Skip to content

Commit

Permalink
try open4 for rubinius [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
cldwalker committed Mar 10, 2012
1 parent 71a39d4 commit 3305c4d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gemspec
Expand Up @@ -12,6 +12,7 @@ Gem::Specification.new do |s|
s.description = "Bahia - where commandline acceptance tests are easy, the people are festive and onde nasceu capoeira. In other words, aruba for any non-cucumber test framework."
s.required_rubygems_version = ">= 1.3.6"
s.add_development_dependency 'rspec', '~> 2.7.0'
s.add_development_dependency 'open4', '~> 1.3.0'
s.files = Dir.glob(%w[{lib,spec}/**/*.rb bin/* [A-Z]*.{md,txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
s.files += %w{.travis.yml}
s.extra_rdoc_files = ["README.md", "LICENSE.txt"]
Expand Down
13 changes: 12 additions & 1 deletion lib/bahia.rb
Expand Up @@ -30,7 +30,18 @@ def self.run_command(cmd)
args.unshift Bahia.command
args.unshift('RUBYLIB' =>
"#{Bahia.project_directory}/lib:#{ENV['RUBYLIB']}".sub(/:\s*$/, ''))
Open3.capture3(*args)
exec_command *args
end

def self.exec_command(*args)
return Open3.capture3(*args) unless RUBY_DESCRIPTION.include?('rubinius')

require 'open4'
pid, stdin, stdout, stderr = Open4.open4(*args)
_, status = Process.wait2(pid)
out, err = stdout.read, stderr.read
[stdin, stdout, stderr].each(&:close)
[out, err, status]
end

def self.set_project_directory(arr)
Expand Down

0 comments on commit 3305c4d

Please sign in to comment.