-
Notifications
You must be signed in to change notification settings - Fork 486
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
Use Pry as Guard interactor #327
Conversation
It seems to be pure awesomeness, I'll give it a try this week. Thanks! |
Pry::RC_FILES went away recently, in this commit: pry/pry@d830ebb The hooks should work both in 0.9.10 and HEAD pry. Also, gave the user a hint about ~/.guardrc, because it changes the interactor experience quite a bit with/without one.
👍 |
We should try to avoid to much noise from Guard about a specific preferred setup. Thanks @rking for https://gist.github.com/da7f4b2f8465a3d75cd4
So all specs are now in place and the pull request should be fine to merge. However I'd like to have some more feedback how it works for you guys. For me it works mostly, but I have seldom hangs of the interactor, so it won't read any more input. Do other people also see this behavior? I have spent some hours but didn't discover why this happens sometimes... |
Yeah @rymai and I also get (quite frequently sadly) hangs of the interactor (no more key input accepted). |
Yes, we can't merge until the nasty bug is resolved. I've already spent some hours to find the cause for that bug, but without success. I'll keep the branch in sync, until I (or someone else) has time to dig into it an fix it. I'm on holiday for the next two weeks, so I won't be able to put any work into it before the 15th of October. |
@netzpirat great, enjoy your holiday! |
+1 |
Are you 100% sure you get hangs? What I see from time to time is echo being off. When I can't see what I'm doing I just run this:
Then it fixes it. At one point I poked around guard's stty stuff… not sure what any of it is really doing. |
OMG, you're a genius @rking You're right! It doesn't hang, just no echo. I restored the old terminal helper code and I haven't seen the problem until then. @guard/core-team Can you give it a try? |
It seems to work, but I'll use it tomorrow all day to be sure! :) Thanks! |
That would be great @rymai. Since I'm back from holiday, my work is just making phone calls, visiting customers and write emails 😢 So sadly no Guard running all day long. |
Just use interactor :off to disable, all other usages are still deprecated.
@rymai Did you had the chance to run the pry interactor for some time last week? |
@netzpirat for me it seems to works perfectly. |
@netzpirat Yep, seems to work fine! |
Great! I will merge today all pull request you're fine with. |
Perfect, 1.5.0 for today! |
This is awesome guys, thanks for the work. One thing though regarding the upgrade experience: Guard now spews deprecation warnings about usage of There is a pointer to the Pry docs for things one might do with So, I think the problem here is primarily just one of updating the blessed documentation 😉 Or maybe also the DSL should be loaded when evaluating |
@ches As developer we never really have an upgrade, since we continuously move forward, so thanks for your feedback. There is no deprecation message for the I just re-read the deprecation warning and simplified it, because it was not quite correct and the hint for the Pry customization is just not necessary, since it targets more advanced use of Guard. In fact this was also one of the drivers for the change: people wanted to have more control over the workflow with Guard, and a programmable interactor using the Guard API makes a lot of customization possible. It should not replace your main REPL, but it can be very useful for improving your test workflow for example. We have a short sentence in the README about the
If it's not clear to you that the The quote from the README has also a link to the Pry wiki and if you follow it, then I see pages about
and they contain tons of information and examples, and there is even a lot more available. What are you missing? |
@netzpirat Thanks for the detailed reply.
You're right, apologies, it was only Regarding your updated deprecation message, in my case I'm only wanting to set a history file location: interactor :history_file => 'my preferred location' It sounds like I shouldn't be getting a deprecation warning for this usage at all? Or what would be the recommended way/place to configure this now? I think that's my main question and what I found confusing/circular about the docs and warning. I noted the mention of the Pry customization in the README. Personally, I'm a Pry user and I'm familiar with customizing and extending it, so to me at least, the wording and the expressed intent is fairly clear. I think what tripped me up about it is the ordering of the information: that mention of |
So in conclusion, maybe |
The |
Changes Unknown when pulling 4a9f16a on interactor/pry into * on master*. |
This is the initial integration of Pry as replacement of the Guard interactor (
:simple
,:readline
and:coolline
are all gone). Pry itself makes use of rb-readline and coolline whenever they are available, so support for these gems is still available.Guard provides its own set of Pry commands that can be used to control Guard in the same way as before. However
Enter
doesn't trigger therun_all
action anymore, instead use theall
command.The biggest advantage of using Pry is that it comes with a powerful plugin system that allows you to customize and extend the console. This will allow Guard users to release gems that provide extended functionality to Guard, as it's needed by for example by #321 and #305.
Pry will evaluate
~/.guardrc
in addition to the standard~/.pryrc
and./.pryrc
before the session starts, which allows the customization of prompts, commands, aliases, etc.I didn't provide the short hand commands
c
,s
,p
, etc. by intention to avoid variable and method collisions (remember, we have now a full featured Ruby REPL with shell access), because it's so easy to customize it. Just addto
~/.guardrc
and you're fine.There's still some work to do like missing commands specs and a better Pry session restore, but it works and I'd like to have people play with it and give feedback.
I recommend to have a look at the Pry Wiki to see what's possible.