Fix brew info
Removed DEFAULT_USER, etc. constants, as code is clearer with actual values IMO, in this case.
This commit is contained in:
parent
02208387c2
commit
3762bbf56a
@ -47,9 +47,6 @@ Mercurial can be install thusly:
|
||||
end
|
||||
end
|
||||
|
||||
DEFAULT_USER = 'mxcl'
|
||||
DEFAULT_BRANCH = 'master'
|
||||
|
||||
def __make url, name
|
||||
require 'formula'
|
||||
|
||||
@ -167,20 +164,16 @@ def github_info name
|
||||
branch = ($1 || '').chomp
|
||||
end
|
||||
|
||||
user = DEFAULT_USER if user.empty?
|
||||
branch = DEFAULT_BRANCH if user.empty?
|
||||
user = 'mxcl' if user.empty?
|
||||
branch = 'master' if user.empty?
|
||||
|
||||
history="http://github.com/#{user}/homebrew/commits/#{branch}/Library/Formula/#{formula_name}"
|
||||
exec 'open', history
|
||||
return "http://github.com/#{user}/homebrew/commits/#{branch}/Library/Formula/#{formula_name}"
|
||||
end
|
||||
|
||||
def info name
|
||||
require 'formula'
|
||||
|
||||
if ARGV.flag? '--github'
|
||||
github_info name
|
||||
return
|
||||
end
|
||||
exec 'open', github_info(name) if ARGV.flag? '--github'
|
||||
|
||||
f=Formula.factory name
|
||||
puts "#{f.name} #{f.version}"
|
||||
@ -205,6 +198,7 @@ def info name
|
||||
puts
|
||||
end
|
||||
|
||||
history = github_info
|
||||
puts history if history
|
||||
|
||||
rescue FormulaUnavailableError
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user