squib 0.15.0 → 0.16.0.pre.preview2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +22 -0
  3. data/CHANGELOG.md +41 -1
  4. data/Dockerfile +18 -16
  5. data/Guardfile +8 -0
  6. data/README.md +24 -6
  7. data/RELEASE TODO.md +1 -0
  8. data/Rakefile +3 -0
  9. data/lib/squib.rb +3 -1
  10. data/lib/squib/args/arg_loader.rb +109 -106
  11. data/lib/squib/args/box.rb +52 -48
  12. data/lib/squib/args/card_range.rb +26 -24
  13. data/lib/squib/args/color_validator.rb +4 -9
  14. data/lib/squib/args/coords.rb +39 -25
  15. data/lib/squib/args/csv_opts.rb +13 -16
  16. data/lib/squib/args/dir_validator.rb +7 -12
  17. data/lib/squib/args/draw.rb +69 -68
  18. data/lib/squib/args/embed_adjust.rb +12 -15
  19. data/lib/squib/args/embed_key.rb +6 -11
  20. data/lib/squib/args/hand_special.rb +25 -25
  21. data/lib/squib/args/import.rb +54 -27
  22. data/lib/squib/args/input_file.rb +22 -26
  23. data/lib/squib/args/paint.rb +30 -31
  24. data/lib/squib/args/paragraph.rb +95 -93
  25. data/lib/squib/args/save_batch.rb +50 -48
  26. data/lib/squib/args/scale_box.rb +43 -39
  27. data/lib/squib/args/sheet.rb +147 -149
  28. data/lib/squib/args/showcase_special.rb +32 -32
  29. data/lib/squib/args/sprue_file.rb +30 -30
  30. data/lib/squib/args/svg_special.rb +26 -26
  31. data/lib/squib/args/transform.rb +48 -54
  32. data/lib/squib/args/typographer.rb +88 -92
  33. data/lib/squib/args/unit_conversion.rb +6 -8
  34. data/lib/squib/args/xywh_shorthands.rb +51 -0
  35. data/lib/squib/builtin/projects/advanced/config.yml +4 -3
  36. data/lib/squib/builtin/projects/basic/config.yml +4 -3
  37. data/lib/squib/conf.rb +5 -0
  38. data/lib/squib/deck.rb +34 -12
  39. data/lib/squib/dsl/background.rb +35 -0
  40. data/lib/squib/dsl/circle.rb +39 -0
  41. data/lib/squib/dsl/csv.rb +42 -0
  42. data/lib/squib/dsl/curve.rb +35 -0
  43. data/lib/squib/dsl/cut_zone.rb +47 -0
  44. data/lib/squib/dsl/ellipse.rb +37 -0
  45. data/lib/squib/dsl/grid.rb +35 -0
  46. data/lib/squib/{api → dsl}/groups.rb +0 -0
  47. data/lib/squib/dsl/hand.rb +42 -0
  48. data/lib/squib/dsl/line.rb +35 -0
  49. data/lib/squib/dsl/png.rb +56 -0
  50. data/lib/squib/dsl/polygon.rb +36 -0
  51. data/lib/squib/dsl/rect.rb +37 -0
  52. data/lib/squib/dsl/safe_zone.rb +48 -0
  53. data/lib/squib/dsl/save.rb +21 -0
  54. data/lib/squib/dsl/save_pdf.rb +50 -0
  55. data/lib/squib/dsl/save_png.rb +44 -0
  56. data/lib/squib/dsl/save_sheet.rb +53 -0
  57. data/lib/squib/dsl/showcase.rb +43 -0
  58. data/lib/squib/dsl/star.rb +37 -0
  59. data/lib/squib/dsl/svg.rb +62 -0
  60. data/lib/squib/dsl/text.rb +54 -0
  61. data/lib/squib/dsl/text_embed.rb +78 -0
  62. data/lib/squib/dsl/triangle.rb +35 -0
  63. data/lib/squib/{api → dsl}/units.rb +10 -0
  64. data/lib/squib/dsl/xlsx.rb +40 -0
  65. data/lib/squib/dsl/yaml.rb +40 -0
  66. data/lib/squib/errors_warnings/warn_unexpected_params.rb +14 -0
  67. data/lib/squib/graphics/save_images.rb +3 -3
  68. data/lib/squib/graphics/save_sprue.rb +14 -2
  69. data/lib/squib/graphics/text.rb +37 -9
  70. data/lib/squib/import/csv_importer.rb +45 -0
  71. data/lib/squib/import/quantity_exploder.rb +18 -0
  72. data/lib/squib/import/xlsx_importer.rb +28 -0
  73. data/lib/squib/import/yaml_importer.rb +30 -0
  74. data/lib/squib/layout_parser.rb +24 -7
  75. data/lib/squib/sprues/crop_line.rb +6 -6
  76. data/lib/squib/sprues/crop_line_dash.rb +6 -6
  77. data/lib/squib/sprues/sprue.rb +16 -14
  78. data/lib/squib/version.rb +2 -1
  79. data/samples/autoscale_font/_autoscale_font.rb +77 -8
  80. data/samples/colors/_switch_color.rb +2 -2
  81. data/samples/data/_excel.rb +1 -1
  82. data/samples/ranges/_ranges.rb +1 -1
  83. data/samples/saves/_save_filenames.rb +4 -0
  84. data/samples/saves/_save_pdf.rb +1 -1
  85. data/samples/saves/_saves.rb +2 -1
  86. data/samples/shapes/_draw_shapes.rb +2 -2
  87. data/samples/sprues/_builtin_sprues.rb +1 -0
  88. data/samples/sprues/_fold_sheet.rb +4 -1
  89. data/samples/text/_text.rb +6 -1
  90. data/samples/text/_text_options.rb +2 -1
  91. data/samples/units/_cells.rb +51 -0
  92. data/samples/units/_shorthands.rb +48 -0
  93. data/samples/units/_units.rb +7 -0
  94. data/squib.gemspec +18 -12
  95. metadata +144 -58
  96. data/.travis.yml +0 -17
  97. data/appveyor.yml +0 -25
  98. data/lib/squib/api/background.rb +0 -15
  99. data/lib/squib/api/data.rb +0 -137
  100. data/lib/squib/api/image.rb +0 -49
  101. data/lib/squib/api/save.rb +0 -83
  102. data/lib/squib/api/shapes.rb +0 -124
  103. data/lib/squib/api/text.rb +0 -25
  104. data/lib/squib/api/text_embed.rb +0 -71
@@ -6,5 +6,6 @@ module Squib
6
6
  # Most of the time this is in the alpha of the next release.
7
7
  # e.g. v0.0.5a is on its way to becoming v0.0.5
8
8
  #
9
- VERSION = '0.15.0'
9
+ VERSION = '0.16.0-preview2'
10
10
  end
11
+
@@ -1,13 +1,79 @@
1
1
  require 'squib'
2
2
 
3
- # Here's an example of being able to scale a font
4
- # based on the length of individual string.
5
- # Handy for making minor font scales to fill text boxes.
3
+ # Autoscaling font is handy for a bunch of things:
4
+ # * Picture-perfect text fitting for one-off
5
+ # * Rapid prototyping where you don't have to think about sizes
6
+ #
7
+ # We've got three options...
8
+ # Option 1. Use your data <--- good for picture-perfect
9
+ # Option 2. Use ellipsize: :autoscale <--- good for rapid prototyping
10
+ # Option 3. Use map ranges in your code <--- good for picture-perfect
11
+ # or other weird cases
12
+
13
+ ###########################
14
+ # Option 1: Use your data #
15
+ ###########################
16
+ # If you want to tweak the font size per-card, you can always make font_size
17
+ # a column and map it from there. This is tedious but leads to perfectly
18
+ # customized results
19
+ my_data = Squib.csv data: <<~CSV
20
+ "Title","Font Size"
21
+ "Short & Big",10
22
+ "Medium Length & Size", 5
23
+ "Super duper long string here, therefore a smaller font.", 4
24
+ CSV
25
+
26
+ Squib::Deck.new(width: 300, height: 75, cards: 3) do
27
+ background color: :white
28
+ rect stroke_color: :black
29
+
30
+ text str: my_data.title, font: 'Arial',
31
+ font_size: my_data.font_size, # <-- key part
32
+ x: 10, y:10, align: :center,
33
+ width: 280, # <-- note how height does NOT need to be set
34
+ ellipsize: false,
35
+ hint: :red
36
+ save_sheet columns: 3, prefix: 'autoscale_w_data_'
37
+ end
38
+
39
+ #######################################
40
+ # Option 2: Use ellipsize: :autoscale #
41
+ #######################################
42
+ # If set the height, you can set "autoscale" and it will incrementally
43
+ # downgrade the font size until the text does not ellipsize
44
+ #
45
+ # Great for rapid prototyping, set-it-and-forget-it
46
+ #
47
+ # NOTE: You MUST set the height for this to work. Otherwise, the text will
48
+ # never ellipsize and Squib doesn't know when to start autoscaling
49
+ Squib::Deck.new(width: 300, height: 75, cards: 3) do
50
+ background color: :white
51
+ rect stroke_color: :black
52
+ title = ['Short & Big',
53
+ 'Medium Length & Size',
54
+ 'Super duper long string here, therefore a smaller font.']
55
+
56
+ # Automatically scale the text down from the specified font_size to the largest size that fits
57
+ text str: title, font: 'Arial',
58
+ font_size: 15, # <-- this is the MAX font size. Scale down from here
59
+ ellipsize: :autoscale, # <-- key part
60
+ height: 50, # <-- need this to be set to something
61
+ width: 280, x: 10, y: 10, align: :center, valign: :middle, hint: :red
62
+
63
+ save_sheet columns: 3, prefix: 'autoscale_w_ellipsize_'
64
+ end
65
+
66
+ ############################################
67
+ # Option 3: Mapping to ranges in your code #
68
+ ############################################
69
+ # Here's an in-between option that allows you to programmatically apply font
70
+ # sizes. This allows you a ton of flexibility.Probably more flexibility than
71
+ # you need, frankly. But one advantage is that you don't have to set the height
6
72
  def autoscale(str_array)
7
73
  str_array.map do | str |
8
74
  case str.length
9
75
  when 0..15
10
- 10.66
76
+ 9
11
77
  when 16..20
12
78
  6
13
79
  else
@@ -16,14 +82,17 @@ def autoscale(str_array)
16
82
  end
17
83
  end
18
84
 
19
- Squib::Deck.new(width: 300, height: 100, cards: 3) do
85
+ Squib::Deck.new(width: 300, height: 75, cards: 3) do
20
86
  background color: :white
21
- rect
87
+ rect stroke_color: :black
22
88
  title = ['Short & Big',
23
89
  'Medium Length & Size',
24
90
  'Super duper long string here, therefore a smaller font.']
25
- text str: title, font: 'Arial', font_size: autoscale(title),
91
+
92
+ # Scale text based on the string length
93
+ text str: title, font: 'Arial',
94
+ font_size: autoscale(title), # <-- key part
26
95
  x: 10, y:10, align: :center, width: 280, ellipsize: false, hint: :red
27
96
 
28
- save_sheet columns: 3
97
+ save_sheet columns: 3, prefix: 'autoscale_w_range_'
29
98
  end
@@ -1,11 +1,11 @@
1
- require 'squib'
1
+ require_relative '../../lib/squib'
2
2
 
3
3
  # Choose between black and white color theme for type snake
4
4
  # * Allow using white snake cards with black text or
5
5
  # black snake cards with white text
6
6
  color = 'white'
7
7
 
8
- cards = Squib.csv file: '_switch_color_data.csv', col_sep: "\t"
8
+ cards = Squib.csv file: '_switch_color_data.csv'
9
9
 
10
10
  Squib::Deck.new cards: cards['Type'].size do
11
11
 
@@ -37,7 +37,7 @@ end
37
37
  # from each value. This is the default behavior in Squib, but the options
38
38
  # are here just to make sure.
39
39
 
40
- resource_data = Squib.xlsx(file: 'sample.xlsx', sheet: 2, strip: true) do |header, value|
40
+ resource_data = Squib.xlsx(file: 'sample.xlsx', explode: 'Qty', sheet: 2, strip: true) do |header, value|
41
41
  case header
42
42
  when 'Cost'
43
43
  "$#{value}k" # e.g. "3" becomes "$3k"
@@ -59,6 +59,6 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
59
59
  end
60
60
  end
61
61
 
62
- rect color: 'black' # just a border
62
+ rect stroke_color: 'black' # just a border
63
63
  save_sheet prefix: 'ranges_', columns: 3
64
64
  end
@@ -16,6 +16,10 @@ Squib::Deck.new(width: 50, height: 50, cards: 2) do
16
16
  # bar.png
17
17
  save_png prefix: ['foo', 'bar'], count_format: ''
18
18
 
19
+ # foo_00_bar.png
20
+ # foo_01_bar.png
21
+ save_png prefix: 'foo_', suffix: '_bar'
22
+
19
23
  # thief.png
20
24
  # thug.png
21
25
  data = csv data: "filename\nthief\nthug"
@@ -3,7 +3,7 @@ require 'squib'
3
3
  Squib::Deck.new(cards: 8) do
4
4
  background color: :gray
5
5
  rect x: 37.5, y: 37.5, width: 750, height: 1050,
6
- x_radius: 37.5, y_radius: 37.5, stroke: 3.0, dash: '4 4'
6
+ x_radius: 37.5, y_radius: 37.5, stroke_width: 2.0, dash: '4 4'
7
7
 
8
8
  # Tests for crop marks
9
9
  save_pdf file: 'crops-default.pdf', crop_marks: true
@@ -5,7 +5,7 @@ require 'squib'
5
5
  Squib::Deck.new(width: 825, height: 1125, cards: 16) do
6
6
  background color: :gray
7
7
  rect x: 38, y: 38, width: 750, height: 1050,
8
- x_radius: 38, y_radius: 38, stroke: 3.0, dash: '4 4'
8
+ x_radius: 38, y_radius: 38, stroke_width: 2.0, dash: '4 4'
9
9
 
10
10
  text str: (1..16).to_a, x: 220, y: 78, font: 'Arial 18'
11
11
 
@@ -45,6 +45,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 16) do
45
45
 
46
46
  # Sheets can arrange left-to-right and right-to-left
47
47
  save_sheet prefix: 'save_sheet_rtl_',
48
+ suffix: '_with_suffix',
48
49
  range: 0..1, rtl: true,
49
50
  columns: 2, rows: 1,
50
51
  margin: 75, gap: 5, trim: 37
@@ -3,8 +3,8 @@ require 'squib'
3
3
  Squib::Deck.new do
4
4
  background color: :white
5
5
 
6
- grid x: 10, y: 10, width: 50, height: 50, stroke_color: '#0066FF', stroke_width: 1.5, angle: 0.1
7
- grid x: 10, y: 10, width: 200, height: 200, stroke_color: '#0066FF', stroke_width: 3, angle: 0.1
6
+ grid x: 10, y: 10, width: 50, height: 50, stroke_color: '#0066FF', stroke_width: 1.5
7
+ grid x: 10, y: 10, width: 200, height: 200, stroke_color: '#0066FF', stroke_width: 3
8
8
 
9
9
  rect x: 305, y: 105, width: 200, height: 50, dash: '4 2'
10
10
 
@@ -17,5 +17,6 @@ Squib::Deck.new(width: '50mm', height: '70mm', cards: 9) do
17
17
  drivethrucards_1up.yml
18
18
  ).each do |builtin|
19
19
  save_sheet sprue: builtin, prefix: "sprue_#{builtin}_"
20
+ save_pdf sprue: builtin, file: "sprue_#{builtin}_"
20
21
  end
21
22
  end
@@ -22,6 +22,9 @@ Squib::Deck.new(width: '2.5in', height: '3.5in', cards: 8) do
22
22
 
23
23
  text str: strings,font: 'Sans 32', align: :center, valign: :middle,
24
24
  height: :deck, width: :deck
25
+
25
26
  save_sheet prefix: 'foldable_',
26
- sprue: 'letter_poker_foldable_8up.yml'
27
+ sprue: 'letter_poker_foldable_8up.yml' # built-in sprue
28
+ save_pdf file: 'foldable.pdf',
29
+ sprue: 'letter_poker_foldable_8up.yml' # built-in sprue
27
30
  end
@@ -1,7 +1,7 @@
1
1
  require 'squib'
2
2
  require 'squib/sample_helpers'
3
3
 
4
- Squib::Deck.new(width: 1000, height: 1250) do
4
+ Squib::Deck.new(width: 1000, height: 1450) do
5
5
  draw_graph_paper width, height
6
6
 
7
7
  sample 'Font strings are quite expressive. Specify family, modifiers, then size. Font names with spaces in them should end with a comma to help with parsing.' do |x, y|
@@ -21,6 +21,11 @@ Squib::Deck.new(width: 1000, height: 1250) do
21
21
  hint: :red, width: 350, font: 'Serif bold 7'
22
22
  end
23
23
 
24
+ sample 'If you specify ellipsize: :autosize, the font size will autoscale.' do |x, y|
25
+ text str: 'This text doeas not fit with font size 7. It is autoscaled to the largest size that fits instead.', x: x - 50, y: y,
26
+ hint: :red, width: 350, height: 100, ellipsize: :autoscale, font: 'Serif bold 7'
27
+ end
28
+
24
29
  sample 'If you specify the width only, and turn off ellipsize, the height will auto-stretch.' do |x, y|
25
30
  text str: 'This has fixed width, but not fixed height.', x: x, y: y,
26
31
  hint: :red, width: 300, ellipsize: false, font: 'Serif bold 8'
@@ -1,5 +1,6 @@
1
1
  # encoding: UTF-8
2
- require 'squib'
2
+ # require 'squib'
3
+ require_relative '../../lib/squib'
3
4
 
4
5
  data = { 'name' => ['Thief', 'Grifter', 'Mastermind'],
5
6
  'level' => [1, 2, 3] }
@@ -0,0 +1,51 @@
1
+ require 'squib'
2
+
3
+ Squib::Deck.new(width: '1.5in', height: '1.5in') do
4
+ background color: :white
5
+
6
+ # Squib has a custom unit, called "cell"
7
+ # A "cell" unit defaults to 37.5px, which at 300dpi is 1/8in or 3.175mm
8
+ # This is a very common multiple for layouts.
9
+ # This helps us lay things out in grids without doing much math in our heads
10
+ # Here's an example... with grid!
11
+ grid width: '1 cell', height: '1 cell'
12
+
13
+ # Plurals are fine or just 'c' as a unit is fine
14
+ # Whitespace is pretty lenient too.
15
+ rect fill_color: :blue,
16
+ x: '1 cell', y: '2 cells',
17
+ width: '1c', height: '1cell '
18
+
19
+ # Technically, the "cell" is actually a "unit", so you can even combine
20
+ # with xywh shorhands!!
21
+ rect fill_color: :red,
22
+ x: 'middle + 0.5c', y: 'height - 1.5c',
23
+ width: '1c', height: '1c'
24
+
25
+ # And, unlike xywh shorthands, this applies basically everywhere we support
26
+ # unit conversion.
27
+ circle fill_color: :green,
28
+ x: '3c', y: '2c', radius: '1c'
29
+ # Decimals are fine too
30
+ circle fill_color: :green,
31
+ x: '5c', y: '2c', radius: '0.5c'
32
+ # Even dashes!
33
+ circle fill_color: '#0000', stroke_color: :purple,
34
+ x: '1c', y: '4c', radius: '0.5c', dash: '0.25c 0.25c'
35
+
36
+ # We can also do stuff in layout. Check out the yml file...
37
+ # (even cleaner in Yaml since we don't need quotes!)
38
+ use_layout file: 'cells.yml'
39
+ rect layout: :example
40
+ rect layout: :extends_example
41
+
42
+ save_png prefix: 'cells_'
43
+ end
44
+
45
+
46
+ # You can customize this with the cell_px configuration option
47
+ Squib::Deck.new(width: 100, height: 100, config: 'cell_config.yml') do
48
+ background color: :white
49
+ rect x: '1c', y: '1c', width: '1c', height: '1c', fill_color: :purple
50
+ save_png prefix: 'custom_cell_'
51
+ end
@@ -0,0 +1,48 @@
1
+ require_relative '../../lib/squib'
2
+
3
+ # Lots of DSL methods have shorthands that are accepted for
4
+ # x, y, width, and height parameters.
5
+ Squib::Deck.new(width: '0.5in', height: '0.25in') do
6
+ background color: :white
7
+
8
+ # middle for x and y will resolve to half the height
9
+ text str: 'xymiddle', font: 'Sans Bold 3', hint: :red,
10
+ x: 'middle', y: :middle
11
+
12
+ # 'center' also works
13
+ rect width: 30, height: 30,
14
+ x: :center, y: 'center'
15
+
16
+ # Applies to shapes
17
+ triangle x1: 20, y1: 20,
18
+ x2: 60, y2: 20,
19
+ x3: :middle, y3: :middle
20
+
21
+ # We can also do width-, height-, width/, height/
22
+ rect x: 20, y: 5, stroke_color: :green,
23
+ width: 'deck - 0.1in', height: 10
24
+
25
+ rect x: 10, y: 50, width: 10, height: 'deck / 3',
26
+ stroke_color: :purple
27
+
28
+ # And middle+/-
29
+ rect x: 'middle + 0.1in', y: 'center - 0.1in',
30
+ width: '0.1in', height: '0.1in', fill_color: :blue
31
+
32
+ # Layouts apply this too.
33
+ use_layout file: 'shorthands.yml'
34
+ rect layout: :example
35
+
36
+ # HOWEVER! Shorthands don't combine in an "extends" situation,
37
+ # e.g. this won't work:
38
+ # parent:
39
+ # x: middle
40
+ # child:
41
+ # extends: parent
42
+ # x: += 0.5in
43
+
44
+ # These shorthands are not intended for every xywh parameter or
45
+ # length parameter, see docs for when they do or do not apply.
46
+
47
+ save_png prefix: 'shorthand_'
48
+ end
@@ -23,10 +23,17 @@ Squib::Deck.new(width: '1.5in', height: '1.5in') do
23
23
  width: safe_width, height: safe_height,
24
24
  radius: '2 mm '
25
25
 
26
+ # Angles are also automatically converted to radians if you use deg
27
+ svg file: '../spanner.svg',
28
+ x: 100, y: 100, width: 40, height: 40, angle: '30deg'
29
+
26
30
  # We can also do stuff in layout. Check out the yml file...
27
31
  # (even cleaner in Yaml since we don't need quotes!)
28
32
  use_layout file: 'using_units.yml'
29
33
  text str: 'Hello.', layout: :example
34
+ svg file: '../spanner.svg', layout: :angled
30
35
 
31
36
  save prefix: 'units_', format: :png
37
+
38
+ # But wait... there's more! See _shorthands.rb for more fanciness with units
32
39
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.specification_version = 2 if spec.respond_to? :specification_version=
8
8
  spec.required_rubygems_version = Gem::Requirement.new('>= 0') if spec.respond_to? :required_rubygems_version=
9
9
  spec.rubygems_version = '2.2.2'
10
- spec.required_ruby_version = '>= 2.4.0'
10
+ spec.required_ruby_version = '>= 2.5.0'
11
11
 
12
12
  spec.name = 'squib'
13
13
  spec.version = Squib::VERSION
@@ -15,9 +15,11 @@ Gem::Specification.new do |spec|
15
15
 
16
16
  spec.summary = 'A Ruby DSL for prototyping card games'
17
17
  spec.description = 'Squib is a Ruby DSL for prototyping card games'
18
+ spec.post_install_message = 'Happy Squibbing!'
18
19
  spec.authors = ['Andy Meneely']
19
20
  spec.email = 'andy.meneely@gmail.com'
20
21
  spec.homepage = 'https://github.com/andymeneely/squib'
22
+ spec.requirements << 'On Windows, you need the Ruby+DevKit. See https://rubyinstaller.org/downloads'
21
23
 
22
24
  spec.rdoc_options = ['--charset=UTF-8']
23
25
  spec.extra_rdoc_files = Dir['README.md', 'samples/**/*.rb']
@@ -29,20 +31,24 @@ Gem::Specification.new do |spec|
29
31
  spec.test_files = spec.files.grep(/^(spec|samples|docs|benchmarks)\//)
30
32
  spec.require_paths = ['lib']
31
33
 
32
- spec.add_runtime_dependency 'cairo', '1.16.4'
34
+ spec.add_runtime_dependency 'cairo', '~> 1.16'
33
35
  spec.add_runtime_dependency 'classy_hash', '0.2.1'
34
- spec.add_runtime_dependency 'gio2', '3.3.6'
35
- spec.add_runtime_dependency 'gobject-introspection', '3.3.6'
36
- spec.add_runtime_dependency 'highline', '2.0.2'
37
- spec.add_runtime_dependency 'mercenary', '0.3.6'
38
- spec.add_runtime_dependency 'nokogiri', '1.10.3'
39
- spec.add_runtime_dependency 'pango', '3.3.6'
40
- spec.add_runtime_dependency 'roo', '2.8.2'
41
- spec.add_runtime_dependency 'rsvg2', '3.3.6'
42
- spec.add_runtime_dependency 'ruby-progressbar', '1.10.0'
43
-
36
+ spec.add_runtime_dependency 'gio2', '~> 3.4'
37
+ spec.add_runtime_dependency 'gobject-introspection', '~> 3.4'
38
+ spec.add_runtime_dependency 'highline', '2.0.3'
39
+ spec.add_runtime_dependency 'mercenary', '0.4.0'
40
+ spec.add_runtime_dependency 'nokogiri', '~> 1.10'
41
+ spec.add_runtime_dependency 'pango', '~> 3.4'
42
+ spec.add_runtime_dependency 'rainbow', '~> 3.0'
43
+ spec.add_runtime_dependency 'roo', '~> 2.8'
44
+ spec.add_runtime_dependency 'rsvg2', '~> 3.4'
45
+ spec.add_runtime_dependency 'ruby-progressbar', '~> 1.10'
46
+
47
+ spec.add_development_dependency 'activesupport'
44
48
  spec.add_development_dependency 'bundler'
45
49
  spec.add_development_dependency 'coveralls', '>= 0.8.21'
50
+ spec.add_development_dependency 'guard'
51
+ spec.add_development_dependency 'guard-rake'
46
52
  spec.add_development_dependency 'game_icons'
47
53
  spec.add_development_dependency 'launchy'
48
54
  spec.add_development_dependency 'rake'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0.pre.preview2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Meneely
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.16.4
19
+ version: '1.16'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.16.4
26
+ version: '1.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: classy_hash
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,128 +42,156 @@ dependencies:
42
42
  name: gio2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.3.6
47
+ version: '3.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.3.6
54
+ version: '3.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: gobject-introspection
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.3.6
61
+ version: '3.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.3.6
68
+ version: '3.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: highline
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.2
75
+ version: 2.0.3
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.2
82
+ version: 2.0.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mercenary
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.3.6
89
+ version: 0.4.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.3.6
96
+ version: 0.4.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: nokogiri
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '='
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.10.3
103
+ version: '1.10'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '='
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.10.3
110
+ version: '1.10'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pango
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '='
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 3.3.6
117
+ version: '3.4'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '='
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rainbow
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
123
130
  - !ruby/object:Gem::Version
124
- version: 3.3.6
131
+ version: '3.0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: roo
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
- - - '='
143
+ - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: 2.8.2
145
+ version: '2.8'
132
146
  type: :runtime
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - '='
150
+ - - "~>"
137
151
  - !ruby/object:Gem::Version
138
- version: 2.8.2
152
+ version: '2.8'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rsvg2
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
- - - '='
157
+ - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: 3.3.6
159
+ version: '3.4'
146
160
  type: :runtime
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - '='
164
+ - - "~>"
151
165
  - !ruby/object:Gem::Version
152
- version: 3.3.6
166
+ version: '3.4'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: ruby-progressbar
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
- - - '='
171
+ - - "~>"
158
172
  - !ruby/object:Gem::Version
159
- version: 1.10.0
173
+ version: '1.10'
160
174
  type: :runtime
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
- - - '='
178
+ - - "~>"
165
179
  - !ruby/object:Gem::Version
166
- version: 1.10.0
180
+ version: '1.10'
181
+ - !ruby/object:Gem::Dependency
182
+ name: activesupport
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
167
195
  - !ruby/object:Gem::Dependency
168
196
  name: bundler
169
197
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +220,34 @@ dependencies:
192
220
  - - ">="
193
221
  - !ruby/object:Gem::Version
194
222
  version: 0.8.21
223
+ - !ruby/object:Gem::Dependency
224
+ name: guard
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: guard-rake
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
195
251
  - !ruby/object:Gem::Dependency
196
252
  name: game_icons
197
253
  requirement: !ruby/object:Gem::Requirement
@@ -314,31 +370,24 @@ extra_rdoc_files:
314
370
  - samples/text/_embed_text.rb
315
371
  - samples/text/_text.rb
316
372
  - samples/text/_text_options.rb
373
+ - samples/units/_cells.rb
374
+ - samples/units/_shorthands.rb
317
375
  - samples/units/_units.rb
318
376
  files:
377
+ - ".github/workflows/tests.yml"
319
378
  - ".gitignore"
320
- - ".travis.yml"
321
379
  - CHANGELOG.md
322
380
  - CONTRIBUTING.md
323
381
  - Dockerfile
324
382
  - Gemfile
383
+ - Guardfile
325
384
  - LICENSE.txt
326
385
  - README.md
327
386
  - RELEASE TODO.md
328
387
  - Rakefile
329
- - appveyor.yml
330
388
  - bin/squib
331
389
  - lib/squib.rb
332
- - lib/squib/api/background.rb
333
- - lib/squib/api/data.rb
334
- - lib/squib/api/groups.rb
335
- - lib/squib/api/image.rb
336
- - lib/squib/api/save.rb
337
390
  - lib/squib/api/settings.rb
338
- - lib/squib/api/shapes.rb
339
- - lib/squib/api/text.rb
340
- - lib/squib/api/text_embed.rb
341
- - lib/squib/api/units.rb
342
391
  - lib/squib/args/arg_loader.rb
343
392
  - lib/squib/args/box.rb
344
393
  - lib/squib/args/card_range.rb
@@ -363,6 +412,7 @@ files:
363
412
  - lib/squib/args/transform.rb
364
413
  - lib/squib/args/typographer.rb
365
414
  - lib/squib/args/unit_conversion.rb
415
+ - lib/squib/args/xywh_shorthands.rb
366
416
  - lib/squib/builtin/layouts/economy.yml
367
417
  - lib/squib/builtin/layouts/fantasy.yml
368
418
  - lib/squib/builtin/layouts/hand.yml
@@ -413,6 +463,34 @@ files:
413
463
  - lib/squib/conf.rb
414
464
  - lib/squib/constants.rb
415
465
  - lib/squib/deck.rb
466
+ - lib/squib/dsl/background.rb
467
+ - lib/squib/dsl/circle.rb
468
+ - lib/squib/dsl/csv.rb
469
+ - lib/squib/dsl/curve.rb
470
+ - lib/squib/dsl/cut_zone.rb
471
+ - lib/squib/dsl/ellipse.rb
472
+ - lib/squib/dsl/grid.rb
473
+ - lib/squib/dsl/groups.rb
474
+ - lib/squib/dsl/hand.rb
475
+ - lib/squib/dsl/line.rb
476
+ - lib/squib/dsl/png.rb
477
+ - lib/squib/dsl/polygon.rb
478
+ - lib/squib/dsl/rect.rb
479
+ - lib/squib/dsl/safe_zone.rb
480
+ - lib/squib/dsl/save.rb
481
+ - lib/squib/dsl/save_pdf.rb
482
+ - lib/squib/dsl/save_png.rb
483
+ - lib/squib/dsl/save_sheet.rb
484
+ - lib/squib/dsl/showcase.rb
485
+ - lib/squib/dsl/star.rb
486
+ - lib/squib/dsl/svg.rb
487
+ - lib/squib/dsl/text.rb
488
+ - lib/squib/dsl/text_embed.rb
489
+ - lib/squib/dsl/triangle.rb
490
+ - lib/squib/dsl/units.rb
491
+ - lib/squib/dsl/xlsx.rb
492
+ - lib/squib/dsl/yaml.rb
493
+ - lib/squib/errors_warnings/warn_unexpected_params.rb
416
494
  - lib/squib/graphics/background.rb
417
495
  - lib/squib/graphics/cairo_context_wrapper.rb
418
496
  - lib/squib/graphics/embedding_utils.rb
@@ -426,7 +504,11 @@ files:
426
504
  - lib/squib/graphics/shapes.rb
427
505
  - lib/squib/graphics/showcase.rb
428
506
  - lib/squib/graphics/text.rb
507
+ - lib/squib/import/csv_importer.rb
429
508
  - lib/squib/import/data_frame.rb
509
+ - lib/squib/import/quantity_exploder.rb
510
+ - lib/squib/import/xlsx_importer.rb
511
+ - lib/squib/import/yaml_importer.rb
430
512
  - lib/squib/layout_parser.rb
431
513
  - lib/squib/progress.rb
432
514
  - lib/squib/sample_helpers.rb
@@ -481,13 +563,15 @@ files:
481
563
  - samples/text/_text.rb
482
564
  - samples/text/_text_options.rb
483
565
  - samples/text/bug134.rb
566
+ - samples/units/_cells.rb
567
+ - samples/units/_shorthands.rb
484
568
  - samples/units/_units.rb
485
569
  - squib.gemspec
486
570
  homepage: https://github.com/andymeneely/squib
487
571
  licenses:
488
572
  - MIT
489
573
  metadata: {}
490
- post_install_message:
574
+ post_install_message: Happy Squibbing!
491
575
  rdoc_options:
492
576
  - "--charset=UTF-8"
493
577
  require_paths:
@@ -496,16 +580,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
496
580
  requirements:
497
581
  - - ">="
498
582
  - !ruby/object:Gem::Version
499
- version: 2.4.0
583
+ version: 2.5.0
500
584
  required_rubygems_version: !ruby/object:Gem::Requirement
501
585
  requirements:
502
- - - ">="
586
+ - - ">"
503
587
  - !ruby/object:Gem::Version
504
- version: '0'
505
- requirements: []
506
- rubyforge_project:
507
- rubygems_version: 2.7.6
508
- signing_key:
588
+ version: 1.3.1
589
+ requirements:
590
+ - On Windows, you need the Ruby+DevKit. See https://rubyinstaller.org/downloads
591
+ rubygems_version: 3.1.4
592
+ signing_key:
509
593
  specification_version: 2
510
594
  summary: A Ruby DSL for prototyping card games
511
595
  test_files:
@@ -554,4 +638,6 @@ test_files:
554
638
  - samples/text/_text.rb
555
639
  - samples/text/_text_options.rb
556
640
  - samples/text/bug134.rb
641
+ - samples/units/_cells.rb
642
+ - samples/units/_shorthands.rb
557
643
  - samples/units/_units.rb