To run the following sketch you need to be using jruby-9000 (the development version of jruby which supports ruby 2.1.0 syntax out of the box), here I am actually used JRubyArt the development version of ruby-processing (that uses jruby-9000 by default). This sketch uses the very concise syntax for rationals in ruby-2.1.0 (fractions for the masses)
def setup
size 640, 250
background 10
f = createFont("Arial", 24, true)
third = 1 / 3r
quarter = 1 / 4r
add = "#{third} + #{quarter} = #{third + quarter}"
subtract = "#{third} - #{quarter} = #{third - quarter}"
multiply = "#{third} * #{quarter} = #{third * quarter}"
text_font(f, 24)
fill(220)
text("Math blackboard ruby-processing", 80, 50)
text(add, 110, 100)
text(subtract, 110, 150)
text(multiply, 110, 200)
end
Update 16th November, after a long hiatus the sketch is now working again with jruby 9000.dev-SNAPSHOT (2.1.2p142) 2014-11-08 8a13045 OpenJDK 64-Bit Server VM 24.65-b04 on 1.7.0_65-b32 +jit [linux-amd64].
Unfortunately not many others sketches will currently run...