Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0

Monday 25 February 2013

My Fork is now at Processing-2.0 and JRuby-1.7.4

Finally it might all be coming together, following the recent release of JRuby-1.7.4 and the even more recent release of Processing-2.0, I have updated my ruby-processing fork here. Please fork/clone it (includes many examples translated from the vanilla processing release...), especially if you are on Windows or Mac, and let me know how you get on.....
Building and testing is as simple running rake in the ruby-processing folder.
Linux users might want to substitute the Rakefile in the vendors folder with this gist, apparently OSX tar doesn't like the --wildcard flag which seems to required on linux for pattern matching on the basis that there's probably more of them than us I've changed to the OSX compatible version (wont matter when it gets to gem stage anyway)....
Bare rake builds and tests the gem (don't worry if one test fails by deadlock, that threaded test by moomar is just a bit too clever, I should really fix it..). To re-run test "rake test" to install "rake install" (super user is reqd on linux, unless you just install in your home directory, but then make sure RP5 is on your path).
The easiest way to develop with ruby-processing is to use TextmateSublime text 2.0 if you are on a Mac or JEdit (available with extensions/plugins that allow the running of the sketch directly from the editor, NB: snippets for textmate need updating to be bare sketches) for Windows / Linux users (jEdit option should also work on the Mac, but won't look as nice as the other editors).
For simple sketches you can also make use of the watch mode for "live" editing, runs on "save".
You could of course use vim as an editor here is video proof, it should also be possible to run directly from the vim editor, but I can't tell whether that's being used in the video!!!
However the following entry will do it, and display output in a new console alongside the current vim console!!!!
:let f=expand("%")|vnew|execute '.!rp5 run "' . f . '"'
Or just to simply run the sketch from ruby
:!rp5 run %  

EMacs should also work, or any other macro enabled editor.
Here is trefoil sketch running from jEdit on my linux box:-

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2