aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-28 12:39:00 +0200
committerMarkus Reiter2017-04-30 21:11:28 +0200
commit22f624b373d77ede5c15db6f62672bdd81e6c9da (patch)
tree2e74f0456b0d8e9707b19c545735208f939c00fe /Library/Homebrew/utils.rb
parente70f2ec33233422b70db047338aa85d9e2088042 (diff)
downloadbrew-22f624b373d77ede5c15db6f62672bdd81e6c9da.tar.bz2
Make `PATH` enumerable.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 98a6ce6da..257d24784 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -293,7 +293,7 @@ def quiet_system(cmd, *args)
end
def which(cmd, path = ENV["PATH"])
- PATH.new(path).to_a.each do |p|
+ PATH.new(path).each do |p|
begin
pcmd = File.expand_path(cmd, p)
rescue ArgumentError
@@ -307,7 +307,7 @@ def which(cmd, path = ENV["PATH"])
end
def which_all(cmd, path = ENV["PATH"])
- PATH.new(path).to_a.map do |p|
+ PATH.new(path).map do |p|
begin
pcmd = File.expand_path(cmd, p)
rescue ArgumentError
@@ -416,7 +416,7 @@ def nostdout
end
def paths(env_path = ENV["PATH"])
- @paths ||= PATH.new(env_path).to_a.collect do |p|
+ @paths ||= PATH.new(env_path).collect do |p|
begin
File.expand_path(p).chomp("/")
rescue ArgumentError