jruby_art 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jruby_art/app.rb +7 -5
- data/lib/jruby_art/config.rb +38 -0
- data/lib/jruby_art/installer.rb +2 -2
- data/lib/jruby_art/library_loader.rb +1 -1
- data/lib/jruby_art/runner.rb +4 -21
- data/lib/jruby_art/version.rb +1 -1
- data/lib/rpextras.jar +0 -0
- data/vendors/Rakefile +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebf4e0e9543d34a691190a32b124c92c83acb263
|
4
|
+
data.tar.gz: 5f5c169933e317f65d1efeffa9fcdc8086c83c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '091a86a696a90c174d5c8d506adc2f656bfaf4ed473b19fa55f9da8d2faa320b47ab3e07e0be44d38f910df603bbd4b8203b2036c3a2d993fd12e056285cc2ec'
|
7
|
+
data.tar.gz: 8d3861eb7bcb6f8105b97c36536805738c346aae8e7c7ecd4145ba28793b13cbcf3b7cf341699f085ef05dcf1a6a4f1831a77f83f921f6b589784484477bfe22
|
data/lib/jruby_art/app.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
# frozen_string_literal: false
|
2
3
|
require 'java'
|
3
4
|
require_relative '../rpextras'
|
@@ -55,10 +56,10 @@ module Processing
|
|
55
56
|
|
56
57
|
class << self
|
57
58
|
# Handy getters and setters on the class go here:
|
58
|
-
|
59
|
+
attr_reader :sketch_class, :library_loader
|
59
60
|
|
60
61
|
def load_libraries(*args)
|
61
|
-
library_loader ||= LibraryLoader.new
|
62
|
+
@library_loader ||= LibraryLoader.new
|
62
63
|
library_loader.load_library(*args)
|
63
64
|
end
|
64
65
|
alias load_library load_libraries
|
@@ -93,9 +94,10 @@ module Processing
|
|
93
94
|
# Options are no longer relevant, define post_initialize method to use
|
94
95
|
# custom options (see Sandi Metz POODR)
|
95
96
|
|
96
|
-
def initialize
|
97
|
+
def initialize(options = {})
|
97
98
|
super()
|
98
99
|
$app = self
|
100
|
+
post_initialize(options)
|
99
101
|
proxy_java_fields
|
100
102
|
mix_proxy_into_inner_classes
|
101
103
|
java.lang.Thread.default_uncaught_exception_handler = proc do |_thread_, exception|
|
@@ -121,8 +123,8 @@ module Processing
|
|
121
123
|
surface.set_title(title)
|
122
124
|
end
|
123
125
|
|
124
|
-
def sketch_path(spath =
|
125
|
-
return super() if spath.
|
126
|
+
def sketch_path(spath = '')
|
127
|
+
return super() if spath.empty?
|
126
128
|
super(spath)
|
127
129
|
end
|
128
130
|
|
data/lib/jruby_art/config.rb
CHANGED
@@ -13,4 +13,42 @@ module Processing
|
|
13
13
|
warn(format('WARN: you need to set PROCESSING_ROOT in %s', config_path))
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
WIN_PATTERNS = [
|
18
|
+
/bccwin/i,
|
19
|
+
/cygwin/i,
|
20
|
+
/djgpp/i,
|
21
|
+
/ming/i,
|
22
|
+
/mswin/i,
|
23
|
+
/wince/i
|
24
|
+
].freeze
|
25
|
+
|
26
|
+
# This class knows about supported JRubyArt operating systems
|
27
|
+
class HostOS
|
28
|
+
def self.os
|
29
|
+
detect_os = RbConfig::CONFIG['host_os']
|
30
|
+
case detect_os
|
31
|
+
when /mac|darwin/ then :mac
|
32
|
+
when /linux/ then :linux
|
33
|
+
when /solaris|bsd/ then :unix
|
34
|
+
else
|
35
|
+
WIN_PATTERNS.find { |reg| detect_os =~ reg }
|
36
|
+
raise "unsupported os: #{detect_os.inspect}" if Regexp.last_match.nil?
|
37
|
+
:windows
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
OS ||= HostOS.os
|
43
|
+
end
|
44
|
+
|
45
|
+
# This class encapulates knowledge of processing sketchbook structure
|
46
|
+
class Sketchbook
|
47
|
+
def self.path
|
48
|
+
File.join(Processing::RP_CONFIG['sketchbook_path'], 'libraries')
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.library(name)
|
52
|
+
Dir["#{path}/#{name}/library/\*.jar"]
|
53
|
+
end
|
16
54
|
end
|
data/lib/jruby_art/installer.rb
CHANGED
@@ -31,13 +31,13 @@ class Installer
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def root_exist?
|
34
|
-
return false if config.
|
34
|
+
return false if config.empty?
|
35
35
|
File.exist? config['PROCESSING_ROOT']
|
36
36
|
end
|
37
37
|
|
38
38
|
def config
|
39
39
|
k9config = File.expand_path("#{home}/.jruby_art/config.yml")
|
40
|
-
return
|
40
|
+
return '' unless File.exist? k9config
|
41
41
|
YAML.load_file(k9config)
|
42
42
|
end
|
43
43
|
|
@@ -109,7 +109,7 @@ module Processing
|
|
109
109
|
"#{Processing::RP_CONFIG['PROCESSING_ROOT']}/modes/java/libraries/#{library_name}/library",
|
110
110
|
"#{K9_ROOT}/library/#{library_name}/library",
|
111
111
|
"#{K9_ROOT}/library/#{library_name}",
|
112
|
-
|
112
|
+
"#{Sketchbook.path}/#{library_name}/library"
|
113
113
|
].each do |jpath|
|
114
114
|
if File.exist?(jpath) && !Dir.glob(format('%s/*.%s', jpath, ext)).empty?
|
115
115
|
return jpath
|
data/lib/jruby_art/runner.rb
CHANGED
@@ -136,13 +136,13 @@ module Processing
|
|
136
136
|
|
137
137
|
def install
|
138
138
|
require_relative '../jruby_art/installer'
|
139
|
-
JRubyCompleteInstall.new(K9_ROOT,
|
140
|
-
UnpackSamples.new(K9_ROOT,
|
139
|
+
JRubyCompleteInstall.new(K9_ROOT, OS).install
|
140
|
+
UnpackSamples.new(K9_ROOT, OS).install
|
141
141
|
end
|
142
142
|
|
143
143
|
def check
|
144
144
|
require_relative '../jruby_art/installer'
|
145
|
-
Check.new(K9_ROOT,
|
145
|
+
Check.new(K9_ROOT, OS).install
|
146
146
|
end
|
147
147
|
|
148
148
|
# Show the standard help/usage message.
|
@@ -183,24 +183,7 @@ module Processing
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def libraries
|
186
|
-
%w(video sound).map { |library|
|
187
|
-
end
|
188
|
-
|
189
|
-
def sketchbook_library(name)
|
190
|
-
Dir["#{Processing::RP_CONFIG['sketchbook_path']}/libraries/#{name}/library/\*.jar"]
|
191
|
-
end
|
192
|
-
|
193
|
-
def host_os
|
194
|
-
detect_os = RbConfig::CONFIG['host_os']
|
195
|
-
case detect_os
|
196
|
-
when /mac|darwin/ then :mac
|
197
|
-
when /linux/ then :linux
|
198
|
-
when /solaris|bsd/ then :unix
|
199
|
-
else
|
200
|
-
WIN_PATTERNS.find { |r| detect_os =~ r }
|
201
|
-
raise "unknown os: #{detect_os.inspect}" if Regexp.last_match.nil?
|
202
|
-
:windows
|
203
|
-
end
|
186
|
+
%w(video sound).map { |library| Sketchbook.library(library) }.flatten
|
204
187
|
end
|
205
188
|
end # class Runner
|
206
189
|
end # module Processing
|
data/lib/jruby_art/version.rb
CHANGED
data/lib/rpextras.jar
CHANGED
Binary file
|
data/vendors/Rakefile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby_art
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Ashkenas
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-01-
|
13
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
requirements:
|
102
102
|
- A decent graphics card
|
103
103
|
- java runtime >= 1.8.0_111+
|
104
|
-
- processing = 3.2.
|
104
|
+
- processing = 3.2.4+
|
105
105
|
rubyforge_project:
|
106
106
|
rubygems_version: 2.6.8
|
107
107
|
signing_key:
|