squib 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (392) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -2
  3. data/CHANGELOG.md +16 -1
  4. data/appveyor.yml +2 -3
  5. data/lib/squib/args/sheet.rb +66 -34
  6. data/lib/squib/graphics/save_pdf.rb +1 -1
  7. data/lib/squib/import/data_frame.rb +7 -7
  8. data/lib/squib/version.rb +1 -1
  9. data/samples/autoscale_font/_autoscale_font.rb +1 -1
  10. data/samples/build_groups/build_groups.rb +3 -3
  11. data/samples/colors/_colors.rb +1 -0
  12. data/samples/{config_text_markup.rb → config/config_text_markup.rb} +0 -0
  13. data/samples/{custom_config.rb → config/custom_config.rb} +0 -0
  14. data/samples/{cairo_access.rb → images/_cairo_access.rb} +0 -0
  15. data/samples/images/_images.rb +1 -1
  16. data/samples/{unicode.rb → images/_unicode.rb} +0 -0
  17. data/samples/intro/01_hello.rb +1 -2
  18. data/samples/intro/02_options.rb +1 -2
  19. data/samples/intro/03_layout.rb +1 -2
  20. data/samples/intro/04_arrays.rb +1 -2
  21. data/samples/intro/05_excel.rb +3 -4
  22. data/samples/{tgc_proofs.rb → proofs/_tgc_proofs.rb} +1 -4
  23. data/samples/saves/_save_pdf.rb +7 -0
  24. data/samples/{embed_text.rb → text/_embed_text.rb} +1 -0
  25. data/samples/text/_text.rb +1 -1
  26. data/samples/{text_options.rb → text/_text_options.rb} +1 -1
  27. data/samples/{bug134.rb → text/bug134.rb} +0 -0
  28. data/squib.gemspec +17 -16
  29. metadata +90 -596
  30. data/benchmarks/antialias_best.rb +0 -13
  31. data/benchmarks/antialias_best.yml +0 -1
  32. data/benchmarks/antialias_fast.rb +0 -13
  33. data/benchmarks/antialias_fast.yml +0 -1
  34. data/benchmarks/backend-svg.yml +0 -4
  35. data/benchmarks/backend_memory.rb +0 -14
  36. data/benchmarks/backend_svg.rb +0 -14
  37. data/benchmarks/shiny-purse.png +0 -0
  38. data/benchmarks/spanner.svg +0 -91
  39. data/benchmarks/tons_of_png.rb +0 -6
  40. data/benchmarks/tons_of_svg.rb +0 -7
  41. data/benchmarks/tons_of_text.rb +0 -8
  42. data/docs/Makefile +0 -216
  43. data/docs/_static/css/squibdocs.css +0 -23
  44. data/docs/args/draw.rst +0 -36
  45. data/docs/args/expansion.rst +0 -3
  46. data/docs/args/layout.rst +0 -6
  47. data/docs/args/output_dir.rst +0 -6
  48. data/docs/args/range.rst +0 -6
  49. data/docs/args/transform.rst +0 -51
  50. data/docs/args/trim.rst +0 -11
  51. data/docs/args/wh.rst +0 -12
  52. data/docs/args/xy.rst +0 -12
  53. data/docs/arrays.rst +0 -80
  54. data/docs/backends.rst +0 -20
  55. data/docs/bleed.rst +0 -13
  56. data/docs/build_groups.rst +0 -45
  57. data/docs/colors.rst +0 -90
  58. data/docs/conf.py +0 -287
  59. data/docs/config.rst +0 -135
  60. data/docs/data.rst +0 -26
  61. data/docs/dsl/background.rst +0 -20
  62. data/docs/dsl/build.rst +0 -32
  63. data/docs/dsl/build_groups.rst +0 -23
  64. data/docs/dsl/circle.rst +0 -27
  65. data/docs/dsl/cm.rst +0 -19
  66. data/docs/dsl/configure.rst +0 -18
  67. data/docs/dsl/csv.rst +0 -81
  68. data/docs/dsl/curve.rst +0 -63
  69. data/docs/dsl/data_frame.rst +0 -85
  70. data/docs/dsl/deck.rst +0 -45
  71. data/docs/dsl/disable_build.rst +0 -25
  72. data/docs/dsl/disable_build_globally.rst +0 -46
  73. data/docs/dsl/ellipse.rst +0 -23
  74. data/docs/dsl/enable_build.rst +0 -25
  75. data/docs/dsl/enable_build_globally.rst +0 -44
  76. data/docs/dsl/grid.rst +0 -31
  77. data/docs/dsl/hand.rst +0 -40
  78. data/docs/dsl/hint.rst +0 -15
  79. data/docs/dsl/inches.rst +0 -19
  80. data/docs/dsl/index.rst +0 -9
  81. data/docs/dsl/line.rst +0 -52
  82. data/docs/dsl/mm.rst +0 -19
  83. data/docs/dsl/png.rst +0 -49
  84. data/docs/dsl/polygon.rst +0 -28
  85. data/docs/dsl/rect.rst +0 -22
  86. data/docs/dsl/save.rst +0 -23
  87. data/docs/dsl/save_pdf.rst +0 -89
  88. data/docs/dsl/save_png.rst +0 -46
  89. data/docs/dsl/save_sheet.rst +0 -55
  90. data/docs/dsl/showcase.rst +0 -76
  91. data/docs/dsl/star.rst +0 -35
  92. data/docs/dsl/svg.rst +0 -119
  93. data/docs/dsl/text.rst +0 -292
  94. data/docs/dsl/triangle.rst +0 -50
  95. data/docs/dsl/use_layout.rst +0 -16
  96. data/docs/dsl/xlsx.rst +0 -56
  97. data/docs/guides/game_icons.rst +0 -126
  98. data/docs/guides/getting-started/index.rst +0 -5
  99. data/docs/guides/getting-started/part_0_learning_ruby.rst +0 -145
  100. data/docs/guides/getting-started/part_1_zero_to_game.rst +0 -217
  101. data/docs/guides/getting-started/part_2_iconography.rst +0 -228
  102. data/docs/guides/getting-started/part_3_workflows.rst +0 -46
  103. data/docs/guides/getting-started/part_4_ruby_power.rst +0 -18
  104. data/docs/guides/git.rst +0 -14
  105. data/docs/guides/guard.rst +0 -84
  106. data/docs/guides/hello_world.rst +0 -65
  107. data/docs/guides/projects.rst +0 -35
  108. data/docs/help.rst +0 -157
  109. data/docs/index.rst +0 -35
  110. data/docs/install.rst +0 -68
  111. data/docs/layouts.rst +0 -290
  112. data/docs/learning.rst +0 -12
  113. data/docs/make.bat +0 -263
  114. data/docs/parameters.rst +0 -34
  115. data/docs/server.bat +0 -1
  116. data/docs/text_feature.rst +0 -115
  117. data/docs/units.rst +0 -14
  118. data/samples/autoscale_font/.gitignore +0 -2
  119. data/samples/autoscale_font/card_00_expected.png +0 -0
  120. data/samples/backend/.gitignore +0 -1
  121. data/samples/backend/_backend-config.yml +0 -5
  122. data/samples/backend/backend_00_expected.png +0 -0
  123. data/samples/backend/backend_01_expected.png +0 -0
  124. data/samples/backend/backend_vectorized_expected.pdf +0 -0
  125. data/samples/backend/backend_vectors_00_expected.svg +0 -84
  126. data/samples/backend/backend_vectors_01_expected.svg +0 -84
  127. data/samples/backend/shiny-purse.png +0 -0
  128. data/samples/backend/showcase_expected.png +0 -0
  129. data/samples/backend/spanner.svg +0 -91
  130. data/samples/ball.png +0 -0
  131. data/samples/build_groups/.gitignore +0 -1
  132. data/samples/build_groups/Rakefile +0 -25
  133. data/samples/colors/.gitignore +0 -1
  134. data/samples/colors/color_constants_00_expected.png +0 -0
  135. data/samples/colors/colors_00_expected.png +0 -0
  136. data/samples/colors/gradient_00_expected.png +0 -0
  137. data/samples/config_disable_quotes.yml +0 -3
  138. data/samples/config_text_markup.yml +0 -9
  139. data/samples/custom-config.yml +0 -5
  140. data/samples/customconfig-imgdir/shiny-purse2.png +0 -0
  141. data/samples/customconfig-imgdir/spanner2.svg +0 -91
  142. data/samples/data/.gitignore +0 -1
  143. data/samples/data/explode_quantities.xlsx +0 -0
  144. data/samples/data/quantity_explosion.csv +0 -3
  145. data/samples/data/sample.csv +0 -3
  146. data/samples/data/sample.xlsx +0 -0
  147. data/samples/data/sample_csv_00_expected.png +0 -0
  148. data/samples/data/sample_csv_01_expected.png +0 -0
  149. data/samples/data/sample_csv_qty_00_expected.png +0 -0
  150. data/samples/data/sample_excel_00_expected.png +0 -0
  151. data/samples/data/sample_excel_01_expected.png +0 -0
  152. data/samples/data/sample_excel_02_expected.png +0 -0
  153. data/samples/data/sample_excel_resources_00_expected.png +0 -0
  154. data/samples/data/sample_excel_resources_01_expected.png +0 -0
  155. data/samples/data/sample_xlsx_qty_00_expected.png +0 -0
  156. data/samples/glass-heart.svg +0 -52
  157. data/samples/grit.png +0 -0
  158. data/samples/images/.gitignore +0 -8
  159. data/samples/images/_images_00_expected.png +0 -0
  160. data/samples/images/angler-fish.png +0 -0
  161. data/samples/images/ball.png +0 -0
  162. data/samples/images/glass-heart.svg +0 -52
  163. data/samples/images/grit.png +0 -0
  164. data/samples/images/offset.svg +0 -85
  165. data/samples/images/robot-golem.svg +0 -1
  166. data/samples/images/shiny-purse.png +0 -0
  167. data/samples/images/spanner.svg +0 -91
  168. data/samples/images/sprites.png +0 -0
  169. data/samples/images/with-alpha.png +0 -0
  170. data/samples/intro/.gitignore +0 -2
  171. data/samples/intro/auto-repair.svg +0 -1
  172. data/samples/intro/crawling.svg +0 -1
  173. data/samples/intro/data.xlsx +0 -0
  174. data/samples/intro/humans.svg +0 -1
  175. data/samples/intro/ninja-mask.svg +0 -1
  176. data/samples/intro/part1_00_expected.png +0 -0
  177. data/samples/intro/part2_00_expected.png +0 -0
  178. data/samples/intro/part3_00_expected.png +0 -0
  179. data/samples/intro/part3_layout.yml +0 -34
  180. data/samples/intro/part4_00_expected.png +0 -0
  181. data/samples/intro/part4_01_expected.png +0 -0
  182. data/samples/intro/part5_00_expected.png +0 -0
  183. data/samples/intro/part5_01_expected.png +0 -0
  184. data/samples/intro/part5_02_expected.png +0 -0
  185. data/samples/intro/part5_03_expected.png +0 -0
  186. data/samples/intro/part5_hand_expected.png +0 -0
  187. data/samples/intro/part5_showcase_expected.png +0 -0
  188. data/samples/intro/pirate-skull.svg +0 -1
  189. data/samples/intro/robot-golem.svg +0 -1
  190. data/samples/layouts/custom-layout.yml +0 -60
  191. data/samples/layouts/custom-layout2.yml +0 -15
  192. data/samples/layouts/expected_layouts_builtin_economy_00.png +0 -0
  193. data/samples/layouts/expected_layouts_builtin_fantasy_00.png +0 -0
  194. data/samples/layouts/expected_layouts_builtin_hand_00.png +0 -0
  195. data/samples/layouts/expected_layouts_builtin_playing_card_00.png +0 -0
  196. data/samples/layouts/expected_layouts_builtin_tuck_box_00.png +0 -0
  197. data/samples/layouts/shiny-purse.png +0 -0
  198. data/samples/layouts/spanner.svg +0 -91
  199. data/samples/load_images_config.yml +0 -1
  200. data/samples/offset.svg +0 -71
  201. data/samples/pokercard.png +0 -0
  202. data/samples/project/Gemfile +0 -6
  203. data/samples/project/Guardfile +0 -18
  204. data/samples/project/Rakefile +0 -25
  205. data/samples/project/bw/robot-golem.svg +0 -53
  206. data/samples/project/color/robot-golem.svg +0 -1
  207. data/samples/project/config.yml +0 -2
  208. data/samples/project/layouts/characters.yml +0 -3
  209. data/samples/project/layouts/skills.yml +0 -3
  210. data/samples/ranges/glass-heart.svg +0 -52
  211. data/samples/ranges/ranges_00_expected.png +0 -0
  212. data/samples/saves/.gitignore +0 -1
  213. data/samples/saves/hand_expected.png +0 -0
  214. data/samples/saves/hand_pretty_expected.png +0 -0
  215. data/samples/saves/save-pdf-small_expected.pdf +0 -0
  216. data/samples/saves/save-pdf_expected.pdf +0 -0
  217. data/samples/saves/save_png_00_expected.png +0 -0
  218. data/samples/saves/save_png_trimmed_00_expected.png +0 -0
  219. data/samples/saves/save_sheet_00_expected.png +0 -0
  220. data/samples/saves/save_sheet_01_expected.png +0 -0
  221. data/samples/saves/save_sheet_range_00_expected.png +0 -0
  222. data/samples/saves/save_sheet_range_01_expected.png +0 -0
  223. data/samples/saves/save_single_sheet_00_expected.png +0 -0
  224. data/samples/saves/saves_notrim_01_expected.png +0 -0
  225. data/samples/saves/showcase2_expected.png +0 -0
  226. data/samples/saves/showcase_expected.png +0 -0
  227. data/samples/saves/showcase_individual_00_expected.png +0 -0
  228. data/samples/saves/showcase_individual_01_expected.png +0 -0
  229. data/samples/saves/showcase_individual_02_expected.png +0 -0
  230. data/samples/saves/showcase_individual_03_expected.png +0 -0
  231. data/samples/saves/spanner.svg +0 -91
  232. data/samples/shapes/.gitignore +0 -1
  233. data/samples/shapes/shape_00_expected.png +0 -0
  234. data/samples/shiny-purse.png +0 -0
  235. data/samples/spanner.svg +0 -91
  236. data/samples/sprites.png +0 -0
  237. data/samples/text/.gitignore +0 -2
  238. data/samples/text/README.md +0 -1
  239. data/samples/text/_text_00_expected.png +0 -0
  240. data/samples/text/config.yml +0 -2
  241. data/samples/units/units_00_expected.png +0 -0
  242. data/samples/units/using_units.yml +0 -10
  243. data/spec/api/api_data_spec.rb +0 -172
  244. data/spec/api/api_groups_spec.rb +0 -49
  245. data/spec/api/api_settings_spec.rb +0 -38
  246. data/spec/api/api_units_spec.rb +0 -37
  247. data/spec/args/box_spec.rb +0 -127
  248. data/spec/args/draw_spec.rb +0 -101
  249. data/spec/args/embed_key_spec.rb +0 -13
  250. data/spec/args/input_file_spec.rb +0 -21
  251. data/spec/args/paint_spec.rb +0 -22
  252. data/spec/args/paragraph_spec.rb +0 -153
  253. data/spec/args/range_spec.rb +0 -41
  254. data/spec/args/save_batch_spec.rb +0 -51
  255. data/spec/args/scale_box_spec.rb +0 -71
  256. data/spec/args/sheet_spec.rb +0 -80
  257. data/spec/args/showcase_special_spec.rb +0 -15
  258. data/spec/args/transform_spec.rb +0 -25
  259. data/spec/args/typographer_spec.rb +0 -71
  260. data/spec/args/unit_conversion_spec.rb +0 -29
  261. data/spec/card_spec.rb +0 -11
  262. data/spec/commands/new_spec.rb +0 -48
  263. data/spec/conf_spec.rb +0 -47
  264. data/spec/data/conf/basic.yml +0 -1
  265. data/spec/data/conf/empty.yml +0 -1
  266. data/spec/data/conf/unrecognized.yml +0 -4
  267. data/spec/data/csv/basic.csv +0 -3
  268. data/spec/data/csv/custom_opts.csv +0 -2
  269. data/spec/data/csv/dup_cols.csv +0 -3
  270. data/spec/data/csv/newline.csv +0 -3
  271. data/spec/data/csv/qty.csv +0 -3
  272. data/spec/data/csv/qty_named.csv +0 -3
  273. data/spec/data/csv/with_spaces.csv +0 -3
  274. data/spec/data/csv/yield.csv +0 -3
  275. data/spec/data/layouts/easy-circular-extends.yml +0 -6
  276. data/spec/data/layouts/empty-rule.yml +0 -1
  277. data/spec/data/layouts/empty.yml +0 -1
  278. data/spec/data/layouts/extends-nonexists.yml +0 -3
  279. data/spec/data/layouts/extends-units-mixed.yml +0 -8
  280. data/spec/data/layouts/extends-units.yml +0 -8
  281. data/spec/data/layouts/hard-circular-extends.yml +0 -9
  282. data/spec/data/layouts/multi-extends-single-entry.yml +0 -14
  283. data/spec/data/layouts/multi-level-extends.yml +0 -10
  284. data/spec/data/layouts/multifile-a.yml +0 -4
  285. data/spec/data/layouts/multifile-b.yml +0 -4
  286. data/spec/data/layouts/multifile-extends-a.yml +0 -8
  287. data/spec/data/layouts/multifile-extends-b.yml +0 -9
  288. data/spec/data/layouts/no-extends.yml +0 -5
  289. data/spec/data/layouts/pre-extends.yml +0 -7
  290. data/spec/data/layouts/self-circular-extends.yml +0 -3
  291. data/spec/data/layouts/single-extends.yml +0 -7
  292. data/spec/data/layouts/single-level-multi-extends.yml +0 -12
  293. data/spec/data/samples/autoscale_font/_autoscale_font.rb.txt +0 -133
  294. data/spec/data/samples/basic.rb.txt +0 -248
  295. data/spec/data/samples/cairo_access.rb.txt +0 -59
  296. data/spec/data/samples/colors/_gradients.rb.txt +0 -84
  297. data/spec/data/samples/config_text_markup.rb.txt +0 -74
  298. data/spec/data/samples/custom_config.rb.txt +0 -59
  299. data/spec/data/samples/data/_csv.rb.txt +0 -231
  300. data/spec/data/samples/data/_excel.rb.txt +0 -704
  301. data/spec/data/samples/embed_text.rb.txt +0 -431
  302. data/spec/data/samples/hello_world.rb.txt +0 -38
  303. data/spec/data/samples/images/_more_load_images.rb.txt +0 -335
  304. data/spec/data/samples/layouts.rb.txt +0 -489
  305. data/spec/data/samples/ranges/_ranges.rb.txt +0 -484
  306. data/spec/data/samples/saves/_hand.rb.txt +0 -594
  307. data/spec/data/samples/saves/_portrait_landscape.rb.txt +0 -57
  308. data/spec/data/samples/saves/_save_pdf.rb.txt +0 -1601
  309. data/spec/data/samples/saves/_saves.rb.txt +0 -873
  310. data/spec/data/samples/saves/_showcase.rb.txt +0 -5942
  311. data/spec/data/samples/shapes/_draw_shapes.rb.txt +0 -757
  312. data/spec/data/samples/text_options.rb.txt +0 -1158
  313. data/spec/data/samples/tgc_proofs.rb.txt +0 -102
  314. data/spec/data/samples/units/_units.rb.txt +0 -53
  315. data/spec/data/xlsx/basic.xlsx +0 -0
  316. data/spec/data/xlsx/explode_quantities.xlsx +0 -0
  317. data/spec/data/xlsx/formulas.xlsx +0 -0
  318. data/spec/data/xlsx/whitespace.xlsx +0 -0
  319. data/spec/data/xlsx/with_macros.xlsm +0 -0
  320. data/spec/deck_spec.rb +0 -73
  321. data/spec/graphics/cairo_context_wrapper_spec.rb +0 -104
  322. data/spec/graphics/embedding_utils_spec.rb +0 -73
  323. data/spec/graphics/graphics_save_doc_spec.rb +0 -74
  324. data/spec/import/data_frame_spec.rb +0 -251
  325. data/spec/layout_parser_spec.rb +0 -226
  326. data/spec/logger_spec.rb +0 -12
  327. data/spec/samples/_diffs/gitkeep.txt +0 -0
  328. data/spec/samples/diff-with-css.example.html +0 -39
  329. data/spec/samples/expected/autoscale_00.png +0 -0
  330. data/spec/samples/expected/autoscale_01.png +0 -0
  331. data/spec/samples/expected/autoscale_02.png +0 -0
  332. data/spec/samples/expected/backend_00.png +0 -0
  333. data/spec/samples/expected/backend_00.svg +0 -78
  334. data/spec/samples/expected/backend_01.png +0 -0
  335. data/spec/samples/expected/backend_01.svg +0 -78
  336. data/spec/samples/expected/basic_00.png +0 -0
  337. data/spec/samples/expected/basic_01.png +0 -0
  338. data/spec/samples/expected/basic_02.png +0 -0
  339. data/spec/samples/expected/cairo_access_00.png +0 -0
  340. data/spec/samples/expected/cairo_access_01.png +0 -0
  341. data/spec/samples/expected/card_00.png +0 -0
  342. data/spec/samples/expected/card_01.png +0 -0
  343. data/spec/samples/expected/colors_00.png +0 -0
  344. data/spec/samples/expected/config_disable_text_00.png +0 -0
  345. data/spec/samples/expected/config_text_00.png +0 -0
  346. data/spec/samples/expected/custom-config_00.png +0 -0
  347. data/spec/samples/expected/embed_00.png +0 -0
  348. data/spec/samples/expected/embed_multisheet_00.png +0 -0
  349. data/spec/samples/expected/gitkeep.txt +0 -0
  350. data/spec/samples/expected/gradient_00.png +0 -0
  351. data/spec/samples/expected/hand.png +0 -0
  352. data/spec/samples/expected/hand_pretty.png +0 -0
  353. data/spec/samples/expected/landscape_00.png +0 -0
  354. data/spec/samples/expected/layout2_00.png +0 -0
  355. data/spec/samples/expected/layout_00.png +0 -0
  356. data/spec/samples/expected/layout_builtin_hand_00.png +0 -0
  357. data/spec/samples/expected/layout_builtin_playing_card_00.png +0 -0
  358. data/spec/samples/expected/load_images_00.png +0 -0
  359. data/spec/samples/expected/portrait_00.png +0 -0
  360. data/spec/samples/expected/ranges_00.png +0 -0
  361. data/spec/samples/expected/sample_csv_00.png +0 -0
  362. data/spec/samples/expected/sample_csv_01.png +0 -0
  363. data/spec/samples/expected/sample_excel_00.png +0 -0
  364. data/spec/samples/expected/sample_excel_01.png +0 -0
  365. data/spec/samples/expected/sample_excel_02.png +0 -0
  366. data/spec/samples/expected/save_sheet_00.png +0 -0
  367. data/spec/samples/expected/save_sheet_01.png +0 -0
  368. data/spec/samples/expected/save_sheet_range_00.png +0 -0
  369. data/spec/samples/expected/save_sheet_range_01.png +0 -0
  370. data/spec/samples/expected/save_single_sheet_00.png +0 -0
  371. data/spec/samples/expected/saves_notrim_01.png +0 -0
  372. data/spec/samples/expected/shape_00.png +0 -0
  373. data/spec/samples/expected/showcase.png +0 -0
  374. data/spec/samples/expected/showcase2.png +0 -0
  375. data/spec/samples/expected/showcase_individual_00.png +0 -0
  376. data/spec/samples/expected/showcase_individual_01.png +0 -0
  377. data/spec/samples/expected/showcase_individual_02.png +0 -0
  378. data/spec/samples/expected/showcase_individual_03.png +0 -0
  379. data/spec/samples/expected/text_00.png +0 -0
  380. data/spec/samples/expected/text_01.png +0 -0
  381. data/spec/samples/expected/text_02.png +0 -0
  382. data/spec/samples/expected/tgc_sample_00.png +0 -0
  383. data/spec/samples/expected/units_00.png +0 -0
  384. data/spec/samples/run_samples_spec.rb +0 -17
  385. data/spec/samples/samples_regression_spec.rb +0 -71
  386. data/spec/samples/sanity.html.erb +0 -28
  387. data/spec/samples/sanity.rb +0 -70
  388. data/spec/sanity/.gitignore +0 -1
  389. data/spec/sanity/sanity.html.erb +0 -42
  390. data/spec/sanity/sanity_test.rb +0 -42
  391. data/spec/sanity/tests.yml +0 -12
  392. data/spec/spec_helper.rb +0 -159
@@ -1,135 +0,0 @@
1
- Configuration Options
2
- =====================
3
-
4
- Squib supports various configuration properties that can be specified in an external file. By default, Squib looks for a file called ``config.yml`` in the current directory. Or, you can set the ``config:`` option in ``Deck.new`` to specify the name of the configuration file.
5
-
6
- These properties are intended to be immutable for the life of the Deck, and intended to configure how Squib behaves.
7
-
8
- The options include:
9
-
10
- progress_bars
11
- default: ``false``
12
-
13
- When set to ``true``, long-running operations will show a progress bar in the console
14
-
15
- hint
16
- default: ``:off``
17
-
18
- Text hints are used to show the boundaries of text boxes. Can be enabled/disabled for individual commands, or set globally with the `hint` method. This setting is overridden by `hint` (and subsequently individual :doc:`/dsl/text`).
19
-
20
- custom_colors
21
- default: ``{}``
22
-
23
- Defines globally-available named colors available to the deck. Must be specified as a hash in yaml. For example::
24
-
25
- # config.yml
26
- custom_colors:
27
- fg: '#abc'
28
- bg: '#def'
29
-
30
-
31
- antialias
32
- default: ``'best'``
33
-
34
- Set the algorithm that Cairo will use for anti-aliasing throughout its rendering. Available options are ``fast``, ``good``, ``best``, ``none``, ``gray``, ``subpixel``.
35
-
36
- Not every option is available on every platform. Using our benchmarks on large decks, `best` is only ~10% slower anyway. For more info see the `Cairo docs <http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t>`_.
37
-
38
- backend
39
- default: ``'memory'``
40
-
41
- Defines how Cairo will store the operations. Can be ``svg`` or ``memory``. See :doc:`/backends`.
42
-
43
- prefix
44
- default: ``'card_'``
45
-
46
- When using an SVG backend, cards are auto-saved with this prefix and ``'%02d'`` numbering format.
47
-
48
- img_dir
49
- default: ``'.'``
50
-
51
- For reading image file command (e.g. png and svg), read from this directory instead
52
-
53
- warn_ellipsize
54
- default: true
55
-
56
- Show a warning on the console when text is ellipsized. Warning is issued per card.
57
-
58
- warn_png_scale
59
- default: true
60
-
61
- Show a warning on the console when a PNG file is upscaled. Warning is issued per card.
62
-
63
- lsquote
64
- default: ``"\u2018"``
65
-
66
- Smart quoting: change the left single quote when ``markup: true``
67
-
68
- rsquote
69
- default: ``"\u2019"``
70
-
71
- Smart quoting: change the right single quote when ``markup: true``
72
-
73
- ldquote
74
- default: ``"\u201C"``
75
-
76
- Smart quoting: change the left double quote when ``markup: true``
77
-
78
- rdquote
79
- default: ``"\u201D"``
80
-
81
- Smart quoting: change the right double quote when ``markup: true``
82
-
83
- em_dash
84
- default: ``"\u2014"``
85
-
86
- Convert the ``--`` to this character when ``markup: true``
87
-
88
- en_dash
89
- default: ``"\u2013"``
90
-
91
- Convert the ``---`` to this character when ``markup: true``
92
-
93
-
94
- ellipsis
95
- default: ``"\u2026"``
96
-
97
- Convert ``...`` to this character when ``markup: true``
98
-
99
- smart_quotes
100
- default: true
101
-
102
- When ``markup: true``, the ``text`` method will convert quotes. With ``smart_quotes: false``, explicit replacements like em-dashes and en-dashes will be replaced but not smart quotes.
103
-
104
-
105
- Options are available as methods
106
- --------------------------------
107
-
108
- For debugging/sanity purposes, if you want to make sure your configuration options are parsed correctly, the above options are also available as methods within ``Squib::Deck``, for example::
109
-
110
- Squib::Deck.new do
111
- puts backend # prints 'memory' by default
112
- end
113
-
114
- These are read-only - you will not be able to change these.
115
-
116
- Squib.configure sets options programmatically
117
- ---------------------------------------------
118
-
119
- You can also use :doc:`/dsl/configure` to override anything in the config file. Use it like this:
120
-
121
- .. literalinclude:: ../samples/project/Rakefile
122
- :language: ruby
123
- :linenos:
124
-
125
-
126
- See :doc:`/guides/getting-started/part_3_workflows` for how we put this to good use.
127
-
128
- Making Squib Verbose
129
- --------------------
130
-
131
- By default, Squib's logger is set to ``WARN``, but more fine-grained logging is embedded in the code. To set the logger, just put this at the top of your script::
132
-
133
- Squib::logger.level = Logger::INFO
134
-
135
- If you REALLY want to see tons of output, you can also set DEBUG, but that's not intended for general consumption.
@@ -1,26 +0,0 @@
1
- Be Data-Driven with XLSX and CSV
2
- ================================
3
-
4
- Squib supports importing data from ExcelX (.xlsx) files and Comma-Separated Values (.csv) files. Because :doc:`/arrays`, these methods are column-based, which means that they assume you have a header row in your table, and that header row will define the name of the column.
5
-
6
- Squib::DataFrame, or a Hash of Arrays
7
- -------------------------------------
8
-
9
- In both DSL methods, Squib will return a "data frame" (literally of type ``Squib::DataFrame``). The best way to think of this is a ``Hash`` of ``Arrays``, where each column is a key in the hash, and every element of each Array represents a data point on a card.
10
-
11
- The data import methods expect you to structure your Excel sheet or CSV like this:
12
-
13
- * First row should be a header - preferably with concise naming since you'll reference it in Ruby code
14
- * Rows should represent cards in the deck
15
- * Columns represent data about cards (e.g. "Type", "Cost", or "Name")
16
-
17
- Of course, you can always import your game data other ways using just Ruby (e.g. from a REST API, a JSON file, or your own custom format). There's nothing special about Squib's methods in how they relate to ``Squib::Deck`` other than their convenience.
18
-
19
- See :doc:`/dsl/xlsx` and :doc:`/dsl/csv` for more details and examples on how the data can be imported.
20
-
21
- The ``Squib::DataFrame`` class provides much more than what a ``Hash`` provides, however. The :doc:`/dsl/data_frame`
22
-
23
- Quantity Explosion
24
- ------------------
25
-
26
- If you want more than one copy of a card, then have a column in your data file called ``Qty`` and fill it with counts for each card. Squib's :doc:`/dsl/xlsx` and :doc:`/dsl/xlsx` methods will automatically expand those rows according to those counts. You can also customize that "Qty" to anything you like by setting the `explode` option (e.g. ``explode: 'Quantity'``). Again, see the specific methods for examples.
@@ -1,20 +0,0 @@
1
- background
2
- ----------
3
-
4
- Fills the background with the given color
5
-
6
-
7
- Options
8
- ^^^^^^^
9
- .. include:: /args/expansion.rst
10
-
11
- .. include:: /args/range.rst
12
-
13
- color
14
- default: ``:black``
15
-
16
- the color or gradient to fill the background with. See :doc:`/colors`.
17
-
18
-
19
- Examples
20
- ^^^^^^^^
@@ -1,32 +0,0 @@
1
- build
2
- =====
3
-
4
- Establish a set of commands that can be enabled/disabled together to allow for customized builds. See :doc:`/build_groups` for ways to use this effectively.
5
-
6
- Required Arguments
7
- ------------------
8
-
9
- .. note::
10
-
11
- This is an argument, not an option like most DSL methods. See example below.
12
-
13
- group
14
- default: ``:all``
15
-
16
- The name of the build group. Convention is to use a Ruby symbol.
17
-
18
-
19
- &block
20
- When this group is enabled (and only ``:all`` is enabled by default), then this block is executed. Otherwise, the block is ignored.
21
-
22
-
23
- Examples
24
- --------
25
-
26
- Use group to organize your Squib code into build groups::
27
-
28
- Squib::Deck.new do
29
- build :pnp do
30
- save_pdf
31
- end
32
- end
@@ -1,23 +0,0 @@
1
- build_groups
2
- ============
3
-
4
- Returns the set of group names that have been enabled. See :doc:`/build_groups` for ways to use this effectively.
5
-
6
- Arguments
7
- ---------
8
-
9
- (none)
10
-
11
-
12
- Examples
13
- --------
14
-
15
- Use group to organize your Squib code into build groups::
16
-
17
- Squib::Deck.new do
18
- enable_build :pnp
19
- build :pnp do
20
- save_pdf
21
- end
22
- puts build_groups # outputs :all and :pnp
23
- end
@@ -1,27 +0,0 @@
1
- circle
2
- ------
3
-
4
- Draw a circle centered at the given coordinates
5
-
6
- Options
7
- ^^^^^^^
8
- .. include:: /args/expansion.rst
9
-
10
- .. include:: /args/xy.rst
11
-
12
- radius
13
- default: ``100``
14
-
15
- radius of the circle. Supports :doc:`/units`.
16
-
17
- .. include:: /args/draw.rst
18
- .. include:: /args/range.rst
19
- .. include:: /args/layout.rst
20
-
21
- Examples
22
- ^^^^^^^^
23
-
24
- .. literalinclude:: /../samples/shapes/_draw_shapes.rb
25
- :language: ruby
26
- :linenos:
27
- :caption: This snippet and others like it live `here <https://github.com/andymeneely/squib/blob/master/samples/>`_
@@ -1,19 +0,0 @@
1
- cm
2
- --
3
-
4
- Given centimeters, returns the number of pixels according to the deck's DPI.
5
-
6
- Parameters
7
- ^^^^^^^^^^
8
-
9
- n
10
- the number of centimeters
11
-
12
-
13
- Examples
14
- ^^^^^^^^
15
-
16
- .. code-block:: ruby
17
-
18
- cm(1) # 118.11px (for default Deck::dpi of 300)
19
- cm(2) + cm(1) # 354.33ox (for default Deck::dpi of 300)
@@ -1,18 +0,0 @@
1
- Squib.configure
2
- ---------------
3
-
4
- Prior to the construction of a Squib::Deck, set a global default that overrides what is specified `config.yml`.
5
-
6
- This is intended to be done prior to Squib::Deck.new, and is intended to be used inside of a Rakefile
7
-
8
- Options
9
- ^^^^^^^
10
-
11
- All options that are specified in :doc:`/config`
12
-
13
- Exmaples
14
- ^^^^^^^^
15
-
16
- .. literalinclude:: ../../samples/project/Rakefile
17
- :language: ruby
18
- :linenos:
@@ -1,81 +0,0 @@
1
- csv
2
- ===
3
-
4
- Pulls CSV data from .csv files into a hash of arrays keyed by the headers. First row is assumed to be the header row.
5
-
6
- Parsing uses Ruby's CSV, with options ``{headers: true, converters: :numeric}``
7
- http://www.ruby-doc.org/stdlib-2.0/libdoc/csv/rdoc/CSV.html
8
-
9
- The ``csv`` method is a member of ``Squib::Deck``, but it is also available outside of the Deck DSL with ``Squib.csv()``. This allows a construction like::
10
-
11
- data = Squib.csv file: 'data.csv'
12
- Squib::Deck.new(cards: data['name'].size) do
13
- end
14
-
15
-
16
- Options
17
- -------
18
-
19
- file
20
- default: ``'deck.csv'``
21
-
22
- the CSV-formatted file to open. Opens relative to the current directory. If ``data`` is set, this option is overridden.
23
-
24
- data
25
- default: ``nil``
26
-
27
- when set, CSV will parse this data instead of reading the file.
28
-
29
- strip
30
- default: ``true``
31
-
32
- When ``true``, strips leading and trailing whitespace on values and headers
33
-
34
- explode
35
- default: ``'qty'``
36
-
37
- Quantity explosion will be applied to the column this name. For example, rows in the csv with a ``'qty'`` of 3 will be duplicated 3 times.
38
-
39
- col_sep
40
- default: ``','``
41
-
42
- Column separator. One of the CSV custom options in Ruby. See next option below.
43
-
44
- CSV custom options in Ruby standard lib.
45
- All of the options in Ruby's std lib version of CSV are supported **except** ``headers`` is always ``true`` and ``converters`` is always set to ``:numeric``. See the `Ruby Docs <http://ruby-doc.org/stdlib-2.2.0/libdoc/csv/rdoc/CSV.html#method-c-new>`_ for information on the options.
46
-
47
- Individual Pre-processing
48
- -------------------------
49
-
50
- The ``xlsx`` method also takes in a block that will be executed for each cell in your data. This is useful for processing individual cells, like putting a dollar sign in front of dollars, or converting from a float to an integer. The value of the block will be what is assigned to that cell. For example::
51
-
52
- resource_data = Squib.csv(file: 'sample.xlsx') do |header, value|
53
- case header
54
- when 'Cost'
55
- "$#{value}k" # e.g. "3" becomes "$3k"
56
- else
57
- value # always return the original value if you didn't do anything to it
58
- end
59
- end
60
-
61
- Examples
62
- --------
63
-
64
-
65
- To get the sample Excel files, go to `its source <https://github.com/andymeneely/squib/tree/dev/samples/data>`_
66
-
67
- .. literalinclude:: ../../samples/data/_csv.rb
68
- :language: ruby
69
- :linenos:
70
-
71
- Here's the sample.csv
72
-
73
- .. literalinclude:: ../../samples/data/sample.csv
74
- :language: text
75
- :linenos:
76
-
77
- Here's the quantity_explosion.csv
78
-
79
- .. literalinclude:: ../../samples/data/quantity_explosion.csv
80
- :language: text
81
- :linenos:
@@ -1,63 +0,0 @@
1
- curve
2
- -----
3
-
4
- Draw a bezier curve using the given coordinates, from x1,y1 to x2,y2. The curvature is set by the control points cx1,cy2 and cx2,cy2.
5
-
6
- Options
7
- ^^^^^^^
8
- .. include:: /args/expansion.rst
9
-
10
- x1
11
- default: ``0``
12
-
13
- the x-coordinate of the first endpoint. Supports :doc:`/units`.
14
-
15
-
16
- y1
17
- default: ``0``
18
-
19
- the y-coordinate of the first endpoint. Supports :doc:`/units`.
20
-
21
-
22
- x2
23
- default: ``5``
24
-
25
- the x-coordinate of the second endpoint. Supports :doc:`/units`.
26
-
27
-
28
- y2
29
- default: ``5``
30
-
31
- the y-coordinate of the second endpoint. Supports :doc:`/units`.
32
-
33
-
34
- cx1
35
- default: ``0``
36
-
37
- the x-coordinate of the first control point. Supports :doc:`/units`.
38
-
39
-
40
- cy1
41
- default: ``0``
42
-
43
- the y-coordinate of the first control point. Supports :doc:`/units`.
44
-
45
-
46
- cx2
47
- default: ``5``
48
-
49
- the x-coordinate of the second control point. Supports :doc:`/units`.
50
-
51
-
52
- cy2
53
- default: ``5``
54
-
55
- the y-coordinate of the second control point. Supports :doc:`/units`.
56
-
57
-
58
- .. include:: /args/draw.rst
59
- .. include:: /args/range.rst
60
- .. include:: /args/layout.rst
61
-
62
- Examples
63
- ^^^^^^^^