Every repository with this icon (
Every repository with this icon (
Exporting Applets and Applications
Ruby-Processing on the Web
Most Ruby-Processing sketches can be exported as Java applets, to be viewed on the web. Ruby-Processing includes an applet exporter, which packs up your sketch and all of its dependencies, and generates an HTML page, so that you can just drop the folder on your server. To use it, just do a rp5 applet path/to/my_sketch.rb It will immediately create a folder (of the same name as your sketch) with your exported sketch stored inside. Exports respect the width, height, and title of your sketch, and also will add a description, like so:
# Description: # This description will be extracted and printed in the HTML at the bottom # of the generated gallery page. The width and height will set the # dimensions of the applet, and the title will become the title of the page. # Code goes here... Sketch.new :width => 700, :height => 500, :title => "Hey, I'm on the Web."
Stumbling Blocks: Applet export is still a bit of a dark art — sketches which use Java Native libraries will not run (apart from OpenGL), due to applets’ security restrictions. Viewing an applet entails loading the JRuby runtime, an ~ 9 MB .jar which can take a while to download.
Check out the Gallery for some live applets.
Tripartite Application Export
Ruby-Processing can export Mac/Windows/Linux applications:
rp5 app path/to/my_sketch.rb
It will pack up your app, its data folder, all of the libraries that it’s loading, and tuck them into a brand-new MySketch.app, ready to share. If you happen to have a .icns icon file in your data folder, it will use that for the icon of your application (for Macs). Now you can distribute the application without any need to install JRuby or Ruby-Processing.
For Windows and Linux, the .app acts as a folder containing executable programs. You can rename it or share it as is.

A Ruby-Processing application, running in the Dock
Check out the Gallery to grab some application examples.






