# Free to modify and redistribute with credit.
# If you get errors, make sure to set your PATH in ~/.bash_profile per
# Adding /opt/local/bin (where it is for me) to avoid having to do this.
html_header "CapMate" "$TM_PROJECT_DIRECTORY"
cd "$TM_PROJECT_DIRECTORY" 2> /dev/null
[ -d app/controllers ] || exit_show_html "Not in a Rails project!"
ruby -e 'class << STDERR; alias_method :old_puts, :puts; def puts(m); old_puts(m.strip); Kernel.puts; end; end; load(`which cap`.strip);' deploy | pre
Capistrano buffers its output. After trying a whole lot of different things, the only thing that actually worked to get unbuffered, incremental output was the Ruby kludge above.
STDERR.puts, which the Capistrano logger uses for output, is monkey-patched to run
Kernel.puts after each piece of output.
I only started playing with Capistrano yesterday. If I find I use more of Capistrano regularly, I might write more TextMate commands, but I've no such plans at this time. If you need more commands, feel free to write and distribute your own with this as a starting point.