Use Formula.path

This commit is contained in:
Jack Nagel 2014-02-28 16:51:15 -06:00
parent 2d50501c4e
commit 26785dbe5d
4 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ module Homebrew extend self
if name.include? '/'
Pathname.new(name)
else
HOMEBREW_REPOSITORY+"Library/Formula/#{name}.rb"
Formula.path(name)
end
end
unless ARGV.force?

View File

@ -25,7 +25,7 @@ module Homebrew extend self
ARGV.named.each do |name|
# if a formula has been tapped ignore the blacklisting
if not File.file? HOMEBREW_REPOSITORY/"Library/Formula/#{name}.rb"
unless Formula.path(name).file?
msg = blacklisted? name
raise "No available formula for #{name}\n#{msg}" if msg
end

View File

@ -8,7 +8,7 @@ module Homebrew extend self
path = ARGV.formulae.first.path.realpath
rescue FormulaUnavailableError
# Maybe the formula was deleted
path = HOMEBREW_REPOSITORY/"Library/Formula/#{ARGV.named.first}.rb"
path = Formula.path(ARGV.named.first)
end
cd path.dirname # supports taps
exec "git", "log", *ARGV.options_only + ["--", path]

View File

@ -403,7 +403,7 @@ class Formula
end
# test if the name is a core formula
formula_with_that_name = Pathname.new("#{HOMEBREW_LIBRARY}/Formula/#{name}.rb")
formula_with_that_name = Formula.path(name)
if formula_with_that_name.file? and formula_with_that_name.readable?
return name
end