jruby_art 0.2.3.pre → 0.2.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/lib/jruby_art/app.rb +14 -10
- data/lib/jruby_art/library_loader.rb +3 -3
- data/lib/jruby_art/runner.rb +0 -20
- data/lib/jruby_art/version.rb +1 -1
- data/lib/rpextras.jar +0 -0
- data/library/grammar/grammar.rb +31 -0
- data/vendors/Rakefile +9 -1
- data/vendors/config.tar.gz +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c56a4fef1b06b3b0eef19527dd33a9b0d89333
|
4
|
+
data.tar.gz: 300a3b7e12a1883085fac9d467bcacbe46d268bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e27c5d4f77c70155763fc0c0012d53ed6e42eb83dcf89b1657e1be452617181b3e7d618fd4991b8b280946cf711c2f7971b80fbe7e370375d6629e57f309e8
|
7
|
+
data.tar.gz: 040c4eee673e1b5816e0bdb6029e6218413df601a66eda8ef6e1b3a23224517b3e4c29d1aac36d0cb6bbd07b4144857f6908625b2b0823773df9c871a377ad67
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
It might seem a little of that this log starts at version 0.1.2, the reason for this is that previous version relate to earlier versions which were essentially a clone of ruby-processing.
|
4
4
|
|
5
|
+
### Version 0.2.4
|
6
|
+
|
7
|
+
Can't wait forever for jruby-9000, this release is require to promote the new toxiclibs gem.
|
8
|
+
|
5
9
|
### Version 0.2.3
|
6
10
|
|
7
11
|
Now using curl instead of wget "following the path of least resistance for enfeebled Mac users" and also there might be better Windows support for curl vs wget. Now includes a library loader for jars (supports video and sound library etc), added control_panel and boids library.
|
data/README.md
CHANGED
data/lib/jruby_art/app.rb
CHANGED
@@ -157,16 +157,20 @@ module Processing
|
|
157
157
|
fail unless /opengl/ =~ mode
|
158
158
|
end
|
159
159
|
|
160
|
-
|
161
|
-
|
162
|
-
library_loader
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
160
|
+
class << self
|
161
|
+
# Handy getters and setters on the class go here:
|
162
|
+
attr_accessor :sketch_class, :library_loader
|
163
|
+
|
164
|
+
def load_libraries(*args)
|
165
|
+
library_loader ||= LibraryLoader.new
|
166
|
+
library_loader.load_libraries(*args)
|
167
|
+
end
|
168
|
+
alias_method :load_library, :load_libraries
|
169
|
+
|
170
|
+
# When certain special methods get added to the sketch, we need to let
|
171
|
+
# Processing call them by their expected Java names.
|
172
|
+
def method_added(method_name) #:nodoc:
|
173
|
+
return unless METHODS_TO_ALIAS.key?(method_name)
|
170
174
|
alias_method METHODS_TO_ALIAS[method_name], method_name
|
171
175
|
end
|
172
176
|
end
|
@@ -76,11 +76,11 @@ class LibraryLoader
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def platform
|
79
|
-
match = %w(
|
80
|
-
java.lang.System.getProperty('os.name').index(os)
|
79
|
+
match = %w(mac linux windows).find do |os|
|
80
|
+
java.lang.System.getProperty('os.name').downcase.index(os)
|
81
81
|
end
|
82
82
|
return 'other' unless match
|
83
|
-
return match
|
83
|
+
return match unless match =~ /mac/
|
84
84
|
'macosx'
|
85
85
|
end
|
86
86
|
|
data/lib/jruby_art/runner.rb
CHANGED
@@ -103,31 +103,11 @@ module Processing
|
|
103
103
|
case choice
|
104
104
|
when /install/ # download and install jruby-complete and unpack examples to user home
|
105
105
|
system "cd #{K9_ROOT}/vendors && rake"
|
106
|
-
unless proc_root
|
107
|
-
set_processing_root
|
108
|
-
warn 'PROCESSING_ROOT set optimistically, run check to confirm'
|
109
|
-
end
|
110
106
|
else
|
111
107
|
puts usage
|
112
108
|
end
|
113
109
|
end
|
114
110
|
|
115
|
-
# Optimistically set processing root
|
116
|
-
def set_processing_root
|
117
|
-
require 'psych'
|
118
|
-
@os ||= host_os
|
119
|
-
data = {}
|
120
|
-
path = File.expand_path("#{ENV['HOME']}/.jruby_art/config.yml")
|
121
|
-
if os == :mac
|
122
|
-
data['PROCESSING_ROOT'] = '/Applications/Processing.app/Contents/Java'
|
123
|
-
else
|
124
|
-
root = "#{ENV['HOME']}/processing-2.2.1"
|
125
|
-
data['PROCESSING_ROOT'] = root
|
126
|
-
end
|
127
|
-
data['JRUBY'] = true
|
128
|
-
open(path, 'w:UTF-8') { |f| f.write(data.to_yaml) }
|
129
|
-
end
|
130
|
-
|
131
111
|
# Show the standard help/usage message.
|
132
112
|
def show_help
|
133
113
|
puts HELP_MESSAGE
|
data/lib/jruby_art/version.rb
CHANGED
data/lib/rpextras.jar
CHANGED
Binary file
|
@@ -0,0 +1,31 @@
|
|
1
|
+
############################
|
2
|
+
# Simple lsystem grammar
|
3
|
+
############################
|
4
|
+
class Grammar
|
5
|
+
|
6
|
+
attr_reader :axiom, :rules
|
7
|
+
def initialize(axiom, rules)
|
8
|
+
@axiom = axiom
|
9
|
+
@rules = rules
|
10
|
+
end
|
11
|
+
|
12
|
+
def expand(production, iterations, &block)
|
13
|
+
production.each_char do |token|
|
14
|
+
if rules.key?(token) && iterations > 0
|
15
|
+
expand(rules[token], iterations - 1, &block)
|
16
|
+
else
|
17
|
+
yield token
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def each(gen)
|
23
|
+
expand(axiom, gen) { |token| yield token }
|
24
|
+
end
|
25
|
+
|
26
|
+
def generate(gen)
|
27
|
+
output = []
|
28
|
+
each(gen) { |token| output << token }
|
29
|
+
return output
|
30
|
+
end
|
31
|
+
end
|
data/vendors/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rake/clean'
|
2
|
+
require 'rbconfig'
|
2
3
|
|
3
4
|
WARNING = <<-EOS
|
4
5
|
WARNING: you may not have curl installed, you could just download
|
@@ -16,7 +17,7 @@ MAC_OR_LINUX = /linux|mac|darwin/ =~ RbConfig::CONFIG['host_os']
|
|
16
17
|
CLOBBER.include("jruby-complete-#{JRUBYC_VERSION}.jar", "#{EXAMPLES}.tar.gz")
|
17
18
|
|
18
19
|
desc "download, and copy to ruby-processing"
|
19
|
-
task :default => [:download, :copy_ruby, :download_examples, :copy_examples]
|
20
|
+
task :default => [:download, :copy_ruby, :download_examples, :copy_examples, :config]
|
20
21
|
|
21
22
|
desc "download JRuby upstream sources"
|
22
23
|
task :download => ["jruby-complete-#{JRUBYC_VERSION}.jar"]
|
@@ -65,6 +66,13 @@ task :copy_examples => file_name do
|
|
65
66
|
sh "rm -r JRubyArt-examples-#{EXAMPLES}"
|
66
67
|
end
|
67
68
|
|
69
|
+
desc "config"
|
70
|
+
task :config => file_name do
|
71
|
+
next if FileTest.exist?("#{HOME_DIR}/.jruby_art/config.yml")
|
72
|
+
sh "tar xzvf config.tar.gz"
|
73
|
+
sh "cp -r .jruby_art #{HOME_DIR}"
|
74
|
+
end
|
75
|
+
|
68
76
|
def check_sha1(filename, expected_hash)
|
69
77
|
require "digest/sha1"
|
70
78
|
sha1 = Digest::SHA1.new
|
Binary file
|
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.4.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-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- lib/jruby_art/helpers/camel_string.rb
|
98
98
|
- lib/jruby_art/helpers/numeric.rb
|
99
99
|
- lib/jruby_art/helpers/range.rb
|
100
|
+
- library/grammar/grammar.rb
|
100
101
|
- library/control_panel/control_panel.rb
|
101
102
|
- library/boids/boids.rb
|
102
103
|
- library/file_chooser/file_chooser.rb
|
@@ -106,6 +107,7 @@ files:
|
|
106
107
|
- spec/app_spec.rb
|
107
108
|
- spec/deglut_spec.rb
|
108
109
|
- vendors/Rakefile
|
110
|
+
- vendors/config.tar.gz
|
109
111
|
homepage: https://github.com/ruby-processing/JRubyArt
|
110
112
|
licenses:
|
111
113
|
- MIT
|