Don't let generators die if rubygems puts crap in your load path.

This commit is contained in:
José Valim 2010-01-21 12:10:39 +01:00
parent 31fddf2ace
commit 48dc1ae309

@ -243,7 +243,9 @@ def self.lookup(namespaces) #:nodoc:
raise unless e.message =~ /#{Regexp.escape(path)}$/
rescue NameError => e
raise unless e.message =~ /Rails::Generator([\s(::)]|$)/
warn "[WARNING] Could not load generator #{path.inspect} because it's a Rails 2.x generator, which is not supported anymore. Error: #{e.message}"
warn "[WARNING] Could not load generator #{path.inspect} because it's a Rails 2.x generator, which is not supported anymore. Error: #{e.message}.\n#{e.backtrace}"
rescue Exception => e
warn "[WARNING] Could not load generator #{path.inspect}. Error: #{e.message}.\n#{e.backtrace}"
end
end
end