Skip to content

Commit 68b537b

Browse files
committed
tiny changes
1 parent df85d2b commit 68b537b

File tree

7 files changed

+22
-19
lines changed

7 files changed

+22
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
**v1.1.3** Revert using String refinements in `creator.rb`. Refactor java options to `java_opts.rb`.
3+
24
**v1.1.2** Refactor `runner.rb` to `runner.rb`, `args.rb` and `installer.rb`. The `Installer` classes have the role of installing `jruby-complete`, the examples and providing `setup check` functionality. Refactored and improved default `config.yml` tool, all should make it easier for `collaborators/successors` to follow the code. Refactored `Vec2D` and `Vec3D` `==` and `eql?` methods. New `chooser` library makes it possible to use `select_input` reflection method.
35

46
**v1.1.1** Even more `data_path` fixes in examples, update to jruby-complete-9.1.2.0

lib/jruby_art/creators/creator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ def create!(path, args)
199199
@title = StringExtra.new(main_file).titleize
200200
@width = args[0]
201201
@height = args[1]
202-
@mode = args[2].upcase unless args[2].nil?
203-
template = @mode.nil? ? basic_template : basic_template_mode
204-
writer.save(template)
202+
return writer.save(basic_template) if args[2].nil?
203+
@mode = args[2].upcase
204+
writer.save(basic_template_mode)
205205
end
206206
end
207207

lib/jruby_art/java_opts.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# frozen_string_literal: false
22
# class to parse java_args.txt or java_args in config.yml
33
class JavaOpts
4-
attr_reader :jvm_opts
4+
attr_reader :opts
55

66
def initialize(sketch_root)
77
arg_file = File.join(sketch_root, 'data/java_args.txt')
8-
@jvm_opts = []
9-
if FileTest.exist?(arg_file)
10-
@jvm_opts += File.read(arg_file).split(/\s+/)
11-
elsif Processing::RP_CONFIG['java_args']
12-
@jvm_opts += Processing::RP_CONFIG['java_args'].split(/\s+/)
8+
@opts = []
9+
@opts += File.read(arg_file).split(/\s+/) if FileTest.exist?(arg_file)
10+
if opts.empty? && Processing::RP_CONFIG.fetch('java_args', false)
11+
@opts += Processing::RP_CONFIG['java_args'].split(/\s+/)
1312
end
1413
end
14+
end
1515

16-
# wrap java args for jruby
17-
def jruby
18-
return [] if jvm_opts.length == 0
19-
jvm_opts.map { |arg| "-J#{arg}" }
16+
# wrap args to pass through to jvm from jruby
17+
class JRubyOpts < JavaOpts
18+
def opts
19+
super.map { |arg| "-J#{arg}" }
2020
end
2121
end

lib/jruby_art/runner.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,20 @@ def show_version
146146
def spin_up(starter_script, sketch, args)
147147
runner = "#{K9_ROOT}/lib/jruby_art/runners/#{starter_script}"
148148
@options.nojruby = true if Processing::RP_CONFIG['JRUBY'] == 'false'
149-
opts = JavaOpts.new(SKETCH_ROOT)
150149
if @options.nojruby
150+
opts = JavaOpts.new(SKETCH_ROOT).opts
151151
command = ['java',
152-
opts.jvm_opts,
152+
opts,
153153
'-cp',
154154
jruby_complete,
155155
'org.jruby.Main',
156156
runner,
157157
sketch,
158158
args].flatten
159159
else
160+
opts = JRubyOpts.new(SKETCH_ROOT).opts
160161
command = ['jruby',
161-
opts.jruby,
162+
opts,
162163
runner,
163164
sketch,
164165
args].flatten

lib/jruby_art/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# frozen_string_literal: true
33
# A wrapper for version
44
module JRubyArt
5-
VERSION = '1.1.2'
5+
VERSION = '1.1.3'
66
end

pom.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
project 'rp5extras', 'https://github.com/ruby-processing/JRubyArt' do
66

77
model_version '4.0.0'
8-
id 'ruby-processing:rp5extras', '1.1.2'
8+
id 'ruby-processing:rp5extras', '1.1.3'
99
packaging 'jar'
1010

1111
description 'rp5extras for JRubyArt'

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
1111
<modelVersion>4.0.0</modelVersion>
1212
<groupId>ruby-processing</groupId>
1313
<artifactId>rp5extras</artifactId>
14-
<version>1.1.2</version>
14+
<version>1.1.3</version>
1515
<name>rp5extras</name>
1616
<description>rp5extras for JRubyArt</description>
1717
<url>https://github.com/ruby-processing/JRubyArt</url>

0 commit comments

Comments
 (0)