aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/popen.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-11 15:51:19 -0500
committerJack Nagel2014-07-11 15:52:39 -0500
commitcf93f7e15901ad4493e44bfd78312aa2802a979e (patch)
treedc21c0fdd0f08a1bf2385baced34d62ec7d1e9f6 /Library/Homebrew/utils/popen.rb
parent625d891090c5d3f1ba5f9ca0a33e72d11dafa781 (diff)
downloadhomebrew-cf93f7e15901ad4493e44bfd78312aa2802a979e.tar.bz2
Read if no block is passed to Utils.popen_read
Diffstat (limited to 'Library/Homebrew/utils/popen.rb')
-rw-r--r--Library/Homebrew/utils/popen.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/popen.rb b/Library/Homebrew/utils/popen.rb
index 83f140163..1463df530 100644
--- a/Library/Homebrew/utils/popen.rb
+++ b/Library/Homebrew/utils/popen.rb
@@ -10,7 +10,11 @@ module Utils
def self.popen(args, mode)
IO.popen("-", mode) do |pipe|
if pipe
- yield pipe
+ if block_given?
+ yield pipe
+ else
+ return pipe.read
+ end
else
STDERR.reopen("/dev/null", "w")
exec(*args)