diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-30 10:30:58 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-30 10:30:58 +0200 |
commit | 1ba22bcde1d5ee1e16e14d4d2dd23cbeb01cd59f (patch) | |
tree | 0c74273f34c20e56975a6b7845a034fa3df8c469 /railties/lib/rails/railtie/configuration.rb | |
parent | 69f97f469747777ed1c457715f5361f6b8a0ab7b (diff) | |
parent | 9f569c60adb3505cd7ca1723481199bf26619038 (diff) | |
download | rails-1ba22bcde1d5ee1e16e14d4d2dd23cbeb01cd59f.tar.gz rails-1ba22bcde1d5ee1e16e14d4d2dd23cbeb01cd59f.tar.bz2 rails-1ba22bcde1d5ee1e16e14d4d2dd23cbeb01cd59f.zip |
Merge remote branch 'drogus/engines'
Diffstat (limited to 'railties/lib/rails/railtie/configuration.rb')
-rw-r--r-- | railties/lib/rails/railtie/configuration.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/railties/lib/rails/railtie/configuration.rb b/railties/lib/rails/railtie/configuration.rb index f09e3940cc..e0e4324a4a 100644 --- a/railties/lib/rails/railtie/configuration.rb +++ b/railties/lib/rails/railtie/configuration.rb @@ -17,6 +17,19 @@ module Rails @@app_middleware ||= Rails::Configuration::MiddlewareStackProxy.new end + # This allows you to modify application's generators from Railties. + # + # Values set on app_generators will become defaults for applicaiton, unless + # application overwrites them. + def app_generators + @@app_generators ||= Rails::Configuration::Generators.new + if block_given? + yield @@app_generators + else + @@app_generators + end + end + # Holds generators configuration: # # config.generators do |g| @@ -30,11 +43,11 @@ module Rails # config.generators.colorize_logging = false # def generators - @@generators ||= Rails::Configuration::Generators.new + @generators ||= Rails::Configuration::Generators.new if block_given? - yield @@generators + yield @generators else - @@generators + @generators end end |