From 69b91a1fa859a48d7823ba178afb5bc3f0be129f Mon Sep 17 00:00:00 2001 From: Samuel Cochran Date: Tue, 19 Jun 2012 16:25:19 +0800 Subject: [PATCH] 1.8.7 doesn't support IO.popen with options --- lib/mail_catcher.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mail_catcher.rb b/lib/mail_catcher.rb index 91c2ac8..7466a04 100644 --- a/lib/mail_catcher.rb +++ b/lib/mail_catcher.rb @@ -1,3 +1,5 @@ +require 'open3' + require 'active_support/all' require 'eventmachine' require 'optparse' @@ -16,7 +18,9 @@ module MailCatcher module_function 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 def mac?