BT

Ruby Shoes Roundup: Ruby-Processing with JRuby, The Shoebox, GitHub

by Mirko Stocker on May 01, 2008 |

The Shoebox is a repository for Shoes applications, Why The Lucky Stiff's tiny toolkit for creating graphical applications. You can find an introductory article about the Ruby GUI toolkit Shoes here on InfoQ. Also, the book "Nobody knows Shoes" is now available for free.

Applications can be added to the Shoebox via its web interface, which also supports multiple versions, so modifying and republishing an application is made as simple as possible. Until recently, the Shoebox contained only Shoes applications, but now it has also become the home of Ruby-Processing, a JRuby wrapper for the Processing environment:

Processing is an open source programming language and environment for people who want to program images, animation, and interactions.

Ruby-Processing attempts to make Processing more Shoes-like, replacing Processing's Java syntax with Ruby. Let's take a look at an example: the following code suffices for a minimal application that displays a sphere that follows the cursor when it moves over the screen:

require 'ruby-processing'

class FollowCursor < Processing::App
 def setup
 # 4 lines of setup code omitted for brevity
 end

 def draw
 background 1
 translate( mouse_x, mouse_y )
 sphere 20
end
end

FollowCursor.new(:width => 200, :height => 200, :title => "Follow The Cursor!")

Some more extensive examples can be found in the Ruby-Processing download and of course on the Shoebox. The Shoes repository is now also hosted on GitHub.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT