jruby_art 1.0.3 → 1.0.4

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: 96ea5bf6d9711bdc36b0aaf432aecfc58063f9bf
4
- data.tar.gz: c8d61f759538b91eb39f0787d9385f6fc539674d
3
+ metadata.gz: 2b2acc334aa2bcb49c4c0ea1c80699bf8994d5bf
4
+ data.tar.gz: 1b055e648c9ff3a3c5cc6411d014579b3d54337b
5
5
  SHA512:
6
- metadata.gz: a83c65f9b8d7c927c3aac436f58e51eea66bcc2105d39bc56269a95a174b22647301efcffaeded3fea88853e1b64a8442d1136f07086e1d169779f1da45a16e8
7
- data.tar.gz: 9f378b5748571551737679735fda13c52c79cabf6b698472a81cbc40875ee40b798b0ec3e4d4399c35247ff57ac41eeee5cc1b42920a4116fd6c9c95028f6476
6
+ metadata.gz: d6fd3f7733ba107fa41f292250b14daedbb259cb021b089d67c1c8c1f9573627d558d796c7f73a32b19348eac210c2e0acb19ed4408da1488aff65d1258bffea
7
+ data.tar.gz: b87e7cc558472028e995a781df15e353e6c7f72b0a47476b36a2df0d012334202fe88dd15b7e528d4308c74ab76e2dd167546b9a687de174f4a579ce2d9e5dfd
@@ -71,13 +71,14 @@ module Processing
71
71
 
72
72
  # explicitly provide 'processing.org' dist instance method
73
73
  def dist(*args)
74
- len = args.length
75
- if len == 4
74
+ case args.length
75
+ when 4
76
76
  return dist2d(*args)
77
- elsif len == 6
77
+ when 6
78
78
  return dist3d(*args)
79
+ else
80
+ fail ArgumentError, 'takes 4 or 6 parameters'
79
81
  end
80
- fail ArgumentError, 'takes 4 or 6 parameters'
81
82
  end
82
83
 
83
84
  # Uses PImage class method under hood
@@ -161,15 +162,22 @@ module Processing
161
162
 
162
163
  private
163
164
 
165
+ FIXNUM_COL = -> (x) { x.is_a?(Fixnum) }
166
+ STRING_COL = -> (x) { x.is_a?(String) }
167
+ FLOAT_COL = -> (x) { x.is_a?(Float) }
164
168
  # parse single argument color int/double/String
165
169
  def hex_color(a)
166
- if a.is_a?(Fixnum)
167
- return Java::Monkstone::ColorUtil.colorLong(a)
168
- elsif a.is_a?(String)
170
+ case a
171
+ when FIXNUM_COL
172
+ Java::Monkstone::ColorUtil.colorLong(a)
173
+ when STRING_COL
169
174
  return Java::Monkstone::ColorUtil.colorString(a) if a =~ /#\h+/
170
175
  fail StandardError, 'Dodgy Hexstring'
176
+ when FLOAT_COL
177
+ Java::Monkstone::ColorUtil.colorDouble(a)
178
+ else
179
+ fail StandardError, 'Dodgy Color Conversion'
171
180
  end
172
- Java::Monkstone::ColorUtil.colorDouble(a)
173
181
  end
174
182
 
175
183
  def dist2d(*args)
@@ -24,7 +24,7 @@ module Processing
24
24
  watch: watch for changes on the file and relaunch it on the fly
25
25
  live: run sketch and open a pry console bound to $app
26
26
  create [width height][mode][flag]: create a new sketch.
27
- setup: check setup, install jruby-complete, unpack samples
27
+ setup: check / install / unpack_samples
28
28
 
29
29
  Common options:
30
30
  --nojruby: use jruby-complete in place of an installed version of jruby
@@ -1,4 +1,4 @@
1
1
  # A wrapper for version
2
2
  module JRubyArt
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
data/lib/rpextras.jar CHANGED
Binary file
@@ -146,9 +146,9 @@ module ControlPanel
146
146
  def look_feel(lf)
147
147
  set_feel(lf)
148
148
  end
149
-
149
+
150
150
  private
151
-
151
+
152
152
  def set_feel(lf = 'metal')
153
153
  lafinfo = javax.swing.UIManager.getInstalledLookAndFeels
154
154
  laf = lafinfo.select do |info|
@@ -161,7 +161,7 @@ module ControlPanel
161
161
  # instance methods module
162
162
  module InstanceMethods
163
163
  def control_panel
164
- @control_panel = ControlPanel::Panel.new unless @control_panel
164
+ @control_panel ||= ControlPanel::Panel.new
165
165
  return @control_panel unless block_given?
166
166
  yield(@control_panel)
167
167
  @control_panel.display
data/vendors/Rakefile CHANGED
@@ -8,7 +8,7 @@ WARNING = <<-EOS
8
8
 
9
9
  EOS
10
10
 
11
- JRUBYC_VERSION = '9.0.4.0'
11
+ JRUBYC_VERSION = '9.0.5.0'
12
12
  EXAMPLES = '1.3'
13
13
  HOME_DIR = ENV['HOME']
14
14
  MAC_OR_LINUX = /linux|mac|darwin/ =~ RbConfig::CONFIG['host_os']
@@ -27,7 +27,7 @@ file "jruby-complete-#{JRUBYC_VERSION}.jar" do
27
27
  rescue
28
28
  warn(WARNING)
29
29
  end
30
- check_sha256("jruby-complete-#{JRUBYC_VERSION}.jar", "3b87fc20a8e51e56632d6b0f7a00b5906f5ecd6c6642f9c189105307103220e8")
30
+ check_sha256("jruby-complete-#{JRUBYC_VERSION}.jar", "7fe1054bf6085f24b9e3069d3e93abf8f17d1448f503eaea2042f98bce2a1d43")
31
31
  end
32
32
 
33
33
  directory "../lib/ruby"
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.0.3
4
+ version: 1.0.4
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: 2016-01-10 00:00:00.000000000 Z
13
+ date: 2016-01-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '5.8'
43
43
  description: |2
44
44
  JRubyArt is a ruby wrapper for the processing art framework.
45
- The current version supports processing-3.0.1, and uses jruby-9.0.4.0
45
+ The current version supports processing-3.0.1, and uses jruby-9.0.5.0
46
46
  as the glue between ruby and java. You can use both processing libraries and ruby
47
47
  gems in your sketches. Features create/run/watch/live modes. The "watch" mode,
48
48
  provides a nice REPL-ish way to work on your processing sketches. Includes:-