Vincent Wang wrote:
> #! /usr/bin/env ruby
>
> event_hash = {
> /^=> Ctrl-C to shutdown server/ => lambda { ["Rails started"] },
> /^(\d+ tests, \d+ assertions, \d+ failures, \d+ errors)/ => lambda { [$1,
> "Ruby Test"] },
> }
>
> def notify(msg, title="Notification")
> system(%Q{/usr/local/bin/growlnotify --image ~/Desktop/mylogo.png -n
> "ShellNotification" -m "#{msg}" "#{title}" 2>/dev/null;})
> end
>
> ARGF.each do |line|
> event_hash.each_pair do |k, v|
> notify(*v.call) if line =~ k
> end
> end
in the hash value of "/^(\d+ tests, \d+ assertions, \d+ failures, \d+ errors)/",
"lambda { [$1, "Ruby Test"] }", where does "$1" come from?
I think if I'm going to implement something like this, I'll do a simple
shell script with the patterns in a separate configuration file and with
something that lets me disable it automatically as soon as I want to
replace the pipe-pane with a log-to-file.
I'm not sure what happens when the pipe-pane is blocked for a noticable
period of time (eg. by a slow ruby or an error). Does all of tmux hang,
just the pane, do I just loose content in the pipe?
clemens
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users