squib 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/CHANGELOG.md +10 -0
  4. data/README.md +44 -21
  5. data/Rakefile +74 -1
  6. data/benchmarks/shiny-purse.png +0 -0
  7. data/benchmarks/spanner.svg +91 -0
  8. data/benchmarks/tons_of_png.rb +6 -0
  9. data/benchmarks/tons_of_svg.rb +7 -0
  10. data/benchmarks/tons_of_text.rb +8 -0
  11. data/lib/squib/api/background.rb +1 -1
  12. data/lib/squib/api/image.rb +6 -4
  13. data/lib/squib/api/save.rb +4 -3
  14. data/lib/squib/api/shapes.rb +7 -7
  15. data/lib/squib/api/text.rb +1 -1
  16. data/lib/squib/args/unit_conversion.rb +21 -0
  17. data/lib/squib/card.rb +2 -1
  18. data/lib/squib/constants.rb +8 -0
  19. data/lib/squib/deck.rb +14 -12
  20. data/lib/squib/graphics/background.rb +1 -1
  21. data/lib/squib/graphics/cairo_context_wrapper.rb +42 -0
  22. data/lib/squib/graphics/gradient_regex.rb +46 -0
  23. data/lib/squib/graphics/image.rb +17 -7
  24. data/lib/squib/graphics/save_doc.rb +16 -13
  25. data/lib/squib/graphics/save_images.rb +4 -4
  26. data/lib/squib/graphics/shapes.rb +7 -7
  27. data/lib/squib/graphics/text.rb +1 -1
  28. data/lib/squib/input_helpers.rb +8 -8
  29. data/lib/squib/version.rb +1 -1
  30. data/samples/colors.rb +22 -1
  31. data/samples/glass-heart.svg +52 -0
  32. data/samples/gradients.rb +34 -0
  33. data/samples/load_images.rb +14 -0
  34. data/samples/saves.rb +5 -0
  35. data/spec/api/api_image_spec.rb +2 -2
  36. data/spec/args/unit_conversion_spec.rb +22 -0
  37. data/spec/data/samples/autoscale_font.rb.txt +9 -9
  38. data/spec/data/samples/basic.rb.txt +24 -24
  39. data/spec/data/samples/cairo_access.rb.txt +4 -4
  40. data/spec/data/samples/csv_import.rb.txt +10 -10
  41. data/spec/data/samples/custom_config.rb.txt +3 -3
  42. data/spec/data/samples/draw_shapes.rb.txt +8 -8
  43. data/spec/data/samples/excel.rb.txt +15 -15
  44. data/spec/data/samples/gradients.rb.txt +65 -0
  45. data/spec/data/samples/hello_world.rb.txt +4 -4
  46. data/spec/data/samples/load_images.rb.txt +30 -4
  47. data/spec/data/samples/portrait-landscape.rb.txt +6 -6
  48. data/spec/data/samples/ranges.rb.txt +30 -30
  49. data/spec/data/samples/saves.rb.txt +74 -70
  50. data/spec/data/samples/showcase.rb.txt +20 -20
  51. data/spec/data/samples/text_options.rb.txt +63 -63
  52. data/spec/data/samples/tgc_proofs.rb.txt +8 -8
  53. data/spec/data/samples/units.rb.txt +8 -8
  54. data/spec/deck_spec.rb +6 -0
  55. data/spec/graphics/cairo_context_wrapper_spec.rb +75 -0
  56. data/spec/graphics/graphics_images_spec.rb +5 -6
  57. data/spec/input_helpers_spec.rb +11 -9
  58. data/spec/samples/samples_regression_spec.rb +3 -1
  59. data/spec/spec_helper.rb +1 -0
  60. metadata +20 -5
  61. data/spec/data/samples/colors.rb.txt +0 -124
@@ -1,27 +1,27 @@
1
1
  cairo: save([])
2
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=1.0, @green=1.0, @blue=1.0>])
2
+ cairo: set_source_color([:white])
3
3
  cairo: paint([])
4
4
  cairo: restore([])
5
5
  cairo: save([])
6
6
  cairo: rounded_rectangle([38, 38, 750, 1050, 38, 38])
7
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
7
+ cairo: set_source_color([:black])
8
8
  cairo: set_line_width([2.0])
9
9
  cairo: stroke([])
10
10
  cairo: rounded_rectangle([38, 38, 750, 1050, 38, 38])
11
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.0, @red=0.0, @green=0.0, @blue=0.0>])
11
+ cairo: set_source_color(["#0000"])
12
12
  cairo: fill([])
13
13
  cairo: restore([])
14
14
  cairo: save([])
15
15
  cairo: rounded_rectangle([75, 75, 128, 128, 25, 25])
16
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
16
+ cairo: set_source_color([:black])
17
17
  cairo: set_line_width([2.0])
18
18
  cairo: stroke([])
19
19
  cairo: rounded_rectangle([75, 75, 128, 128, 25, 25])
20
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.0, @red=0.0, @green=0.0, @blue=0.0>])
20
+ cairo: set_source_color(["#0000"])
21
21
  cairo: fill([])
22
22
  cairo: restore([])
23
23
  cairo: save([])
24
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
24
+ cairo: set_source_color([:black])
25
25
  cairo: translate([220, 78])
26
26
  cairo: rotate([0])
27
27
  cairo: translate([-220, -78])
@@ -38,7 +38,7 @@ cairo: update_pango_layout([MockDouble])
38
38
  cairo: show_pango_layout([MockDouble])
39
39
  cairo: restore([])
40
40
  cairo: save([])
41
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
41
+ cairo: set_source_color([:black])
42
42
  cairo: translate([75, 85])
43
43
  cairo: rotate([0])
44
44
  cairo: translate([-75, -85])
@@ -78,4 +78,4 @@ cairo: translate([0, 0])
78
78
  cairo: set_source([ImageSurface, 0, 0])
79
79
  cairo: paint([0.5])
80
80
  cairo: restore([])
81
- surface: write_to_png(["_output/tgc_sample_0.png"])
81
+ surface: write_to_png(["_output/tgc_sample_00.png"])
@@ -1,32 +1,32 @@
1
1
  cairo: save([])
2
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.8666666666666667, @green=0.8666666666666667, @blue=0.8666666666666667>])
2
+ cairo: set_source_color(["#ddd"])
3
3
  cairo: paint([])
4
4
  cairo: restore([])
5
5
  cairo: save([])
6
6
  cairo: rounded_rectangle([37.5, 37.5, 750.0, 1050.0, 25, 25])
7
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
7
+ cairo: set_source_color([:black])
8
8
  cairo: set_line_width([2.0])
9
9
  cairo: stroke([])
10
10
  cairo: rounded_rectangle([37.5, 37.5, 750.0, 1050.0, 25, 25])
11
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.0, @red=0.0, @green=0.0, @blue=0.0>])
11
+ cairo: set_source_color(["#0000"])
12
12
  cairo: fill([])
13
13
  cairo: restore([])
14
14
  cairo: save([])
15
15
  cairo: rounded_rectangle([75.0, 75.0, 675.0, 975.0, 25, 25])
16
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
16
+ cairo: set_source_color([:black])
17
17
  cairo: set_line_width([2.0])
18
18
  cairo: stroke([])
19
19
  cairo: rounded_rectangle([75.0, 75.0, 675.0, 975.0, 25, 25])
20
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.0, @red=0.0, @green=0.0, @blue=0.0>])
20
+ cairo: set_source_color(["#0000"])
21
21
  cairo: fill([])
22
22
  cairo: restore([])
23
23
  cairo: save([])
24
24
  cairo: rounded_rectangle([472.4409444, 472.4409444, 100, 100, 0, 0])
25
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.0, @green=0.0, @blue=0.0>])
25
+ cairo: set_source_color([:black])
26
26
  cairo: set_line_width([2.0])
27
27
  cairo: stroke([])
28
28
  cairo: rounded_rectangle([472.4409444, 472.4409444, 100, 100, 0, 0])
29
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.0, @red=0.0, @green=0.0, @blue=0.0>])
29
+ cairo: set_source_color(["#0000"])
30
30
  cairo: fill([])
31
31
  cairo: restore([])
32
- surface: write_to_png(["_output/units_0.png"])
32
+ surface: write_to_png(["_output/units_00.png"])
@@ -10,6 +10,12 @@ describe Squib::Deck do
10
10
  expect(d.cards.size).to eq(1)
11
11
  end
12
12
 
13
+ it 'can be built with unit conversion' do
14
+ d = Squib::Deck.new(width: '1in', height: '2in')
15
+ expect(d.width).to eq(300)
16
+ expect(d.height).to eq(600)
17
+ end
18
+
13
19
  context 'in dealing with ranges' do
14
20
  it 'calls text on all cards by default' do
15
21
  card1 = instance_double(Squib::Card)
@@ -0,0 +1,75 @@
1
+ require 'spec_helper'
2
+ require 'squib/graphics/cairo_context_wrapper'
3
+
4
+ describe Squib::Graphics::CairoContextWrapper do
5
+
6
+ let(:cairo) { double(Cairo::Context) }
7
+ subject { Squib::Graphics::CairoContextWrapper.new(cairo) }
8
+
9
+ it 'passes on colors as normal' do
10
+ expect(cairo).to receive(:set_source_color).with('blue')
11
+ subject.set_source_squibcolor('blue')
12
+ end
13
+
14
+ it 'passes on color symbols as normal' do
15
+ expect(cairo).to receive(:set_source_color).with(:blue)
16
+ subject.set_source_squibcolor(:blue)
17
+ end
18
+
19
+ it 'passes on color hashes' do
20
+ expect(cairo).to receive(:set_source_color)
21
+ .with('#aabbccdd')
22
+ subject.set_source_squibcolor('#aabbccdd')
23
+ end
24
+
25
+ context 'regex variations for linear gradients' do
26
+ before(:each) do
27
+ dbl = double(Cairo::LinearPattern)
28
+ expect(Cairo::LinearPattern).to receive(:new).with(1,2,3,4).and_return(dbl)
29
+ expect(dbl).to receive(:add_color_stop).with(0.0, 'blue')
30
+ expect(dbl).to receive(:add_color_stop).with(1.0, 'red')
31
+ expect(cairo).to receive(:set_source).with(dbl)
32
+ end
33
+
34
+ it('handles no decimals' ) { subject.set_source_squibcolor('(1,2) (3,4) blue@0 red@1') }
35
+ it('handles decimals' ) { subject.set_source_squibcolor('(1.0,2.0) (3.0,4.0) blue@0 red@1') }
36
+ it('handles no whitespace') { subject.set_source_squibcolor('(1,2)(3,4)blue@0red@1') }
37
+ it('handles whitespace' ) { subject.set_source_squibcolor(' ( 1 , 2 ) ( 3 , 4 ) blue@0 red@1 ') }
38
+ end
39
+
40
+ context 'regex variations for radial gradients' do
41
+ before(:each) do
42
+ dbl = double(Cairo::RadialPattern)
43
+ expect(Cairo::RadialPattern).to receive(:new).with(1,2,5,3,4,6).and_return(dbl)
44
+ expect(dbl).to receive(:add_color_stop).with(0.0, 'blue')
45
+ expect(dbl).to receive(:add_color_stop).with(1.0, 'red')
46
+ expect(cairo).to receive(:set_source).with(dbl)
47
+ end
48
+
49
+ it('handles no decimals' ) { subject.set_source_squibcolor('(1,2,5) (3,4,6) blue@0 red@1') }
50
+ it('handles decimals' ) { subject.set_source_squibcolor('(1.0,2.0,5.0) (3.0,4.0,6.0) blue@0 red@1') }
51
+ it('handles no whitespace') { subject.set_source_squibcolor('(1,2,5)(3,4,6)blue@0red@1') }
52
+ it('handles whitespace' ) { subject.set_source_squibcolor(' ( 1 , 2 , 5 ) ( 3 , 4 , 6 ) blue@0 red@1 ') }
53
+ end
54
+
55
+ context 'regex handles hash notation' do
56
+ it 'on radial patterns' do
57
+ dbl = double(Cairo::RadialPattern)
58
+ expect(Cairo::RadialPattern).to receive(:new).with(1,2,5,3,4,6).and_return(dbl)
59
+ expect(dbl).to receive(:add_color_stop).with(0.0, '#def')
60
+ expect(dbl).to receive(:add_color_stop).with(1.0, '#112233')
61
+ expect(cairo).to receive(:set_source).with(dbl)
62
+ subject.set_source_squibcolor('(1,2,5) (3,4,6) #def@0 #112233@1')
63
+ end
64
+
65
+ it 'on linear patterns' do
66
+ dbl = double(Cairo::LinearPattern)
67
+ expect(Cairo::LinearPattern).to receive(:new).with(1,2,3,4).and_return(dbl)
68
+ expect(dbl).to receive(:add_color_stop).with(0.0, '#def')
69
+ expect(dbl).to receive(:add_color_stop).with(1.0, '#112233')
70
+ expect(cairo).to receive(:set_source).with(dbl)
71
+ subject.set_source_squibcolor('(1,2) (3,4) #def@0 #112233@1')
72
+ end
73
+ end
74
+
75
+ end
@@ -26,7 +26,7 @@ describe Squib::Card do
26
26
 
27
27
  card = Squib::Card.new(@deck, 100, 150)
28
28
  # png(file, x, y, alpha, blend, angle)
29
- card.png('foo.png', 37, 38, :native, :native, 0.9, :none, 0.0)
29
+ card.png('foo.png', 37, 38, :native, :native, 0.9, :none, 0.0, nil)
30
30
  end
31
31
 
32
32
  it 'sets blend when needed' do
@@ -34,9 +34,8 @@ describe Squib::Card do
34
34
  expect(@context).to receive(:operator=).with(:overlay).once
35
35
 
36
36
  card = Squib::Card.new(@deck, 100, 150)
37
- card.png('foo.png', 37, 38, :native, :native, 0.9, :overlay, 0.0)
37
+ card.png('foo.png', 37, 38, :native, :native, 0.9, :overlay, 0.0, nil)
38
38
  end
39
-
40
39
  end
41
40
 
42
41
  context '#svg' do
@@ -55,7 +54,7 @@ describe Squib::Card do
55
54
 
56
55
  card = Squib::Card.new(@deck, 100, 150)
57
56
  # svg(file, id, x, y, width, height, alpha, blend, angle)
58
- card.svg('foo.png', 'id', 37, 38, :native, :native, 0.9, :none, 0.0)
57
+ card.svg('foo.png', 'id', 37, 38, :native, :native, 0.9, :none, 0.0, nil)
59
58
  end
60
59
 
61
60
  it 'sets blend when needed' do
@@ -64,7 +63,7 @@ describe Squib::Card do
64
63
  expect(@context).to receive(:operator=).with(:overlay).once
65
64
 
66
65
  card = Squib::Card.new(@deck, 100, 150)
67
- card.svg('foo.png', nil, 37, 38, :native, :native, 0.9, :overlay, 0.0)
66
+ card.svg('foo.png', nil, 37, 38, :native, :native, 0.9, :overlay, 0.0, nil)
68
67
  end
69
68
 
70
69
  it 'sets width & height when needed' do
@@ -74,7 +73,7 @@ describe Squib::Card do
74
73
  expect(@context).to receive(:scale).with(2.0, 3.0).once
75
74
 
76
75
  card = Squib::Card.new(@deck, 100, 150)
77
- card.svg('foo.png', nil, 37, 38, 200, 300, 0.9, :none, 0.0)
76
+ card.svg('foo.png', nil, 37, 38, 200, 300, 0.9, :none, 0.0, nil)
78
77
  end
79
78
  end
80
79
 
@@ -99,26 +99,21 @@ describe Squib::InputHelpers do
99
99
  end
100
100
 
101
101
  context '#colorify' do
102
- it 'should parse if nillable' do
102
+ it 'should pass through if nillable' do
103
103
  color = @deck.send(:colorify, {color: ['#fff']}, true)[:color]
104
- expect(color.to_a[0].to_a).to eq([1.0, 1.0, 1.0, 1.0])
105
- end
106
-
107
- it 'raises and error if the color does not exist' do
108
- expect{ @deck.send(:colorify, {color: [:nonexist]}, false) }.to \
109
- raise_error(ArgumentError, 'unknown color name: nonexist')
104
+ expect(color).to eq(['#fff'])
110
105
  end
111
106
 
112
107
  it 'pulls from custom colors in the config' do
113
108
  @deck.custom_colors['foo'] = '#abc'
114
109
  expect(@deck.send(:colorify, {color: [:foo]}, false)[:color][0].to_s).to \
115
- eq('#AABBCCFF')
110
+ eq('#abc')
116
111
  end
117
112
 
118
113
  it 'pulls custom colors even when a string' do
119
114
  @deck.custom_colors['foo'] = '#abc'
120
115
  expect(@deck.send(:colorify, {color: ['foo']}, false)[:color][0].to_s).to \
121
- eq('#AABBCCFF')
116
+ eq('#abc')
122
117
  end
123
118
  end
124
119
 
@@ -181,6 +176,13 @@ describe Squib::InputHelpers do
181
176
  expect(opts).to eq({:x => [236.2204722] }) #assume 300dpi default
182
177
  end
183
178
 
179
+ it 'handles non-expading singletons' do
180
+ args = {margin: '1in', trim: '1in', gap: '1in'}
181
+ needed_params = [:margin, :trim, :gap]
182
+ opts = @deck.send(:convert_units, args, needed_params)
183
+ expect(opts).to eq({margin: 300, trim: 300, gap: 300}) #assume 300dpi default
184
+ end
185
+
184
186
  end
185
187
 
186
188
  context '#rowify' do
@@ -44,15 +44,17 @@ describe "Squib samples" do
44
44
  # FOR NOW!! These two I can't get working on Travis, so I'm disabling
45
45
  # Has to do with UTF-8 encoding of a special characters
46
46
  # layouts.rb
47
+ # These are samples that don't really need a regression log
48
+ # colors.rb
47
49
  # unicode.rb
48
50
  %w( autoscale_font.rb
49
51
  basic.rb
50
52
  cairo_access.rb
51
- colors.rb
52
53
  csv_import.rb
53
54
  custom_config.rb
54
55
  draw_shapes.rb
55
56
  excel.rb
57
+ gradients.rb
56
58
  hello_world.rb
57
59
  load_images.rb
58
60
  portrait-landscape.rb
@@ -44,6 +44,7 @@ def scrub_hex(str)
44
44
  .gsub(/#<Pango::FontDescription:.*>/,'')
45
45
  .gsub(/#<Cairo::ImageSurface:.*>/,'ImageSurface')
46
46
  .gsub(/#<Cairo::LinearPattern:.*>/,'LinearPattern')
47
+ .gsub(/#<Cairo::RadialPattern:.*>/,'RadialPattern')
47
48
  .gsub(/#<Cairo::Matrix:.*>/,'Matrix')
48
49
  .gsub(/#<RSVG::Handle.*>/,'RSVG::Handle')
49
50
  .gsub(/#<RSpec::Mocks::Double:.*>/,'MockDouble')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Meneely
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-13 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
@@ -221,6 +221,7 @@ extra_rdoc_files:
221
221
  - samples/custom_config.rb
222
222
  - samples/draw_shapes.rb
223
223
  - samples/excel.rb
224
+ - samples/gradients.rb
224
225
  - samples/hello_world.rb
225
226
  - samples/layouts.rb
226
227
  - samples/load_images.rb
@@ -242,6 +243,11 @@ files:
242
243
  - README.md
243
244
  - RELEASE TODO.md
244
245
  - Rakefile
246
+ - benchmarks/shiny-purse.png
247
+ - benchmarks/spanner.svg
248
+ - benchmarks/tons_of_png.rb
249
+ - benchmarks/tons_of_svg.rb
250
+ - benchmarks/tons_of_text.rb
245
251
  - bin/squib
246
252
  - lib/squib.rb
247
253
  - lib/squib/api/background.rb
@@ -252,11 +258,14 @@ files:
252
258
  - lib/squib/api/shapes.rb
253
259
  - lib/squib/api/text.rb
254
260
  - lib/squib/api/units.rb
261
+ - lib/squib/args/unit_conversion.rb
255
262
  - lib/squib/card.rb
256
263
  - lib/squib/commands/new.rb
257
264
  - lib/squib/constants.rb
258
265
  - lib/squib/deck.rb
259
266
  - lib/squib/graphics/background.rb
267
+ - lib/squib/graphics/cairo_context_wrapper.rb
268
+ - lib/squib/graphics/gradient_regex.rb
260
269
  - lib/squib/graphics/image.rb
261
270
  - lib/squib/graphics/save_doc.rb
262
271
  - lib/squib/graphics/save_images.rb
@@ -293,6 +302,8 @@ files:
293
302
  - samples/customconfig-imgdir/spanner2.svg
294
303
  - samples/draw_shapes.rb
295
304
  - samples/excel.rb
305
+ - samples/glass-heart.svg
306
+ - samples/gradients.rb
296
307
  - samples/grit.png
297
308
  - samples/hello_world.rb
298
309
  - samples/layouts.rb
@@ -314,6 +325,7 @@ files:
314
325
  - spec/api/api_data_spec.rb
315
326
  - spec/api/api_image_spec.rb
316
327
  - spec/api/api_text_spec.rb
328
+ - spec/args/unit_conversion_spec.rb
317
329
  - spec/commands/new_spec.rb
318
330
  - spec/data/csv/basic.csv
319
331
  - spec/data/csv/dup_cols.csv
@@ -337,11 +349,11 @@ files:
337
349
  - spec/data/samples/autoscale_font.rb.txt
338
350
  - spec/data/samples/basic.rb.txt
339
351
  - spec/data/samples/cairo_access.rb.txt
340
- - spec/data/samples/colors.rb.txt
341
352
  - spec/data/samples/csv_import.rb.txt
342
353
  - spec/data/samples/custom_config.rb.txt
343
354
  - spec/data/samples/draw_shapes.rb.txt
344
355
  - spec/data/samples/excel.rb.txt
356
+ - spec/data/samples/gradients.rb.txt
345
357
  - spec/data/samples/hello_world.rb.txt
346
358
  - spec/data/samples/layouts.rb.txt
347
359
  - spec/data/samples/load_images.rb.txt
@@ -354,6 +366,7 @@ files:
354
366
  - spec/data/samples/tgc_proofs.rb.txt
355
367
  - spec/data/samples/units.rb.txt
356
368
  - spec/deck_spec.rb
369
+ - spec/graphics/cairo_context_wrapper_spec.rb
357
370
  - spec/graphics/graphics_images_spec.rb
358
371
  - spec/graphics/graphics_save_doc_spec.rb
359
372
  - spec/graphics/graphics_shapes_spec.rb
@@ -385,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
398
  version: '0'
386
399
  requirements: []
387
400
  rubyforge_project:
388
- rubygems_version: 2.0.14
401
+ rubygems_version: 2.4.5
389
402
  signing_key:
390
403
  specification_version: 2
391
404
  summary: A Ruby DSL for prototyping card games
@@ -393,6 +406,7 @@ test_files:
393
406
  - spec/api/api_data_spec.rb
394
407
  - spec/api/api_image_spec.rb
395
408
  - spec/api/api_text_spec.rb
409
+ - spec/args/unit_conversion_spec.rb
396
410
  - spec/commands/new_spec.rb
397
411
  - spec/data/csv/basic.csv
398
412
  - spec/data/csv/dup_cols.csv
@@ -416,11 +430,11 @@ test_files:
416
430
  - spec/data/samples/autoscale_font.rb.txt
417
431
  - spec/data/samples/basic.rb.txt
418
432
  - spec/data/samples/cairo_access.rb.txt
419
- - spec/data/samples/colors.rb.txt
420
433
  - spec/data/samples/csv_import.rb.txt
421
434
  - spec/data/samples/custom_config.rb.txt
422
435
  - spec/data/samples/draw_shapes.rb.txt
423
436
  - spec/data/samples/excel.rb.txt
437
+ - spec/data/samples/gradients.rb.txt
424
438
  - spec/data/samples/hello_world.rb.txt
425
439
  - spec/data/samples/layouts.rb.txt
426
440
  - spec/data/samples/load_images.rb.txt
@@ -433,6 +447,7 @@ test_files:
433
447
  - spec/data/samples/tgc_proofs.rb.txt
434
448
  - spec/data/samples/units.rb.txt
435
449
  - spec/deck_spec.rb
450
+ - spec/graphics/cairo_context_wrapper_spec.rb
436
451
  - spec/graphics/graphics_images_spec.rb
437
452
  - spec/graphics/graphics_save_doc_spec.rb
438
453
  - spec/graphics/graphics_shapes_spec.rb
@@ -1,124 +0,0 @@
1
- cairo: save([])
2
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=1.0, @green=1.0, @blue=1.0>])
3
- cairo: paint([])
4
- cairo: restore([])
5
- cairo: save([])
6
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=1.0, @green=0.0, @blue=0.0>])
7
- cairo: translate([50, 50])
8
- cairo: rotate([0])
9
- cairo: translate([-50, -50])
10
- cairo: move_to([50, 50])
11
- pango: font_description=([])
12
- pango: text=(["3-hex"])
13
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
14
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
15
- pango: alignment=([#<Pango::Layout::Alignment left>])
16
- pango: justify=([false])
17
- pango: spacing=([0])
18
- cairo: update_pango_layout([MockDouble])
19
- cairo: update_pango_layout([MockDouble])
20
- cairo: show_pango_layout([MockDouble])
21
- cairo: restore([])
22
- cairo: save([])
23
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=1.0, @green=0.0, @blue=0.0>])
24
- cairo: translate([50, 100])
25
- cairo: rotate([0])
26
- cairo: translate([-50, -100])
27
- cairo: move_to([50, 100])
28
- pango: font_description=([])
29
- pango: text=(["3-hex (alpha)"])
30
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
31
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
32
- pango: alignment=([#<Pango::Layout::Alignment left>])
33
- pango: justify=([false])
34
- pango: spacing=([0])
35
- cairo: update_pango_layout([MockDouble])
36
- cairo: update_pango_layout([MockDouble])
37
- cairo: show_pango_layout([MockDouble])
38
- cairo: restore([])
39
- cairo: save([])
40
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=1.0, @green=0.0, @blue=0.0>])
41
- cairo: translate([50, 150])
42
- cairo: rotate([0])
43
- cairo: translate([-50, -150])
44
- cairo: move_to([50, 150])
45
- pango: font_description=([])
46
- pango: text=(["6-hex"])
47
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
48
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
49
- pango: alignment=([#<Pango::Layout::Alignment left>])
50
- pango: justify=([false])
51
- pango: spacing=([0])
52
- cairo: update_pango_layout([MockDouble])
53
- cairo: update_pango_layout([MockDouble])
54
- cairo: show_pango_layout([MockDouble])
55
- cairo: restore([])
56
- cairo: save([])
57
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.6, @red=1.0, @green=0.0, @blue=0.0>])
58
- cairo: translate([50, 200])
59
- cairo: rotate([0])
60
- cairo: translate([-50, -200])
61
- cairo: move_to([50, 200])
62
- pango: font_description=([])
63
- pango: text=(["8-hex(alpha) *"])
64
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
65
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
66
- pango: alignment=([#<Pango::Layout::Alignment left>])
67
- pango: justify=([false])
68
- pango: spacing=([0])
69
- cairo: update_pango_layout([MockDouble])
70
- cairo: update_pango_layout([MockDouble])
71
- cairo: show_pango_layout([MockDouble])
72
- cairo: restore([])
73
- cairo: save([])
74
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=1.0, @green=0.0, @blue=0.0>])
75
- cairo: translate([50, 250])
76
- cairo: rotate([0])
77
- cairo: translate([-50, -250])
78
- cairo: move_to([50, 250])
79
- pango: font_description=([])
80
- pango: text=(["12-hex"])
81
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
82
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
83
- pango: alignment=([#<Pango::Layout::Alignment left>])
84
- pango: justify=([false])
85
- pango: spacing=([0])
86
- cairo: update_pango_layout([MockDouble])
87
- cairo: update_pango_layout([MockDouble])
88
- cairo: show_pango_layout([MockDouble])
89
- cairo: restore([])
90
- cairo: save([])
91
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=0.6, @red=1.0, @green=0.0, @blue=0.0>])
92
- cairo: translate([50, 300])
93
- cairo: rotate([0])
94
- cairo: translate([-50, -300])
95
- cairo: move_to([50, 300])
96
- pango: font_description=([])
97
- pango: text=(["12-hex (alpha)"])
98
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
99
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
100
- pango: alignment=([#<Pango::Layout::Alignment left>])
101
- pango: justify=([false])
102
- pango: spacing=([0])
103
- cairo: update_pango_layout([MockDouble])
104
- cairo: update_pango_layout([MockDouble])
105
- cairo: show_pango_layout([MockDouble])
106
- cairo: restore([])
107
- cairo: save([])
108
- cairo: set_source_color([#<Cairo::Color::RGB: @alpha=1.0, @red=0.8, @green=0.333333333333333, @blue=0.0>])
109
- cairo: translate([50, 350])
110
- cairo: rotate([0])
111
- cairo: translate([-50, -350])
112
- cairo: move_to([50, 350])
113
- pango: font_description=([])
114
- pango: text=(["Symbols of constants too"])
115
- pango: wrap=([#<Pango::Layout::WrapMode word-char>])
116
- pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>])
117
- pango: alignment=([#<Pango::Layout::Alignment left>])
118
- pango: justify=([false])
119
- pango: spacing=([0])
120
- cairo: update_pango_layout([MockDouble])
121
- cairo: update_pango_layout([MockDouble])
122
- cairo: show_pango_layout([MockDouble])
123
- cairo: restore([])
124
- surface: write_to_png(["_output/colors_0.png"])