Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.2.4 Extract picrate examples to ~/projects/examples instead of ~/picrate_samples for tighter integration with geany editor. Remove non-functioning sound library as an install option (direct toward minim as option).

v1.2.3 Favor latest beta Video2 library over GLVideo.

v1.2.2 Removed landscape from example as too taxing for raspberryPI. Improved geany tools.

v1.2.1 Fix install Samples etc. in runner.rb to match modified vendor Rakefile.

v1.2.0 Update samples to use safer fonts, add linux specific suggestion on missing fonts PFont.java, fix :web_to_color_array(web).
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'
ruby '2.5.3', :engine => 'jruby', :engine_version => '9.2.8.0'
ruby '2.5.7', :engine => 'jruby', :engine_version => '9.2.9.0'
gemspec
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Create processing sketches in ruby on raspberry-pi and linux (this project is a
### To install from rubygems ###

```bash
jgem install picrate -v 1.1.0 # NB: important to specify version
jgem install picrate
```

### To Build and Test ###
Expand All @@ -19,7 +19,7 @@ Requires java to build, but uses a maven wrapper so you don't need to install ma
```bash
cd PiCrate
rake # assumes an installed version of vanilla processing
jgem install picrate-1.1.0-java.gem
jgem install picrate-1.2.4-java.gem

```
To create a template sketch:-
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ task :init do
# for Archlinux etc
# processing_root = File.dirname(`readlink -f $(which processing)`)
# alternative for debian linux etc
processing_root = File.join(HOME_DIR, 'processing-3.5.3')
processing_root = File.join(HOME_DIR, 'processing-3.5.3')
jar_dir = File.join(processing_root, 'core', 'library')
opengl = Dir.entries(jar_dir).grep(/amd64|armv6hf/).select { |jar| jar =~ /linux/ }
opengl.concat %w[jogl-all.jar gluegen-rt.jar]
Expand Down
21 changes: 20 additions & 1 deletion docs/_editors/geany.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,27 @@ Remember to give untitled sketch a new name (PS: it's easy to create your own te

![new with template]({{ site.github.url }}/assets/new_with_template.png)

Use `make` to check syntax and `run` to run sketch
Use `Build/rubocop` to check syntax, and `run` button to run the
sketch

See running sketch below:-

![geany]({{ site.github.url }}/assets/geany.png)

#### Advanced options

1. rubocop

If you install the `rubocop` gem you can use the Build/Rubocop control to do a static test on the current file. You can configure `rubocop` to ignore selected rules if you wish. Or use it to auto-correct issues.

![geany]({{ site.github.url }}/assets/rubocop.png)

2. reek

If you are keen to develop your `OO` skills analysing your sketch code for smells can be instructive see references:-

* Practical Object-Oriented Design in Ruby - Sandi Metz
* Refactoring (Ruby Edition) - Jay Fields, Shane Harvie, Martin Fowler
* 99 Bottles of OOP - Sandi Metz and Katrina Owen

![geany]({{ site.github.url }}/assets/reek.png)
4 changes: 2 additions & 2 deletions docs/_posts/2018-05-06-getting_started.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
layout: post
title: "Getting Started Command Line"
title: "Getting Started Stretch"
date: 2018-05-24 07:34:13
categories: PiCrate update
permalink: /getting/
---
Raspbian stretch installs Oracle jdk-1.8.0_65-bi17 (hard float) and that is just fine, if you have more that one version of java installed you could use `update-alternatives` tool to manage their use. Will work with OpenJDK-11 but currently performance is sub-optimal.
Raspbian Stretch installs Oracle jdk-1.8.0_65-bi17 (hard float) and that is just fine, if you have more that one version of java installed you could use `update-alternatives` tool to manage their use. Will work with OpenJDK-11 but currently performance is sub-optimal.

__Then install JRuby see__ [jruby][jruby].

Expand Down
6 changes: 3 additions & 3 deletions docs/_posts/2018-05-06-install_jruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Get the latest version from [http://jruby.org/download][download]

```bash
cd /opt
sudo tar xzvf /pathToDownload/jruby-bin-9.2.8.0.tar.gz
sudo tar xzvf /pathToDownload/jruby-bin-9.2.9.0.tar.gz
```

Then use the excellent `update-alternatives` tool to provide symbolic links to `jruby`, `jgem`, `jirb` and `rake` especially if you haven't installed `mri` ruby.
Expand Down Expand Up @@ -44,9 +44,9 @@ mkdir installer
cd installer
rake
```
Currently installs jruby-9.2.8.0
Currently installs jruby-9.2.9.0

If you know better please post on wiki

[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.8.0/jruby-dist-9.2.8.0-bin.tar.gz"
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.9.0/jruby-dist-9.2.9.0-bin.tar.gz"
[rake_gist]:https://gist.github.com/monkstone/159c5a9813c9cd181040b4715e74f6b2
2 changes: 1 addition & 1 deletion docs/_posts/2018-11-18-building-gem.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Requirements:-

Simply clone this distribution, then rake to build and test gem
```bash
git clone -b stretch --single-branch https://github.com/ruby-processing/PiCrate.git
git clone --depth 1 https://github.com/ruby-processing/PiCrate.git
cd PiCrate
rake # to build gem
```
6 changes: 3 additions & 3 deletions docs/_posts/2018-11-27-getting_started_geany.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The current version of raspbian installs jdk-1.8.0_65-bi17 (hard float) and that
Then install JRuby see [jruby][jruby].

```bash
jgem install picrate -v 1.2.1
jgem install picrate
```

Install samples, and configure `geany` ide (for `PiCrate`)
Expand All @@ -31,8 +31,8 @@ picrate --install Samples
Install processing libraries

```bash
picrate -i Sound
picrate -i glvideo # preferred over vanilla video for now
# picrate -i Sound not currently working
picrate -i video # preferred over vanilla video for now
```

### Creating Sketches from the GeanyIDE
Expand Down
116 changes: 116 additions & 0 deletions docs/_posts/2019-11-11-getting_started_buster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
layout: post
title: "Getting Started Buster"
date: 2019-11-11 07:34:13
categories: PiCrate update
permalink: /getting_buster/
---
Currently Raspbian Buster does not come with a pre-installed java. So the first step is to install a `jdk` we currently recommend installing openjdk8 (_there a complications you don't need using jdk11_) to benefit from `client` optimisations. There is a bash script [here][buster], that will install `openjdk8`, `jruby-9.2.9.0` and picrate for you.
```bash
bash buster_install.sh
```

__Otherwise follow these instructions in order as needed:-__

```bash
sudo apt-get update # sync your local database with current release
sudo update # update to latest release
sudo apt install openjdk-8-jdk # installs latest jdk8
java -version # check installed version
```
If you have already installed a version java the java version may not match you can control the _active_ java version on Debian using `update-alternatives` as follows:-
```bash
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config jar
```
See [java][java] install for more explanations.

__Then install JRuby see__ [jruby][jruby].

We strongly recommend that you create a local storage for gems on your system, as follows:-

```bash
mkdir -p ~/.gem/jruby/2.5.0
```
Now set your `GEM_HOME`, `GEM_PATH` and amend your `PATH` as follows:-

```bash
echo "export GEM_HOME=\"\${HOME}/.gem/ruby/${MRI_RUBY}\"" >> ~/.profile
echo "export GEM_PATH=\"\${HOME}/.gem/ruby/${MRI_RUBY}\"" >> ~/.profile
echo "export PATH=\"\${PATH}:\${GEM_PATH}/bin\"" >> ~/.profile
source ~/.profile # to update environment without re-logging in
```
Now should be ready to install `picrate` and other gems.
Install a local version of rake:-
```bash
jgem install rake
```
To install picrate and its dependencies:-

```bash
jgem install picrate
```
__For a first install:-__

```bash
picrate --install # no args, install samples and geany config
# or
picrate -i Samples # to omit geany config
```

This installs example sketches in `~/sample_sketches` and ties them into a `geany` project `picrate.geany`. It should also be possible to run sketches from the `geany` ide.

To create a template sketch from the command line:-

```bash
picrate -c my_sketch 600 400
```
creates file my_sketch.rb

```ruby
#!/usr/bin/env jruby
# frozen_string_literal: false
require 'picrate'

class MySketch < Processing::App
def settings
size 200, 200
end

def setup
sketch_title 'My Sketch'
end

def draw

end
end
MySketch.new

```

Edit in `vim` (at command line) or `geany` (gui), you may need to install `vim`
```bash
vim my_sketch.rb
:!jruby % # from vim runs the sketch
```

To run sketches from command line:-

```bash
jruby my_sketch.rb
```

Or even `chmod +x my_sketch.rb` to make an executable script.

See [editors][geany] geany, for how to run sketches from a gui.

### JWishy Sketch Running on RaspberryPI

![jwishy_buster]({{ site.github.url }}/assets/jwishy_buster.png)

[buster]: https://gist.github.com/monkstone/04a1272ca9274a2c7e3e1bf170877bfb
[java]:http://ruby-processing.github.io/java/raspberry/
[jruby]:{{ site.github.url }}/install_jruby/
[geany]:{{ site.github.url }}/editors/geany
Binary file added docs/assets/jwishy_buster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/reek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/rubocop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions lib/picrate/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def parse_options(args)
end

options[:install] = false
message = '<Samples><GLVideo><Video><Sound> Install samples or library'
message = '<Samples><Video> Install samples or library'
opts.on('-i', '--install', message) do
options[:install] = true
end
Expand Down Expand Up @@ -80,7 +80,9 @@ def install(library = nil)
library ||= 'new'
choice = library.downcase
case choice
when /samples|sound|video/
when /sound/
warn 'The sound library is broken, try minim instead'
when /samples|video/
system "cd #{PICRATE_ROOT}/vendors && rake install_#{choice}"
when /new/
# install samples and config geany
Expand Down
2 changes: 1 addition & 1 deletion lib/picrate/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module PiCrate
VERSION = '1.2.1'
VERSION = '1.2.4'
end
2 changes: 1 addition & 1 deletion picrate.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
A batteries included version of processing in ruby, for raspberrypi and
linux. Install samples to configures geany ide.
EOS
gem.summary = %q{ruby wrapper for processing-3.5.3 on raspberrypi and linux64}
gem.summary = %q{ruby implementation of processing-3 on raspberrypi and linux64}
gem.homepage = 'https://ruby-processing.github.io/PiCrate/'
gem.post_install_message = %q{Use 'picrate --install' to config geany & install samples}
gem.files = `git ls-files`.split($/)
Expand Down
12 changes: 6 additions & 6 deletions pom.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project 'picrate', 'http://maven.apache.org' do

model_version '4.0.0'
id 'ruby-processing:picrate:1.2.1'
id 'ruby-processing:picrate:1.2.4'
packaging 'jar'

description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
Expand Down Expand Up @@ -31,24 +31,24 @@
'polyglot.dump.pom' => 'pom.xml'
)

pom 'org.jruby:jruby:9.2.8.0'
pom 'org.jruby:jruby:9.2.9.0'
jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
jar 'org.processing:video:3.0.2'
end

overrides do
plugin :resources, '2.7'
plugin :dependency, '2.8'
plugin :resources, '3.1.0'
plugin :dependency, '3.1.1'
plugin( :compiler, '3.8.1', 'release' => '8' )
plugin(
:javadoc,
'2.10.4',
'3.1.1',
'detectOfflineLinks' => 'false',
'links' => [ '${processing.api}', '${jruby.api}' ]
)
plugin(
:jar, '3.1.0',
:jar, '3.1.2',
'archive' => {
'manifestEntries' => { 'Class-Path' => 'gluegen-rt.jar jog-all.jar' }
}
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
<modelVersion>4.0.0</modelVersion>
<groupId>ruby-processing</groupId>
<artifactId>picrate</artifactId>
<version>1.2.1</version>
<version>1.2.4</version>
<name>picrate</name>
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
<url>http://maven.apache.org</url>
Expand Down Expand Up @@ -76,7 +76,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>9.2.8.0</version>
<version>9.2.9.0</version>
<type>pom</type>
</dependency>
<dependency>
Expand Down Expand Up @@ -119,11 +119,11 @@ DO NOT MODIFIY - GENERATED CODE
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<version>3.1.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -134,7 +134,7 @@ DO NOT MODIFIY - GENERATED CODE
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<version>3.1.1</version>
<configuration>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
Expand All @@ -145,7 +145,7 @@ DO NOT MODIFIY - GENERATED CODE
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.2</version>
<configuration>
<archive>
<manifestEntries>
Expand Down
Loading