aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHrvoje Šimić <shime.ferovac@gmail.com>2013-05-12 22:55:41 +0200
committerHrvoje Šimić <shime.ferovac@gmail.com>2013-05-12 23:39:25 +0200
commitbde14bef61b16fe3f7190f66cf9d93f14c4c7b15 (patch)
treed6d1a22698fe0495a1b2574f520348b3cf942c91
parent2519fb0e6d468b45e6d12157d436540c9ef080a0 (diff)
downloadrails-bde14bef61b16fe3f7190f66cf9d93f14c4c7b15.tar.gz
rails-bde14bef61b16fe3f7190f66cf9d93f14c4c7b15.tar.bz2
rails-bde14bef61b16fe3f7190f66cf9d93f14c4c7b15.zip
better error message when app name is not passed in `rails new`
Prior to this change, for the following command: $ rails new we received "Options should be given after the application name" as an error message. This is outdated and should be "Application name should be provided in arguments".
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 5877579fc4..d48dcf9ef3 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -151,7 +151,15 @@ module Rails
desc: "Show Rails version number and quit"
def initialize(*args)
- raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank?
+ if args[0].blank?
+ if args[1].blank?
+ # rails new
+ raise Error, "Application name should be provided in arguments. For details run: rails --help"
+ else
+ # rails new --skip-bundle my_new_application
+ raise Error, "Options should be given after the application name. For details run: rails --help"
+ end
+ end
super