diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-02-03 04:32:17 -0800 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-02-03 04:32:17 -0800 |
commit | c5512946e0eed19ff5c212ac0618cc693308cf83 (patch) | |
tree | 41808274ab680486545c44f47ccfc52564d610d8 /railties/lib | |
parent | 2abaa19e77d1097730cfa6e0924ee7c1660ac01f (diff) | |
parent | c6ef45d6c4e718b306ba8309e15ee5c1fb532878 (diff) | |
download | rails-c5512946e0eed19ff5c212ac0618cc693308cf83.tar.gz rails-c5512946e0eed19ff5c212ac0618cc693308cf83.tar.bz2 rails-c5512946e0eed19ff5c212ac0618cc693308cf83.zip |
Merge pull request #4860 from carlosantoniodasilva/generators-hide-namespace
Add convenience method to hide a generator from the available ones
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/base.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 8f779316c1..60e94486bb 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -48,6 +48,12 @@ module Rails @namespace ||= super.sub(/_generator$/, '').sub(/:generators:/, ':') end + # Convenience method to hide this generator from the available ones when + # running rails generator command. + def self.hide! + Rails::Generators.hide_namespace self.namespace + end + # Invoke a generator based on the value supplied by the user to the # given option named "name". A class option is created when this method # is invoked and you can set a hash to customize it. |