Use + instead of /.

This commit is contained in:
Adam Vandenberg 2010-12-31 11:00:15 -08:00
parent 761cbd3dab
commit 2a5f757816
12 changed files with 20 additions and 20 deletions

View File

@ -3,7 +3,7 @@ module Homebrew extend self
if ARGV.named.empty?
puts HOMEBREW_CELLAR
else
puts ARGV.formulae.map{ |f| HOMEBREW_CELLAR/f }
puts ARGV.formulae.map{ |f| HOMEBREW_CELLAR+f }
end
end
end

View File

@ -21,7 +21,7 @@ module Homebrew extend self
end
end
prefix = HOMEBREW_CELLAR/name/version
prefix = HOMEBREW_CELLAR+name+version
if File.file? 'CMakeLists.txt'
puts "-DCMAKE_INSTALL_PREFIX=#{prefix}"

View File

@ -6,14 +6,14 @@ module Homebrew extend self
# EDITOR isn't a good fit here, we need a GUI client that actually has
# a UI for projects, so apologies if this wasn't what you expected,
# please improve it! :)
exec 'mate', HOMEBREW_REPOSITORY/"bin/brew",
HOMEBREW_REPOSITORY/'README.md',
HOMEBREW_REPOSITORY/".gitignore",
*Dir[HOMEBREW_REPOSITORY/"Library/*"]
exec 'mate', HOMEBREW_REPOSITORY+"bin/brew",
HOMEBREW_REPOSITORY+'README.md',
HOMEBREW_REPOSITORY+".gitignore",
*Dir[HOMEBREW_REPOSITORY+"Library/*"]
else
# Don't use ARGV.formulae as that will throw if the file doesn't parse
paths = ARGV.named.map do |name|
HOMEBREW_REPOSITORY/"Library/Formula/#{Formula.caniconical_name name}.rb"
HOMEBREW_REPOSITORY+"Library/Formula/#{Formula.caniconical_name name}.rb"
end
unless ARGV.force?
paths.each do |path|

View File

@ -74,7 +74,7 @@ module Homebrew extend self
rescue FormulaUnavailableError
# check for DIY installation
d = HOMEBREW_PREFIX/name
d = HOMEBREW_PREFIX+name
if d.directory?
ohai "DIY Installation"
d.children.each{ |keg| puts "#{keg} (#{keg.abv})" }

View File

@ -9,7 +9,7 @@ module Homebrew extend self
if ARGV.named.empty?
HOMEBREW_CELLAR.children.select{ |pn| pn.directory? }
else
ARGV.named.map{ |n| HOMEBREW_CELLAR/n }.select{ |pn| pn.exist? }
ARGV.named.map{ |n| HOMEBREW_CELLAR+n }.select{ |pn| pn.exist? }
end.each do |d|
versions = d.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s }
puts "#{d.basename} #{versions*' '}"

View File

@ -7,7 +7,7 @@ module Homebrew extend self
$d = 0
dirs = []
%w[bin sbin etc lib include share].map{ |d| HOMEBREW_PREFIX/d }.each do |path|
%w[bin sbin etc lib include share].map{ |d| HOMEBREW_PREFIX+d }.each do |path|
path.find do |path|
path.extend ObserverPathnameExtension
if path.symlink?

View File

@ -39,7 +39,7 @@ module Homebrew extend self
# Filter out aliases when the full name was also found
results.reject do |alias_name|
if aliases.include? alias_name
resolved_name = (HOMEBREW_REPOSITORY/"Library/Aliases"/alias_name).readlink.basename('.rb').to_s
resolved_name = (HOMEBREW_REPOSITORY+"Library/Aliases"+alias_name).readlink.basename('.rb').to_s
results.include? resolved_name
end
end

View File

@ -54,7 +54,7 @@ class Formula
# Don't resolve paths or URLs
return name if name.include?("/")
aka = HOMEBREW_REPOSITORY/:Library/:Aliases/name
aka = HOMEBREW_REPOSITORY+"Library/Aliases"+name
if aka.file?
aka.realpath.basename('.rb').to_s
else

View File

@ -18,7 +18,7 @@ module HomebrewArgvExtension
require 'keg'
require 'formula'
@kegs ||= downcased_unique_named.collect do |name|
d = HOMEBREW_CELLAR/Formula.caniconical_name(name)
d = HOMEBREW_CELLAR+Formula.caniconical_name(name)
dirs = d.children.select{ |pn| pn.directory? } rescue []
raise NoSuchKegError.new(name) if not d.directory? or dirs.length == 0
raise MultipleVersionsInstalledError.new(name) if dirs.length > 1

View File

@ -299,8 +299,8 @@ class Formula
end
def self.caniconical_name name
formula_with_that_name = HOMEBREW_REPOSITORY/"Library/Formula/#{name}.rb"
possible_alias = HOMEBREW_REPOSITORY/"Library/Aliases"/name
formula_with_that_name = HOMEBREW_REPOSITORY+"Library/Formula/#{name}.rb"
possible_alias = HOMEBREW_REPOSITORY+"Library/Aliases"+name
if name.include? "/"
# Don't resolve paths or URLs
name
@ -365,7 +365,7 @@ class Formula
end
def self.path name
HOMEBREW_REPOSITORY/"Library/Formula/#{name.downcase}.rb"
HOMEBREW_REPOSITORY+"Library/Formula/#{name.downcase}.rb"
end
def deps

View File

@ -27,10 +27,10 @@ HOMEBREW_REPOSITORY = Pathname.new(HOMEBREW_BREW_FILE).realpath.dirname.parent #
# Where we store built products; /usr/local/Cellar if it exists,
# otherwise a Cellar relative to the Repository.
HOMEBREW_CELLAR = if (HOMEBREW_PREFIX/"Cellar").exist?
HOMEBREW_PREFIX/"Cellar"
HOMEBREW_CELLAR = if (HOMEBREW_PREFIX+"Cellar").exist?
HOMEBREW_PREFIX+"Cellar"
else
HOMEBREW_REPOSITORY/"Cellar"
HOMEBREW_REPOSITORY+"Cellar"
end
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp

View File

@ -167,7 +167,7 @@ def install f
end
# Check for man pages that aren't in share/man
if (f.prefix/:man).exist?
if (f.prefix+'man').exist?
opoo 'A top-level "man" folder was found.'
puts "Homebrew requires that man pages live under share."
puts 'This can often be fixed by passing "--mandir=#{man}" to configure.'