New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show correct command name in help of rails runner #24325

Merged
merged 1 commit into from Mar 27, 2016

Conversation

Projects
None yet
5 participants
@y-yagi
Member

y-yagi commented Mar 26, 2016

Summary

If you using spring, help of rails runner will show an incorrect command name.

$ ./bin/rails r a
Running via Spring preloader in process 12334
Please specify a valid ruby command or the path of a script to run.
Run 'rails_runner -h' for help. 

spring is rewrite $0 in the interior command name.
Therefore, for $0 correct command name does not appear, fixed so that it does not use $0.

@rails-bot

This comment has been minimized.

rails-bot commented Mar 26, 2016

r? @pixeltrix

(@rails-bot has picked a reviewer for you, use r? to override)

@@ -2,7 +2,7 @@
options = { environment: (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development").dup }
code_or_file = nil
command = 'bin/rails runner'
if ARGV.first.nil?

This comment has been minimized.

@prathamesh-sonpatki

prathamesh-sonpatki Mar 26, 2016

Member

Nitpick but can you add a line break after this?

This comment has been minimized.

@y-yagi

y-yagi Mar 26, 2016

Member

Oops. Thanks! I updated.

show correct command name in help of rails runner
If use rails together with `spring`, `spring` is rewrite `$0` in the interior
command name. Therefore, for `$0` correct command name does not appear, `$0` has
been modified so that it does not use.

@y-yagi y-yagi force-pushed the y-yagi:show_correct_command_name_in_help_of_rails_runner branch from b6fc139 to 06cd7ab Mar 26, 2016

@kaspth kaspth merged commit 59bf226 into rails:master Mar 27, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@kaspth

This comment has been minimized.

Member

kaspth commented Mar 27, 2016

Thanks!

@y-yagi

This comment has been minimized.

Member

y-yagi commented Mar 27, 2016

😄

@y-yagi y-yagi deleted the y-yagi:show_correct_command_name_in_help_of_rails_runner branch Mar 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment