Skip to content

Commit b2dc93a

Browse files
committed
use square brackets
1 parent a929d66 commit b2dc93a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+68
-136
lines changed

contributed/jwishy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setup
1919
c.slider :alpha, 0.0..1.0, 0.5
2020
c.checkbox :go_big
2121
c.button :reset
22-
c.menu :shape, %w(oval square triangle)
22+
c.menu :shape, %w[oval square triangle)
2323
end
2424
@shape = 'oval'
2525
@go_big = false

contributed/quadraticvertex.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup
1414
sketch_title 'Quadratic Vertex'
1515
control_panel do |c|
1616
c.title 'Controller'
17-
c.menu(:detail, %w(4 5 6 7 8 9 10), '7')
17+
c.menu(:detail, %w[4 5 6 7 8 9 10), '7')
1818
c.checkbox :debug
1919
c.button :save_image
2020
end

examples/WOVNS/geometric_grid4.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Divan Quality, Pastel 2 Palette
2-
PALETTE = %w(#D1D2EA #BFCDE5 #ABC1E5 #EEC3C3 #FFE4F3 #FFEEF8).freeze
2+
PALETTE = %w[#D1D2EA #BFCDE5 #ABC1E5 #EEC3C3 #FFE4F3 #FFEEF8].freeze
33
STEP = 133
44

55
def settings

examples/WOVNS/random_grid.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# takes quite a long time to render
2-
PALETTE = %w(#74AED7 #FFE4F3 #FEE597).freeze
3-
COULEURS = %i(ciel pinking yolk).freeze
2+
PALETTE = %w[#74AED7 #FFE4F3 #FEE597].freeze
3+
COULEURS = %i[ciel pinking yolk].freeze
44
STEP = 84
55
attr_reader :shapes, :web
66

examples/WOVNS/repeats.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# the size of the generated image (should match the WOVNS quality)
33
WIDTH = 2400
44
HEIGHT = 6372
5-
PALETTE = %w(#050505 #B83D4E #FFFFFF).freeze
6-
COULEURS = %i(petrol geranium white).freeze
5+
PALETTE = %w[#050505 #B83D4E #FFFFFF].freeze
6+
COULEURS = %i[petrol geranium white].freeze
77
STRPE = 500
88

99
# how many repeats of the generated image to show on-screen

examples/WOVNS/stripes.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Talma Quality, Spectrum 2 Palette
2-
PALETTE = %w(#D5C9D9 #B83D4E #95577E #A884A1).freeze
3-
COULEURS = %i(pink_pearl geranium orchid lilac).freeze
2+
PALETTE = %w[#D5C9D9 #B83D4E #95577E #A884A1].freeze
3+
COULEURS = %i[pink_pearl geranium orchid lilac].freeze
44
STRPE = 500
55

66
def settings

examples/WOVNS/wave.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Talma Quality, Eden 20 Quality
2-
PALETTE = %w( #C9E0F6 #BAE1D5 #C9E0F6 #BAE1D5 #C9E0F6 #BAE1D5).freeze
2+
PALETTE = %w[ #C9E0F6 #BAE1D5 #C9E0F6 #BAE1D5 #C9E0F6 #BAE1D5].freeze
33

44
def settings
55
size(3984, 3000) # 46-48" x 36", 84 DPI

external_library/gem/geomerative/typo_merge.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
require 'geomerative'
2828

2929
attr_reader :my_font, :stop, :xoff, :yoff, :x_inc, :y_inc
30-
TEXT = %w(Merge Design).freeze
30+
TEXT = %w[Merge Design].freeze
3131

3232
def settings
3333
size(900, 500)

external_library/gem/ruby_wordcram/fruits.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# Other suggested sources for usable palette are http://colorbrewer2.org/
77
# and http://paletton.com
88

9-
PALETTE = %w(#b2c248 #c40000 #a61733 #f7ca18 #32cd23 #ffc800 #f27935 #ffe5b4 #913d88 #f22613 #c72c48 #ff43a4).freeze
10-
FRUITS = %w(avocado cherry\ red cranberry lemon lime mango orange peach plum pomegranate raspberry strawberry).freeze
9+
PALETTE = %w[#b2c248 #c40000 #a61733 #f7ca18 #32cd23 #ffc800 #f27935 #ffe5b4 #913d88 #f22613 #c72c48 #ff43a4].freeze
10+
FRUITS = %w[avocado cherry\ red cranberry lemon lime mango orange peach plum pomegranate raspberry strawberry].freeze
1111

1212
def settings
1313
size 600, 480

external_library/gem/ruby_wordcram/render_to_pdf.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# After you run this,
77
# open the sketch's folder.
88
# See the PDF.
9-
WEB = %w(#000000 #0000dd #ff0000).freeze
9+
WEB = %w[#000000 #0000dd #ff0000].freeze
1010

1111
def settings
1212
size(700, 700, PDF, 'usconst.pdf')

external_library/gem/ruby_wordcram/render_to_svg.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Liberation Serif font from RedHat: https://www.redhat.com/promo/fonts/
33
require 'ruby_wordcram'
44

5-
WEB = %w(#0033ff #0055ff #0088ff #00bbff #00ffdd).freeze
5+
WEB = %w[#0033ff #0055ff #0088ff #00bbff #00ffdd].freeze
66
LETTERS = ('A'..'Z').to_a
77

88
def settings

external_library/gem/toxiclibs/geometry/boolean_shapes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
include Toxi
55

66
TYPE = [BooleanShapeBuilder::Type::UNION, BooleanShapeBuilder::Type::XOR].freeze
7-
KEY = %w(union xor).freeze
7+
KEY = %w[union xor].freeze
88

99
def setup
1010
sketch_title 'Boolean Shapes'

external_library/gem/toxiclibs/noise/simplex_noise_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
attr_reader :noise_dimension, :noise_offset
55

66
NS = 0.06 # (try from 0.005 to 0.5)
7-
KEYS = %w(1 2 3 4).freeze
7+
KEYS = %w[1 2 3 4].freeze
88
def settings
99
size 300, 300, P2D
1010
end

external_library/gem/toxiclibs/simulation/gray_scott_image.rb

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
require 'toxiclibs'
22

33
# <p>GrayScottImage uses the seedImage() method to use a bitmap as simulation seed.
4-
# In this demo the image is re-applied every frame and the user can adjust the
4+
# In this demo the image is re-applied every frame and the user can adjust the
55
# F coefficient of the reaction diffusion to produce different patterns emerging
66
# from the boundary of the bitmapped seed. Unlike some other GS demos provided,
77
# this one also uses a wrapped simulation space, creating tiled patterns.</p>
88
#
99
# <p><strong>usage:</strong></p>
1010
# <ul>
1111
# <li>click + drag mouse to locally disturb the simulation</li>
12-
# <li>press 1-9 to adjust the F parameter of the simulation</li>
12+
# <li>press 1-9 to adjust the F parameter of the simulation</li>
1313
# <li>press any other key to reset</li>
1414
# </ul>
1515
#
1616

17-
#
17+
#
1818
# Copyright (c) 2010 Karsten Schmidt
19-
#
19+
#
2020
# This demo & library is free software you can redistribute it and/or
2121
# modify it under the terms of the GNU Lesser General Public
2222
# License as published by the Free Software Foundation either
2323
# version 2.1 of the License, or (at your option) any later version.
24-
#
24+
#
2525
# http:#creativecommons.org/licenses/LGPL/2.1/
26-
#
26+
#
2727
# This library is distributed in the hope that it will be useful,
2828
# but WITHOUT ANY WARRANTY without even the implied warranty of
2929
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3030
# Lesser General Public License for more details.
31-
#
31+
#
3232
# You should have received a copy of the GNU Lesser General Public
3333
# License along with this library if not, write to the Free Software
3434
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -47,7 +47,7 @@ def setup
4747

4848
def draw
4949
@gs.seed_image(img.pixels, img.width, img.height)
50-
@gs.set_rect(mouse_x, mouse_y, 20, 20) if mouse_pressed?
50+
@gs.set_rect(mouse_x, mouse_y, 20, 20) if mouse_pressed?
5151
load_pixels
5252
10.times { @gs.update(1) }
5353
# read out the V result array
@@ -59,7 +59,7 @@ def draw
5959
end
6060

6161
def key_pressed
62-
control_key = %w(1 2 3 4 5 6 7 8 9)
62+
control_key = %w[1 2 3 4 5 6 7 8 9].freeze
6363
case key
6464
when *control_key
6565
@gs.setF(0.02 + (key.ord - 48) * 0.001)
@@ -74,4 +74,3 @@ def key_pressed
7474
def settings
7575
size(256, 256, P2D)
7676
end
77-

external_library/java/gicentreUtils/chart.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def setup
3030
7_657, 9_649, 9_767, 12_167, 15_154, 18_200, 23_124, 28_645, 39_471
3131
].to_java(:float)
3232
bar_chart.bar_labels =
33-
%w(
33+
%w[
3434
1830 1840 1850 1860 1870 1880 1890 1900 1910 1920
3535
1930 1940 1950 1960 1970 1980 1990 2000 2010
36-
)
36+
]
3737
bar_chart.bar_colour = color(200, 80, 80, 100)
3838
bar_chart.bar_gap = 2
3939
bar_chart.value_format = '$###,###'

external_library/java/hype/color_pool.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Hype
77
java_import 'hype.extended.layout.HGridLayout'
88
end
99

10-
PALETTE = %w(#FFFFFF #F7F7F7 #ECECEC #0095A8 #00616F #333333 #FF3300 #FF6600).freeze
10+
PALETTE = %w[#FFFFFF #F7F7F7 #ECECEC #0095A8 #00616F #333333 #FF3300 #FF6600].freeze
1111

1212
def settings
1313
size(600, 600)

external_library/java/hype/color_pool_wovns.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Hype
77
java_import 'hype.extended.layout.HGridLayout'
88
end
99

10-
PALETTE = %w(#B83D4E #B56A8C #4688B5 #A53643 #5869A0 #487A9C #95577E #302D32 #0C0000 #020100 #070707)
10+
PALETTE = %w[#B83D4E #B56A8C #4688B5 #A53643 #5869A0 #487A9C #95577E #302D32 #0C0000 #020100 #070707].freeze
1111

1212
def settings
1313
size(2400, 6372)

external_library/java/hype/color_presets.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include_package 'hype'
33
java_import 'hype.extended.layout.HGridLayout'
44
# string color array
5-
PALETTE = %w(
5+
PALETTE = %w[
66
CLEAR
77
WHITE
88
BLACK
@@ -15,7 +15,7 @@
1515
CYAN
1616
YELLOW
1717
MAGENTA
18-
).freeze
18+
].freeze
1919
# format string see fill below
2020
FSTRING = 'H::%s'.freeze
2121

external_library/java/hype/h_orbiter.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Hype
88
end
99

1010
attr_reader :colors, :pool
11-
PALETTE = %w(#333333 #494949 #5F5F5F #707070 #7D7D7D #888888 #949494 #A2A2A2 #B1B1B1 #C3C3C3 #D6D6D6 #EBEBEB #FFFFFF).freeze
11+
PALETTE = %w[#333333 #494949 #5F5F5F #707070 #7D7D7D #888888 #949494 #A2A2A2 #B1B1B1 #C3C3C3 #D6D6D6 #EBEBEB #FFFFFF].freeze
1212

1313
def settings
1414
size(640, 640, P3D)

external_library/java/hype/h_rotate.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
include_package 'hype'
44
java_import 'hype.extended.behavior.HRotate'
55
attr_reader :box_x, :box_y, :box_z, :colors
6-
PALETTE = %w(#242424 #FF3300 #00CC00).freeze
6+
PALETTE = %w[#242424 #FF3300 #00CC00].freeze
77

88
def settings
99
size(640, 640, P3D)

external_library/java/hype/h_sprite.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
hype_extended_format = 'hype.extended.%s'
88
EXTENDED.each { |klass| java_import format(hype_extended_format, klass) }
99

10-
PALETTE = %w(#FFFFFF #F7F7F7 #ECECEC #CCCCCC #999999 #666666 #4D4D4D #333333 #FF3300 #FF6600).freeze
10+
PALETTE = %w[#FFFFFF #F7F7F7 #ECECEC #CCCCCC #999999 #666666 #4D4D4D #333333 #FF3300 #FF6600].freeze
1111
attr_reader :pool,
1212

1313
def settings

external_library/java/hype/hype_swarm.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ module Hype
1010
java_import 'hype.interfaces.HLocatable'
1111
end
1212

13-
PALETTE = %w(#FFFFFF #F7F7F7 #ECECEC #333333 #0095a8 #00616f #FF3300 #FF6600).freeze
14-
PALETTE2 = %w(#242424 #111111 #ECECEC).freeze
13+
PALETTE = %w[#FFFFFF #F7F7F7 #ECECEC #333333 #0095a8 #00616f #FF3300 #FF6600].freeze
14+
PALETTE2 = %w[#242424 #111111 #ECECEC].freeze
1515
include Hype
1616

1717
attr_reader :swarm, :canvas, :colors, :pool, :tween, :count

external_library/java/hype/polar_layout.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
java_import 'hype.extended.behavior.HOscillator'
66
java_import 'hype.extended.colorist.HColorPool'
77

8-
PALETTE = %w(#FFFFFF #F7F7F7 #ECECEC #CCCCCC #999999 #666666 #4D4D4D #333333 #242424 #202020 #111111 #080808 #000000).freeze
8+
PALETTE = %w[#FFFFFF #F7F7F7 #ECECEC #CCCCCC #999999 #666666 #4D4D4D #333333 #242424 #202020 #111111 #080808 #000000].freeze
99
attr_reader :pool, :colors, :box_depth
1010

1111
def settings

external_library/java/hype/proximity.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
java_import 'hype.extended.behavior.HProximity'
55
java_import 'hype.extended.behavior.HOscillator'
66

7-
PALETTE = %w(#242424 #00FF00 #FF3300 #4D4D4D).freeze
8-
KEY = %i(background fill_one fill_two stroke).freeze
7+
PALETTE = %w[#242424 #00FF00 #FF3300 #4D4D4D].freeze
8+
KEY = %i[background fill_one fill_two stroke].freeze
99

1010
attr_reader :colors
1111

external_library/java/hype/random_trigger.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
include_package 'hype'
44
java_import 'hype.extended.behavior.HRandomTrigger'
55

6-
PALETTE = %w(#242424 #999999 #202020).freeze
7-
KEY = %i(background stroke fill).freeze
6+
PALETTE = %w[#242424 #999999 #202020].freeze
7+
KEY = %i[background stroke fill].freeze
88

99
def settings
1010
size(640,640)

external_library/java/hype/rotate_gear.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
include_package 'hype'
44
java_import 'hype.extended.behavior.HRotate'
55
attr_reader :box_x, :box_y, :box_z, :colors
6-
PALETTE = %w(#242424 #FF3300 #FF6600).freeze
6+
PALETTE = %w[#242424 #FF3300 #FF6600].freeze
77

88
def settings
99
size(640, 640)

external_library/java/hype/tween_example.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Hype
99
java_import 'hype.extended.colorist.HColorPool'
1010
end
1111

12-
PALETTE = %w(#FFFFFF #F7F7F7 #ECECEC #333333 #0095a8 #00616f #FF3300 #FF6600).freeze
12+
PALETTE = %w[#FFFFFF #F7F7F7 #ECECEC #333333 #0095a8 #00616f #FF3300 #FF6600].freeze
1313

1414
def settings
1515
size(640, 640)

external_library/java/hype/tween_lambda_example.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Hype
1010
end
1111

1212
attr_reader :canvas
13-
PALETTE = %w(#FFFFFF #F7F7F7 #ECECEC #333333 #0095a8 #00616f #FF3300 #FF6600).freeze
13+
PALETTE = %w[#FFFFFF #F7F7F7 #ECECEC #333333 #0095a8 #00616f #FF3300 #FF6600].freeze
1414

1515
def settings
1616
size(640, 640)

processing_app/basics/color/creating2.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# in the program by their name, rather than a number.
55
# An alternative using palette
66
attr_reader :palette
7-
WEB = %w(#CC6600 #CC9900 #993300).freeze
7+
WEB = %w[#CC6600 #CC9900 #993300].freeze
88
REDDER = 0
99
YELLOWER = 1
1010
ORANGISH = 2

processing_app/basics/form/rgb_cube.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def draw
4949
rotate_y(-@xmag)
5050
scale 90
5151
begin_shape QUADS
52-
%i(top front left back right bottom).each do |s|
52+
%i[top front left back right bottom].each do |s|
5353
@box[s].each do |p|
5454
fill_from_points p
5555
vertex_from_points p

processing_app/basics/objects/shapes/circle.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# Example 22-2: Polymorphism
77

88
# Circle class inherits Processing:Proxy module methods from Shape
9-
# Inherits all instance variables from parent + adding one using the
9+
# Inherits all instance variables from parent + adding one using the
1010
# post_initialize hook method. Use of change_color makes initialization of @c
1111
# irrelevant, but without example is spoiled.
1212
require_relative 'shape'
1313

1414
class Circle < Shape
15-
COLORS = %w(#ff0000 #ffff00 #3333ff #33cc33)
15+
COLORS = %w[#ff0000 #ffff00 #3333ff #33cc33].freeze
1616
attr_reader :c, :x, :y, :r
1717

1818
def post_initialize(args)
@@ -34,7 +34,7 @@ def display
3434
stroke(0)
3535
ellipse(x, y, r, r)
3636
end
37-
37+
3838
def run
3939
jiggle
4040
display

0 commit comments

Comments
 (0)