Skip to content

Commit d1b9eea

Browse files
authored
Merge pull request #1 from ruby-processing/optparse
Optparse
2 parents cfe6c40 + bb37e6c commit d1b9eea

File tree

34 files changed

+41
-37
lines changed

34 files changed

+41
-37
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# JRubyArt-examples for JRubyArt-1.1+
1+
# JRubyArt-examples for JRubyArt-1.2.0.pre
22
JRubyArt-examples
33
================
44

5+
Rakefiles amended to use `-r` in place of `run`
6+
57
Many of the vanilla processing example sketches have been translated to ruby-processing, and they are mainly written as 'bare' sketches (ie not class wrapped) in keeping with the original processing. At runtime these sketches the get wrapped into a Sketch class. Should you prefer you can still write class wrapped sketches, these will work equally well with jruby_art. You should also checkout the [Nature of Code Examples in ruby][] and for the beginner [Learning Processing with Ruby][] for even more examples.
68
Includes autorun Rakefiles:-
79

contributed/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 run #{sample_name}", 'r') do |io|
25+
open("|k9 -r #{sample_name}", 'r') do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

external_library/gem/pbox2d/mouse_joint/boundary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def display
3636
stroke(127)
3737
fill(127)
3838
stroke_weight(1)
39-
rect_mode(Java::ProcessingCore::CENTER)
39+
rect_mode(Java::ProcessingCore::PConstants::CENTER)
4040
a = b.get_angle
4141
push_matrix
4242
translate(x, y)

external_library/gem/pbox2d/mouse_joint/box.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Nature of Code
22
# Daniel Shiffman
33
# http://natureofcode.com
4-
4+
require 'forwardable'
55
# A rectangular box
66
class Box
77
extend Forwardable
@@ -34,7 +34,7 @@ def display
3434
pos = box2d.body_coord(body)
3535
# Get its angle of rotation
3636
a = body.getAngle
37-
rect_mode(Java::ProcessingCore::CENTER)
37+
rect_mode(Java::ProcessingCore::PConstants::CENTER)
3838
push_matrix
3939
translate(pos.x, pos.y)
4040
rotate(a)

external_library/gem/pbox2d/mouse_joint/mouse_joint.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
require_relative 'boundary'
1010
require_relative 'spring'
1111
require_relative 'dummy_spring'
12-
require 'forwardable'
1312

1413
# A reference to our box2d world
1514
attr_reader :box2d, :boundaries, :box, :spring
15+
def settings
16+
size(640, 360)
17+
end
1618

1719
def setup
18-
size(640, 360)
20+
sketch_title('Mouse Joint')
1921
# Initialize box2d physics and create the world
2022
@box2d = Box2D.new self
2123
box2d.create_world

external_library/java/hype/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 run #{sample_name}", "r") do |io|
25+
open("|k9 -r #{sample_name}", "r") do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

processing_app/basics/color/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 run #{sample_name}", "r") do |io|
25+
open("|k9 -r #{sample_name}", "r") do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

processing_app/basics/control/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 run #{sample_name}", "r") do |io|
25+
open("|k9 -r #{sample_name}", "r") do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

processing_app/basics/data/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 run #{sample_name}", "r") do |io|
25+
open("|k9 -r #{sample_name}", "r") do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

processing_app/basics/form/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 run #{sample_name}", "r") do |io|
25+
open("|k9 -r #{sample_name}", "r") do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

0 commit comments

Comments
 (0)