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
commit9b5cb6cfb648c528cfe9587363ee930dbfd23025 (patch)
tree3db2500beb2e16fcc2cadf61b2f840b51697ca6f /Library/Homebrew/cmd
parent62db042277dbd60d8b6ff74416e84c053a62b781 (diff)
downloadbrew-9b5cb6cfb648c528cfe9587363ee930dbfd23025.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?