aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-15 16:20:48 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-15 16:20:48 +0200
commit7022b58842ec3490d85efc5b947d86a0fd72d0cb (patch)
treead1134b23961e64f6f754863f82dfeb2e3e0c8b2 /railties/lib/generators.rb
parent0702e04e0d671227259f71f614adfe3f35f88b48 (diff)
downloadrails-7022b58842ec3490d85efc5b947d86a0fd72d0cb.tar.gz
rails-7022b58842ec3490d85efc5b947d86a0fd72d0cb.tar.bz2
rails-7022b58842ec3490d85efc5b947d86a0fd72d0cb.zip
Allow namespaced configuration on generators.
Diffstat (limited to 'railties/lib/generators.rb')
-rw-r--r--railties/lib/generators.rb86
1 files changed, 58 insertions, 28 deletions
diff --git a/railties/lib/generators.rb b/railties/lib/generators.rb
index ddb65c8579..6935cb8319 100644
--- a/railties/lib/generators.rb
+++ b/railties/lib/generators.rb
@@ -17,34 +17,64 @@ require 'generators/named_base'
module Rails
module Generators
- DEFAULT_ALIASES = {
- :actions => '-a',
- :fixture_replacement => '-r',
- :orm => '-o',
- :resource_controller => '-c',
- :scaffold_controller => '-c',
- :stylesheets => '-y',
- :test_framework => '-t',
- :template_engine => '-e'
- }
-
- DEFAULT_OPTIONS = {
- :fixture => true,
- :force_plural => false,
- :helper => true,
- :integration_tool => :test_unit,
- :layout => true,
- :migration => true,
- :orm => :active_record,
- :performance_tool => :test_unit,
- :resource_controller => :controller,
- :scaffold_controller => :scaffold_controller,
- :singleton => false,
- :stylesheets => true,
- :test_framework => :test_unit,
- :template_engine => :erb,
- :timestamps => true
- }
+ DEFAULT_ALIASES = Hash.new{ |h,k| h[k] = {} }
+ DEFAULT_ALIASES.merge!(
+ :rails => {
+ :actions => '-a',
+ :orm => '-o',
+ :resource_controller => '-c',
+ :scaffold_controller => '-c',
+ :stylesheets => '-y',
+ :template_engine => '-e',
+ :test_framework => '-t'
+ },
+
+ :test_unit => {
+ :fixture_replacement => '-r',
+ },
+
+ :plugin => {
+ :generator => '-g',
+ :tasks => '-r'
+ }
+ )
+
+ DEFAULT_OPTIONS = Hash.new{ |h,k| h[k] = {} }
+ DEFAULT_OPTIONS.merge!(
+ :active_record => {
+ :migration => true,
+ :timestamps => true
+ },
+
+ :erb => {
+ :layout => true
+ },
+
+ :rails => {
+ :force_plural => false,
+ :helper => true,
+ :layout => true,
+ :orm => :active_record,
+ :integration_tool => :test_unit,
+ :performance_tool => :test_unit,
+ :resource_controller => :controller,
+ :scaffold_controller => :scaffold_controller,
+ :singleton => false,
+ :stylesheets => true,
+ :template_engine => :erb,
+ :test_framework => :test_unit
+ },
+
+ :test_unit => {
+ :fixture => true,
+ :fixture_replacement => nil
+ },
+
+ :plugin => {
+ :generator => false,
+ :tasks => false
+ }
+ )
def self.aliases
@@aliases ||= DEFAULT_ALIASES.dup