move paths to utils

This commit is contained in:
Adam Vandenberg 2013-09-15 20:11:17 -07:00
parent fa0872a42c
commit a126946a9b
3 changed files with 10 additions and 20 deletions

View File

@ -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").

View File

@ -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.

View File

@ -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/")