This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"JRUBY": "false", | |
"PROCESSING_ROOT": "/home/tux/processing-3.0a5", | |
"X_OFF": 192, | |
"Y_OFF": 108 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(':')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert.rb | |
def titleize(str) | |
str.gsub(/::/, '/') | |
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') | |
.gsub(/([a-z\d])([A-Z])/, '\1_\2') | |
.tr('-', '_') | |
.downcase | |
.gsub(/_id$/, '') | |
.gsub(/_/, ' ').capitalize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'forwardable' | |
# A custom Array created using forwardable (that can also access the PApplet pre, | |
# post and draw loops by extending our new LibraryProxy class. Also has access | |
# to custom background(int), fill(int) and stroke(int) methods. | |
class CustomArray < LibraryProxy | |
extend Forwardable | |
def_delegators(:@objs, :each, :<<) | |
include Enumerable |