jruby_art 0.2.1.pre → 0.2.2.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14b6b25af68362b0935ec7fa7060ff94c6058082
4
- data.tar.gz: 9c8a4949546e952b315aea6042c655f77ceeb0ca
3
+ metadata.gz: cc6b839d4a0522e7ee66e742f988458db321bd8c
4
+ data.tar.gz: 139442bd195106223036ab7d7e8af3090466c58b
5
5
  SHA512:
6
- metadata.gz: 593dd27469ab97670b0037298a947de4e2b7cefe8e8abeec3f4649b6c49ec1f68501637910226cfa3f54d7c4e27e090f81becb128deb435ecfd841f06714e873
7
- data.tar.gz: d5b979d144d4acc91b490f5696d5fdbd28c8cead7aca9ad3b4cf85c007859e3fb2ec330dd51e578a24b49044b69011450c80f80384b1e3dbeeb7a32427d2602d
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 a development fork of [ruby-processing][] that has a somewhat independent existence, see [processing-core][] at least in the short term. Plan was that JRubyArt releases (pre-releases) would use jruby-9.0.0.0 from the start, but now I think it might be more sane to start with jruby-1.7.18. Version 0.2.0.pre is now available from rubygems. To build from repo:-
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
- You should (like ruby-processing) install [processing-2.2.1][]
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
- Then create a `~/.jruby_art/config.yml` config file, here is
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
- ```ruby
22
- ---
23
- PROCESSING_ROOT: /Applications/Processing.app/Contents/Java
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
- To copy processing jars `rake processing_jars`
28
+ class MySketch < Processing::App
29
+ def setup
30
+ size 200, 200
31
+ end
27
32
 
28
- To compile extensions `jruby -S rake compile` _requires rake-compiler gem_
33
+ def draw
29
34
 
30
- To build gem `jruby -S rake package`
35
+ end
36
+ end
31
37
 
32
- To install `gem install pkg/jruby_art-0.2.pre.gem`
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
- To create a new blank sketch
46
+ def draw
35
47
 
36
- ```bash
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
- or for 3D opengl sketch
52
+ ###Ruby Versions
41
53
 
42
- ```bash
43
- k9 create my_app 200 200 p3d
44
- ```
54
+ jruby-1.7.19 (when sketches run with jruby command)
45
55
 
46
- To run most sketches, all you need is an installed jruby:-
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
- ```bash
49
- jruby my_app.rb
50
- ```
58
+ or
51
59
 
52
- To run certain sketches, eg those with load_image (or shaders), either use [netbeans][] as your development ide or use the vendored jruby-complete (beyond our control something to do with jruby permissions?). To install jruby-complete:-
60
+ ruby-2.1.2+ (when sketches are run using k9 command, ie using jruby-complete)
53
61
 
54
- ```bash
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
- ```bash
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
- 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
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
- require jar
33
- end
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)
@@ -1,3 +1,3 @@
1
1
  module JRubyArt
2
- VERSION = '0.2.1.pre'
2
+ VERSION = '0.2.2.pre'
3
3
  end
data/lib/rpextras.jar CHANGED
Binary file
data/spec/vecmath_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative '../lib/ribiprocessing'
1
+ require_relative '../lib/jruby_art'
2
2
 
3
3
  Java::ProcessingVecmathVec2::Vec2Library.new.load(JRuby.runtime, false)
4
4
 
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 wget installed, you could just download
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 wget. Some
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 "wget https://s3.amazonaws.com/jruby.org/downloads/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar"
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 "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
48
+ sh "curl -Lo examples.zip https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
64
49
  else
65
- sh "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.tar.gz"
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 #{EXAMPLES},zip"
60
+ sh "unzip examples.zip"
76
61
  else
77
- sh "tar xzvf #{EXAMPLES}.tar.gz"
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.1.pre
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-02 00:00:00.000000000 Z
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