From a126946a9be8a1915ce516a674ffe4663583f691 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 15 Sep 2013 20:11:17 -0700 Subject: [PATCH] move paths to utils --- Library/Homebrew/cmd/commands.rb | 10 ---------- Library/Homebrew/cmd/doctor.rb | 10 ---------- Library/Homebrew/utils.rb | 10 ++++++++++ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index b9bbb12ece..1d765f57b7 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -1,14 +1,4 @@ module Homebrew extend self - def paths - @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p| - begin - File.expand_path(p).chomp('/') - rescue ArgumentError - onoe "The following PATH component is invalid: #{p}" - end - end.uniq.compact - end - def commands # Find commands in Homebrew/cmd cmds = (HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"). diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index a39b193497..e7123fd7c4 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -41,16 +41,6 @@ end class Checks ############# HELPERS - def paths - @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p| - begin - File.expand_path(p).chomp('/') - rescue ArgumentError - onoe "The following PATH component is invalid: #{p}" - end - end.uniq.compact - end - # Finds files in HOMEBREW_PREFIX *and* /usr/local. # Specify paths relative to a prefix eg. "include/foo.h". # Sets @found for your convenience. diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index f99b0a03ee..8a266ef7aa 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -238,6 +238,16 @@ def nostdout end end +def paths + @paths ||= ENV['PATH'].split(File::PATH_SEPARATOR).collect do |p| + begin + File.expand_path(p).chomp('/') + rescue ArgumentError + onoe "The following PATH component is invalid: #{p}" + end + end.uniq.compact +end + module GitHub extend self ISSUES_URI = URI.parse("https://api.github.com/legacy/issues/search/mxcl/homebrew/open/")