aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-04-27 10:44:44 +0200
committerMarkus Reiter2017-04-30 21:11:27 +0200
commitf8ad9d7efd5f3f489ed3c1671f16eb2a2eaef822 (patch)
treeb49a1211a472e686fed66010e2ddd38ca92cd2a9 /Library/Homebrew/utils.rb
parent314483f75c8893eb68073f5863e7784797d6ea2a (diff)
downloadbrew-f8ad9d7efd5f3f489ed3c1671f16eb2a2eaef822.tar.bz2
Use `PATH` where possible.
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 2ac195cdb..98a6ce6da 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.split(File::PATH_SEPARATOR).each do |p|
+ PATH.new(path).to_a.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.to_s.split(File::PATH_SEPARATOR).map do |p|
+ PATH.new(path).to_a.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 ||= env_path.split(File::PATH_SEPARATOR).collect do |p|
+ @paths ||= PATH.new(env_path).to_a.collect do |p|
begin
File.expand_path(p).chomp("/")
rescue ArgumentError