Permalink
Browse files

Fix regexp in generators for right catching error message

  • Loading branch information...
1 parent 81f7bf5 commit ca044113f38ed900fe30790c87a87089e4e9bcee @gazay gazay committed Jun 20, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/generators.rb
@@ -300,7 +300,7 @@ def self.lookup(namespaces) #:nodoc:
rescue LoadError => e
raise unless e.message =~ /#{Regexp.escape(path)}$/
rescue NameError => e
- raise unless e.message =~ /Rails::Generator([\s(::)]|$)/
+ 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}.\n#{e.backtrace.join("\n")}"
rescue Exception => e
warn "[WARNING] Could not load generator #{path.inspect}. Error: #{e.message}.\n#{e.backtrace.join("\n")}"

0 comments on commit ca04411

Please sign in to comment.