[TxMt] Run command on Event and other stuff
timshadel at gmail.com
Thu Aug 4 06:47:28 UTC 2005
I'm really new to TextMate, having recently converted to a bit of Ruby
development on the Mac. I'm interested in writing a bundle or some
commands to help me use a tool called Hackystat. You can check out a
few things about it here:
Basically, it's a metrics collection server. It lets you install
small sensors to collect software metrics, like how long you worked on
a particular file. Since it's automatic it stays out of your way,
it's consistent, and it's reliable. Each user controls their own
I want to write a sensor to collect these metrics from TextMate. The
basics would be: 1) log when a new file is opened, 2) log when a file
is closed, and 3) every so often (30 seconds) log which file is in the
active window. Pretty simple.
I'd like to start a small command-line program from a TM command, but
I'd like to keep it open until TM is closed and send info to it
periodically throughout the TM session.
I've seen several items about launching command-line programs from TM,
but can I keep one open in the background? Does TM block until the
script finishes or can my Ruby script start another process and then
return and get back to that process later?
Can I intercept the File | Open actions and then record my metrics? I
haven't seen how to do this in other posts. There's a growing list of
tools that support Hackystat, including Emacs, Vim, Eclipse, and
VisualStudio. I'd love to add TextMate to that list.
Plese let me know if any of this is possible and where I can dig up
some documentation on it.
More information about the textmate