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,80 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib/args/sheet'
3
-
4
- describe Squib::Args::Sheet do
5
-
6
- context 'dsl overrides' do
7
- subject(:sheet) { Squib::Args::Sheet.new({}, { file: 'foo' }) }
8
-
9
- it 'works when specified' do
10
- sheet.load!({}) # go right to defaults
11
- expect(sheet.file).to eq('foo') # dsl method default override
12
- end
13
-
14
- end
15
-
16
- context 'rows and colums' do
17
- subject(:sheet) { Squib::Args::Sheet.new({}, {}, 4) }
18
-
19
- it 'does nothing on a perfect fit' do
20
- opts = { columns: 2, rows: 2 }
21
- sheet.load! opts
22
- expect(sheet).to have_attributes(columns: 2, rows: 2)
23
- end
24
-
25
- it 'keeps both if specified' do
26
- opts = { columns: 1, rows: 1 }
27
- sheet.load! opts
28
- expect(sheet).to have_attributes(columns: 1, rows: 1)
29
- end
30
-
31
- it 'computes properly on non-integer' do
32
- opts = { columns: 1, rows: :infinite }
33
- sheet.load! opts
34
- expect(sheet).to have_attributes(columns: 1, rows: 4)
35
- end
36
-
37
- it 'computes properly on unspecified rows' do
38
- opts = { columns: 1 }
39
- sheet.load! opts
40
- expect(sheet).to have_attributes(columns: 1, rows: 4)
41
- end
42
-
43
- it 'computes properly on unspecified, too-big column' do
44
- opts = {}
45
- sheet.load! opts
46
- expect(sheet).to have_attributes(columns: 5, rows: 1)
47
- end
48
-
49
- it 'fails on a non-integer column' do
50
- opts = { columns: :infinite }
51
- expect { sheet.load!(opts) }.to raise_error('columns must be an integer')
52
- end
53
- end
54
-
55
- context 'crop marks' do
56
- subject(:sheet) { Squib::Args::Sheet.new({}, {}, 4) }
57
-
58
- it 'computes crop marks properly' do
59
- opts = {
60
- width: 1000,
61
- height: 1100,
62
- trim: 10,
63
- crop_margin_top: 20,
64
- crop_margin_left: 30,
65
- crop_margin_right: 40,
66
- crop_margin_bottom: 50,
67
- }
68
- expect(sheet.load!(opts).crop_coords(3,4, 300, 400)).to eq(
69
- [ {:x1=>43, :y1=>0, :x2=>43, :y2=>74},
70
- {:x1=>253, :y1=>0, :x2=>253, :y2=>74},
71
- {:x1=>43, :y1=>1100, :x2=>43, :y2=>1026},
72
- {:x1=>253, :y1=>1100, :x2=>253, :y2=>1026},
73
- {:x1=>0, :y1=>34, :x2=>74, :y2=>34},
74
- {:x1=>1000, :y1=>34, :x2=>926, :y2=>34},
75
- {:x1=>0, :y1=>344, :x2=>74, :y2=>344},
76
- {:x1=>1000, :y1=>344, :x2=>926, :y2=>344}]
77
- )
78
- end
79
- end
80
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib/args/showcase_special'
3
-
4
- describe Squib::Args::ShowcaseSpecial do
5
- subject(:showcase_special) { Squib::Args::ShowcaseSpecial.new }
6
-
7
- context '#face_right?' do
8
- it 'compares face to right' do
9
- opts = { face: 'LEFT ' }
10
- showcase_special.load! opts
11
- expect(showcase_special.face_right?).to be false
12
- end
13
- end
14
-
15
- end
@@ -1,25 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib/args/transform'
3
-
4
- describe Squib::Args::Box do
5
- subject(:trans) { Squib::Args::Transform.new }
6
- let(:expected_defaults) { { x: [0], y: [0], crop_width: [:native], crop_height: [:native] } }
7
-
8
- context 'validation' do
9
- it 'replaces with deck width and height' do
10
- args = { crop_width: :deck, crop_height: :deck }
11
- deck = OpenStruct.new(width: 123, height: 456)
12
- trans = Squib::Args::Transform.new(deck)
13
- trans.load!(args, expand_by: 1)
14
- expect(trans).to have_attributes(crop_width: [123], crop_height: [456])
15
- end
16
-
17
- it 'has radius override x_radius and y_radius' do
18
- args = { crop_corner_x_radius: 1, crop_corner_y_radius: 2, crop_corner_radius: 3 }
19
- trans.load!(args, expand_by: 2)
20
- expect(trans).to have_attributes(crop_corner_x_radius: [3, 3], crop_corner_y_radius: [3, 3])
21
- end
22
-
23
- end
24
-
25
- end
@@ -1,71 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib/args/typographer'
3
-
4
- describe Squib::Args::Typographer do
5
- subject(:t) { Squib::Args::Typographer.new }
6
-
7
- it 'does nothing on a non-quoted string' do
8
- expect(t.process(%{nothing})).to eq(%{nothing})
9
- end
10
-
11
- it 'left quotes at the beginning' do
12
- expect(t.process(%{"foo})).to eq(%{\u201Cfoo})
13
- end
14
-
15
- it 'left quotes in the middle of the string' do
16
- expect(t.process(%{hello "foo})).to eq(%{hello \u201Cfoo})
17
- end
18
-
19
- it 'right quotes at the end' do
20
- expect(t.process(%{foo"})).to eq(%{foo\u201D})
21
- end
22
-
23
- it 'handles the entire string quoted' do
24
- expect(t.process(%{"foo"})).to eq(%{\u201Cfoo\u201D})
25
- end
26
-
27
- it 'quotes in the middle of the string' do
28
- expect(t.process(%{hello "foo" world})).to eq(%{hello \u201Cfoo\u201D world})
29
- end
30
-
31
- it 'single left quotes at the beginning' do
32
- expect(t.process(%{'foo})).to eq(%{\u2018foo})
33
- end
34
-
35
- it 'single right quotes at the end' do
36
- expect(t.process(%{foo'})).to eq(%{foo\u2019})
37
- end
38
-
39
- it 'single quotes in the middle' do
40
- expect(t.process(%{a 'foo' bar})).to eq(%{a \u2018foo\u2019 bar})
41
- end
42
-
43
- it 'handles apostraphes' do
44
- expect(t.process(%{can't})).to eq(%{can\u2019t})
45
- end
46
-
47
- it 'single quotes inside double quotes' do
48
- expect(t.process(%{"'I can't do that', he said"})).to eq(%{\u201C\u2018I can\u2019t do that\u2019, he said\u201D})
49
- end
50
-
51
- it 'replaces the straightforward ones' do
52
- expect(t.process(%{``hi...'' -- ---})).to eq(%{\u201Chi\u2026\u201D \u2013 \u2014})
53
- end
54
-
55
- it 'does nothing on lone quotes' do
56
- expect(t.process(%{"})).to eq(%{"})
57
- expect(t.process(%{'})).to eq(%{'})
58
- end
59
-
60
- it 'ignores stuff in <tags>' do
61
- expect(t.process(%{<span weight="bold">"can't"</span>})).to eq(%{<span weight="bold">\u201Ccan\u2019t\u201D</span>})
62
- end
63
-
64
-
65
- context 'configured' do
66
- # TODO
67
- end
68
-
69
-
70
-
71
- end
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib/args/unit_conversion'
3
-
4
- describe Squib::Args::UnitConversion do
5
-
6
- it 'does nothing on just numbers' do
7
- expect(subject.parse(20)).to eq(20)
8
- end
9
-
10
- it 'strips trailing whitespace' do
11
- expect(subject.parse('1in ')).to eq(300)
12
- end
13
-
14
- it 'is ok w/internal whitesapce' do
15
- expect(subject.parse('1 in')).to eq(300)
16
- end
17
-
18
- it 'does cm' do
19
- expect(subject.parse('1cm')).to eq(118.1102361)
20
- expect(subject.parse('1cm ')).to eq(118.1102361)
21
- end
22
-
23
- it 'does mm' do
24
- expect(subject.parse('1mm')).to eq(11.81102361)
25
- expect(subject.parse('1mm ')).to eq(11.81102361)
26
- end
27
-
28
-
29
- end
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib/card'
3
-
4
- describe Squib::Card do
5
- it 'logs fatal for unknown backend' do
6
- deck = OpenStruct.new(dir: '.', prefix: '', count_format: '%02d', backend: 'broken robots')
7
-
8
- expect(Squib::logger).to receive(:fatal).with("Back end not recognized: 'broken robots'")
9
- expect { Squib::Card.new(deck, 100, 100, 0) }.to raise_error SystemExit
10
- end
11
- end
@@ -1,48 +0,0 @@
1
- require 'spec_helper'
2
- require 'squib'
3
-
4
- describe Squib::Commands::New do
5
-
6
- describe '#process' do
7
- before(:all) do
8
- @old_stderr = $stderr
9
- $stderr = StringIO.new
10
- @oldpwd = Dir.pwd
11
- Dir.chdir(output_dir)
12
- end
13
-
14
- before(:each) do
15
- FileUtils.rm_rf('foo', secure: true)
16
- @cmd = Squib::Commands::New.new
17
- end
18
-
19
- it 'raises an error if no directory was specified' do
20
- expect{@cmd.process([])}.to raise_error(ArgumentError, 'Please specify a path.')
21
- end
22
-
23
- it 'creates a new template on an fresh directory' do
24
- @cmd.process(['foo'])
25
- expect(File.exists?('foo/deck.rb')).to be true
26
- end
27
-
28
- it 'creates a new template on an empty directory' do
29
- Dir.mkdir('foo')
30
- @cmd.process(['foo'])
31
- expect(File.exists?('foo/deck.rb')).to be true
32
- end
33
-
34
- it 'does not create a new template on an empty ' do
35
- Dir.mkdir('foo')
36
- File.new('foo/somefile.txt', 'w+')
37
- @cmd.process(['foo'])
38
- $stderr.rewind
39
- expect($stderr.string.chomp).to end_with ' exists and is not empty. Doing nothing and quitting.'
40
- end
41
-
42
- after(:all) do
43
- $stderr = @old_stderr
44
- Dir.chdir(@oldpwd)
45
- end
46
- end
47
-
48
- end
@@ -1,47 +0,0 @@
1
- require 'squib'
2
- require 'spec_helper'
3
-
4
- describe Squib::Conf do
5
-
6
- it 'parses the project template file just fine' do
7
- conf = Squib::Conf.load project_template('config.yml')
8
- expect(conf.backend).to eq(Squib::Conf::DEFAULTS['backend'])
9
- end
10
-
11
- it 'parses an empty file' do
12
- conf = Squib::Conf.load conf('empty.yml')
13
- expect(conf.backend).to eq(Squib::Conf::DEFAULTS['backend'])
14
- end
15
-
16
- it 'parses the sample custom config' do
17
- conf = Squib::Conf.load sample_file('custom-config.yml')
18
- expect(conf.progress_bars).to be true
19
- expect(conf.text_hint).to eq '#FF0000'
20
- expect(conf.custom_colors).to eq({ 'foo' => '#ccc' })
21
- expect(conf.img_dir).to eq 'customconfig-imgdir'
22
- end
23
-
24
- it 'normalizes antialias automatically' do
25
- expect(Squib::Conf::DEFAULTS['antialias']).to eq 'best'
26
- expect(Squib::Conf.new.antialias).to eq 'subpixel'
27
- end
28
-
29
- it 'warns when the yml has an unrecognized option' do
30
- expect(Squib::logger).to receive(:warn).with('Unrecognized configuration option(s): unicorns')
31
- Squib::Conf.load conf('unrecognized.yml')
32
- end
33
-
34
- it 'helps Andy get full coverage with a test on to_s' do
35
- conf = Squib::Conf.load conf('empty.yml')
36
- expect(conf.to_s).to start_with 'Conf: '
37
- end
38
-
39
- it 'allows Squib.configure to override yml' do
40
- Squib.configure img_dir: 'color'
41
- c = Squib::Conf.load conf('basic.yml')
42
- expect(c.img_dir).to eq 'color'
43
- # reset our state to be nice
44
- Squib::USER_CONFIG.clear
45
- end
46
-
47
- end
@@ -1 +0,0 @@
1
- img_dir: bw
@@ -1 +0,0 @@
1
- # Intentionally empty
@@ -1,4 +0,0 @@
1
- # This is recognized, so it should be fine.
2
- backend: svg
3
- # This is not recognized.
4
- unicorns: true
@@ -1,3 +0,0 @@
1
- h1,h2
2
- 1,2
3
- 3,4
@@ -1,2 +0,0 @@
1
- x-y
2
- p-|q-r|
@@ -1,3 +0,0 @@
1
- h1,h1,h2,H2,h3
2
- 1,2,5,6,9
3
- 3,4,7,8,10
@@ -1,3 +0,0 @@
1
- title,level,notes
2
- Foo,1,"a
3
- b"
@@ -1,3 +0,0 @@
1
- Name,Qty
2
- Ha, 3
3
- Ho, 1
@@ -1,3 +0,0 @@
1
- Name,Quantity
2
- Ha, 3
3
- Ho, 1
@@ -1,3 +0,0 @@
1
- With Spaces ,h2,h3
2
- a b c , 2,3
3
- 3 ,4
@@ -1,3 +0,0 @@
1
- a,b
2
- foo%nbar,1
3
- 1,blah%n
@@ -1,6 +0,0 @@
1
- a:
2
- extends: b
3
- x: 50
4
- b:
5
- extends: a
6
- x: 150
@@ -1 +0,0 @@
1
- empty: #no rules actually set
@@ -1 +0,0 @@
1
- # testing for an empty yaml file here
@@ -1,3 +0,0 @@
1
- verbal:
2
- extends: kaisersoze
3
- font_size: 25
@@ -1,8 +0,0 @@
1
- parent:
2
- x: 0.5in
3
- y: 1in
4
-
5
- child:
6
- extends: parent
7
- x: += 1in
8
- y: -= 0.5in
@@ -1,8 +0,0 @@
1
- parent:
2
- x: 0.5in
3
- y: 1in
4
-
5
- child:
6
- extends: parent
7
- x: += 1in
8
- y: -= 0.5in
@@ -1,9 +0,0 @@
1
- a:
2
- extends: c
3
- x: 50
4
- b:
5
- extends: a
6
- x: 150
7
- c:
8
- extends: b
9
- y: 250
@@ -1,14 +0,0 @@
1
- aunt:
2
- a: 101
3
- b: 102
4
- c: 103
5
- uncle:
6
- x: 104
7
- y: 105
8
- b: 106
9
- child:
10
- extends:
11
- - uncle
12
- - aunt
13
- a: 107
14
- x: 108