From bde14bef61b16fe3f7190f66cf9d93f14c4c7b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hrvoje=20=C5=A0imi=C4=87?= Date: Sun, 12 May 2013 22:55:41 +0200 Subject: 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". --- railties/lib/rails/generators/rails/app/app_generator.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3