rake icon indicating copy to clipboard operation
rake copied to clipboard

Add --console

Open avdi opened this issue 5 years ago • 3 comments

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.

avdi avatar Sep 29 '20 14:09 avdi

Isn't it irb -rrake?

nobu avatar Feb 17 '21 04:02 nobu

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?

mateusdeap avatar Oct 19 '22 13:10 mateusdeap

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.

avdi avatar Oct 19 '22 13:10 avdi