-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Building latest gem Martin Prout edited this page on 5 Sep 2017 · 82 revisions
Clone this repository
Install maven (ruby-2.3+ or better is assumed to be installed)
maven-3.3.9
jdk1.8.0_131+ can be openjdk with OpenJFX a separate download works on ArchLinux
cd JRubyArt
rake
Regular Minitests tests (ideally need an installed jruby) but should run and pass, but the sketch tests will fail without the optional configuration, which will be needed runtime:- Optional Configuration ( but required for installation )
You should install processing-3.3.6 and the video library independently (maven central only has 3.0.2) furthermore the sketch tests will not run without them and a valid config.yml. You probably also want to install want to install jruby-9.1.12.0), but in case you don't add JRUBY: 'false' to config.yml.
NB: You will need to edit the pom.rb properties to match your 'processing.core' and 'processing.sketchbook' paths on your system.
Config file is config.yml in ~/.jruby_art folder so can co-exist with a ruby-processing install
Typical linux version
PROCESSING_ROOT: /home/tux/processing-3.3.6 sketchbook_path: /home/tux/sketchbook3
Typical macosx version
PROCESSING_ROOT: /Applications/Processing.app/Contents/Java sketchbook_path: # (as set by user in processing ide or see preferences.txt) MAX_WATCH: 32 template: emacs
warning: if you used homebrew to install processing prefix /Application with your home directory, we need path to jars, symbolic links to executable won't do... Steps
rake # compiles and builds rpextras (from source) depends on config, before building gem gem install --local jruby_art-1.4.1.gem k9 --install # Downloads and install jruby-complete-9.1.12.0
Create sketches from built in templates
k9 --create fred 200, 200 # basic sketch fred.rb k9 --create fred 200, 200, p2d # basic P2D sketch fred.rb
Is the default set template: class or template: emacs to us alternative templates Simple Sketch
def setup sketch_title 'My Sketch' end
def draw background 0 fill 200 ellipse width / 2, height / 2, 300, 200 end
def settings size 400, 300 end
Run Sketch
k9 -r sketch.rb or k9 --run sketch.rb
be prepared to KILL the 'rare' java process (that doesn't exit cleanly all the time), watch seems now to work Watch sketches
k9 --watch sketch.rb # don't try and change render mode, or use the FX2D render mode
Example sketches
Worked Examples more to follow, feel free to add your own, especially ruby-2.3+ syntax now we can. These are installed using k9 --install please move existing rp_samples. Conversion Tool
I wrote this little script to convert sketches from ruby-processing (processing-2) to jruby_art (processing-3.0) here Javadocs RPExtras
The javadocs for rpextra can be generated as follows:-
mvn javadoc:javadoc # see target site