diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-18 12:28:52 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-18 16:21:10 +0100 |
commit | e75ea474346e74e36d92febd47985c3571b1472b (patch) | |
tree | aa6813658ffc7492f0b781765e730950f224096f /railties/lib/rails | |
parent | a2e2e73c5ef7c9082810d77c831c50c91011e6d9 (diff) | |
download | rails-e75ea474346e74e36d92febd47985c3571b1472b.tar.gz rails-e75ea474346e74e36d92febd47985c3571b1472b.tar.bz2 rails-e75ea474346e74e36d92febd47985c3571b1472b.zip |
Automatically remove :generators: from namespaces.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/base.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index ecd0a1c6ea..e8c7a0993b 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -219,7 +219,7 @@ module Rails builtin.sort! lookup("*") - others = subclasses.map{ |k| k.namespace.gsub(':generators:', ':') } + others = subclasses.map{ |k| k.namespace } others -= Rails::Generators.builtin others.sort! diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 9cc342b202..37effb77db 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -42,7 +42,7 @@ module Rails # def self.namespace(name=nil) return super if name - @namespace ||= super.sub(/_generator$/, '') + @namespace ||= super.sub(/_generator$/, '').sub(/:generators:/, ':') end # Invoke a generator based on the value supplied by the user to the |