rejeep / prodigy.el

Manage external services from within Emacs
GNU General Public License v3.0
552 stars 39 forks source link

Check for ready messages on process output #43

Closed shosti closed 10 years ago

shosti commented 10 years ago

Closes #41.

rejeep commented 10 years ago

You forgot about tag inheritance. This one is easy, should work like prodigy-service-cwd for example.

shosti commented 10 years ago

Oops, yes, PR updated

rejeep commented 10 years ago

Sorry if I'm a pain, but could you try to follow the "accessor" pattern, please? I want to stay as consistent as possible.

So create an accessor function (under this section https://github.com/rejeep/prodigy.el/blob/master/prodigy.el#L335) and use that in prodigy-check-for-ready-message.

Also, all accessor functions are also tested in https://github.com/rejeep/prodigy.el/blob/master/test/prodigy-service-accessors-test.el.

shosti commented 10 years ago

OK, PR updated.

rejeep commented 10 years ago

I tried this out but I couldn't get it to work and now I figured out why. I have these services for Rails:

(prodigy-define-tag
  :name 'thin
  :hide t
  :ready-message "Listening on 0\\.0\\.0\\.0:[0-9]+, CTRL\\+C to stop")

(prodigy-define-tag
  :name 'webrick
  :hide t
  :ready-message "WEBrick::HTTPServer#start: pid=[0-9]+ port=[0-9]+")

(prodigy-define-tag
  :name 'mongrel
  :hide t
  :ready-message "Ctrl-C to shutdown server")

(prodigy-define-tag
  :name 'rails
  :truncate-output t
  :tags '(thin mongrel webrick))

The problem is that prodigy-service-or-first-tag-with will only pick the first match. We need to allow this property to be a list, just like prodigy-service-on-output.

shosti commented 10 years ago

Oh, sorry, didn't realize that was the expected behavior. PR updated (hopefully this one will be OK!).

rejeep commented 10 years ago

Merged, thanks!

In the future, I don't mind if you make a new commit for each comment I make. I makes it easier for me to see what changed and it also makes pulling painless.

You are writing a lot of high quality code for Prodigy and I think you've earned commit access, if you want to? I still think new features should be pull requests to give other people a chance to look it over before merge. The same goes for me, I know the source best, but I still make mistakes from time to time. What do you say?

shosti commented 10 years ago

Sounds great! (I'd still like to do PRs for most things, of course.) Good to know about keeping commit history (I tend to squash by habit since some people get a little obsessive about keeping commit history clean). Thanks for making such a great library, and I'm happy to contribute!

rejeep commented 10 years ago

Great, added you as a contributor!