-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
6,363 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Contributing | ||
In the spirit of [free software][free-sw], **everyone** is encouraged to help improve this project. | ||
|
||
Here are some ways *you* can contribute: | ||
|
||
* by reporting bugs | ||
* by suggesting/implementing new features (eg integrate with atom) | ||
* by writing or editing documentation ( _expert Windows users could help write install instructions_ ) | ||
* by contributing examples ( _show your creativity, or translate someone elses masterpiece_ ) | ||
* by refactoring examples to be more rubyfied | ||
* by closing [issues][] | ||
* by proselytizing propane, we need more champions | ||
* by supporting [processing.org][], nothing to do with us but we rely on them | ||
* by creating gems for pdf, video library etc see arcball gem as example | ||
|
||
## Submitting an Issue | ||
We use the [GitHub issue tracker][issues] to track bugs and features. Before | ||
submitting a bug report or feature request, check to make sure it hasn't | ||
already been submitted. When submitting a bug report, ideally include a [Gist][] | ||
that includes a stack trace and any details that may be necessary to reproduce | ||
the bug, including your gem version, Ruby version, and operating system. | ||
|
||
|
||
## Submitting a Pull Request | ||
1. [Fork the repository.][fork] | ||
2. [Submit a pull request.][pr] | ||
|
||
[free-sw]: http://www.fsf.org/licensing/essays/free-sw.html | ||
[issues]: https://github.com/ruby-processing/propane/issues | ||
[gist]: https://gist.github.com/ | ||
[fork]: http://help.github.com/fork-a-repo/ | ||
[pr]: http://help.github.com/send-pull-requests/ | ||
[processing.org]: http://processing.org/foundation/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
This is a simple template for filing Propane issues. | ||
Please help us help you by providing the information below. | ||
Text inside XML comment tags will not be shown in your report. | ||
--> | ||
|
||
### Environment | ||
|
||
Ensure that you are using the recommended versions of jruby (`jruby -v`) and java (`java -version`) | ||
Provide Propane version that you are using (`propane --version`) | ||
Provide your operating system and platform (e.g. `uname -a`, and/or `java -version` output if relevant) | ||
|
||
### Expected Behavior | ||
|
||
Describe your expectation of how Propane sketch should behave. | ||
Provide a `problematic` Propane sketch or a link to an example repository. | ||
|
||
### Actual Behavior | ||
|
||
Describe or show the actual behavior. | ||
Provide text or screen capture showing the behavior. | ||
|
||
### Other | ||
|
||
eg installation issue (just use this header and explain the problem as best you can) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*.log | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
target | ||
*.jar | ||
*~ | ||
MANIFEST.MF | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<extensions> | ||
<extension> | ||
<groupId>io.takari.polyglot</groupId> | ||
<artifactId>polyglot-ruby</artifactId> | ||
<version>0.1.18</version> | ||
</extension> | ||
</extensions> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
**v0.9.0** Implements `data_path` in ruby, you should use this method to return the absolute path to the `data` folder (read and write). Prefer JRubyArt methods, in the main. | ||
|
||
**v0.8.0** Complete samples refactored to `data_path` folder, no longer require jruby-complete to run because we provide an absolute path to `data` folder, but it still probably requires that you run the sketch from the directory. Future direction might be to create a `~/.propane` folder, which would support additionalvanilla processing libraries, also integration with `atom` editor. | ||
**v0.7.0** Update to JRuby-Complete-9.1.2.0. | ||
|
||
**v0.6.0** Includes a sketch creator utility 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy), includes slider in sketch library, change to requiring jdk8. Update to JRuby-Complete-9.1.0.0, request updated arcball (to run samples). | ||
|
||
**v0.5.0** Includes a sketch creator utility 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy). | ||
|
||
**v0.4.0.pre** Inclusion of jogl-all.jar should fix 3D if install fails try getting rid of previous versions of gem (especially if you had done local installs, foxed me first) 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy). | ||
|
||
**v0.3.0.pre** First pre-release of propane.gem turns out 3D was not working because of missing jar in gem (3D was only going to work on macosx and linux64 OS anyways. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source 'https://rubygems.org' | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Propane | ||
[![Gem Version](https://badge.fury.io/rb/propane.svg)](https://badge.fury.io/rb/propane) | ||
|
||
A slim layer to communicate with Processing from JRuby, features a polyglot maven build, this started out as a non serious project by Phillip Cunningam called ribiprocessing. It has now morphed into an experimental project for ruby-processing so we can now "Cook with Gas". We have created a configuration free version of ruby processing, albeit tied to processing-2.2.1, where we get processing core from maven central (and opengl currently testing on linux64/mac). These jars are small enough to include in the gem distribution, and hence we should not require configuration. This has created a scriptable version, ie files get run direct from jruby, but you could use jruby-complete if you used the propane script (avoids need to give the absolute data path for the data folder, but would also be needed for a watch mode). | ||
## Requirements | ||
|
||
- jdk8+ since version 0.6.0 | ||
- jruby-9.1.2.0+ | ||
- mvn-3.3.1+ (development only) | ||
|
||
## Building and testing | ||
|
||
```bash | ||
rake | ||
rake gem | ||
rake javadoc | ||
``` | ||
|
||
## Installation | ||
```bash | ||
jgem install propane-{version}-java.gem # local install | ||
jgem install propane # from rubygems.org | ||
``` | ||
|
||
## Usage | ||
|
||
``` ruby | ||
require 'propane' | ||
|
||
class FlashingLightsSketch < Propane::App | ||
|
||
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 Propane::Proxy | ||
|
||
def generate | ||
background(rand(255), rand(255), rand(255)) | ||
end | ||
|
||
end | ||
|
||
FlashingLightsSketch.new title: "Flashing Lights" | ||
``` | ||
|
||
To install the samples and jruby-complete. The samples get copied to `~/propane_samples`. | ||
```bash | ||
propane --install | ||
``` | ||
There is a handy sketch creator tool | ||
```bash | ||
propane -c my_sketch 200 200 # for default renderer | ||
propane -c my_sketch 200 200 p2d # for opengl 2D renderer | ||
propane -c my_sketch 200 200 p3d # for opengl 3D renderer | ||
|
||
To run sketches using the installed jruby-complete, you can also use shortform `-r` | ||
```bash | ||
propane --run my_sketch.rb # or | ||
jruby -S propane --run my_sketch.rb # belt and braces version | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# encoding: utf-8 | ||
# frozen_string_literal: false | ||
require_relative 'lib/propane/version' | ||
|
||
def create_manifest | ||
title = 'Implementation-Title: rpextras (java extension for propane)' | ||
version = format('Implementation-Version: %s', Propane::VERSION) | ||
File.open('MANIFEST.MF', 'w') do |f| | ||
f.puts(title) | ||
f.puts(version) | ||
f.puts('Class-Path: core-2.2.1.jar gluegen-rt-2.1.5-01.jar jog-all-2.1.5-01.jar') | ||
end | ||
end | ||
|
||
task default: [:init, :compile, :install, :test, :gem] | ||
|
||
desc 'Create Manifest' | ||
task :init do | ||
create_manifest | ||
end | ||
|
||
desc 'Install' | ||
task :install do | ||
sh 'mvn dependency:copy' | ||
sh 'mv target/propane.jar lib' | ||
end | ||
|
||
desc 'Gem' | ||
task :gem do | ||
sh 'gem build propane.gemspec' | ||
end | ||
|
||
desc 'Document' | ||
task :javadoc do | ||
sh 'mvn javadoc:javadoc' | ||
end | ||
|
||
desc 'Compile' | ||
task :compile do | ||
sh 'mvn package' | ||
end | ||
|
||
desc 'JRuby-Complete' | ||
task :install_complete do | ||
sh 'cd vendors && rake' | ||
end | ||
|
||
desc 'Test' | ||
task :test do | ||
sh 'jruby test/respond_to_test.rb' | ||
end | ||
|
||
desc 'clean' | ||
task :clean do | ||
Dir['./**/*.%w{jar gem}'].each do |path| | ||
puts 'Deleting #{path} ...' | ||
File.delete(path) | ||
end | ||
FileUtils.rm_rf('./target') | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env jruby | ||
unless defined? PROPANE_ROOT | ||
$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) | ||
PROPANE_ROOT = File.expand_path(File.dirname(__FILE__) + '/../') | ||
end | ||
|
||
require "#{PROPANE_ROOT}/lib/propane/runner" | ||
Propane::Runner.execute |
Oops, something went wrong.