1.8.7 doesn't support IO.popen with options

This commit is contained in:
Samuel Cochran 2012-06-19 16:25:19 +08:00
parent 744ee93c57
commit 69b91a1fa8

View File

@ -1,3 +1,5 @@
require 'open3'
require 'active_support/all' require 'active_support/all'
require 'eventmachine' require 'eventmachine'
require 'optparse' require 'optparse'
@ -16,7 +18,9 @@ module MailCatcher
module_function module_function
def which command def which command
IO.popen(["which", command], "r", :err => :close).read.chomp.presence Open3.popen3 'which', 'command' do |stdin, stdout, stderr|
return stdout.read.chomp.presence
end
end end
def mac? def mac?