Skip to content

Commit 6b4291b

Browse files
committed
use command.rb
1 parent 74ded96 commit 6b4291b

17 files changed

Lines changed: 41 additions & 62 deletions

LICENSE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Martin Prout
3+
Copyright (c) 2015-16 Martin Prout
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

lib/jruby_art.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# frozen_string_literal: false
1+
# frozen_string_literal: true
22
# JRubyArt is for Code Art.
33
# Send suggestions, ideas, and hate-mail to mamba2928 [at] gmail.com
44
# Also, send samples and libraries.

lib/jruby_art/app.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# frozen_string_literal: false
2-
32
require 'java'
43
require_relative '../rpextras'
54
require_relative '../jruby_art/helper_methods'
@@ -31,7 +30,7 @@ module Render
3130
key_pressed: :keyPressed,
3231
key_released: :keyReleased,
3332
key_typed: :keyTyped
34-
}
33+
}.freeze
3534
# All sketches extend this class
3635
class App < PApplet
3736
include HelperMethods, Math, MathTool, Render
@@ -87,7 +86,7 @@ def method_added(method_name) #:nodoc:
8786
def library_loaded?(library_name)
8887
self.class.library_loaded?(library_name)
8988
end
90-
89+
9190
# Since processing-3.0 you should prefer setting the sketch width and
9291
# height and renderer using the size method in the settings loop of the
9392
# sketch (as with vanilla processing) but is hidden see created java.
@@ -108,7 +107,7 @@ def initialize
108107
# NB: this is the processing runSketch() method as used by processing.py
109108
run_sketch
110109
end
111-
110+
112111
def size(*args)
113112
w, h, mode = *args
114113
@width ||= w
@@ -129,8 +128,8 @@ def sketch_path(spath = nil)
129128

130129
def data_path(dat)
131130
dat_root = File.join(SKETCH_ROOT, 'data')
132-
Dir.mkdir(dat_root) unless File.exist?(dat_root)
133-
File.join(dat_root, dat)
131+
Dir.mkdir(dat_root) unless File.exist?(dat_root)
132+
File.join(dat_root, dat)
134133
end
135134

136135
def sketch_size(x, y)
@@ -181,8 +180,8 @@ def mix_proxy_into_inner_classes
181180
def import_opengl
182181
# Include processing opengl classes that we'd like to use:
183182
%w(FontTexture FrameBuffer LinePath LineStroker PGL
184-
PGraphics2D PGraphics3D PGraphicsOpenGL PShader
185-
PShapeOpenGL Texture).each do |klass|
183+
PGraphics2D PGraphics3D PGraphicsOpenGL PShader
184+
PShapeOpenGL Texture).each do |klass|
186185
java_import format('processing.opengl.%s', klass)
187186
end
188187
end

lib/jruby_art/command.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
require_relative '../jruby_art/jruby_complete'
23
require_relative '../jruby_art/java_opts'
34
module Processing

lib/jruby_art/config.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: utf-8
21
# frozen_string_literal: false
32

43
require 'yaml'
@@ -9,7 +8,7 @@ module Processing
98
config_path = '~/.jruby_art/config.yml'
109
begin
1110
CONFIG_FILE_PATH = File.expand_path(config_path)
12-
RP_CONFIG = (YAML.load_file(CONFIG_FILE_PATH))
11+
RP_CONFIG = YAML.load_file(CONFIG_FILE_PATH)
1312
rescue
1413
warn(format('WARN: you need to set PROCESSING_ROOT in %s', config_path))
1514
end

lib/jruby_art/helper_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def key_pressed?
181181

182182
private
183183

184-
FIXNUM_COL = -> (x) { x.is_a?(Fixnum) }
184+
FIXNUM_COL = -> (x) { x.is_a?(Integer) }
185185
STRING_COL = -> (x) { x.is_a?(String) }
186186
FLOAT_COL = -> (x) { x.is_a?(Float) }
187187
# parse single argument color int/double/String

lib/jruby_art/helpers/aabb.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# encoding: utf-8
2-
# frozen_string_literal: false
3-
1+
# frozen_string_literal: true
42
# Axis aligned bounding box class (AABB would clash with Toxicgem)
53
class AaBb
64
attr_reader :center, :extent

lib/jruby_art/helpers/numeric.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# encoding: utf-8
2-
# frozen_string_literal: false
1+
# frozen_string_literal: true
32
# Re-open Numeric so that we can do simple degree and radian conversions
43
# conversion factors are 180 / Math::PI and Math::PI / 180
54

lib/jruby_art/installer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def set_processing_root
2323
path = File.join(folder, 'config.yml')
2424
proot = "#{home}/processing-#{VERSION}"
2525
proot = "/Java/Processing-#{VERSION}" if os == :windows
26-
proot = "/Applications/Processing.app/Contents/Java" if os == :mac
26+
proot = '/Applications/Processing.app/Contents/Java' if os == :mac
2727
settings = %w(PROCESSING_ROOT JRUBY sketchbook_path template MAX_WATCH)
2828
values = [proot, true, sketch, 'bare', 32]
2929
data = settings.zip(values).to_h

lib/jruby_art/jruby_complete.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
class JRubyComplete
23
def self.complete
34
rcomplete = File.join('/home/tux/JRubyArt', 'lib/ruby/jruby-complete.jar')

0 commit comments

Comments
 (0)