Ribiprocessing
A really super-slim layer to communicate with Processing from JRuby.
Installation
Add this line to your application's Gemfile:
gem 'ribiprocessing'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ribiprocessing
Usage
require 'ribiprocessing'
class FlashingLightsSketch < Ribiprocessing::SimpleApp
attr_reader :random_background
def initialize opts={}
@random_background = opts.fetch :random_background, RandomBackground.new(self)
super
end
def setup
size(800, 600)
end
def draw
random_background.generate
end
end
class RandomBackground
include Ribiprocessing::Proxy
def generate
background(rand(255), rand(255), rand(255))
end
end
FlashingLightsSketch.new title: "Flashing Lights"
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request