info: output correct URL for tapped dupes

Tapped formulae that dupe those in core now display the correct URL when
invoked like `brew info homebrew/dupes/openssl`.

This also fixes the broken `brew info` test.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-04-06 23:40:54 -05:00
parent 504756745b
commit d2c9b27e14
2 changed files with 5 additions and 4 deletions

View File

@ -28,8 +28,8 @@ module Homebrew extend self
end end
end end
def github_info name def github_info f
path = Formula.path(name).realpath path = f.path.realpath
if path.to_s =~ %r{#{HOMEBREW_REPOSITORY}/Library/Taps/(\w+)-(\w+)/(.*)} if path.to_s =~ %r{#{HOMEBREW_REPOSITORY}/Library/Taps/(\w+)-(\w+)/(.*)}
user = $1 user = $1
@ -47,7 +47,7 @@ module Homebrew extend self
end end
def info_formula f def info_formula f
exec 'open', github_info(f.name) if ARGV.flag? '--github' exec 'open', github_info(f) if ARGV.flag? '--github'
puts "#{f.name} #{f.version}" puts "#{f.name} #{f.version}"
puts f.homepage puts f.homepage
@ -77,7 +77,7 @@ module Homebrew extend self
puts "Not installed" puts "Not installed"
end end
history = github_info f.name history = github_info(f)
puts history if history puts history if history
the_caveats = (f.caveats || "").strip the_caveats = (f.caveats || "").strip

View File

@ -6,6 +6,7 @@ class TestBall <Formula
@url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz" @url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
@homepage = 'http://example.com/' @homepage = 'http://example.com/'
super "testball" super "testball"
@path = Pathname.new(__FILE__)
end end
def install def install
prefix.install "bin" prefix.install "bin"