squib 0.14.3.pre1 → 0.16.0.pre.preview1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +22 -0
- data/CHANGELOG.md +58 -2
- data/Dockerfile +27 -0
- data/Guardfile +8 -0
- data/README.md +24 -6
- data/RELEASE TODO.md +1 -0
- data/Rakefile +3 -0
- data/lib/squib.rb +3 -1
- data/lib/squib/args/arg_loader.rb +109 -106
- data/lib/squib/args/box.rb +52 -48
- data/lib/squib/args/card_range.rb +26 -24
- data/lib/squib/args/color_validator.rb +4 -9
- data/lib/squib/args/coords.rb +39 -25
- data/lib/squib/args/csv_opts.rb +13 -16
- data/lib/squib/args/dir_validator.rb +7 -12
- data/lib/squib/args/draw.rb +69 -68
- data/lib/squib/args/embed_adjust.rb +12 -15
- data/lib/squib/args/embed_key.rb +6 -11
- data/lib/squib/args/hand_special.rb +25 -25
- data/lib/squib/args/import.rb +54 -27
- data/lib/squib/args/input_file.rb +22 -26
- data/lib/squib/args/paint.rb +30 -31
- data/lib/squib/args/paragraph.rb +95 -93
- data/lib/squib/args/save_batch.rb +50 -48
- data/lib/squib/args/scale_box.rb +43 -39
- data/lib/squib/args/sheet.rb +147 -149
- data/lib/squib/args/showcase_special.rb +32 -29
- data/lib/squib/args/sprue_file.rb +30 -30
- data/lib/squib/args/svg_special.rb +26 -26
- data/lib/squib/args/transform.rb +48 -54
- data/lib/squib/args/typographer.rb +88 -92
- data/lib/squib/args/unit_conversion.rb +6 -8
- data/lib/squib/args/xywh_shorthands.rb +56 -0
- data/lib/squib/builtin/projects/advanced/config.yml +3 -6
- data/lib/squib/builtin/projects/basic/config.yml +3 -6
- data/lib/squib/commands/make_sprue.rb +2 -0
- data/lib/squib/conf.rb +5 -5
- data/lib/squib/deck.rb +34 -12
- data/lib/squib/dsl/background.rb +35 -0
- data/lib/squib/dsl/circle.rb +39 -0
- data/lib/squib/dsl/csv.rb +42 -0
- data/lib/squib/dsl/curve.rb +35 -0
- data/lib/squib/dsl/cut_zone.rb +47 -0
- data/lib/squib/dsl/ellipse.rb +37 -0
- data/lib/squib/dsl/grid.rb +35 -0
- data/lib/squib/{api → dsl}/groups.rb +0 -0
- data/lib/squib/dsl/hand.rb +42 -0
- data/lib/squib/dsl/line.rb +35 -0
- data/lib/squib/dsl/png.rb +56 -0
- data/lib/squib/dsl/polygon.rb +36 -0
- data/lib/squib/dsl/rect.rb +37 -0
- data/lib/squib/dsl/safe_zone.rb +48 -0
- data/lib/squib/dsl/save.rb +21 -0
- data/lib/squib/dsl/save_pdf.rb +50 -0
- data/lib/squib/dsl/save_png.rb +47 -0
- data/lib/squib/dsl/save_sheet.rb +53 -0
- data/lib/squib/dsl/showcase.rb +43 -0
- data/lib/squib/dsl/star.rb +37 -0
- data/lib/squib/dsl/svg.rb +62 -0
- data/lib/squib/dsl/text.rb +54 -0
- data/lib/squib/dsl/text_embed.rb +78 -0
- data/lib/squib/dsl/triangle.rb +35 -0
- data/lib/squib/{api → dsl}/units.rb +10 -0
- data/lib/squib/dsl/xlsx.rb +40 -0
- data/lib/squib/dsl/yaml.rb +40 -0
- data/lib/squib/errors_warnings/warn_unexpected_params.rb +14 -0
- data/lib/squib/graphics/cairo_context_wrapper.rb +2 -2
- data/lib/squib/graphics/image.rb +0 -6
- data/lib/squib/graphics/save_images.rb +3 -3
- data/lib/squib/graphics/save_sprue.rb +39 -12
- data/lib/squib/graphics/showcase.rb +1 -1
- data/lib/squib/graphics/text.rb +37 -9
- data/lib/squib/import/csv_importer.rb +45 -0
- data/lib/squib/import/quantity_exploder.rb +18 -0
- data/lib/squib/import/xlsx_importer.rb +28 -0
- data/lib/squib/import/yaml_importer.rb +30 -0
- data/lib/squib/layout_parser.rb +24 -7
- data/lib/squib/sprues/crop_line.rb +6 -6
- data/lib/squib/sprues/crop_line_dash.rb +6 -6
- data/lib/squib/sprues/sprue.rb +19 -14
- data/lib/squib/sprues/sprue_schema.rb +4 -2
- data/lib/squib/version.rb +1 -1
- data/samples/autoscale_font/_autoscale_font.rb +77 -8
- data/samples/colors/_colors.rb +11 -5
- data/samples/colors/_switch_color.rb +33 -0
- data/samples/data/_excel.rb +1 -1
- data/samples/images/_more_load_images.rb +1 -1
- data/samples/ranges/_ranges.rb +1 -1
- data/samples/saves/_save_filenames.rb +28 -0
- data/samples/saves/_save_pdf.rb +1 -1
- data/samples/saves/_saves.rb +2 -1
- data/samples/shapes/_draw_shapes.rb +2 -2
- data/samples/sprues/_advanced_sprues.rb +4 -3
- data/samples/sprues/_builtin_sprues.rb +1 -0
- data/samples/sprues/_fold_sheet.rb +4 -1
- data/samples/text/_text.rb +6 -1
- data/samples/text/_text_options.rb +2 -1
- data/samples/units/_cells.rb +51 -0
- data/samples/units/_shorthands.rb +49 -0
- data/samples/units/_units.rb +7 -0
- data/squib.gemspec +19 -13
- metadata +151 -61
- data/.travis.yml +0 -19
- data/appveyor.yml +0 -24
- data/lib/squib/api/background.rb +0 -15
- data/lib/squib/api/data.rb +0 -137
- data/lib/squib/api/image.rb +0 -49
- data/lib/squib/api/save.rb +0 -83
- data/lib/squib/api/shapes.rb +0 -124
- data/lib/squib/api/text.rb +0 -25
- data/lib/squib/api/text_embed.rb +0 -71
- data/samples/bug256/_bug256.rb +0 -13
data/lib/squib/args/box.rb
CHANGED
@@ -1,55 +1,59 @@
|
|
1
1
|
require_relative 'arg_loader'
|
2
|
+
require_relative 'xywh_shorthands'
|
2
3
|
|
3
|
-
module Squib
|
4
|
-
# @api private
|
5
|
-
module Args
|
6
|
-
|
7
|
-
class Box
|
8
|
-
include ArgLoader
|
9
|
-
|
10
|
-
def initialize(deck = nil, dsl_method_defaults = {})
|
11
|
-
@deck = deck
|
12
|
-
@dsl_method_defaults = dsl_method_defaults
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.parameters
|
16
|
-
{ x: 0, y: 0,
|
17
|
-
width: :deck, height: :deck,
|
18
|
-
radius: nil, x_radius: 0, y_radius: 0
|
19
|
-
}
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.expanding_parameters
|
23
|
-
parameters.keys # all of them
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.params_with_units
|
27
|
-
parameters.keys # all of them
|
28
|
-
end
|
29
|
-
|
30
|
-
def validate_width(arg, _i)
|
31
|
-
return arg if @deck.nil?
|
32
|
-
return @deck.width if arg == :deck
|
33
|
-
arg
|
34
|
-
end
|
35
|
-
|
36
|
-
def validate_height(arg, _i)
|
37
|
-
return arg if @deck.nil?
|
38
|
-
return @deck.height if arg == :deck
|
39
|
-
arg
|
40
|
-
end
|
41
|
-
|
42
|
-
def validate_x_radius(arg, i)
|
43
|
-
return radius[i] unless radius[i].nil?
|
44
|
-
arg
|
45
|
-
end
|
46
|
-
|
47
|
-
def validate_y_radius(arg, i)
|
48
|
-
return radius[i] unless radius[i].nil?
|
49
|
-
arg
|
50
|
-
end
|
4
|
+
module Squib::Args
|
51
5
|
|
6
|
+
module_function def extract_box(opts, deck, dsl_method_defaults = {})
|
7
|
+
Box.new(deck, dsl_method_defaults).extract!(opts, deck)
|
8
|
+
end
|
9
|
+
|
10
|
+
class Box
|
11
|
+
include ArgLoader
|
12
|
+
include XYWHShorthands
|
13
|
+
|
14
|
+
def initialize(deck = nil, dsl_method_defaults = {})
|
15
|
+
@deck = deck
|
16
|
+
@dsl_method_defaults = dsl_method_defaults
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.parameters
|
20
|
+
{ x: 0, y: 0,
|
21
|
+
width: :deck, height: :deck,
|
22
|
+
radius: nil, x_radius: 0, y_radius: 0
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.expanding_parameters
|
27
|
+
parameters.keys # all of them
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.params_with_units
|
31
|
+
parameters.keys # all of them
|
52
32
|
end
|
53
33
|
|
34
|
+
def validate_x(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
35
|
+
def validate_y(arg,_i) apply_shorthands(arg, @deck, axis: :y) end
|
36
|
+
|
37
|
+
def validate_width(arg, _i)
|
38
|
+
return arg if @deck.nil?
|
39
|
+
apply_shorthands(arg, @deck, axis: :x)
|
40
|
+
end
|
41
|
+
|
42
|
+
def validate_height(arg, _i)
|
43
|
+
return arg if @deck.nil?
|
44
|
+
apply_shorthands(arg, @deck, axis: :y)
|
45
|
+
end
|
46
|
+
|
47
|
+
def validate_x_radius(arg, i)
|
48
|
+
return radius[i] unless radius[i].nil?
|
49
|
+
arg
|
50
|
+
end
|
51
|
+
|
52
|
+
def validate_y_radius(arg, i)
|
53
|
+
return radius[i] unless radius[i].nil?
|
54
|
+
arg
|
55
|
+
end
|
56
|
+
|
54
57
|
end
|
58
|
+
|
55
59
|
end
|
@@ -1,32 +1,34 @@
|
|
1
|
-
module Squib
|
2
|
-
# @api private
|
3
|
-
module Args
|
4
|
-
class CardRange
|
5
|
-
include Enumerable
|
1
|
+
module Squib::Args
|
6
2
|
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
module_function def extract_range(opts, deck)
|
4
|
+
CardRange.new(opts[:range], deck_size: deck.size)
|
5
|
+
end
|
6
|
+
|
7
|
+
class CardRange
|
8
|
+
include Enumerable
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
10
|
+
def initialize(input, deck_size: 1)
|
11
|
+
@range = validate(input, deck_size)
|
12
|
+
end
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
# Hook into enumerable by delegating to @range
|
15
|
+
def each(&block)
|
16
|
+
@range.each { |i| block.call(i) }
|
17
|
+
end
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
input = 0..(deck_size - 1) if input == :all
|
24
|
-
input = (input.to_i)..(input.to_i) if input.respond_to? :to_i
|
25
|
-
raise ArgumentError.new("#{input} must be Enumerable (i.e. respond_to :each).") unless input.respond_to? :each
|
26
|
-
raise ArgumentError.new("#{input} is outside of deck range of 0..#{deck_size - 1}") if (!input.max.nil?) && (input.max > (deck_size - 1))
|
27
|
-
input
|
28
|
-
end
|
19
|
+
def size
|
20
|
+
@range.size
|
21
|
+
end
|
29
22
|
|
23
|
+
private
|
24
|
+
def validate(input, deck_size)
|
25
|
+
input ||= :all # default
|
26
|
+
input = 0..(deck_size - 1) if input == :all
|
27
|
+
input = (input.to_i)..(input.to_i) if input.respond_to? :to_i
|
28
|
+
raise ArgumentError.new("#{input} must be Enumerable (i.e. respond_to :each).") unless input.respond_to? :each
|
29
|
+
raise ArgumentError.new("#{input} is outside of deck range of 0..#{deck_size - 1}") if (!input.max.nil?) && (input.max > (deck_size - 1))
|
30
|
+
input
|
30
31
|
end
|
32
|
+
|
31
33
|
end
|
32
34
|
end
|
@@ -1,12 +1,7 @@
|
|
1
|
-
module Squib
|
2
|
-
# @api private
|
3
|
-
module Args
|
4
|
-
module ColorValidator
|
1
|
+
module Squib::Args::ColorValidator
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
end
|
3
|
+
def colorify(color, custom_colors = {})
|
4
|
+
custom_colors[color.to_s] || color.to_s
|
11
5
|
end
|
6
|
+
|
12
7
|
end
|
data/lib/squib/args/coords.rb
CHANGED
@@ -1,35 +1,49 @@
|
|
1
1
|
require_relative 'arg_loader'
|
2
|
+
require_relative 'xywh_shorthands'
|
2
3
|
|
3
|
-
module Squib
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
class Coords
|
8
|
-
include ArgLoader
|
4
|
+
module Squib::Args
|
5
|
+
module_function def extract_coords(opts, deck)
|
6
|
+
Coords.new.extract!(opts, deck)
|
7
|
+
end
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
x2: 150, y2: 150,
|
14
|
-
x3: 100, y3: 150,
|
15
|
-
cx1: 0 , cy1: 0,
|
16
|
-
cx2: 0 , cy2: 0,
|
17
|
-
inner_radius: 50, outer_radius: 100,
|
18
|
-
radius: 100,
|
19
|
-
n: 5,
|
20
|
-
arc_start: 0, arc_end: 2 * Math::PI, arc_direction: :clockwise, arc_close: false,
|
21
|
-
}
|
22
|
-
end
|
9
|
+
class Coords
|
10
|
+
include ArgLoader
|
11
|
+
include XYWHShorthands
|
23
12
|
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
def self.parameters
|
14
|
+
{ x: 0, y: 0,
|
15
|
+
x1: 100, y1: 100,
|
16
|
+
x2: 150, y2: 150,
|
17
|
+
x3: 100, y3: 150,
|
18
|
+
cx1: 0 , cy1: 0,
|
19
|
+
cx2: 0 , cy2: 0,
|
20
|
+
inner_radius: 50, outer_radius: 100,
|
21
|
+
radius: 100,
|
22
|
+
n: 5,
|
23
|
+
arc_start: 0, arc_end: 2 * Math::PI, arc_direction: :clockwise, arc_close: false,
|
24
|
+
}
|
25
|
+
end
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
def self.expanding_parameters
|
28
|
+
parameters.keys # all of them
|
29
|
+
end
|
31
30
|
|
31
|
+
def self.params_with_units
|
32
|
+
parameters.keys # all of them
|
32
33
|
end
|
33
34
|
|
35
|
+
def validate_x(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
36
|
+
def validate_y(arg,_i) apply_shorthands(arg, @deck, axis: :y) end
|
37
|
+
def validate_x1(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
38
|
+
def validate_y1(arg,_i) apply_shorthands(arg, @deck, axis: :y) end
|
39
|
+
def validate_x2(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
40
|
+
def validate_y2(arg,_i) apply_shorthands(arg, @deck, axis: :y)end
|
41
|
+
def validate_x3(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
42
|
+
def validate_y3(arg,_i) apply_shorthands(arg, @deck, axis: :y) end
|
43
|
+
def validate_cx1(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
44
|
+
def validate_cy1(arg,_i) apply_shorthands(arg, @deck, axis: :y) end
|
45
|
+
def validate_cx2(arg, i) apply_shorthands(arg, @deck, axis: :x) end
|
46
|
+
def validate_cy2(arg,_i) apply_shorthands(arg, @deck, axis: :y) end
|
34
47
|
end
|
48
|
+
|
35
49
|
end
|
data/lib/squib/args/csv_opts.rb
CHANGED
@@ -1,25 +1,22 @@
|
|
1
1
|
require 'csv'
|
2
2
|
|
3
|
-
module Squib
|
4
|
-
|
5
|
-
module Args
|
6
|
-
class CSV_Opts
|
3
|
+
module Squib::Args
|
4
|
+
class CSV_Opts
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
def to_hash
|
14
|
-
@hash
|
15
|
-
end
|
6
|
+
def initialize(opts)
|
7
|
+
opts = opts.keep_if { |k, _v| CSV::DEFAULT_OPTIONS.key? k}
|
8
|
+
@hash = CSV::DEFAULT_OPTIONS.merge(opts).merge(required)
|
9
|
+
end
|
16
10
|
|
17
|
-
|
11
|
+
def to_hash
|
12
|
+
@hash
|
13
|
+
end
|
18
14
|
|
19
|
-
|
20
|
-
{ headers: true, converters: :numeric }
|
21
|
-
end
|
15
|
+
private
|
22
16
|
|
17
|
+
def required
|
18
|
+
{ headers: true, converters: :numeric }
|
23
19
|
end
|
20
|
+
|
24
21
|
end
|
25
22
|
end
|
@@ -1,16 +1,11 @@
|
|
1
|
-
module Squib
|
2
|
-
# @api private
|
3
|
-
module Args
|
4
|
-
module DirValidator
|
5
|
-
|
6
|
-
def ensure_dir_created(dir)
|
7
|
-
unless Dir.exists?(dir)
|
8
|
-
Squib.logger.warn "Dir '#{dir}' does not exist, creating it."
|
9
|
-
FileUtils.mkdir_p dir
|
10
|
-
end
|
11
|
-
return dir
|
12
|
-
end
|
1
|
+
module Squib::Args::DirValidator
|
13
2
|
|
3
|
+
def ensure_dir_created(dir)
|
4
|
+
unless Dir.exists?(dir)
|
5
|
+
Squib.logger.warn "Dir '#{dir}' does not exist, creating it."
|
6
|
+
FileUtils.mkdir_p dir
|
14
7
|
end
|
8
|
+
return dir
|
15
9
|
end
|
10
|
+
|
16
11
|
end
|
data/lib/squib/args/draw.rb
CHANGED
@@ -2,91 +2,92 @@ require 'cairo'
|
|
2
2
|
require_relative 'arg_loader'
|
3
3
|
require_relative 'color_validator'
|
4
4
|
|
5
|
-
module Squib
|
6
|
-
# @api private
|
7
|
-
module Args
|
5
|
+
module Squib::Args
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
module_function def extract_draw(opts, deck, dsl_method_defaults = {})
|
8
|
+
Draw.new(deck.custom_colors, dsl_method_defaults).extract!(opts, deck)
|
9
|
+
end
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
11
|
+
class Draw
|
12
|
+
include ArgLoader
|
13
|
+
include ColorValidator
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
stroke_width: 2.0,
|
23
|
-
stroke_strategy: :fill_first,
|
24
|
-
join: :miter,
|
25
|
-
cap: 'butt',
|
26
|
-
dash: ''
|
27
|
-
}
|
28
|
-
end
|
15
|
+
def initialize(custom_colors, dsl_method_defaults = {})
|
16
|
+
@custom_colors = custom_colors
|
17
|
+
@dsl_method_defaults = dsl_method_defaults
|
18
|
+
end
|
29
19
|
|
30
|
-
|
31
|
-
|
32
|
-
|
20
|
+
def self.parameters
|
21
|
+
{ color: :black,
|
22
|
+
fill_color: '#0000',
|
23
|
+
stroke_color: :black,
|
24
|
+
stroke_width: 2.0,
|
25
|
+
stroke_strategy: :fill_first,
|
26
|
+
join: :miter,
|
27
|
+
cap: 'butt',
|
28
|
+
dash: ''
|
29
|
+
}
|
30
|
+
end
|
33
31
|
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
def self.expanding_parameters
|
33
|
+
parameters.keys # all of them are expandable
|
34
|
+
end
|
37
35
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
Cairo::LINE_JOIN_MITER
|
42
|
-
when 'round'
|
43
|
-
Cairo::LINE_JOIN_ROUND
|
44
|
-
when 'bevel'
|
45
|
-
Cairo::LINE_JOIN_BEVEL
|
46
|
-
end
|
47
|
-
end
|
36
|
+
def self.params_with_units
|
37
|
+
[:stroke_width]
|
38
|
+
end
|
48
39
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
40
|
+
def validate_join(arg, _i)
|
41
|
+
case arg.to_s.strip.downcase
|
42
|
+
when 'miter'
|
43
|
+
Cairo::LINE_JOIN_MITER
|
44
|
+
when 'round'
|
45
|
+
Cairo::LINE_JOIN_ROUND
|
46
|
+
when 'bevel'
|
47
|
+
Cairo::LINE_JOIN_BEVEL
|
58
48
|
end
|
49
|
+
end
|
59
50
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
51
|
+
def validate_cap(arg, _i)
|
52
|
+
case arg.to_s.strip.downcase
|
53
|
+
when 'butt'
|
54
|
+
Cairo::LINE_CAP_BUTT
|
55
|
+
when 'round'
|
56
|
+
Cairo::LINE_CAP_ROUND
|
57
|
+
when 'square'
|
58
|
+
Cairo::LINE_CAP_SQUARE
|
64
59
|
end
|
60
|
+
end
|
65
61
|
|
66
|
-
|
67
|
-
|
62
|
+
def validate_dash(arg, _i)
|
63
|
+
arg.to_s.split.collect do |x|
|
64
|
+
UnitConversion.parse(x, @dpi, @cell_px).to_f
|
68
65
|
end
|
66
|
+
end
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
def validate_fill_color(arg, _i)
|
69
|
+
colorify(arg, @custom_colors)
|
70
|
+
end
|
73
71
|
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
def validate_stroke_color(arg, _i)
|
73
|
+
colorify(arg, @custom_colors)
|
74
|
+
end
|
77
75
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
:fill_first
|
82
|
-
when 'stroke_first'
|
83
|
-
:stroke_first
|
84
|
-
else
|
85
|
-
raise "Only 'stroke_first' or 'fill_first' allowed"
|
86
|
-
end
|
87
|
-
end
|
76
|
+
def validate_color(arg, _i)
|
77
|
+
colorify(arg, @custom_colors)
|
78
|
+
end
|
88
79
|
|
80
|
+
def validate_stroke_strategy(arg, _i)
|
81
|
+
case arg.to_s.downcase.strip
|
82
|
+
when 'fill_first'
|
83
|
+
:fill_first
|
84
|
+
when 'stroke_first'
|
85
|
+
:stroke_first
|
86
|
+
else
|
87
|
+
raise "Only 'stroke_first' or 'fill_first' allowed"
|
88
|
+
end
|
89
89
|
end
|
90
90
|
|
91
91
|
end
|
92
|
+
|
92
93
|
end
|