README.md in jruby_art-0.2.1.pre vs README.md in jruby_art-0.2.2.pre

- old
+ new

@@ -1,67 +1,69 @@ ## JRubyArt [![Gem Version](https://badge.fury.io/rb/jruby_art.svg)](http://badge.fury.io/rb/jruby_art) -Is a development fork of [ruby-processing][] that has a somewhat independent existence, see [processing-core][] at least in the short term. Plan was that JRubyArt releases (pre-releases) would use jruby-9.0.0.0 from the start, but now I think it might be more sane to start with jruby-1.7.18. Version 0.2.0.pre is now available from rubygems. To build from repo:- +Is an alternative implementation of [ruby-processing][] that provides a ruby-wrapper for the java version of [processing][]. It is currently at the pre-release stage, but is ready for testing, and available from rubygems.org. +### Requirements -You should (like ruby-processing) install [processing-2.2.1][] +Java runtime 7+, and ruby (can be MRI ruby), curl (to download jruby-complete and examples, although there is a workaround). NB: it is not necessary to install vanilla [processing][] with this implementation, core jars are included in the gem. -Then create a `~/.jruby_art/config.yml` config file, here is -what mine looks like on arch-linux +### Getting Started -```ruby ---- -PROCESSING_ROOT: /usr/share/processing - +```bash +gem install jruby-art --dev +k9 setup install # uses curl to to download jruby-complete and examples +cd examples/contributed +k9 run clock.rb # if you've got jruby on your machine `jruby clock.rb` also works ``` -However unlike ruby-processing, the core jars become part of the gem and PROCESSING_ROOT is not used at runtime. -The following config should work on macosx - -```ruby ---- -PROCESSING_ROOT: /Applications/Processing.app/Contents/Java +### Creating your own +```bash +k9 create my_sketch 200 200 +vim my_sketch.rb # other editors are available ``` +Output: +```ruby +require 'jruby_art' -To copy processing jars `rake processing_jars` +class MySketch < Processing::App + def setup + size 200, 200 + end -To compile extensions `jruby -S rake compile` _requires rake-compiler gem_ + def draw -To build gem `jruby -S rake package` + end +end -To install `gem install pkg/jruby_art-0.2.pre.gem` +MySketch.new(title: 'My Sketch') +``` +The above is an example of class wrapped sketch (that can be run using `jruby my_sketch.rb` or `k9 run my_sketch.rb`), bare sketches also work. See [examples/bare_sketches][] +```ruby +def setup + size 200, 200 +end -To create a new blank sketch +def draw -```bash -k9 create my_app 200 200 +end ``` +However such sketches must be run with `k9 run sketch.rb`, however you can do 'k9 wrap sketch.rb` which converts bare sketches to a class wrapped form. -or for 3D opengl sketch +###Ruby Versions -```bash -k9 create my_app 200 200 p3d -``` +jruby-1.7.19 (when sketches run with jruby command) -To run most sketches, all you need is an installed jruby:- +jruby-9.0.0.0.pre1 also seems to work (the next pre-release will target jruby-9.0.0.0-pre1) -```bash -jruby my_app.rb -``` +or -To run certain sketches, eg those with load_image (or shaders), either use [netbeans][] as your development ide or use the vendored jruby-complete (beyond our control something to do with jruby permissions?). To install jruby-complete:- +ruby-2.1.2+ (when sketches are run using k9 command, ie using jruby-complete) -```bash -k9 setup install # requires wget (Now also downloads examples to users home) -``` -To run sketches with jruby-complete (rather than installed jruby) +### Using netbeans as an ide for JRubyArt -```bash -k9 run my_app.rb # NB: k9 setup install, is a one-time 'install to gem' procedure -that also downloads and install samples in examples folder in users directory -``` +See [netbeans][] [Contributing][] [License][] @@ -69,23 +71,14 @@ [Examples][] [CHANGELOG][] -###Ruby Versions - -jruby-1.7.18 (when sketches run with jruby command) - -jruby-9.0.0.0.pre1 also seems to work - -or - -ruby-2.1.2+ (when sketches are run using k9 command, ie using jruby-complete) - [Acknowledgements]:ACKNOWLEDGEMENTS.md [CHANGELOG]:CHANGELOG.md [Contributing]:CONTRIBUTING.md [Examples]:https://github.com/ruby-processing/JRubyArt-examples +[examples/bare_sketches]:https://github.com/ruby-processing/JRubyArt-examples/tree/master/bare_sketches [License]:LICENSE.md [processing]:https://github.com/processing/processing [ruby-processing]:https://github.com/jashkenas/ruby-processing [netbeans]:http://learning-ruby-processing.blogspot.co.uk/2014/10/alternative-ruby-processing-implentation.html [processing-2.2.1]:https://processing.org/download/