aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-12-12 16:22:54 +0000
committerMax Howell2009-12-12 16:24:19 +0000
commit3762bbf56ac0fcc571660ea91a5db3e1e779610b (patch)
tree749d6a7895e7427bde6941dba1113a8edb302f8a /Library
parent02208387c27cdfac5397948547e98eee4a5739d3 (diff)
downloadbrew-3762bbf56ac0fcc571660ea91a5db3e1e779610b.tar.bz2
Fix brew info
Removed DEFAULT_USER, etc. constants, as code is clearer with actual values IMO, in this case.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index f06b0b206..9035f4dcc 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -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