jruby_art 0.2.1.pre → 0.2.2.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -48
- data/lib/jruby_art.rb +15 -15
- data/lib/jruby_art/version.rb +1 -1
- data/lib/rpextras.jar +0 -0
- data/spec/vecmath_spec.rb +1 -1
- data/vendors/Rakefile +7 -23
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc6b839d4a0522e7ee66e742f988458db321bd8c
|
4
|
+
data.tar.gz: 139442bd195106223036ab7d7e8af3090466c58b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd9a024eb64be8c46b8f505243e848928e922d525aa6c7485abf5e5c3de52141aa3110e047b7dfb62e72b1816ee568e8ec1e4a226aab16e6499865e7fb01bd27
|
7
|
+
data.tar.gz: 422611e5878dc76d27346b1c935ff5b3356dd1a5d8db86c46df25b1938c66a21a3ff8bb9beb909a79c120ddb29a60e4d8530d9e84fbca3005dfb715df3ab631f
|
data/README.md
CHANGED
@@ -1,65 +1,67 @@
|
|
1
1
|
## JRubyArt
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/jruby_art.svg)](http://badge.fury.io/rb/jruby_art)
|
3
3
|
|
4
|
-
Is
|
4
|
+
Is an alternative implementation of [ruby-processing][] that provides a ruby-wrapper for the java version of [processing][]. It is currently at the pre-release stage, but is ready for testing, and available from rubygems.org.
|
5
5
|
|
6
|
+
### Requirements
|
6
7
|
|
7
|
-
|
8
|
+
Java runtime 7+, and ruby (can be MRI ruby), curl (to download jruby-complete and examples, although there is a workaround). NB: it is not necessary to install vanilla [processing][] with this implementation, core jars are included in the gem.
|
8
9
|
|
9
|
-
|
10
|
-
what mine looks like on arch-linux
|
11
|
-
|
12
|
-
```ruby
|
13
|
-
---
|
14
|
-
PROCESSING_ROOT: /usr/share/processing
|
10
|
+
### Getting Started
|
15
11
|
|
12
|
+
```bash
|
13
|
+
gem install jruby-art --dev
|
14
|
+
k9 setup install # uses curl to to download jruby-complete and examples
|
15
|
+
cd examples/contributed
|
16
|
+
k9 run clock.rb # if you've got jruby on your machine `jruby clock.rb` also works
|
16
17
|
```
|
17
|
-
However unlike ruby-processing, the core jars become part of the gem and PROCESSING_ROOT is not used at runtime.
|
18
|
-
|
19
|
-
The following config should work on macosx
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
### Creating your own
|
20
|
+
```bash
|
21
|
+
k9 create my_sketch 200 200
|
22
|
+
vim my_sketch.rb # other editors are available
|
24
23
|
```
|
24
|
+
Output:
|
25
|
+
```ruby
|
26
|
+
require 'jruby_art'
|
25
27
|
|
26
|
-
|
28
|
+
class MySketch < Processing::App
|
29
|
+
def setup
|
30
|
+
size 200, 200
|
31
|
+
end
|
27
32
|
|
28
|
-
|
33
|
+
def draw
|
29
34
|
|
30
|
-
|
35
|
+
end
|
36
|
+
end
|
31
37
|
|
32
|
-
|
38
|
+
MySketch.new(title: 'My Sketch')
|
39
|
+
```
|
40
|
+
The above is an example of class wrapped sketch (that can be run using `jruby my_sketch.rb` or `k9 run my_sketch.rb`), bare sketches also work. See [examples/bare_sketches][]
|
41
|
+
```ruby
|
42
|
+
def setup
|
43
|
+
size 200, 200
|
44
|
+
end
|
33
45
|
|
34
|
-
|
46
|
+
def draw
|
35
47
|
|
36
|
-
|
37
|
-
k9 create my_app 200 200
|
48
|
+
end
|
38
49
|
```
|
50
|
+
However such sketches must be run with `k9 run sketch.rb`, however you can do 'k9 wrap sketch.rb` which converts bare sketches to a class wrapped form.
|
39
51
|
|
40
|
-
|
52
|
+
###Ruby Versions
|
41
53
|
|
42
|
-
|
43
|
-
k9 create my_app 200 200 p3d
|
44
|
-
```
|
54
|
+
jruby-1.7.19 (when sketches run with jruby command)
|
45
55
|
|
46
|
-
|
56
|
+
jruby-9.0.0.0.pre1 also seems to work (the next pre-release will target jruby-9.0.0.0-pre1)
|
47
57
|
|
48
|
-
|
49
|
-
jruby my_app.rb
|
50
|
-
```
|
58
|
+
or
|
51
59
|
|
52
|
-
|
60
|
+
ruby-2.1.2+ (when sketches are run using k9 command, ie using jruby-complete)
|
53
61
|
|
54
|
-
|
55
|
-
k9 setup install # requires wget (Now also downloads examples to users home)
|
56
|
-
```
|
57
|
-
To run sketches with jruby-complete (rather than installed jruby)
|
62
|
+
### Using netbeans as an ide for JRubyArt
|
58
63
|
|
59
|
-
|
60
|
-
k9 run my_app.rb # NB: k9 setup install, is a one-time 'install to gem' procedure
|
61
|
-
that also downloads and install samples in examples folder in users directory
|
62
|
-
```
|
64
|
+
See [netbeans][]
|
63
65
|
|
64
66
|
[Contributing][]
|
65
67
|
|
@@ -71,20 +73,11 @@ that also downloads and install samples in examples folder in users directory
|
|
71
73
|
|
72
74
|
[CHANGELOG][]
|
73
75
|
|
74
|
-
###Ruby Versions
|
75
|
-
|
76
|
-
jruby-1.7.18 (when sketches run with jruby command)
|
77
|
-
|
78
|
-
jruby-9.0.0.0.pre1 also seems to work
|
79
|
-
|
80
|
-
or
|
81
|
-
|
82
|
-
ruby-2.1.2+ (when sketches are run using k9 command, ie using jruby-complete)
|
83
|
-
|
84
76
|
[Acknowledgements]:ACKNOWLEDGEMENTS.md
|
85
77
|
[CHANGELOG]:CHANGELOG.md
|
86
78
|
[Contributing]:CONTRIBUTING.md
|
87
79
|
[Examples]:https://github.com/ruby-processing/JRubyArt-examples
|
80
|
+
[examples/bare_sketches]:https://github.com/ruby-processing/JRubyArt-examples/tree/master/bare_sketches
|
88
81
|
[License]:LICENSE.md
|
89
82
|
[processing]:https://github.com/processing/processing
|
90
83
|
[ruby-processing]:https://github.com/jashkenas/ruby-processing
|
data/lib/jruby_art.rb
CHANGED
@@ -9,28 +9,28 @@ end
|
|
9
9
|
|
10
10
|
# guard prevents issues with mri ruby when using creator
|
11
11
|
if RUBY_PLATFORM == 'java'
|
12
|
-
def platform
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
12
|
+
#def platform
|
13
|
+
# host_os = RbConfig::CONFIG['host_os']
|
14
|
+
# return '*mac-universal.jar' if host_os =~ /mac|darwin/
|
15
|
+
# bit = ENV_JAVA['sun.arch.data.model']
|
16
|
+
# if host_os =~ /linux/
|
17
|
+
# bit.eql?('32') ? '*linux-i586.jar' : '*linux-amd64.jar'
|
18
|
+
# elsif host_os =~ /cygwin|windows/
|
19
|
+
# bit.eql?('32') ? '*windows-i586.jar' : '*windows-amd64.jar'
|
20
|
+
# else
|
21
|
+
# '*armv6hf.jar'
|
22
|
+
# end
|
23
|
+
#end
|
24
24
|
working_directory = File.join(File.dirname(__FILE__))
|
25
25
|
$LOAD_PATH << working_directory unless $LOAD_PATH.include?(working_directory)
|
26
26
|
Dir[File.join(working_directory, '*.jar')].each do |jar|
|
27
27
|
# require_relative jar unless jar =~ /native/ (breaks netbeans)
|
28
28
|
require jar unless jar =~ /native/
|
29
29
|
end
|
30
|
-
Dir[File.join(working_directory, platform)].each do |jar|
|
30
|
+
#Dir[File.join(working_directory, platform)].each do |jar|
|
31
31
|
# require_relative jar (break netbeans)
|
32
|
-
|
33
|
-
|
32
|
+
# require jar
|
33
|
+
# end
|
34
34
|
Java::ProcessingFastmath::DeglutLibrary.new.load(JRuby.runtime, false)
|
35
35
|
Java::ProcessingVecmathVec2::Vec2Library.new.load(JRuby.runtime, false)
|
36
36
|
Java::ProcessingVecmathVec3::Vec3Library.new.load(JRuby.runtime, false)
|
data/lib/jruby_art/version.rb
CHANGED
data/lib/rpextras.jar
CHANGED
Binary file
|
data/spec/vecmath_spec.rb
CHANGED
data/vendors/Rakefile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'rake/clean'
|
2
2
|
|
3
3
|
WARNING = <<-EOS
|
4
|
-
WARNING: you may not have
|
4
|
+
WARNING: you may not have curl installed, you could just download
|
5
5
|
the correct version of jruby-complete and/or examples to the vendors
|
6
|
-
folder, and re-run k9 setup install instead of installing
|
6
|
+
folder, and re-run k9 setup install instead of installing curl. Some
|
7
7
|
systems may also require 'sudo' access to install jruby-complete,
|
8
8
|
NB: this is untested....
|
9
9
|
|
@@ -23,7 +23,7 @@ task :download => ["jruby-complete-#{JRUBYC_VERSION}.jar"]
|
|
23
23
|
|
24
24
|
file "jruby-complete-#{JRUBYC_VERSION}.jar" do
|
25
25
|
begin
|
26
|
-
sh "
|
26
|
+
sh "curl -O https://s3.amazonaws.com/jruby.org/downloads/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar"
|
27
27
|
rescue
|
28
28
|
warn(WARNING)
|
29
29
|
end
|
@@ -37,32 +37,17 @@ task :copy_ruby => ["../lib/ruby"] do
|
|
37
37
|
sh "cp -v jruby-complete-#{JRUBYC_VERSION}.jar ../lib/ruby/jruby-complete.jar"
|
38
38
|
end
|
39
39
|
|
40
|
-
desc 'download and copy examples to user home'
|
41
|
-
task :download_examples
|
42
|
-
file "#{EXAMPLES}" do
|
43
|
-
begin
|
44
|
-
if MAC_OR_LINUX.nil?
|
45
|
-
sh "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
|
46
|
-
else
|
47
|
-
sh "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.tar.gz"
|
48
|
-
end
|
49
|
-
rescue
|
50
|
-
warn(WARNING)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
40
|
desc "download, and copy to JRubyArt"
|
55
41
|
task :unpack_samples => [:download_examples, :copy_examples]
|
56
|
-
|
57
42
|
desc 'download and copy examples to user home'
|
58
43
|
task :download_examples
|
59
44
|
file_name = (MAC_OR_LINUX.nil?) ? "#{EXAMPLES}.zip" : "#{EXAMPLES}.tar.gz"
|
60
45
|
file file_name do
|
61
46
|
begin
|
62
47
|
if MAC_OR_LINUX.nil?
|
63
|
-
sh "
|
48
|
+
sh "curl -Lo examples.zip https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
|
64
49
|
else
|
65
|
-
sh "
|
50
|
+
sh "curl -Lo examples.tar.gz https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.tar.gz"
|
66
51
|
end
|
67
52
|
rescue
|
68
53
|
warn(WARNING)
|
@@ -72,15 +57,14 @@ end
|
|
72
57
|
desc "copy examples"
|
73
58
|
task :copy_examples => file_name do
|
74
59
|
if MAC_OR_LINUX.nil?
|
75
|
-
sh "unzip
|
60
|
+
sh "unzip examples.zip"
|
76
61
|
else
|
77
|
-
sh "tar xzvf
|
62
|
+
sh "tar xzvf examples.tar.gz"
|
78
63
|
end
|
79
64
|
sh "cp -r JRubyArt-examples-#{EXAMPLES} #{HOME_DIR}/examples"
|
80
65
|
sh "rm -r JRubyArt-examples-#{EXAMPLES}"
|
81
66
|
end
|
82
67
|
|
83
|
-
|
84
68
|
def check_sha1(filename, expected_hash)
|
85
69
|
require "digest/sha1"
|
86
70
|
sha1 = Digest::SHA1.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby_art
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Prout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|