Closed monkstone closed 10 years ago
For linux users (possibly mac) there may be a workaround using a "watch script" similar to this script for vanilla processing watch.
#!/bin/bash
while inotifywait -e modify /home/foo/sketchbook/$1; do
ps cax | grep java > /dev/null
if [ $? -eq 0 ]; then
echo "killing java"
killall java
exec -a processing /usr/bin/processing-java --sketch=/home/foo/sketchbook/$1/ --output=/tmp/$1/ --run --force &
else
echo "Running the Sketch"
exec -a processing /usr/bin/processing-java --sketch=/home/foo/sketchbook/$1/ --output=/tmp/$1 --run --force &
fi
done
requires inotify-tools and incron
Watch mode should be fixed in the next release (thanks to a fix in vanilla processing that releases PGL). Tested as working in the development branch JRubyArt, and with ruby-processing (using development version of processing-pre-2.1.2).
Issue nothing to do with ruby-processing, problem came from processing, should be fixed by processing-2.1.2 so I am closing the issue.
This may not be fixable from ruby-processing, since I believe opengl resources do not get properly released in vanilla processing. Anyway if you use a decent editor with macro support (sublime, emacs, vim, jEdit) it is no big deal, as you can have a macro that allows you to "rp5 run" the currently edited sketch with one or two mouse click / key strokes. You could also experiment with an external tool like guard, but unless you are you using it already you will probably waste more time than you could possibly save.