diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 16:20:39 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 16:20:39 -0700 |
commit | 4e0694c603099a2f76de8ad0f65c4f446a44dc4f (patch) | |
tree | 164a7cedcadc135646bb8c5fd9cdbe7f6954153a | |
parent | 82f59a98035c8e9e4151ff0272f1a81fe9ec288c (diff) | |
download | rails-4e0694c603099a2f76de8ad0f65c4f446a44dc4f.tar.gz rails-4e0694c603099a2f76de8ad0f65c4f446a44dc4f.tar.bz2 rails-4e0694c603099a2f76de8ad0f65c4f446a44dc4f.zip |
return argv from each method
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 0377bfb4a3..6b59400f95 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -318,11 +318,10 @@ module Rails def prepare! handle_version_request!(@argv.first) - unless handle_invalid_command!(@argv.first, @argv) + handle_invalid_command!(@argv.first, @argv) do @argv.shift handle_rails_rc!(@argv) end - @argv end def self.default_rc_file @@ -340,8 +339,10 @@ module Rails end def handle_invalid_command!(argument, argv) - if argument != "new" - argv[0] = "--help" + if argument == "new" + yield + else + ['--help'] + argv.drop(1) end end @@ -349,6 +350,7 @@ module Rails unless argv.delete("--no-rc") insert_railsrc_into_argv!(argv, railsrc(argv)) end + argv end def railsrc(argv) |