diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-27 12:03:39 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-27 21:29:59 +0200 |
commit | 9acb721e6a4e78bdd1b9d5f9fb80f4ed2b263b34 (patch) | |
tree | fd86e4253977efb148455248865d8c3fef315447 | |
parent | ff48e23a4eb9f4a5fd3a02addb398499fb3c1455 (diff) | |
download | rails-9acb721e6a4e78bdd1b9d5f9fb80f4ed2b263b34.tar.gz rails-9acb721e6a4e78bdd1b9d5f9fb80f4ed2b263b34.tar.bz2 rails-9acb721e6a4e78bdd1b9d5f9fb80f4ed2b263b34.zip |
Do not generate aliases automatically to avoid conflicts.
-rw-r--r-- | railties/lib/generators/base.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/railties/lib/generators/base.rb b/railties/lib/generators/base.rb index 5c3b3f0782..a29bda6afd 100644 --- a/railties/lib/generators/base.rb +++ b/railties/lib/generators/base.rb @@ -9,6 +9,13 @@ module Rails :template_engine => 'erb' } + ALIASES = { + :orm => '-o', + :helper => '-v', + :test_framework => '-t', + :template_engine => '-e' + } + class Error < Thor::Error end @@ -84,7 +91,7 @@ module Rails options = default_options.dup options[:desc] ||= "#{name.to_s.humanize} to be used" options[:banner] ||= "NAME" - options[:aliases] ||= "-" + name.to_s.gsub(/_framework$/, '').split('_').last[0,1] + options[:aliases] ||= ALIASES[name] class_option name, options.merge!(:type => :default, :default => DEFAULTS[name]) @@ -134,8 +141,7 @@ module Rails names.each do |name| options = default_options.dup - options[:desc] ||= "Indicates when to use #{name.to_s.humanize}" - options[:aliases] ||= "-" + name.to_s.last[0,1] + options[:desc] ||= "Indicates when to use #{name.to_s.humanize}" class_option name, options.merge!(:type => :boolean, :default => DEFAULTS[name] || false) |