Skip to content

Commit

Permalink
first real commit
Browse files Browse the repository at this point in the history
  • Loading branch information
monkstone committed Aug 5, 2016
1 parent 2f98fe7 commit db40619
Show file tree
Hide file tree
Showing 57 changed files with 6,363 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/CONTRIBUTING.md
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/
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE.md
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)
22 changes: 22 additions & 0 deletions .gitignore
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

8 changes: 8 additions & 0 deletions .mvn/extensions.xml
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>
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
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.

2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'

75 changes: 75 additions & 0 deletions README.md
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
```
60 changes: 60 additions & 0 deletions Rakefile
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
8 changes: 8 additions & 0 deletions bin/propane
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
Loading

0 comments on commit db40619

Please sign in to comment.