View convert.rb
1 2 3 4 5 6 7 8 9 10
# convert.rb
settings = <<CODE
def settings
%s
end
CODE
 
Dir.glob('/home/tux/examples/bare_sketches/basics/color/*.rb') do |rb_file|
old = IO.readlines(rb_file)
View test.rb
1 2 3 4 5 6 7 8 9 10
require 'java'
java_import java.lang.System
 
jars = Dir[File.join('/home/tux/ruby-processing/lib', '**/*.jar')]
 
System.setProperty('java.class.path', jars.join(':'))
p System.getProperties['java.class.path']
libpath = System.getProperties['java.library.path']
libpath
System.setProperty('java.library.path', ['/home/tux/lib/linux64', libpath].join(':'))
View box_fluid_demo.rb
1 2 3 4 5 6 7 8 9 10
require 'toxiclibs'
 
#
# <p>BoxFLuid demo combining 3D physics particles with the IsoSurface class to
# create an animated mesh with a fluid behaviour. The mesh is optionally created
# within a boundary sphere, but other forms can be created using a custom
# ParticleConstraint class.</p>
#
# <p>Dependencies:</p>
# <ul>
View .nbattrs
1 2 3 4 5 6 7 8 9 10
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd">
<attributes version="1.0">
<fileobject name="Sketch.rb">
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
<attr name="template" boolvalue="true"/>
</fileobject>
<fileobject name="SketchGL.rb">
<attr name="displayName" stringvalue="SketchGL.rb"/>
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
View .rp5rc
1 2 3 4 5 6
{
"JRUBY": "false",
"PROCESSING_ROOT": "/home/tux/processing-3.0a5",
"X_OFF": 192,
"Y_OFF": 108
}
View app.rb
1 2 3 4 5 6 7 8 9
# version without embedded or online
# This class is a thin wrapper around Processing's PApplet.
# Most of the code here is for interfacing with Swing,
# web applets, going fullscreen and so on.
require 'java'
require_relative '../ruby-processing/helper_methods'
require_relative '../ruby-processing/helpers/string'
require_relative '../ruby-processing/library_loader'
require_relative '../ruby-processing/config'
View gist:e4fa6a436e59e20d32ec
1 2 3 4 5 6 7 8 9 10
grey_circles.rb:10 warning: ambiguous Java methods found, using background(int)
Exception in thread "Animation Thread" org.jruby.exceptions.RaiseException: (IOError) closed stream
at java.lang.Thread.getStackTrace(java/lang/Thread.java:1552)
at org.jruby.runtime.backtrace.TraceType$Gather.getBacktraceData(org/jruby/runtime/backtrace/TraceType.java:175)
at org.jruby.runtime.backtrace.TraceType.getBacktrace(org/jruby/runtime/backtrace/TraceType.java:39)
at org.jruby.RubyException.prepareBacktrace(org/jruby/RubyException.java:227)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:215)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:194)
at org.jruby.exceptions.RaiseException.<init>(org/jruby/exceptions/RaiseException.java:110)
at org.jruby.Ruby.newRaiseException(org/jruby/Ruby.java:3959)
View jruby.log
1 2 3 4 5 6 7 8 9 10
grey_circles.rb:10 warning: ambiguous Java methods found, using background(int)
Exception in thread "Animation Thread" org.jruby.exceptions.RaiseException: (IOError) closed stream
at java.lang.Thread.getStackTrace(java/lang/Thread.java:1589)
at org.jruby.runtime.backtrace.TraceType$Gather.getBacktraceData(org/jruby/runtime/backtrace/TraceType.java:175)
at org.jruby.runtime.backtrace.TraceType.getBacktrace(org/jruby/runtime/backtrace/TraceType.java:39)
at org.jruby.RubyException.prepareBacktrace(org/jruby/RubyException.java:223)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:215)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:194)
at org.jruby.exceptions.RaiseException.<init>(org/jruby/exceptions/RaiseException.java:110)
at org.jruby.Ruby.newRaiseException(org/jruby/Ruby.java:3935)
View app.rb
1 2 3 4 5 6 7 8 9 10
require_relative 'helper_methods'
 
# The Processing module is a wrapper for JRubyArt
# Author:: Martin Prout (extends / re-implements ruby-processing)
module Processing
include_package 'processing.core' # imports the processing.core package.
include_package 'processing.event'
# This class is the base class the user should inherit from when making
# their own sketch.
#
View error_trace
1 2 3 4 5 6 7 8 9 10
ribiprocessing/examples$ jruby -J-Djruby.backtrace.style=raw grey_circles.rb
Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
grey_circles.rb:10 warning: ambiguous Java methods found, using background(int)
Exception in thread "Animation Thread" org.jruby.exceptions.RaiseException: (IOError) closed stream
at java.lang.Thread.getStackTrace(java/lang/Thread.java:1589)
at org.jruby.runtime.backtrace.TraceType$Gather.getBacktraceData(org/jruby/runtime/backtrace/TraceType.java:175)
at org.jruby.runtime.backtrace.TraceType.getBacktrace(org/jruby/runtime/backtrace/TraceType.java:39)
at org.jruby.RubyException.prepareBacktrace(org/jruby/RubyException.java:223)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:213)
at org.jruby.exceptions.RaiseException.preRaise(org/jruby/exceptions/RaiseException.java:194)
Something went wrong with that request. Please try again.