aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2013-04-27 14:44:48 -0500
committerJack Nagel2013-04-27 14:44:48 -0500
commit03a4ecfbcaf758f5c2c1b06fcbf332c44a6e1d68 (patch)
tree3b2542a8c99f85a81c15a4a2aca6af9229124f7a /Library/Homebrew/cmd
parent17471361b4592ddc21ac920e234e9d6443ce3838 (diff)
downloadhomebrew-03a4ecfbcaf758f5c2c1b06fcbf332c44a6e1d68.tar.bz2
Allow `brew versions` to work with underspecified formulae
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/versions.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/versions.rb b/Library/Homebrew/cmd/versions.rb
index 205f4467e..45968100f 100644
--- a/Library/Homebrew/cmd/versions.rb
+++ b/Library/Homebrew/cmd/versions.rb
@@ -77,6 +77,9 @@ class Formula
rev_list.find{ |sha| version == version_for_sha(sha) }
end
+ IGNORED_EXCEPTIONS = [SyntaxError, TypeError, NameError,
+ ArgumentError, FormulaSpecificationError]
+
def version_for_sha sha
mktemp do
path = Pathname.new(Pathname.pwd+"#{name}.rb")
@@ -86,7 +89,7 @@ class Formula
begin
Object.send(:remove_const, Formula.class_s(name))
nostdout { Formula.factory(path).version }
- rescue SyntaxError, TypeError, NameError, ArgumentError => e
+ rescue *IGNORED_EXCEPTIONS => e
# We rescue these so that we can skip bad versions and
# continue walking the history
ohai "#{e} in #{name} at revision #{sha}", e.backtrace if ARGV.debug?