-
Notifications
You must be signed in to change notification settings - Fork 0
/
003_MDG.rb
586 lines (457 loc) · 42.7 KB
/
003_MDG.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
require "prawn"
require "prawn-svg"
require "prawn/table"
#Name of File .rb
a = __FILE__
#Name of File .pdf
name_file = a[0..(a.size-4)] + ".pdf"
#PDF Page size
Page_size = "A4"
#PDF Page Margin
Page_margin = 50
# PDF Define =========================================================
#=====================================================================
#Sizes Default
#A4 = 595.28 - margin = 495.28
Page_size_x = 495.28
#A4 = 841.89 - margin = 741.89
Page_size_y = 741.89
#Ponto de Centro da Pagina
Center_page_x = Page_size_x/2
Center_page_y = Page_size_y/2
#Color List
#Page 000
#bg
Color_white = "FFFFFF"
#elemnt
Color_black = "000000"
Color_persian = "1C39BB"
#Page 001
#bg
Color_whitesmoke = "F5F5F5"
#elemnt
Color_light_blue = "008dd2"
Color_dark_blue = "01608c"
Color_light_green = "6eac15"
Color_dark_green = "498000"
Color_light_red = "df2a00"
Color_dark_red = "b62f00"
#Page 002
#elemnt
Color_nero = "252525"
# Methods ============================================================
#=====================================================================
def Form_draw(x, y, sides, size)
if sides == 6
fill_polygon [x, y + 50 * size], [x - 43.3 * size, y + 25 * size], [x - 43.3 * size, y - 25 * size], [x, y - 50 * size], [x + 43.3 * size, y - 25 * size], [x + 43.3 * size, y + 25 * size]
end
end
def Default_Stroke(page_size_x, page_size_y, pos_x, pos_y, lengthgrid, colorgrid)
stroke_axis(
:at =>[pos_x, pos_y],
:height => page_size_y,
:width => page_size_x,
:step_length => lengthgrid,
:negative_axes_length => 0,
:color => colorgrid
)
end
def background_color(color)
tmp_color = fill_color
canvas do
fill_color color
fill_rectangle [bounds.left, bounds.top], bounds.right, bounds.top
end
fill_color tmp_color
end
# Pages ==============================================================
#=====================================================================
def page_number_000()
background_color(Color_white)
#BackGround Page
Form_draw(Center_page_x, Center_page_y, 6, 12)
fill_color Color_white
Form_draw(Center_page_x, Center_page_y, 6, 10.3)
#Metric Grid
5.times{
Default_Stroke(Page_size_x, Page_size_y, 0, 0, 100, '0000ff')
rotate(180, :origin => [Page_size_x, Page_size_y]) do
Default_Stroke(Page_size_x, Page_size_y, Page_size_x, Page_size_y, 100, '0000ff')
end
Default_Stroke(Page_size_x/2, Page_size_y/2, Page_size_x/4, Page_size_y/4, 50, Color_black)
rotate(180, :origin => [Page_size_x*3/4, Page_size_y*3/4]) do
Default_Stroke(Page_size_x/2, Page_size_y/2, Page_size_x*3/4, Page_size_y*3/4, 50, Color_black)
end
}
#Central Hexa
fill_color Color_persian
Form_draw(Center_page_x, Center_page_y+80, 6, 3)
fill_color Color_white
Form_draw(Center_page_x, Center_page_y+80, 6, 2)
fill_color Color_black
Form_draw(Center_page_x, Center_page_y+80, 6, 1)
#Draw Grid
i=0; while i < Page_size_x
j=0; while j < Page_size_y
fill_circle [i, j], 0.5
j += 10
end
i += 10
end
move_down 345
#Title
fill_color Color_black
font("Heavy_Data") do
fill_color Color_white
text "Mystical\nDigital\nGrimoire",
#:styles => [:bold],
:size => 65,
:align => :center
move_up 210
fill_color Color_black
text "Mystical\nDigital\nGrimoire",
:size => 65,
:align => :center
end
move_down 190
#SubTitle
local_width = 200
local_height = 50
#stroke_rectangle([Center_page_x - (local_width/2), cursor], local_width, local_height)
formatted_text_box [
{ :text => "Writed by", :font => "Conspiracy", :size => 12},
{ :text => " Architect ", :font => "Conspiracy_PR", :size => 16}
],
:align => :center,
:valign => :center,
:at => [Center_page_x - (local_width/2), cursor],
:width => local_width,
:height => local_height
start_new_page
end
def page_number_001()
background_color(Color_whitesmoke)
#Diagram in svg text
svg_001_001 = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="5205px" height="2130px" viewBox="-0.5 -0.5 5205 2130"><defs/><g><rect x="1400" y="462.5" width="1000" height="400" rx="60" ry="60" fill="#10739e" stroke="none" pointer-events="all"/><g fill="#FFFFFF" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="1899.5" y="644.5">Staging</text><text x="1899.5" y="784.5">(index)</text></g><rect x="0" y="462.5" width="1000" height="400" rx="60" ry="60" fill="#10739e" stroke="none" pointer-events="all"/><g fill="#FFFFFF" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="499.5" y="644.5">Working</text><text x="499.5" y="784.5">Directory</text></g><rect x="2800" y="462.5" width="1000" height="400" rx="60" ry="60" fill="#10739e" stroke="none" pointer-events="all"/><g fill="#FFFFFF" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="3299.5" y="644.5">Local</text><text x="3299.5" y="784.5">Repository</text></g><rect x="4200" y="462.5" width="1000" height="400" rx="60" ry="60" fill="#10739e" stroke="none" pointer-events="all"/><g fill="#FFFFFF" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="4699.5" y="644.5">Remote</text><text x="4699.5" y="784.5">Repository</text></g><path d="M 750 462.5 L 750 112.5 Q 750 62.5 800 62.5 L 1600 62.5 Q 1650 62.5 1650 112.5 L 1650 316.01" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 1650 401.01 L 1607.5 316.01 L 1692.5 316.01 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 2150 462.5 L 2150 112.5 Q 2150 62.5 2200 62.5 L 3000 62.5 Q 3050 62.5 3050 112.5 L 3050 316.01" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 3050 401.01 L 3007.5 316.01 L 3092.5 316.01 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 3550 462.5 L 3550 112.5 Q 3550 62.5 3600 62.5 L 4400 62.5 Q 4450 62.5 4450 112.5 L 4450 316.01" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 4450 401.01 L 4407.5 316.01 L 4492.5 316.01 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 1650 862.5 L 1650 1212.5 Q 1650 1262.5 1600 1262.5 L 800 1262.5 Q 750 1262.5 750 1212.5 L 750 1008.99" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 750 923.99 L 792.5 1008.99 L 707.5 1008.99 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 4450 862.5 L 4450 1212.5 Q 4450 1262.5 4400 1262.5 L 3600 1262.5 Q 3550 1262.5 3550 1212.5 L 3550 1008.99" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 3550 923.99 L 3592.5 1008.99 L 3507.5 1008.99 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 4450 862.5 L 4450 1612.5 Q 4450 1662.5 4400 1662.5 L 3600 1662.5 Q 3550 1662.5 3550 1612.5 L 3550 1008.99" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 3550 923.99 L 3592.5 1008.99 L 3507.5 1008.99 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 3050 862.5 L 3050 1612.5 Q 3050 1662.5 3000 1662.5 L 800 1662.5 Q 750 1662.5 750 1612.5 L 750 1008.99" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 750 923.99 L 792.5 1008.99 L 707.5 1008.99 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><path d="M 4450 862.5 L 4450 2012.5 Q 4450 2062.5 4400 2062.5 L 800 2062.5 Q 750 2062.5 750 2012.5 L 750 1008.99" fill="none" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 750 923.99 L 792.5 1008.99 L 707.5 1008.99 Z" fill="#23445d" stroke="#23445d" stroke-width="55" stroke-miterlimit="10" pointer-events="all"/><rect x="800" y="62.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="1199.5" y="214.5">add</text></g><rect x="800" y="1062.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="1199.5" y="1214.5">reset</text></g><rect x="1500" y="1462.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="1899.5" y="1614.5">reset [commit]</text></g><rect x="3600" y="1462.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="3999.5" y="1614.5">pull</text></g><rect x="2200" y="62.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="2599.5" y="214.5">commit</text></g><rect x="3600" y="62.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="3999.5" y="214.5">push</text></g><rect x="3600" y="1062.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="3999.5" y="1214.5">fetch</text></g><rect x="2200" y="1862.5" width="800" height="200" rx="30" ry="30" fill="none" stroke="none" pointer-events="all"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="115px"><text x="2599.5" y="2014.5">pull</text></g></g></svg>'
local_width = 400
local_height = 60
#Ignora Margin
move_up 50
#Title
formatted_text_box [
{ :text => "GIT", :link => "https://git-scm.com/", :font => "Heavy_Data", :size => 60},
],
:align => :center,
:valign => :center,
:at => [Center_page_x - (local_width/2), cursor],
:width => local_width,
:height => local_height
move_down 60
#SVG Call
svg svg_001_001, position: :center, :width => 500
#SubTitle size
text_size_01 = 12
#Command size
text_size_02 = 11
column_box([0, cursor], :font => "Conspiracy_Bold", :columns => 2, :width => bounds.width) do
#===========================================
text "\nCreate", :style => :bold, :size => text_size_01
text "\nCreate a new local repository\n", :size => text_size_01
text "git init PROJECT_NAME\n", :style => :bold, :size => text_size_02, :color => Color_dark_blue
text "\nDownload repository\n", :size => text_size_01
text "git clone PROJECT_URL\n", :style => :bold, :size => text_size_02, :color => Color_dark_blue
#===========================================
text "\nStatus", :style => :bold, :size => text_size_01
text "\nList modified or new files\n", :size => text_size_01
text "git status\n", :style => :bold, :size => text_size_02, :color => Color_light_green
text "\nShow full change history\n", :size => text_size_01
text "git log\n", :style => :bold, :size => text_size_02, :color => Color_light_green
text "\nOutput the reflog of the HEAD\n", :size => text_size_01
text "git reflog\n", :style => :bold, :size => text_size_02, :color => Color_light_green
#===========================================
text "\nBranches", :style => :bold, :size => text_size_01
text "\nList all branches, local and remote\n", :size => text_size_01
text "git branch\n", :style => :bold, :size => text_size_02, :color => Color_dark_green
text "\nSwitch to a branch\n", :size => text_size_01
text "git checkout OTHER_BRANCH\n", :style => :bold, :size => text_size_02, :color => Color_dark_green
text "\nCreate a new branch\n", :size => text_size_01
text "git branch NEW_BRANCH\n", :style => :bold, :size => text_size_02, :color => Color_dark_green
text "\nDelete the branch called\n", :size => text_size_01
text "git branch -d OTHER_BRANCH\n", :style => :bold, :size => text_size_02, :color => Color_dark_green
text "\nMerge BRANCH_A into BRANCH_B\n", :size => text_size_01
text "git checkout BRANCH_B\n", :style => :bold, :size => text_size_02, :color => Color_dark_green
text "git merge BRANCH_A\n", :style => :bold, :size => text_size_02, :color => Color_dark_green
#===========================================
text "\n\nHelp", :style => :bold, :size => text_size_01
text "\nGit help command\n", :size => text_size_01
text "git command --help\n", :style => :bold, :size => text_size_02, :color => Color_light_blue
#===========================================
text "\nStage and Commit", :style => :bold, :size => text_size_01
text "\nStage files to commit\n", :size => text_size_01
text "git add FILE_NAME\n", :style => :bold, :size => text_size_02, :color => Color_light_red
text "\nUnstage file, keep file changes\n", :size => text_size_01
text "git reset\n", :style => :bold, :size => text_size_02, :color => Color_light_red
text "\nRevert everything to the last commit\n", :size => text_size_01
text "git reset --hard\n", :style => :bold, :size => text_size_02, :color => Color_light_red
text "\nCommit all stage files to version\n", :size => text_size_01
text 'git commit -m "commit text" -m "description"', :style => :bold, :size => text_size_02, :color => Color_light_red
#===========================================
text "\nGet the latest changes from origin\n", :size => text_size_01
text "git fetch\n", :style => :bold, :size => text_size_02, :color => Color_dark_red
text "\nFetch changes from origin and merge\n", :size => text_size_01
text "git pull\n", :style => :bold, :size => text_size_02, :color => Color_dark_red
text "\nPush local changes to the origin\n", :size => text_size_01
text "git push\n", :style => :bold, :size => text_size_02, :color => Color_dark_red
#===========================================
text "\nOther", :style => :bold, :size => text_size_01
text "\nShow what revision and author of a file\n", :size => text_size_01
text "git blame -b FILE_NAME | less\n", :style => :bold, :size => text_size_02, :color => Color_persian
text "\nRemove last commit unpushed\n", :size => text_size_01
text "git reset HEAD~1 --soft \n", :style => :bold, :size => text_size_02, :color => Color_persian
end
start_new_page
end
def page_number_002()
background_color(Color_nero)
#Diagram in svg text
svg_020_001 = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1816px" height="1897px" viewBox="-0.5 -0.5 1816 1897"><defs/><g><rect x="8" y="8" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 27px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">EAX</div></div></div></foreignObject><text x="4" y="32" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">EAX</text></switch></g><rect x="8" y="248" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 87px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">EBX</div></div></div></foreignObject><text x="4" y="92" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">EBX</text></switch></g><rect x="8" y="488" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 147px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">ECX</div></div></div></foreignObject><text x="4" y="152" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">ECX</text></switch></g><rect x="8" y="728" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 207px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">EDX</div></div></div></foreignObject><text x="4" y="212" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">EDX</text></switch></g><rect x="176" y="48" width="760" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 188px; height: 1px; padding-top: 27px; margin-left: 44px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">AX</div></div></div></foreignObject><text x="232" y="32" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">AX</text></switch></g><rect x="176" y="288" width="760" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 188px; height: 1px; padding-top: 87px; margin-left: 44px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">BX</div></div></div></foreignObject><text x="232" y="92" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">BX</text></switch></g><rect x="176" y="528" width="760" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 188px; height: 1px; padding-top: 147px; margin-left: 44px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">CX</div></div></div></foreignObject><text x="232" y="152" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">CX</text></switch></g><rect x="176" y="768" width="760" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 188px; height: 1px; padding-top: 207px; margin-left: 44px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">DX</div></div></div></foreignObject><text x="232" y="212" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">DX</text></switch></g><rect x="8" y="968" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 267px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">ESI</div></div></div></foreignObject><text x="4" y="272" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">ESI</text></switch></g><rect x="976" y="528" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 147px; margin-left: 244px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">CH</div></div></div></foreignObject><text x="337" y="152" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">CH</text></switch></g><rect x="1396" y="288" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 87px; margin-left: 349px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">BL</div></div></div></foreignObject><text x="442" y="92" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">BL</text></switch></g><rect x="1396" y="48" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 27px; margin-left: 349px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">AL</div></div></div></foreignObject><text x="442" y="32" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">AL</text></switch></g><rect x="976" y="288" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 87px; margin-left: 244px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">BH</div></div></div></foreignObject><text x="337" y="92" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">BH</text></switch></g><rect x="976" y="48" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 27px; margin-left: 244px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">AH</div></div></div></foreignObject><text x="337" y="32" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">AH</text></switch></g><rect x="976" y="768" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 207px; margin-left: 244px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">DH</div></div></div></foreignObject><text x="337" y="212" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">DH</text></switch></g><rect x="1396" y="528" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 147px; margin-left: 349px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">CL</div></div></div></foreignObject><text x="442" y="152" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">CL</text></switch></g><rect x="1396" y="768" width="380" height="120" rx="18" ry="18" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 93px; height: 1px; padding-top: 207px; margin-left: 349px;"><div style="box-sizing: border-box; font-size: 0; text-align: right; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">DL</div></div></div></foreignObject><text x="442" y="212" fill="#FFFFFF" font-family="Helvetica" font-size="15px" text-anchor="end" font-weight="bold">DL</text></switch></g><rect x="8" y="1208" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 327px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">EDI</div></div></div></foreignObject><text x="4" y="332" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">EDI</text></switch></g><rect x="8" y="1448" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 387px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; "><div>ESP (Stack Pointer) </div></div></div></div></foreignObject><text x="4" y="392" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">ESP (Stack Pointer) </text></switch></g><rect x="8" y="1688" width="1800" height="200" rx="30" ry="30" fill="none" stroke="#ffffff" stroke-width="16" pointer-events="all"/><g transform="translate(-0.5 -0.5)scale(4)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 448px; height: 1px; padding-top: 447px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: left; "><div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: #FFFFFF; line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; word-wrap: normal; ">EBP (Base Pointer)</div></div></div></foreignObject><text x="4" y="452" fill="#FFFFFF" font-family="Helvetica" font-size="15px" font-weight="bold">EBP (Base Pointer)</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text></a></switch></svg>'
#BackGround Draw
stroke_color Color_black
local_width = 50
local_height = 50
i = 0; while i < Page_size_x
j = -local_height*2; while j < Page_size_y + Page_margin
rotate(45,:origin => [i, j]) do
stroke_rectangle([i, j + local_height], local_width, local_height)
end
j += Page_size_y/21
end
i += Page_size_x/50
end
# Words Array
rules_array = [
"Magick is real.",
"Know yourself.",
"The best way to predict the future is to create it.",
"Question authority.",
"Magick is both an art and an experimental science.",
"Be watchful of what you do and say.",
"Intention controls Results.",
"Don’t invoke what you can’t banish.",
"Always consider the options.",
"The job isn’t done until you’ve put away the tools and cleaned up the mess.",
"Keep silent regarding a Magickal work for 24-hours"
]
#Draw Spiral
spiral_point = [Center_page_x, Center_page_y]
font "Conspiracy_Bold"
180.times do |i|
self.line_width = 7
fill_color 'aa00ff'
rotate(i * 7, origin: spiral_point) do
transparent(i.to_f / 100) do
draw_text " "+rules_array[i%10],
size: 12,
at: [spiral_point[0]+(i*3), spiral_point[1]]
end
end
end
#SVG Image Call
image_size = 250
svg svg_020_001,
at: [Center_page_x - image_size/2, Center_page_y + image_size/2],
width: image_size
start_new_page
end
def page_number_003()
background_color(Color_whitesmoke)
local_width = 170
local_height = 500
# Draw Side Walls
fill_color "000000"
fill_polygon [local_width, local_height + 240],
[local_width - 222, local_height + 35],
[local_width - 222, local_height - 145],
[local_width - 33, local_height - 135],
[local_width - 63, local_height - 100],
[local_width, local_height - 44],
[local_width + 188, local_height - 4],
[local_width + 212, local_height + 14]
# Draw North Wall
fill_color "050705"
fill_polygon [local_width, local_height + 240],
[local_width - 222, local_height + 35],
[local_width - 222, local_height - 5],
[local_width + 23, local_height + 77]
# Draw Floor
fill_color "555555"
fill_polygon [local_width + 10, local_height + 170],
[local_width - 162, local_height + 15],
[local_width - 63, local_height - 100],
[local_width, local_height - 44],
[local_width + 178, local_height - 5]
# Draw Stair Shadow
fill_color "050705"
fill_polygon [172, 450],
[172, 300],
[600, 300],
[600, 440]
# Draw Roof Planks
fill_color '000000'
stroke_color 'ffffff'
# Draw Left Planks
self.line_width = 7
floor_plank = [-118, 480]
for i in 1..7 do
floor_plank[0] += 36
floor_plank[1] += 34
rotate(133, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 300, 50
end
end
# Draw Right Planks
self.line_width = 7
floor_plank = [578, 318]
for i in 1..8 do
rotate(133, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 800, 50
end
floor_plank[1] += 73
end
#Draw Stair
self.line_width = 2
# Step #01
floor_plank = [172, 450]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 104, -12
end
# Step #02
floor_plank = [182, 450]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 105, -15
end
# Step #03
self.line_width = 3
floor_plank = [191, 452]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 115, -18
end
# Step #04
floor_plank = [202, 454]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 125, -21
end
# Step #05
floor_plank = [216, 456]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 160, -25
end
# Step #06
self.line_width = 4
floor_plank = [238, 458]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 170, -30
end
# Step #07
floor_plank = [264, 464]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 180, -32
end
# Step #08
floor_plank = [298, 468]
rotate(313, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 200, -44
end
# Step #09
self.line_width = 10
floor_plank = [500, 318]
rotate(133, origin: floor_plank) do
fill_and_stroke_rectangle floor_plank, 217, 50
end
# Draw Text Box with bg
fill_color '000000'
stroke_color Color_whitesmoke
local_width = -200
local_height = 375
fill_and_stroke_rectangle [local_width, local_height], 800, 500
# Draw Table bg
for i in 0..18 do
(i%2 == 1) ? (fill_color '030303') : (fill_color '000000')
fill_rectangle [-200, 370-i*19.43], 800, 20
puts i
end
# Draw Text Box without bg
local_width = -200
local_height = 375
stroke_rectangle [local_width, local_height], 800, 380
#Table Data
table_array = [
["/", " ", "root"],
["/bin", " ", "essential binaries"],
["/boot", " ", "static files of bootloader"],
["/dev", " ", "location of special or device files"],
["/etc", " ", "host specific system config"],
["/home", " ", "user home directories"],
["/lib", " ", "library and kernel modules"],
["/lost+found", " ", "files that get corrupted after crash"],
["/media", " ", "standard location for automounting devices"],
["/mnt", " ", "mount files for temporary filesystems"],
["/opt", " ", "add-on application filesystems"],
["/proc", " ", "process file system"],
["/root", " ", "home directory for root user"],
["/sbin", " ", "system binaries"],
["/srv", " ", "service files"],
["/sys", " ", "access device and device driver"],
["/tmp", " ", "temporary files deleted on bootup"],
["/usr", " ", "shareable and read-only data"],
["/var", " ", "variable data files"]
]
#Draw Table
move_cursor_to 370
font_size 10
font "Komika_Hand"
fill_color 'F5F5F5'
table(
table_array,
:position => :center,
:cell_style => { :borders => [] }
)
start_new_page
end
# PDF Creation =======================================================
#=====================================================================
Prawn::Document.generate( name_file, :page_size => Page_size, :margin => Page_margin ) do
#PDF Structure n Variables
#PDF Font Families
font_families.update("Heavy_Data" => {:normal => "support/Heavy_Data.ttf"})
font_families.update("Conspiracy" => {:normal => "support/Conspiracy.ttf"})
font_families.update("Conspiracy_PR" => {:normal => "support/Conspiracy_PR.ttf",})
font_families.update("Conspiracy_Bold" => {:normal => "support/Conspiracy_Bold.ttf",})
font_families.update("Komika_Hand" => {:normal => "support/Komika_Hand.ttf",})
#Pag Number
page_number_size = Page_margin/2
page_number_position_x = Page_size_x
page_number_position_y = 0
repeat(:all, :dynamic => true) do
unless page_number == 1
fill_color Color_white
fill_rectangle([page_number_position_x + page_number_size, page_number_position_y - page_number_size], page_number_size, page_number_size)
fill_color Color_black
stroke_rectangle([page_number_position_x + page_number_size, page_number_position_y - page_number_size], page_number_size, page_number_size)
formatted_text_box [
{ :text => "#{page_number-1}", :font => "Helvetica", :anchor => 'Cod000', :size => 16},
],
:align => :center,
:valign => :center,
:at => [page_number_position_x + page_number_size, page_number_position_y - page_number_size],
:width => page_number_size,
:height => page_number_size
end
end
add_dest "Cod000", dest_xyz(bounds.absolute_left, y)
#Pages
page_number_000()
page_number_001()
page_number_002()
page_number_003()
end