Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0

Showing posts with label netbeans. Show all posts
Showing posts with label netbeans. Show all posts

Tuesday, 26 May 2015

Alternative development environments for ruby-processing and JRubyArt

NetBeans

No really, netbeans can be used as a development environment for ruby-processing (and might be a sensible choice on windows). The first hurdle is to install the jruby netbeans plugin thereafter things get easier (you can use the plugin to install ruby-processing gem, but you will still need to install vanilla processing, unless using JRubyArt). NB you sometimes have to be a bit patient (ruby-plugin slows down the ide and loading gems etc can take a time).

JEdit

Not really an ide but comes close with the ruby-plugin (but the plugin is in serious need of an update ruby 1.86) see live editing and my jedit resources here for my macro and console plugins

Vim

An editor favoured by many ruby users (combine with tmux etc for true awesomeness). Create a sketch in vim, fire it up with rp5 watch and you have a nice replish way of working.
To simply run the sketch you are currently editing :!rp5 run % or to force use of jruby-complete :!rp5 --nojruby run %

Emacs

Some kind person could produce an Emacs major-mode for ruby-processing, like the processing-mode. Still popular...

Textmate / Sublime

Popular on the Mac see ruby-processing textmate bundle, which also could do with updating, but could get you started.

The Processing Ide

Not an option, Tyfkda did some preliminary work on a ruby-mode for processing, but is difficult.

Atom editor

Looks to be a good editor might be perfect match for ruby-processing development?....

Saturday, 31 January 2015

Installing netbeans ruby-plugin and jruby_art gem

Please note for installation of gems, and some other operations netbeans can be a bit slow:- Download and unzip the plugin yields ~/arch/build/updates/*.* note location, which you will need to navigate to when installing "downloaded" plugins (from netbeans menu). Select all the *.nbm modules and the jruby.jar. And install see below:-























Then install the downloaded gem as install local (local install required to load --pre gem) and you are good to go a real ide to develop jruby_art who needs a processing mode?


























See crude Templates here
To install templates navigate to .netbeans/config/Templates (create a Templates folder if it does not exist) create a sub folder 'Ruby' put the outer .nbattrs file here, create a folder jruby_art and place the other .nbattrs file there along with both ruby sketch files. Templates should now show up in a Ruby sub-folder.

Friday, 30 January 2015

JRubyArt vs ruby-processing


IMPORTANT THIS DOCUMENT IS OUTDATED BUT BY NOW YOU SHOULD ALREADY BE USING JRubyArt or propane

External Dependencies

  • ruby-processing requires an installed version of vanilla-processing
  • jruby_art includes processings core jars in gem

Runnable from netbeans

  • ruby-processing sketches would need a Rakefile or some other script to run 
  • jruby_art sketches mainly just run (except for bare-sketches), opens possibility of incredibly simple/minimal installation from netbeans (no need for MRI ruby or an installed jruby, might suit windows users)

Core processing libraries (sound, video etc)

  • ruby-processing has builtin support 
  • jruby_art now has built in support (but path to libraries is configurable), can also be modular via gem see pbox2d as exemplar

Contributed processing libraries

  • ruby-processing has builtin support for libraries installed by processing ide 
  • jruby_art does not assume that vanilla processing is installed. Wrapping libraries in separate gem would be ideal see pbox2d and toxicgem

Vec2D, Vec3D, Arcball and DEGLUT

  • ruby-processing requires load_library 
  • jruby_art automatically loaded into jruby runtime

Processing::Proxy module

  • in ruby-processing Proxy can be used to mimic processings inner classes, probably v. bad juju convenience isn't everything 
  • in jruby_art a different Proxy is used to access some processing methods eg "pre", "post", "draw" via reflection

Thursday, 29 January 2015

Netbeans, the perfect ide for jruby_art

The perfect ide for jruby_art is netbeans, because all sketches just run (since the netbeans ruby plugin is using a built in jruby-complete) with the jruby command see below (actually bare sketches need k9 command). It is probably easier at this point to download jruby_art-0.2.0.pre.gem and do a local install. Thus it is quite possible to develop jruby_art without a jruby/ruby install, just using the jruby provided by the jruby netbeans plugin (this might actually make sense on windows). However you won't get the examples so make sure you get them here.

Saturday, 4 October 2014

Simple ArcBall in JRubyArt running from netbeans

Things are moving fast here, now we can offer full arcball functionality with JRubyArt (and just one line of code for user!!!). Rotation via mouse drag, zoom with mousewheel.Interesting seems I can get rid of Processing:: prefix for arcball by "including Processing" in the AppGL class...
require 'jruby_art'

class MySketch < Processing::AppGL
  def setup
    size 200, 200, P3D
    Processing::ArcBall.init(self)
    fill 200, 0, 0
    stroke 0
  end

  def draw
    lights
    background 0
    box 100, 100, 100
  end
end

MySketch.new(title: 'My Sketch')

Alternative Ruby-Processing implementation

Currently I am working on a new version of JRubyArt to create an alternative ruby wrapper for processing (to ruby-processing).
  • Sketches run as regular ruby scripts (just need jruby)
  • Vecmath libraries developed for ruby-processing built in
  • You can use Netbeans-8.0.1 to develop and run sketches
  • From netbeans you load and use other gems with your sketches
  • Has a blank sketch creator built in
  • Is in development (yet to support opengl sketches, libraries)
Some sketches as with regular ruby-processing (load image etc) require jruby-complete to run, but with netbeans this is not a problem:-


Sunday, 28 September 2014

Running ribiprocessing from netbeans

Above is a screenshot of me running seeking_neural.rb from Netbeans using ribiprocessing,a really lighweight wrapper for processing. To do this all I needed was the netbeans ruby plugin and then to install (to netbeans) the local gem ribiprocessing-0.1.0.gem.

Thursday, 24 April 2014

Netbeans-8 rubyplugin now available (run ruby files from the ide)

Well this will no doubt be useful for ruby-processing development:-

Thursday, 26 December 2013

Rakefile to run JRubyArt sketches in a directory from netbeans (tested with samples/contributed)

NB need to adjust path to "k9" executable...., since we are running with development version in netbeans (not an externally installed version)
# Simple demo Rakefile to autorun samples in current directory
# from netbeans, adjust path to k9 executable as required

SAMPLES_DIR="./"

desc 'run demo'
task :default => [:demo]

desc 'demo'
task :demo do
  samples_list.shuffle.each{|sample| run_sample sample}
end

def samples_list
  files = []
  Dir.chdir(SAMPLES_DIR)
  Dir.glob("*.rb").each do |file|
    files << File.join(SAMPLES_DIR, file)
  end
  return files
end

def run_sample(sample_name)
  puts "Running #{sample_name}...quit to run next sample"
  open("|../../bin/k9 run #{sample_name}", "r") do |io|
    while l = io.gets
      puts(l.chop)
    end
  end
end

Monday, 12 August 2013

Netbeans for ruby-processing

Hey this looks pretty promising, you can now install a plugin for netbeans-7.3 (for ruby and ruby-on-rails development). I will report how I get on install seemed to go ok, Once I figured out I needed to add *.jar as well as *.nbm sub-modules.

Followers

About Me

My photo
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2