scarpe 0.2.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (378) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +7 -1
  3. data/.yardopts +1 -0
  4. data/CHANGELOG.md +52 -6
  5. data/Gemfile +2 -1
  6. data/Gemfile.lock +20 -6
  7. data/LICENSE.txt +7 -1
  8. data/README.md +100 -21
  9. data/Rakefile +68 -1
  10. data/examples/Edit_box_Styles.rb +8 -0
  11. data/examples/Kerning.rb +7 -0
  12. data/examples/animate.rb +20 -0
  13. data/examples/arrow.rb +10 -0
  14. data/examples/border.rb +11 -0
  15. data/examples/btn_tooltip.rb +7 -0
  16. data/examples/button_style_changed.rb +7 -0
  17. data/examples/button_styles_default.rb +6 -0
  18. data/examples/check.rb +2 -0
  19. data/examples/download_and_show_image.rb +3 -0
  20. data/examples/flags/finland.rb +15 -0
  21. data/examples/flags/italy.rb +11 -0
  22. data/examples/flags/mauritius.rb +14 -0
  23. data/examples/font_family.rb +17 -0
  24. data/examples/font_shorthand.rb +9 -0
  25. data/examples/gen.rb +12 -8
  26. data/examples/highlander.rb +3 -3
  27. data/examples/legacy/README.md +6 -0
  28. data/examples/legacy/not_checked/shoes-contrib/basic/shoes-notes.rb +1 -1
  29. data/examples/legacy/not_checked/shoes-manual/append.rb +10 -0
  30. data/examples/legacy/not_checked/shoes-manual/background_change.rb +12 -0
  31. data/examples/legacy/not_checked/shoes-manual/background_pattern.rb +5 -0
  32. data/examples/legacy/not_checked/shoes-manual/basic_app.rb +8 -0
  33. data/examples/legacy/not_checked/shoes-manual/border.rb +9 -0
  34. data/examples/legacy/not_checked/shoes-manual/builtins/FONTS.rb +5 -0
  35. data/examples/legacy/not_checked/shoes-manual/builtins/ask.rb +2 -0
  36. data/examples/legacy/not_checked/shoes-manual/builtins/ask_color.rb +5 -0
  37. data/examples/legacy/not_checked/shoes-manual/builtins/ask_open_file.rb +5 -0
  38. data/examples/legacy/not_checked/shoes-manual/builtins/ask_save_folder.rb +2 -0
  39. data/examples/legacy/not_checked/shoes-manual/builtins/confirm.rb +4 -0
  40. data/examples/legacy/not_checked/shoes-manual/builtins/debug.rb +2 -0
  41. data/examples/legacy/not_checked/shoes-manual/builtins/info.rb +3 -0
  42. data/examples/legacy/not_checked/shoes-manual/button.rb +9 -0
  43. data/examples/legacy/not_checked/shoes-manual/clear.rb +7 -0
  44. data/examples/legacy/not_checked/shoes-manual/custom_header.rb +13 -0
  45. data/examples/legacy/not_checked/shoes-manual/displace.rb +14 -0
  46. data/examples/legacy/not_checked/shoes-manual/edit_box.rb +8 -0
  47. data/examples/legacy/not_checked/shoes-manual/fill_pattern.rb +5 -0
  48. data/examples/legacy/not_checked/shoes-manual/fonts.rb +7 -0
  49. data/examples/legacy/not_checked/shoes-manual/gutter.rb +6 -0
  50. data/examples/legacy/not_checked/shoes-manual/image_web.rb +4 -0
  51. data/examples/legacy/not_checked/shoes-manual/keypress.rb +7 -0
  52. data/examples/legacy/not_checked/shoes-manual/list_box.rb +10 -0
  53. data/examples/legacy/not_checked/shoes-manual/motion.rb +10 -0
  54. data/examples/legacy/not_checked/shoes-manual/mouse.rb +8 -0
  55. data/examples/legacy/not_checked/shoes-manual/move.rb +14 -0
  56. data/examples/legacy/not_checked/shoes-manual/nested_ovals.rb +8 -0
  57. data/examples/legacy/not_checked/shoes-manual/oval.rb +7 -0
  58. data/examples/legacy/not_checked/shoes-manual/ovals.rb +6 -0
  59. data/examples/legacy/not_checked/shoes-manual/ovals_image.rb +8 -0
  60. data/examples/legacy/not_checked/shoes-manual/prepend.rb +7 -0
  61. data/examples/legacy/not_checked/shoes-manual/progress_bar.rb +10 -0
  62. data/examples/legacy/not_checked/shoes-manual/radio.rb +18 -0
  63. data/examples/legacy/not_checked/shoes-manual/radio_alternative_1.rb +7 -0
  64. data/examples/legacy/not_checked/shoes-manual/radio_alternative_2.rb +9 -0
  65. data/examples/legacy/not_checked/shoes-manual/rotate_rectangle.rb +6 -0
  66. data/examples/legacy/not_checked/shoes-manual/shape.rb +11 -0
  67. data/examples/legacy/not_checked/shoes-manual/static/avatar.png +0 -0
  68. data/examples/legacy/not_checked/shoes-manual/stroke.rb +5 -0
  69. data/examples/legacy/not_checked/shoes-manual/style.rb +3 -0
  70. data/examples/legacy/not_checked/shoes-manual/style_alternative_1.rb +4 -0
  71. data/examples/legacy/not_checked/shoes-manual/style_alternative_2.rb +5 -0
  72. data/examples/legacy/not_checked/shoes-manual/style_length.rb +5 -0
  73. data/examples/legacy/not_checked/shoes-manual/timer.rb +6 -0
  74. data/examples/legacy/not_checked/shoes-manual/trigger_window.rb +8 -0
  75. data/examples/legacy/not_checked/shoes-manual/window_owner.rb +8 -0
  76. data/examples/legacy/not_checked/simple/anim-shapes.rb +1 -1
  77. data/examples/legacy/not_checked/speedometer_app.rb +55 -0
  78. data/examples/legacy/working/shoes_manual/alert_button.rb +2 -0
  79. data/examples/legacy/working/shoes_manual/animate.rb +7 -0
  80. data/examples/legacy/working/shoes_manual/background_para.rb +4 -0
  81. data/examples/legacy/working/shoes_manual/button_alternative.rb +7 -0
  82. data/examples/legacy/working/shoes_manual/checkbox.rb +17 -0
  83. data/examples/legacy/working/shoes_manual/download.rb +12 -0
  84. data/examples/legacy/working/shoes_manual/edit_box.rb +6 -0
  85. data/examples/legacy/working/shoes_manual/editline.rb +7 -0
  86. data/examples/legacy/working/shoes_manual/fixed_height.rb +8 -0
  87. data/examples/legacy/working/shoes_manual/fixed_width.rb +12 -0
  88. data/examples/legacy/working/shoes_manual/image.rb +5 -0
  89. data/examples/legacy/working/shoes_manual/instance_variable_check.rb +10 -0
  90. data/examples/legacy/working/shoes_manual/message.rb +18 -0
  91. data/examples/legacy/working/shoes_manual/rectangle.rb +6 -0
  92. data/examples/legacy/working/shoes_manual/save_download.rb +12 -0
  93. data/examples/legacy/working/shoes_manual/self_check.rb +10 -0
  94. data/examples/legacy/working/shoes_manual/stack.rb +7 -0
  95. data/examples/legacy/working/shoes_manual/style_info.rb +8 -0
  96. data/examples/legacy/working/shoes_manual/utf8_support.rb +8 -0
  97. data/examples/legacy/working/shoes_manual/width.rb +4 -0
  98. data/examples/legacy/working/simple/image-icon.rb +3 -0
  99. data/examples/legacy/{not_checked → working}/simple/image.rb +1 -1
  100. data/examples/list_box_choose.rb +17 -0
  101. data/examples/local_assets/local_file_server.rb +82 -0
  102. data/examples/local_assets/multi_image.rb +5 -0
  103. data/examples/local_assets/sample.gif +0 -0
  104. data/examples/local_assets/sample.mp4 +0 -0
  105. data/examples/local_assets/small.png +0 -0
  106. data/examples/local_fonts.rb +5 -2
  107. data/examples/local_images.rb +2 -3
  108. data/examples/margin.rb +13 -0
  109. data/examples/margin_check.rb +27 -0
  110. data/examples/oval-with-kwargs.rb +3 -0
  111. data/examples/oval.rb +26 -0
  112. data/examples/para/para_text.rb +14 -0
  113. data/examples/para_font_styles.rb +17 -0
  114. data/examples/para_font_variant.rb +6 -0
  115. data/examples/para_fontweight.rb +13 -0
  116. data/examples/parse_xl_funnies.rb +3 -0
  117. data/examples/progress.rb +31 -0
  118. data/examples/radio/radio_groups.rb +2 -2
  119. data/examples/rect.rb +4 -0
  120. data/examples/rotate_shapes.rb +17 -0
  121. data/examples/scarpe_ext.rb +3 -0
  122. data/examples/shapes/star.rb +1 -3
  123. data/examples/simpler-menu.rb +21 -0
  124. data/examples/spacing.rb +1 -1
  125. data/examples/span.rb +4 -2
  126. data/exe/scarpe +2 -1
  127. data/lacci/Gemfile +2 -0
  128. data/lacci/Gemfile.lock +8 -1
  129. data/lacci/lacci.gemspec +2 -2
  130. data/lacci/lib/lacci/scarpe_cli.rb +2 -2
  131. data/lacci/lib/lacci/scarpe_core.rb +2 -1
  132. data/lacci/lib/lacci/version.rb +1 -1
  133. data/lacci/lib/scarpe/niente/app.rb +23 -0
  134. data/lacci/lib/scarpe/niente/display_service.rb +66 -0
  135. data/lacci/lib/scarpe/niente/drawable.rb +59 -0
  136. data/lacci/lib/scarpe/niente/shoes_spec.rb +93 -0
  137. data/lacci/lib/scarpe/niente.rb +32 -0
  138. data/lacci/lib/shoes/app.rb +111 -72
  139. data/lacci/lib/shoes/background.rb +2 -2
  140. data/lacci/lib/shoes/border.rb +2 -2
  141. data/lacci/lib/shoes/builtins.rb +63 -0
  142. data/lacci/lib/shoes/changelog.rb +52 -0
  143. data/lacci/lib/shoes/colors.rb +3 -1
  144. data/lacci/lib/shoes/constants.rb +41 -2
  145. data/lacci/lib/shoes/display_service.rb +80 -18
  146. data/lacci/lib/shoes/download.rb +2 -2
  147. data/lacci/lib/shoes/drawable.rb +654 -0
  148. data/lacci/lib/shoes/drawables/arc.rb +27 -0
  149. data/lacci/lib/shoes/drawables/arrow.rb +21 -0
  150. data/lacci/lib/shoes/drawables/border.rb +28 -0
  151. data/lacci/lib/shoes/drawables/button.rb +57 -0
  152. data/lacci/lib/shoes/drawables/check.rb +33 -0
  153. data/lacci/lib/shoes/drawables/document_root.rb +20 -0
  154. data/lacci/lib/shoes/{widgets → drawables}/edit_box.rb +9 -8
  155. data/lacci/lib/shoes/{widgets → drawables}/edit_line.rb +8 -7
  156. data/lacci/lib/shoes/drawables/flow.rb +20 -0
  157. data/lacci/lib/shoes/drawables/font_helper.rb +62 -0
  158. data/lacci/lib/shoes/{widgets → drawables}/image.rb +7 -7
  159. data/lacci/lib/shoes/drawables/line.rb +17 -0
  160. data/lacci/lib/shoes/drawables/link.rb +31 -0
  161. data/lacci/lib/shoes/drawables/list_box.rb +59 -0
  162. data/lacci/lib/shoes/drawables/oval.rb +48 -0
  163. data/lacci/lib/shoes/drawables/para.rb +206 -0
  164. data/lacci/lib/shoes/drawables/progress.rb +15 -0
  165. data/lacci/lib/shoes/drawables/radio.rb +35 -0
  166. data/lacci/lib/shoes/drawables/rect.rb +18 -0
  167. data/lacci/lib/shoes/{widgets → drawables}/shape.rb +8 -8
  168. data/lacci/lib/shoes/drawables/slot.rb +178 -0
  169. data/lacci/lib/shoes/drawables/stack.rb +21 -0
  170. data/lacci/lib/shoes/drawables/star.rb +28 -0
  171. data/lacci/lib/shoes/drawables/subscription_item.rb +93 -0
  172. data/lacci/lib/shoes/drawables/text_drawable.rb +122 -0
  173. data/lacci/lib/shoes/drawables/video.rb +17 -0
  174. data/lacci/lib/shoes/drawables/widget.rb +74 -0
  175. data/lacci/lib/shoes/drawables.rb +32 -0
  176. data/lacci/lib/shoes/errors.rb +38 -0
  177. data/lacci/lib/shoes/log.rb +2 -2
  178. data/lacci/lib/shoes/margin_helper.rb +79 -0
  179. data/lacci/lib/shoes/ruby_extensions.rb +15 -0
  180. data/lacci/lib/shoes-spec.rb +93 -0
  181. data/lacci/lib/shoes.rb +31 -10
  182. data/lacci/test/.gitignore +1 -0
  183. data/lacci/test/test_draw_context.rb +167 -0
  184. data/lacci/test/test_font_helper.rb +57 -0
  185. data/lacci/test/test_helper.rb +81 -0
  186. data/lacci/test/test_lacci.rb +99 -3
  187. data/lacci/test/test_margin_helper.rb +82 -0
  188. data/lacci/test/test_niente_test_infra.rb +26 -0
  189. data/lacci/test/test_oval.rb +82 -0
  190. data/lacci/test/test_parenting.rb +140 -0
  191. data/lacci/test/test_shoes_errors.rb +49 -0
  192. data/lacci/test/test_text_drawables.rb +23 -0
  193. data/lib/scarpe/assets.rb +18 -0
  194. data/lib/scarpe/cats_cradle.rb +84 -103
  195. data/lib/scarpe/errors.rb +77 -0
  196. data/lib/scarpe/shoes_spec.rb +160 -0
  197. data/lib/scarpe/version.rb +2 -2
  198. data/lib/scarpe/wv/app.rb +21 -20
  199. data/lib/scarpe/wv/arc.rb +4 -51
  200. data/lib/scarpe/wv/arrow.rb +9 -0
  201. data/lib/scarpe/wv/border.rb +9 -18
  202. data/lib/scarpe/wv/button.rb +7 -35
  203. data/lib/scarpe/wv/check.rb +3 -5
  204. data/lib/scarpe/wv/control_interface.rb +20 -30
  205. data/lib/scarpe/wv/document_root.rb +81 -4
  206. data/lib/scarpe/wv/{widget.rb → drawable.rb} +71 -82
  207. data/lib/scarpe/wv/edit_box.rb +8 -18
  208. data/lib/scarpe/wv/edit_line.rb +9 -20
  209. data/lib/scarpe/wv/flow.rb +2 -18
  210. data/lib/scarpe/wv/image.rb +7 -30
  211. data/lib/scarpe/wv/line.rb +3 -25
  212. data/lib/scarpe/wv/link.rb +6 -17
  213. data/lib/scarpe/wv/list_box.rb +6 -29
  214. data/lib/scarpe/wv/oval.rb +13 -0
  215. data/lib/scarpe/wv/para.rb +12 -30
  216. data/lib/scarpe/wv/progress.rb +19 -0
  217. data/lib/scarpe/wv/radio.rb +9 -10
  218. data/lib/scarpe/wv/rect.rb +13 -0
  219. data/lib/scarpe/wv/scarpe_extensions.rb +8 -0
  220. data/lib/scarpe/wv/shape.rb +13 -13
  221. data/lib/scarpe/wv/slot.rb +8 -25
  222. data/lib/scarpe/wv/stack.rb +2 -18
  223. data/lib/scarpe/wv/star.rb +3 -53
  224. data/lib/scarpe/wv/subscription_item.rb +38 -4
  225. data/lib/scarpe/wv/text_drawable.rb +90 -0
  226. data/lib/scarpe/wv/video.rb +15 -15
  227. data/lib/scarpe/wv/web_wrangler.rb +320 -328
  228. data/lib/scarpe/wv/webview_local_display.rb +52 -33
  229. data/lib/scarpe/wv/webview_relay_display.rb +12 -12
  230. data/lib/scarpe/wv/webview_relay_util.rb +7 -10
  231. data/lib/scarpe/wv/wv_display_worker.rb +2 -2
  232. data/lib/scarpe/wv.rb +52 -12
  233. data/lib/scarpe/wv_local.rb +1 -1
  234. data/lib/scarpe/wv_relay.rb +1 -1
  235. data/lib/scarpe.rb +1 -0
  236. data/logger/debug_web_wrangler.json +1 -1
  237. data/logger/scarpe_wv_test.json +1 -1
  238. data/scarpe-components/Gemfile +4 -1
  239. data/scarpe-components/Gemfile.lock +85 -0
  240. data/scarpe-components/README.md +2 -2
  241. data/scarpe-components/assets/bootstrap-themes/bootstrap-cerulean.css +12229 -0
  242. data/scarpe-components/assets/bootstrap-themes/bootstrap-cosmo.css +11810 -0
  243. data/scarpe-components/assets/bootstrap-themes/bootstrap-cyborg.css +12210 -0
  244. data/scarpe-components/assets/bootstrap-themes/bootstrap-darkly.css +12153 -0
  245. data/scarpe-components/assets/bootstrap-themes/bootstrap-flatly.css +12126 -0
  246. data/scarpe-components/assets/bootstrap-themes/bootstrap-icons.min.css +5 -0
  247. data/scarpe-components/assets/bootstrap-themes/bootstrap-journal.css +12099 -0
  248. data/scarpe-components/assets/bootstrap-themes/bootstrap-litera.css +12211 -0
  249. data/scarpe-components/assets/bootstrap-themes/bootstrap-lumen.css +12369 -0
  250. data/scarpe-components/assets/bootstrap-themes/bootstrap-lux.css +11928 -0
  251. data/scarpe-components/assets/bootstrap-themes/bootstrap-materia.css +13184 -0
  252. data/scarpe-components/assets/bootstrap-themes/bootstrap-minty.css +12177 -0
  253. data/scarpe-components/assets/bootstrap-themes/bootstrap-morph.css +12750 -0
  254. data/scarpe-components/assets/bootstrap-themes/bootstrap-pulse.css +11890 -0
  255. data/scarpe-components/assets/bootstrap-themes/bootstrap-quartz.css +12622 -0
  256. data/scarpe-components/assets/bootstrap-themes/bootstrap-sandstone.css +12201 -0
  257. data/scarpe-components/assets/bootstrap-themes/bootstrap-simplex.css +12186 -0
  258. data/scarpe-components/assets/bootstrap-themes/bootstrap-sketchy.css +12451 -0
  259. data/scarpe-components/assets/bootstrap-themes/bootstrap-slate.css +12492 -0
  260. data/scarpe-components/assets/bootstrap-themes/bootstrap-solar.css +12149 -0
  261. data/scarpe-components/assets/bootstrap-themes/bootstrap-spacelab.css +12266 -0
  262. data/scarpe-components/assets/bootstrap-themes/bootstrap-superhero.css +12216 -0
  263. data/scarpe-components/assets/bootstrap-themes/bootstrap-united.css +12077 -0
  264. data/scarpe-components/assets/bootstrap-themes/bootstrap-vapor.css +12549 -0
  265. data/scarpe-components/assets/bootstrap-themes/bootstrap-yeti.css +12325 -0
  266. data/scarpe-components/assets/bootstrap-themes/bootstrap-zephyr.css +12283 -0
  267. data/scarpe-components/assets/bootstrap-themes/bootstrap.bundle.min.js +7 -0
  268. data/scarpe-components/lib/scarpe/components/asset_server.rb +219 -0
  269. data/scarpe-components/lib/scarpe/components/base64.rb +23 -5
  270. data/scarpe-components/lib/scarpe/components/calzini/alert.rb +49 -0
  271. data/scarpe-components/lib/scarpe/components/calzini/art_drawables.rb +227 -0
  272. data/scarpe-components/lib/scarpe/components/calzini/border.rb +38 -0
  273. data/scarpe-components/lib/scarpe/components/calzini/button.rb +37 -0
  274. data/scarpe-components/lib/scarpe/components/calzini/misc.rb +136 -0
  275. data/scarpe-components/lib/scarpe/components/calzini/para.rb +237 -0
  276. data/scarpe-components/lib/scarpe/components/calzini/slots.rb +109 -0
  277. data/scarpe-components/lib/scarpe/components/calzini.rb +236 -0
  278. data/scarpe-components/lib/scarpe/components/errors.rb +24 -0
  279. data/scarpe-components/lib/scarpe/components/file_helpers.rb +1 -0
  280. data/scarpe-components/lib/scarpe/components/html.rb +134 -0
  281. data/scarpe-components/lib/scarpe/components/minitest_export_reporter.rb +83 -0
  282. data/scarpe-components/lib/scarpe/components/minitest_import_runnable.rb +98 -0
  283. data/scarpe-components/lib/scarpe/components/minitest_result.rb +127 -0
  284. data/scarpe-components/lib/scarpe/components/modular_logger.rb +5 -5
  285. data/scarpe-components/lib/scarpe/components/print_logger.rb +22 -3
  286. data/scarpe-components/lib/scarpe/components/process_helpers.rb +37 -0
  287. data/scarpe-components/lib/scarpe/components/promises.rb +14 -14
  288. data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +36 -17
  289. data/scarpe-components/lib/scarpe/components/string_helpers.rb +10 -0
  290. data/scarpe-components/lib/scarpe/components/tiranti.rb +167 -0
  291. data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +48 -6
  292. data/scarpe-components/lib/scarpe/components/version.rb +2 -2
  293. data/scarpe-components/test/assets/big-image.png +0 -0
  294. data/scarpe-components/test/assets/big-stylesheet.css +497 -0
  295. data/scarpe-components/test/assets/little-image.png +0 -0
  296. data/scarpe-components/test/assets/little-stylesheet.css +1 -0
  297. data/scarpe-components/test/calzini/test_calzini_alert.rb +30 -0
  298. data/scarpe-components/test/calzini/test_calzini_art_drawables.rb +105 -0
  299. data/scarpe-components/test/calzini/test_calzini_button.rb +54 -0
  300. data/scarpe-components/test/calzini/test_calzini_misc.rb +115 -0
  301. data/scarpe-components/test/calzini/test_calzini_para.rb +34 -0
  302. data/scarpe-components/test/calzini/test_calzini_slots.rb +85 -0
  303. data/scarpe-components/test/calzini/test_calzini_text_drawables.rb +106 -0
  304. data/scarpe-components/test/calzini/test_various.rb +133 -0
  305. data/scarpe-components/test/mtr_data/exception.json +1 -0
  306. data/scarpe-components/test/mtr_data/fail_with_message.json +1 -0
  307. data/scarpe-components/test/mtr_data/skipped_no_message.json +1 -0
  308. data/scarpe-components/test/mtr_data/skipped_w_msg.json +1 -0
  309. data/scarpe-components/test/mtr_data/succeed_2_asserts.json +1 -0
  310. data/scarpe-components/test/test_asset_server.rb +72 -0
  311. data/scarpe-components/test/test_components.rb +31 -2
  312. data/scarpe-components/test/test_dimensions.rb +26 -0
  313. data/scarpe-components/test/test_helper.rb +20 -1
  314. data/scarpe-components/test/test_html.rb +65 -0
  315. data/scarpe-components/test/test_minitest_result.rb +68 -0
  316. data/scarpe-components/test/test_promises.rb +5 -4
  317. data/scarpe-components/test/test_segmented_app_files.rb +10 -6
  318. data/scarpegen.rb +14 -14
  319. data/sig/scarpe.rbs +1 -1
  320. data/tasks/check_html_fixtures.rb +140 -0
  321. data/tasks/regenerate_html_fixtures.rb +104 -0
  322. data/templates/basic_class_template.erb +13 -14
  323. data/templates/class_template_with_event_bind.erb +4 -4
  324. data/templates/class_template_with_shapes.erb +8 -28
  325. data/templates/example_template.erb +1 -1
  326. data/templates/module_template.erb +4 -4
  327. data/templates/webview_template.erb +3 -2
  328. metadata +286 -80
  329. data/examples/legacy/not_checked/shoes-contrib/elements/image-icon.rb +0 -3
  330. data/lacci/lib/shoes/spacing.rb +0 -9
  331. data/lacci/lib/shoes/widget.rb +0 -218
  332. data/lacci/lib/shoes/widgets/alert.rb +0 -19
  333. data/lacci/lib/shoes/widgets/arc.rb +0 -51
  334. data/lacci/lib/shoes/widgets/button.rb +0 -35
  335. data/lacci/lib/shoes/widgets/check.rb +0 -28
  336. data/lacci/lib/shoes/widgets/document_root.rb +0 -20
  337. data/lacci/lib/shoes/widgets/flow.rb +0 -22
  338. data/lacci/lib/shoes/widgets/font.rb +0 -14
  339. data/lacci/lib/shoes/widgets/line.rb +0 -18
  340. data/lacci/lib/shoes/widgets/link.rb +0 -25
  341. data/lacci/lib/shoes/widgets/list_box.rb +0 -25
  342. data/lacci/lib/shoes/widgets/para.rb +0 -68
  343. data/lacci/lib/shoes/widgets/radio.rb +0 -35
  344. data/lacci/lib/shoes/widgets/slot.rb +0 -75
  345. data/lacci/lib/shoes/widgets/span.rb +0 -26
  346. data/lacci/lib/shoes/widgets/stack.rb +0 -24
  347. data/lacci/lib/shoes/widgets/star.rb +0 -44
  348. data/lacci/lib/shoes/widgets/subscription_item.rb +0 -60
  349. data/lacci/lib/shoes/widgets/text_widget.rb +0 -51
  350. data/lacci/lib/shoes/widgets/video.rb +0 -15
  351. data/lacci/lib/shoes/widgets.rb +0 -29
  352. data/lib/scarpe/evented_assertions.rb +0 -88
  353. data/lib/scarpe/wv/alert.rb +0 -66
  354. data/lib/scarpe/wv/background.rb +0 -27
  355. data/lib/scarpe/wv/control_interface_test.rb +0 -238
  356. data/lib/scarpe/wv/dimensions.rb +0 -22
  357. data/lib/scarpe/wv/font.rb +0 -36
  358. data/lib/scarpe/wv/html.rb +0 -108
  359. data/lib/scarpe/wv/spacing.rb +0 -41
  360. data/lib/scarpe/wv/span.rb +0 -68
  361. data/lib/scarpe/wv/text_widget.rb +0 -30
  362. /data/examples/legacy/not_checked/{expert → shoes-contrib/basic}/definr.rb +0 -0
  363. /data/examples/legacy/not_checked/{expert → shoes-contrib/basic}/funnies.rb +0 -0
  364. /data/examples/legacy/not_checked/shoes-contrib/{elements → basic}/list_box-select-class.rb +0 -0
  365. /data/examples/legacy/{not_checked → working}/shoes3-tests/editline/editline.rb +0 -0
  366. /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/basic-edit-box.rb +0 -0
  367. /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/basic-fps.rb +0 -0
  368. /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/border-cat.rb +0 -0
  369. /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/check-mate.rb +0 -0
  370. /data/examples/legacy/{not_checked/shoes-contrib/manipulation → working/simple}/clear-slot.rb +0 -0
  371. /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/clock.rb +0 -0
  372. /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/gradient-shoes.rb +0 -0
  373. /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/list_box-shape-report.rb +0 -0
  374. /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/list_box.rb +0 -0
  375. /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/phat-button.rb +0 -0
  376. /data/examples/legacy/{not_checked/shoes-contrib → working}/simple/simple-calc.rb +0 -0
  377. /data/examples/legacy/{not_checked/shoes-contrib/position → working/simple}/stack-width.rb +0 -0
  378. /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/width-introspec.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b07033a939f5503cea0f357a5ac67f0df01833038c433933c4dd2984bcd15b76
4
- data.tar.gz: cc633f8adfe627f260e06371feae6d1b152f28c279db62576c82f5c16a44e1be
3
+ metadata.gz: 4d9a2f4008f1c1db114dc1b5f3b0331635b8021d878a3ca30d79a7c8bc6a00fd
4
+ data.tar.gz: 4d46f7680c7dcee6737c0ba6c9214ace6d81383b3238cc4c93c94521569cdc3f
5
5
  SHA512:
6
- metadata.gz: 105ea36e4f41d00d1e67ce3ff68cefac8195cc692225133e90382c770c2bfe393ee50c827b5feff0873f9d34cb54b35a11cf7e75994ec10b62d35f72ee0adb37
7
- data.tar.gz: ff5b648210d7d24e9114e3850529c10999091215aa5f7576e4ee26544797cb98e1f6a51642f39c4b638b7f4a55525bc463188a678265d4ff13f01a5af8d0f931
6
+ metadata.gz: f4b7b5279f422631643c9c53e98051abce6c85ab42ec4d1eee3e19dc0bb1c15a77ba6773c2e844bafa3313ea58138f4c855c4d8036f122863dbb5f57c226c10a
7
+ data.tar.gz: 71206dc45ab004580e009cc9ccc03c9af075721538dcf2bf7527dcdd5c2a428a5b84aa109c1f322480550b900c0376eea215515057aa3570ba9dea0e7b7539a1
data/.rubocop.yml CHANGED
@@ -7,7 +7,7 @@ AllCops:
7
7
  Exclude:
8
8
  - 'bin/**/*'
9
9
  - 'exe/**/*'
10
- - 'examples/**/*'
10
+ # - 'examples/**/*' Since I'm only doing this locally.
11
11
  - 'docs/**/*'
12
12
 
13
13
  Layout/LineLength:
@@ -19,6 +19,12 @@ Style/RedundantHeredocDelimiterQuotes:
19
19
  Style/MissingRespondToMissing:
20
20
  Enabled: false
21
21
 
22
+ Metrics/ParameterLists:
23
+ Enabled: false
24
+
25
+ Style/ParallelAssignment:
26
+ Enabled: false
27
+
22
28
 
23
29
 
24
30
  Style/MethodCallWithArgsParentheses:
data/.yardopts CHANGED
@@ -8,6 +8,7 @@
8
8
  --exclude lib/scarpe/glibui
9
9
  lib/**/*.rb
10
10
  lacci/lib/**/*.rb
11
+ scarpe-components/lib/**/*.rb
11
12
  -
12
13
  docs/yard/*.md
13
14
  docs/static/manual.md
data/CHANGELOG.md CHANGED
@@ -1,19 +1,65 @@
1
- ## [Unreleased]
1
+ ## [Unreleased Future]
2
2
 
3
3
  Here we write upgrading notes for brands. It's a team effort to make them as
4
4
  straightforward as possible.
5
5
 
6
- ### Added
6
+ ### Enhancements
7
+
8
+ ### Bugs Fixed
7
9
  - #-some-pr-number <description> @author-of-pr
8
10
 
9
- ### Changed
11
+ ### Incompatibilities
12
+
13
+ ## [0.3.1] - 2023-??-?? - Up
14
+
15
+ Lots of bug fixes. We're also still implementing major Shoes3 features.
16
+ Testing is finally improving at a reasonable rate, but we have a long
17
+ way to go.
18
+
19
+ The Scarpe architecture is still early. We've improved the internal APIs
20
+ for creating drawables significantly, added an asset server and are
21
+ still making big changes.
22
+
23
+ ### Enhancements
24
+
25
+ - Ovals!
26
+ - Lots more text methods: del, sub, sup; lots more text styles: underline, strikethrough, strikecolor, align
27
+ - Features! Shoes.app(feature: [:html, :scarpe]) lets apps declare dependencies on non-classic Shoes!
28
+ - Better handling of :left, :top, :width and :height, :margin and :padding on more drawables
29
+ - The html_class style is a feature to make it easier to do Bootstrap styling on your drawables
30
+ - Directly run Shoes Specs, including with Niente
31
+ - We use Minitest assertion DSL rather than our own everywhere now
32
+
33
+ ### Bugs Fixed
34
+
35
+ - We've changed "module Shoes" to "class Shoes" for Shoes3 compatibility.
36
+ - Several style and method names, including on Para and ListBox, changed to Shoes3 standard.
37
+
38
+ ### Incompatibilities
39
+
40
+ TextDrawables now draw with very different Calzini (HTML renderer) properties
41
+ We're deprecating the CatsCradle test DSL in favour of Shoes-Spec.
42
+ Some error names have changed, with more to come.
43
+ We've changed the Lacci drawable-create event to include the parent ID.
44
+
45
+ ## [0.3.0] - 2023-11-24 - You
46
+
47
+ - Progress bars
48
+ - Various new APIs and many bug fixes
49
+ - Added Tiranti, a Bootstrap-based Calzini HTML renderer replacement
50
+ - Added Calzini, a Drawable-to-HTML renderer
51
+ - Rename of Widget to Drawable
52
+ - Extremely early Shoes-Spec testing support
53
+ - Niente, a "no-op" testing display service
54
+
55
+ ## [0.2.1] - 2023-07-02 - Give
10
56
 
11
- ### Fixed
57
+ - Bugfix release
12
58
 
13
- ## [0.2.0] - 2022-07-02
59
+ ## [0.2.0] - 2023-07-02 - Gonna
14
60
 
15
61
  - First batch of functionality. Will aggressively track to changelog from here on out.
16
62
 
17
- ## [0.1.0] - 2022-02-09
63
+ ## [0.1.0] - 2023-02-09 - Never
18
64
 
19
65
  - Initial release
data/Gemfile CHANGED
@@ -21,7 +21,8 @@ group :development do
21
21
  gem "redcarpet"
22
22
  gem "debug"
23
23
  gem "rubocop", "~> 1.21"
24
- gem "rubocop-shopify"
24
+ gem "htmlbeautifier"
25
+ gem "diff-lcs"
25
26
  #gem "commonmarker"
26
27
  #gem "github-markup"
27
28
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scarpe (0.2.1)
4
+ scarpe (0.3.0)
5
5
  bloops (~> 0.5)
6
6
  fastimage
7
7
  lacci
@@ -9,17 +9,19 @@ PATH
9
9
  nokogiri
10
10
  scarpe-components
11
11
  sqlite3
12
+ webrick
12
13
  webview_ruby (~> 0.1.1)
13
14
 
14
15
  PATH
15
16
  remote: lacci
16
17
  specs:
17
- lacci (0.2.1)
18
+ lacci (0.3.0)
19
+ scarpe-components
18
20
 
19
21
  PATH
20
22
  remote: scarpe-components
21
23
  specs:
22
- scarpe-components (0.2.1)
24
+ scarpe-components (0.3.0)
23
25
 
24
26
  GEM
25
27
  remote: https://rubygems.org/
@@ -31,11 +33,13 @@ GEM
31
33
  debug (1.8.0)
32
34
  irb (>= 1.5.0)
33
35
  reline (>= 0.3.1)
36
+ diff-lcs (1.5.0)
34
37
  fastimage (2.2.7)
35
38
  ffi (1.15.5)
36
39
  ffi-compiler (1.0.1)
37
40
  ffi (>= 1.0.0)
38
41
  rake
42
+ htmlbeautifier (1.4.2)
39
43
  io-console (0.6.0)
40
44
  irb (1.6.4)
41
45
  reline (>= 0.3.0)
@@ -51,8 +55,12 @@ GEM
51
55
  minitest (>= 5.0)
52
56
  ruby-progressbar
53
57
  multi_json (1.15.0)
58
+ nokogiri (1.15.2-arm64-darwin)
59
+ racc (~> 1.4)
54
60
  nokogiri (1.15.2-x86_64-darwin)
55
61
  racc (~> 1.4)
62
+ nokogiri (1.15.2-x86_64-linux)
63
+ racc (~> 1.4)
56
64
  parallel (1.22.1)
57
65
  parser (3.2.1.0)
58
66
  ast (~> 2.4.1)
@@ -76,10 +84,10 @@ GEM
76
84
  unicode-display_width (>= 2.4.0, < 3.0)
77
85
  rubocop-ast (1.26.0)
78
86
  parser (>= 3.2.1.0)
79
- rubocop-shopify (2.12.0)
80
- rubocop (~> 1.44)
81
87
  ruby-progressbar (1.11.0)
88
+ sqlite3 (1.6.3-arm64-darwin)
82
89
  sqlite3 (1.6.3-x86_64-darwin)
90
+ sqlite3 (1.6.3-x86_64-linux)
83
91
  unicode-display_width (2.4.2)
84
92
  webrick (1.7.0)
85
93
  webview_ruby (0.1.2)
@@ -90,20 +98,26 @@ GEM
90
98
  webrick (~> 1.7.0)
91
99
 
92
100
  PLATFORMS
101
+ arm64-darwin-21
102
+ arm64-darwin-22
103
+ arm64-darwin-23
93
104
  x86_64-darwin-19
105
+ x86_64-darwin-20
94
106
  x86_64-darwin-22
107
+ x86_64-darwin-23
95
108
  x86_64-linux
96
109
 
97
110
  DEPENDENCIES
98
111
  bloops (~> 0.5)
99
112
  debug
113
+ diff-lcs
114
+ htmlbeautifier
100
115
  lacci!
101
116
  minitest (~> 5.0)
102
117
  minitest-reporters
103
118
  rake (~> 13.0)
104
119
  redcarpet
105
120
  rubocop (~> 1.21)
106
- rubocop-shopify
107
121
  scarpe!
108
122
  scarpe-components!
109
123
  yard
data/LICENSE.txt CHANGED
@@ -1,6 +1,12 @@
1
+ Scarpe, Lacci and Scarpe-Components code is available under the MIT license.
2
+
3
+ Bootswatch themes are made by Thomas Park and are released under MIT license.
4
+ Bootstrap Icons are by Bootstrap Icons and are released under MIT license.
5
+
6
+ =================
1
7
  The MIT License (MIT)
2
8
 
3
- Copyright (c) 2022 TODO: Write your name
9
+ Copyright (c) 2022-present, Scarpe team and contributors.
4
10
 
5
11
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
12
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <img src="https://user-images.githubusercontent.com/7865030/217309905-7f25e3cf-1850-481d-811b-dfddea2df54a.png" width="200" height="200">
9
9
 
10
- "Scarpe" means shoes in Italian. "Scarpe" also means [Shoes](https://github.com/shoes/shoes-deprecated) in modern Ruby and webview!
10
+ "Scarpe" means shoes in Italian. "Scarpe" also means [Shoes](https://github.com/shoes/shoes-deprecated) in modern Ruby and Webview!
11
11
 
12
12
  Scarpe isn't feature complete with any version of Shoes (yet?). We're initially targeting [Shoes 3](https://github.com/scarpe-team/scarpe/wiki/ShoesImplementations.md), also called "Red Shoes."
13
13
 
@@ -15,7 +15,7 @@ Scarpe isn't feature complete with any version of Shoes (yet?). We're initially
15
15
 
16
16
  Shoes is an old library (really [several different ones](https://github.com/scarpe-team/scarpe/wiki/ShoesImplementations.md)) that let you build little local desktop computer programs, package them up and give copies to people. Imagine if you can write a tiny little Ruby program (e.g. sneak a peek at the next section) and then it would make a runnable app, opening a window in Ruby, where you could click buttons and play sounds and stuff.
17
17
 
18
- Scarpe is a rewrite of Shoes, because old Shoes doesn't really work any more. There have been a surprising number of rewrites of Shoes over the years -- people love it and miss having it around. This one is ours. Also it uses Webview.
18
+ Scarpe is a rewrite of Shoes, because old Shoes doesn't work any more. There have been a surprising number of rewrites of Shoes over the years -- people love it and miss having it around. This one is ours. By default it uses [Webview](https://github.com/webview/webview).
19
19
 
20
20
  ## Usage
21
21
 
@@ -29,33 +29,49 @@ Shoes.app do
29
29
  end
30
30
  ```
31
31
 
32
- More examples can be found in the [`examples` folder](https://github.com/scarpe-team/scarpe/tree/main/examples)!
32
+ <img width="480" alt="hello_world" src="https://user-images.githubusercontent.com/9624267/158565981-57240f72-fbaf-4b72-b66e-8c0d517a90d7.png">
33
+
34
+ A bit more...
35
+
36
+ ```ruby
37
+ Shoes.app do
38
+ @push = button "Push me"
39
+ @note = para "Nothing pushed so far"
40
+ @push.click {
41
+ @note.replace(
42
+ "Aha! Click! ",
43
+ link("Go back") { @note.replace "Nothing pushed so far" }
44
+ )
45
+ }
46
+ end
47
+ ```
33
48
 
34
- ## Screenshots
49
+ <img width="480" alt="hello_world" src="https://user-images.githubusercontent.com/9624267/158566011-0372d0c7-fbeb-4ed6-a082-73908f04a0b6.gif">
35
50
 
36
- From the hello world example:
51
+ More examples can be found in the [`examples` folder](https://github.com/scarpe-team/scarpe/tree/main/examples)!
37
52
 
38
- <img width="480" alt="hello_world" src="https://user-images.githubusercontent.com/9624267/158565981-57240f72-fbaf-4b72-b66e-8c0d517a90d7.png">
53
+ ## Wiki
39
54
 
40
- From the button example:
55
+ Explore more in the [Scarpe Wiki](https://github.com/scarpe-team/scarpe/wiki) for in-depth documentation, tutorials, and additional resources. Whether you're a new user, a new contributor or an experienced user, the Wiki provides valuable information to enhance your Scarpe experience.
41
56
 
42
- <img width="480" alt="hello_world" src="https://user-images.githubusercontent.com/9624267/158566011-0372d0c7-fbeb-4ed6-a082-73908f04a0b6.gif">
43
57
 
44
58
  ## Scarpe in Development
45
59
 
46
60
  ### Quickstart
47
61
 
48
- Scarpe requires [Ruby 3.2](https://www.ruby-lang.org/en/downloads/) or higher! You can use `rvm`, `rbenv` or your favourite version control just like normal.
62
+ Scarpe requires [Ruby 3.2](https://www.ruby-lang.org/en/downloads/) or higher! You can use `rvm`, `rbenv` or your favourite version control to install Ruby just like normal.
49
63
 
50
64
  This repo is where most of the action is happening right now, and to have the full Scarpe experience _today_ this is probably what you want to do.
51
65
 
52
66
  ```
53
67
  # dependencies - Mac version
54
68
  brew install portaudio pkg-config # for sound!
69
+ # dependencies - Mac M1 version
70
+ brew install portaudio && bundle config build.bloops --with-portaudio-dir=$(brew --prefix portaudio)
55
71
  # dependencies - Ubuntu Linux version
56
- sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev libportaudio2
72
+ sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev portaudio19-dev
57
73
 
58
- for any other linux or windows. please see the webview docs for your [platform](https://github.com/webview/webview#prerequisites)
74
+ for any other Linux or Windows please see the webview docs for your [platform](https://github.com/webview/webview#prerequisites)
59
75
 
60
76
  # get it
61
77
  git clone http://github.com/scarpe-team/scarpe
@@ -67,33 +83,71 @@ cd scarpe; bundle install
67
83
 
68
84
  If you are using Visual Studio Code, you can use this [extension](https://github.com/gintama91/Scarpe-Vscode-Extension). This extension simplifies the process of executing commands by eliminating the need to repeatedly type lengthy file paths, resulting in a more efficient and productive development experience.
69
85
 
70
- ### Finer details
86
+ ## Run Test
87
+
88
+ To Run all availble tests run command
89
+
90
+ ```
91
+ bundle exec rake ci_test
92
+
93
+ ```
94
+
95
+ ### To Run Tests separately
96
+
97
+ Scarpe is composed of [various sub-libraries](https://github.com/scarpe-team/scarpe/wiki/ShoesArchitecture.md). You can run some tests separately.
98
+
99
+ Run Lacci Tests:
100
+
101
+ ```
102
+ bundle exec rake lacci_test
103
+
104
+ ```
105
+
106
+ Run Scarpe-Components Tests:
107
+
108
+ ```
109
+ bundle exec rake component_test
110
+ ```
111
+
112
+ Run Scarpe Tests:
113
+
114
+ ```
115
+ bundle exec rake test
116
+ ```
117
+
118
+ Check HTML Output:
119
+
120
+ ```
121
+ bundle exec rake test:check_html_fixtures
122
+ ```
123
+
124
+ ### Finer Details
71
125
 
72
126
  First, clone the [main GitHub repository](https://github.com/scarpe-team/scarpe).
73
127
 
74
- `bundle install` dependencies like webview from the cloned directory in your Ruby of choice.
128
+ `bundle install` dependencies like Webview from the cloned directory in your Ruby of choice.
75
129
 
76
130
  You can run without Scarpe being installed by including its directory. For instance, from the "examples" directory you can run `ruby -I../lib -I../lacci/lib -rscarpe hello_world.rb`. You can also install Scarpe locally (`gem build scarpe.gemspec && gem install scarpe-0.1.0.gem`) or using a Gemfile with the "path" option for local Scarpe.
77
131
 
78
132
  Most commonly we are all using this command: `./exe/scarpe examples/button.rb --dev --debug`
79
133
 
80
- The `--dev` flag points to your local scarpe rather than an installed Scarpe gem.
134
+ The `--dev` flag points to your local Scarpe rather than an installed Scarpe gem.
81
135
 
82
136
  The `--debug` flag will dump a ton of useful information to the console if you want to see what's happening with your app.
83
137
 
84
- It's very early in the development process. If you'd like to help develop Scarpe, great! It would be useful to drop us a message/issue/PR on GitHub early on, so we know you're working in a particular area, and we can warn you if anybody else is currently doing so. We also have a Discord.
138
+ It's very early in Scarpe's development process. If you'd like to help develop Scarpe, great! It would be useful to drop us a message/issue/PR on GitHub early on, so we know you're working in a particular area, and we can warn you if anybody else is currently doing so. We also have a Discord.
85
139
 
86
140
  We'd love the help!
87
141
 
88
- If you want to quickly add a feature, you can use the `ruby scarpegen.rb` command. This command will generate the necessary files for you, along with a simple template and a set of questions to guide you through the process. By following these steps, you will be good to go!
89
-
90
- By leveraging the `ruby scarpegen.rb` command and the provided resources, you can expedite the feature addition process and ensure a smoother development experience.
142
+ If you want to quickly add a feature, you can use the `ruby scarpegen.rb` command. This command will generate the necessary files for you, along with a simple template and a set of questions to guide you through the process. By leveraging the `ruby scarpegen.rb` command and the provided resources, you can expedite the feature addition process and ensure a smoother development experience.
91
143
 
92
- ## Are we done yet?
144
+ ## Are We Done Yet?
93
145
 
94
146
  Great question! Right now we have a few key things we want to achieve. The first is passing all of the examples we can get our hands on. The second is passing [Hackety-Hack](https://github.com/hacketyhack/hacketyhack). We're manually keeping tabs on that here.
95
147
 
96
- ### Webview Display Service Examples Passing
148
+ But the short version is: no, we're far from done. Some Shoes features (e.g. multiple window support) may be very difficult to support with Webview at all. We're working on other ways to handle those features.
149
+
150
+ ### Examples Passing with the Webview Display Service
97
151
 
98
152
  ![](https://geps.dev/progress/30?dangerColor=800000&warningColor=ff9900&successColor=006600)
99
153
 
@@ -118,6 +172,31 @@ The SCARPE_TEST_CONTROL environment variable can contain a path to a test-contro
118
172
 
119
173
  If you run ./exe/scarpe --dev env, you can see all current environment settings.
120
174
 
175
+ ## Shoes-Spec
176
+
177
+ Pre-Scarpe Shoes didn't have specific test APIs or infrastructure. That was pretty standard for GUI libraries when it was written. Scarpe supports a test API called Shoes-Spec, and different display services tend to extend it.
178
+
179
+ The idea is that you write a standard Shoes application and then there's additional test code that runs once your application is running. Since different display services run in very different ways (e.g. Webview vs Wasm vs GTK+), the test code isn't necessarily in the same Ruby process as the Shoes application.
180
+
181
+ They're often packaged in .sspec files that look like this:
182
+
183
+ ~~~
184
+ ---
185
+ ----------- app code
186
+ Shoes.app do
187
+ @b = button "OK" do
188
+ @b.text = "Clicked"
189
+ end
190
+ end
191
+
192
+ ----------- test code
193
+ assert_equal "OK", button().text
194
+ button().trigger_click
195
+ assert_equal "Clicked", button().text
196
+ ~~~
197
+
198
+ See [https://github.com/scarpe-team/shoes-spec] for more details.
199
+
121
200
  ## More info
122
201
 
123
202
  * [Nobody Knows Shoes manual](https://github.com/whymirror/why-archive/raw/master/shoes/nobody-knows-shoes.pdf)
@@ -147,7 +226,7 @@ You can set SCARPE_LOG_CONFIG to an appropriate YAML file to set log levels per-
147
226
  ```
148
227
  {
149
228
  "default": "warn",
150
- "WV::WebWrangler": ["logger/web_wrangler.log", "debug"]
229
+ "Webview::WebWrangler": ["logger/web_wrangler.log", "debug"]
151
230
  }
152
231
  ```
153
232
 
data/Rakefile CHANGED
@@ -4,6 +4,59 @@ require "bundler/gem_tasks"
4
4
  require "rake/testtask"
5
5
  require "rubocop/rake_task"
6
6
 
7
+ # Rakefile
8
+
9
+ task :ci_test do
10
+ puts "
11
+ \033[1;32;4;47mInstalling Dependencies\033[0m
12
+ "
13
+
14
+ system('brew install pkg-config portaudio')
15
+
16
+
17
+ puts "
18
+ \033[1;32;4;47mCheckout Code\033[0m
19
+ "
20
+ system('git checkout main')
21
+
22
+
23
+ puts "
24
+ \033[1;32;4;47mSetup Ruby and install Gems\033[0m
25
+ "
26
+ system('bundle install')
27
+
28
+ # Run tests
29
+
30
+ puts "
31
+ \033[1;32;4;47mRun Lacci Tests\033[0m
32
+ "
33
+ system('CI_RUN=true bundle exec rake lacci_test')
34
+
35
+ puts "
36
+ \033[1;32;4;47mRun Scarpe-Component Tests\033[0m
37
+ "
38
+
39
+ system('CI_RUN=true bundle exec rake component_test')
40
+
41
+
42
+ puts "
43
+ \033[1;32;4;47mRun Scarpe Tests\033[0m
44
+ "
45
+ system('CI_RUN=true bundle exec rake test')
46
+
47
+
48
+ puts "
49
+ \033[1;32;4;47mCheck HTML Output\033[0m
50
+ "
51
+ system('bundle exec rake test:check_html_fixtures')
52
+
53
+
54
+ puts "
55
+ \033[1;32;4;47mUpload Fail logs\033[0m
56
+ "
57
+ system('if [ ! -z "$(ls logger/test_failure*.out.log 2>/dev/null)" ]; then actions/upload-artifact@v4 --name "test failure logs" --path logger/test_failure*.out.log; fi')
58
+ end
59
+
7
60
  Rake::TestTask.new(:test) do |t|
8
61
  t.libs << "test"
9
62
  t.libs << "lib"
@@ -22,6 +75,20 @@ Rake::TestTask.new(:component_test) do |t|
22
75
  t.test_files = FileList["scarpe-components/test/**/test_*.rb"]
23
76
  end
24
77
 
78
+ namespace :test do
79
+ desc 'Regenerate HTML fixtures'
80
+ task :regenerate_html_fixtures do |t|
81
+ ENV['SELECTED_FILE'] = ARGV[-1] if ARGV[-1].include?(".rb")
82
+ load 'tasks/regenerate_html_fixtures.rb'
83
+ end
84
+
85
+ desc 'Check HTML fixtures against latest output'
86
+ task :check_html_fixtures do |t|
87
+ ENV['SELECTED_FILE'] = ARGV[-1] if ARGV[-1].include?(".rb")
88
+ load 'tasks/check_html_fixtures.rb'
89
+ end
90
+ end
91
+
25
92
  RuboCop::RakeTask.new
26
93
 
27
- task default: [:test, :lacci_test, :component_test, :rubocop]
94
+ task default: [:test, :lacci_test, :component_test]
@@ -0,0 +1,8 @@
1
+ Shoes.app do
2
+ para "Anything:",size:"30px"
3
+ lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim."
4
+ @manuscript = edit_box(lorem, width: "100%", font:"italic normal bold 25px 'Times New Roman', serif;", tooltip:"This is a tooltip") do |box|
5
+ @char_count.replace("#{box.text.length} characters")
6
+ end
7
+ @char_count = para "#{@manuscript.text.length} characters" ,size:"20px"
8
+ end
@@ -0,0 +1,7 @@
1
+ Shoes.app do
2
+
3
+ para "This text have kerning applied to it", kerning:10, size:18
4
+
5
+ para "This is normal text for reference", size:18
6
+
7
+ end
@@ -0,0 +1,20 @@
1
+ Shoes.app do
2
+ stack do
3
+ para "10 fps"
4
+ p = para "-"
5
+ animate do |frame|
6
+ p.replace(frame.to_s)
7
+ end
8
+ para "20 fps"
9
+ p2 = para "-"
10
+ animate(20) do |frame|
11
+ p2.replace(frame.to_s)
12
+ end
13
+ para "3spf"
14
+ p3 = para "-"
15
+ every(3) do |count|
16
+ p3.replace(count.to_s)
17
+ end
18
+ end
19
+ end
20
+
data/examples/arrow.rb ADDED
@@ -0,0 +1,10 @@
1
+ Shoes.app do
2
+ arrow 100, 100, 30
3
+
4
+ arrow 150, 120,40
5
+
6
+ arrow 30 ,60 ,40
7
+
8
+ arrow :left => 50, :top => 80,
9
+ :width => 40
10
+ end
@@ -0,0 +1,11 @@
1
+ Shoes.app(width: 300, height: 50) do
2
+ stack height: 50 do
3
+ para "Border is on top of text"
4
+ border yellow, strokewidth: 4
5
+ end
6
+
7
+ stack do
8
+ para "This border is also on top of text"
9
+ border blue, strokewidth: 4
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ Shoes.app do
2
+ @btn = button "who am i?", :tooltip => "i have no idea either"
3
+ @para = para "i am a button"
4
+ @btn.hover do
5
+ @para.replace "i am a button and i am being hovered"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ Shoes.app do
2
+ @p = para "This text will start red\n", stroke: :red
3
+ button "OK" do
4
+ @p.replace("... but turn green when you click it.")
5
+ @p.stroke = :green
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ Shoes.app do
2
+ style Shoes::Para, stroke: :red
3
+ para "This text should be red\n"
4
+ para "But this text should be green\n", stroke: :green
5
+ button "OK"
6
+ end
data/examples/check.rb CHANGED
@@ -5,6 +5,8 @@ Shoes.app do
5
5
  flow { check; para "Kin-Dza-Dza by Georgi Danelia" }
6
6
  flow { check; para "Children of Heaven by Majid Majidi" }
7
7
  @btn = check; para "The White Balloon by Jafar Panahi"
8
+ @p = para ""
9
+ @btn.click { @p.replace("Clicked! Yay!") }
8
10
  flow do
9
11
  button "Mark me" do
10
12
  @btn.checked = true
@@ -1,3 +1,6 @@
1
+ # html_ci: false
2
+ # This is due to a button rendering issue
3
+
1
4
  Shoes.app do
2
5
  stack do
3
6
  title "Downloading Google image", size: 16
@@ -0,0 +1,15 @@
1
+ Shoes.app(title: "Finland", width: 360, height: 220, ) do
2
+ background blue
3
+ stack width: 100, height: 80 do
4
+ background white
5
+ end
6
+ stack width: 100, height: 80, top: 140, left: 0 do
7
+ background white
8
+ end
9
+ stack width: 200, height: 80, top: 0, left: 160 do
10
+ background white
11
+ end
12
+ stack width: 200, height: 80, top: 140, left: 160 do
13
+ background white
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ Shoes.app(height: 300) do
2
+ stack width: 0.33, height: 1.0 do
3
+ background green
4
+ end
5
+ stack width: 0.34, height: 1.0 do
6
+ background white
7
+ end
8
+ stack width: 0.33, height: 1.0 do
9
+ background red
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ Shoes.app(title: "Mauritius", height: 300) do
2
+ stack width: 1.0, height: 0.25 do
3
+ background red
4
+ end
5
+ stack width: 1.0, height: 0.25 do
6
+ background blue
7
+ end
8
+ stack width: 1.0, height: 0.25 do
9
+ background yellow
10
+ end
11
+ stack width: 1.0, height: 0.25 do
12
+ background green
13
+ end
14
+ end