Skip to content
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

Conversation

y-yagi
Copy link
Member

@y-yagi 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
Copy link

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick but can you add a line break after this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Thanks! I updated.

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 show_correct_command_name_in_help_of_rails_runner branch from b6fc139 to 06cd7ab Compare March 26, 2016 11:19
@kaspth kaspth merged commit 59bf226 into rails:master Mar 27, 2016
@kaspth
Copy link
Contributor

kaspth commented Mar 27, 2016

Thanks!

@y-yagi
Copy link
Member Author

y-yagi commented Mar 27, 2016

😄

@y-yagi y-yagi deleted the show_correct_command_name_in_help_of_rails_runner branch March 27, 2016 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants