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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6583235100be711a51d787b016db40e373f058bb
4
- data.tar.gz: 3e12254c7ba77564a7a43899e09b142a4add57f2
3
+ metadata.gz: 05c56a4fef1b06b3b0eef19527dd33a9b0d89333
4
+ data.tar.gz: 300a3b7e12a1883085fac9d467bcacbe46d268bc
5
5
  SHA512:
6
- metadata.gz: 98e5d4dc74ed309290100e96f2d42fcfab4eb3346e46b86a8129f107fcabecea90cd63a5e557f87f1e3e08389c84115d491e98195392842dc0d0eb5e2df790a7
7
- data.tar.gz: 39dbad9dbf14b0520dd8c9b0c350a1e200741e1bee9f9796474e466de41ed49006dc9828f09e390a9dec59db1731e9de2a8c6511318fbbcaff2786c3bd41a9cc
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
@@ -63,6 +63,8 @@ ruby-2.1.2+ (when sketches are run using k9 command, ie using jruby-complete)
63
63
 
64
64
  See [netbeans][]
65
65
 
66
+ ___
67
+
66
68
  [Contributing][]
67
69
 
68
70
  [License][]
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
- def load_libraries(*args)
161
- library_loader ||= LibraryLoader.new
162
- library_loader.load_libraries(*args)
163
- end
164
- alias_method :load_library, :load_libraries
165
-
166
- # When certain special methods get added to the sketch, we need to let
167
- # Processing call them by their expected Java names.
168
- def self.method_added(method_name) #:nodoc:
169
- if METHODS_TO_ALIAS.key?(method_name)
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(Mac Linux Windows).find do |os|
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.downcase unless match =~ /Mac/
83
+ return match unless match =~ /mac/
84
84
  'macosx'
85
85
  end
86
86
 
@@ -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
@@ -1,4 +1,4 @@
1
1
  # The sole purpose of this module is to provide a name-space for version
2
2
  module JRubyArt
3
- VERSION = '0.2.3.pre'
3
+ VERSION = '0.2.4.pre'
4
4
  end
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.3.pre
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-02-28 00:00:00.000000000 Z
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