Skip to content

Commit afc3f4e

Browse files
committed
Merge pull request #17 from ruby-processing/data_path
Data path
2 parents e871139 + 3bb15a9 commit afc3f4e

File tree

9 files changed

+22
-20
lines changed

9 files changed

+22
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
**v1.0.8** Exposed Constrain functionality for ArcBall, added literate perspektive method. No longer trying to expose `sketchPath` variable (that was private since recent changes to vanilla processing), but provided an overloaded `sketchPath` method. Re-factor `MathTool` module class (jruby extension) to a simpler more correct form. Recommending the use of latest processing-3.1.1.
1+
**v1.1.0** Using ruby to implement the `data_path` wrapper (to avoid java permission issues). Any macosx users that have problems with accessing the local data folders should use this wrapper within `load_image`, `load_shader` etc or provide the absolute path to the data file eg `File.absolute_path('data/image.png')`. Using the `data_path` wrapper or providing the absolute data path also may fix the permission issue that required the `--no-jruby` flag (tested on linux). Includes update to jruby-complete-9.1.1.0.
22

3+
**v1.0.8** Exposed Constrain functionality for ArcBall, added literate perspektive method. No longer trying to expose `sketchPath` variable (that was private since recent changes to vanilla processing), but provided an overloaded `sketchPath` method. Re-factor `MathTool` module class (jruby extension) to a simpler more correct form. Recommending the use of latest processing-3.1.1.
34
**v1.0.7** Added tool to efficiently convert an Array of web colour Strings to and Array of color int (should be used by users of hype library, that uses of web strings in most of its examples). Update to use jruby-complete-9.1.0.0.
45

56
**v1.0.6** Experimental support for an in sketch slider, examples now featuring Joshua Davis hype library.
@@ -8,7 +9,7 @@
89

910
**v1.0.4** Using jruby-complete-9.0.5.0. Adding javadoc, with links to jruby.api and processing.api
1011

11-
**v1.0.3** Build now using processing-3.0.1 core and matching video jars from maven central and pom.rb build file (polyglot maven), furthermore using maven-wrapper so maven version isn't even required see mvnw and mvwm.bat and .mvn/maven-wrapper.properties. The pom.xml is not needed but included for completness.
12+
**v1.0.3** Build now using processing-3.0.1 core and matching video jars from maven central and pom.rb build file (polyglot maven), furthermore using maven-wrapper so maven version is not even required see mvnw and mvwm.bat and .mvn/maven-wrapper.properties. The pom.xml is not needed but included for completness.
1213

1314
**v1.0.2** Various cleanups, favoring SHA256 over SHA1 to check jruby-complete
1415

jruby_art.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
1111
spec.email = '[email protected]'
1212
spec.description = <<-EOS
1313
JRubyArt is a ruby wrapper for the processing art framework.
14-
This version supports processing-3.1.1, and uses jruby-9.1.0.0 as the glue
14+
This version supports processing-3.1.1, and uses jruby-9.1.1.0 as the glue
1515
between ruby and java. You can use both processing libraries and ruby gems
1616
in your sketches. Features create/run/watch/live modes. The "watch" mode,
1717
provides a nice REPL-ish way to work on your processing sketches. Includes:-

lib/jruby_art/app.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,17 @@ def sketch_title(title)
125125
surface.set_title(title)
126126
end
127127

128-
def sketchPath(spath = nil)
128+
def sketch_path(spath = nil)
129129
return super() if spath.nil?
130130
super(spath)
131131
end
132132

133+
def data_path(dat)
134+
dat_root = File.join(SKETCH_ROOT, 'data')
135+
Dir.mkdir(dat_root) unless File.exist?(dat_root)
136+
File.join(dat_root, dat)
137+
end
138+
133139
def sketch_size(x, y)
134140
surface.set_size(x, y)
135141
end

lib/jruby_art/helper_methods.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ def java_self
136136
@java_self ||= to_java(Java::ProcessingCore::PApplet)
137137
end
138138

139-
# Get the sketch path
140-
def sketch_path
141-
@declared_fields['sketchPath'].value(java_self)
142-
end
143-
144139
# Fields that should be made accessible as under_scored.
145140
define_method(:mouse_x) { mouseX }
146141

lib/jruby_art/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# frozen_string_literal: true
33
# A wrapper for version
44
module JRubyArt
5-
VERSION = '1.0.8'
5+
VERSION = '1.1.0'
66
end

pom.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
project 'rp5extras', 'https://github.com/ruby-processing/JRubyArt' do
66

77
model_version '4.0.0'
8-
id 'ruby-processing:rp5extras', '1.0.8'
8+
id 'ruby-processing:rp5extras', '1.1.0'
99
packaging 'jar'
1010

1111
description 'rp5extras for JRubyArt'
@@ -35,7 +35,7 @@
3535
'jruby.api' => 'http://jruby.org/apidocs/'
3636
)
3737

38-
pom 'org.jruby:jruby:9.1.0.0'
38+
pom 'org.jruby:jruby:9.1.1.0'
3939
jar 'org.processing:core:3.1'
4040
jar 'org.processing:video:3.0.2'
4141
plugin_management do

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
1111
<modelVersion>4.0.0</modelVersion>
1212
<groupId>ruby-processing</groupId>
1313
<artifactId>rp5extras</artifactId>
14-
<version>1.0.8</version>
14+
<version>1.0.9</version>
1515
<name>rp5extras</name>
1616
<description>rp5extras for JRubyArt</description>
1717
<url>https://github.com/ruby-processing/JRubyArt</url>

test/k9_run_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_sketch_path
2525
end
2626
end
2727
end
28-
assert_match('/home/tux/JRubyArt/test', out, 'Failed Sketch Path Sketch')
28+
assert_match('/home/tux/data_path/test', out, 'Failed Sketch Path Sketch')
2929
end
3030

3131
def test_on_top

vendors/Rakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ WARNING = <<-EOS
88
99
EOS
1010

11-
JRUBYC_VERSION = '9.1.0.0'
12-
EXAMPLES = '1.7'
11+
JRUBYC_VERSION = '9.1.1.0'
12+
EXAMPLES = '1.0'
1313
HOME_DIR = ENV['HOME']
1414
MAC_OR_LINUX = /linux|mac|darwin/ =~ RbConfig::CONFIG['host_os']
1515

@@ -27,7 +27,7 @@ file "jruby-complete-#{JRUBYC_VERSION}.jar" do
2727
rescue
2828
warn(WARNING)
2929
end
30-
check_sha256("jruby-complete-#{JRUBYC_VERSION}.jar", "8a4b5f4cbdcfd43272002a543a59abfbf419577ef679273d4893a4f09594267e")
30+
check_sha256("jruby-complete-#{JRUBYC_VERSION}.jar", "659a2b120a02e8df55dddf3836e34023c80313a1c08b159ba3882f7d25ff8ef2")
3131
end
3232

3333
directory "../lib/ruby"
@@ -59,9 +59,9 @@ file_name = (MAC_OR_LINUX.nil?) ? "#{EXAMPLES}.zip" : "#{EXAMPLES}.tar.gz"
5959
file file_name do
6060
begin
6161
if MAC_OR_LINUX.nil?
62-
sh "wget https://github.com/ruby-processing/samples4ruby-processing3/archive/#{EXAMPLES}.zip"
62+
sh "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
6363
else
64-
sh "wget https://github.com/ruby-processing/samples4ruby-processing3/archive/#{EXAMPLES}.tar.gz"
64+
sh "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.tar.gz"
6565
end
6666
rescue
6767
warn(WARNING)
@@ -78,4 +78,4 @@ task :copy_examples => file_name do
7878
sh "rm -r #{HOME_DIR}/k9_samples" if File.exist? "#{HOME_DIR}/k9_samples"
7979
sh "cp -r samples4ruby-processing3-#{EXAMPLES} #{HOME_DIR}/k9_samples"
8080
sh "rm -r samples4ruby-processing3-#{EXAMPLES}"
81-
end
81+
end

0 commit comments

Comments
 (0)