From 9acb721e6a4e78bdd1b9d5f9fb80f4ed2b263b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 27 Jun 2009 12:03:39 +0200 Subject: Do not generate aliases automatically to avoid conflicts. --- railties/lib/generators/base.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'railties/lib/generators/base.rb') 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) -- cgit v1.2.3