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

Add --console #362

Open
avdi opened this issue Sep 29, 2020 · 3 comments
Open

Add --console #362

avdi opened this issue Sep 29, 2020 · 3 comments

Comments

@avdi
Copy link

avdi commented Sep 29, 2020

It would be handy to have an option to start an IRB session in the context of the current Rake workspace, e.g.:

$ rake --console
irb(main):001:0> 

We can currently get the same effect with -e, but there's some nonobvious work to keep IRB from getting confused by the Rake command-line arguments.

$ rake -rirb -e 'ARGV.clear; IRB.start'
irb(main):001:0>

If this is a contribution others would be interested in, I wouldn't mind adding it.

@nobu
Copy link
Member

nobu commented Feb 17, 2021

Isn't it irb -rrake?

@mateusdeap
Copy link

So, I'm keen to help on this if needed, but I'm unsure exactly what this does, since I'm not that familiar with rake yet.

I understood the concept but, for example, what would be the use of this feature? to test out rake tasks or debugging things?

@avdi
Copy link
Author

avdi commented Oct 19, 2022

For performing one-off operations in the exact same context that Rake tasks run in (loaded libraries, whatever constant initialization is triggered by the Rakefile loading, etc.)

Sometimes you want to try something out before you turn it into a rake task. Sometimes you want to do something exactly once, but with the whole Rake context loaded.

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

No branches or pull requests

3 participants