scarpe 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. checksums.yaml +4 -4
  2. data/.cursor/rules/commit-style-preferences.mdc +72 -0
  3. data/.cursor/rules/component_context.mdc +82 -0
  4. data/.cursor/rules/debug-failed-tests.mdc +100 -0
  5. data/.cursor/rules/display_service_context.mdc +80 -0
  6. data/.cursor/rules/event_handling_context.mdc +100 -0
  7. data/.cursor/rules/git-pager-handling.mdc +64 -0
  8. data/.cursor/rules/lacci-context.mdc +52 -0
  9. data/.cursor/rules/scarpe_design_context.mdc +46 -0
  10. data/.cursor/rules/shoes_compatibility_context.mdc +75 -0
  11. data/.cursor/rules/timeout_context.mdc +78 -0
  12. data/.cursor/rules/update_lacci_and_wv.mdc +8 -0
  13. data/.cursor/rules/what_is_scarpe.mdc +22 -0
  14. data/.cursor/rules/writing-new-rules.mdc +73 -0
  15. data/CHANGELOG.md +46 -5
  16. data/CLAUDE.md +223 -0
  17. data/Gemfile +2 -2
  18. data/Gemfile.lock +85 -55
  19. data/LICENSE.txt +7 -1
  20. data/README.md +80 -20
  21. data/Rakefile +73 -14
  22. data/docs/SCARPE_FEATURES.md +38 -0
  23. data/docs/_config.yml +13 -0
  24. data/docs/calzini_components_and_updates.md +78 -0
  25. data/docs/display_service_separation.md +39 -0
  26. data/docs/documentation.md +43 -0
  27. data/docs/event_loops.md +66 -0
  28. data/docs/image.png +0 -0
  29. data/docs/index.md +118 -0
  30. data/docs/lacci.md +121 -0
  31. data/docs/scarpe_shoes_incompatibilities.md +71 -0
  32. data/docs/shoes_and_display_events.md +55 -0
  33. data/docs/shoes_implementations.md +79 -0
  34. data/docs/static/manual.md +5 -0
  35. data/docs/static/scarpe-logo.png +0 -0
  36. data/docs/timeouts_and_handlers.md +66 -0
  37. data/docs/web_archaeology.md +76 -0
  38. data/examples/Edit_box_Styles.rb +8 -0
  39. data/examples/Kerning.rb +7 -0
  40. data/examples/background_with_image.rb +14 -5
  41. data/examples/bloopsaphone/working/feepogram.rb +1 -1
  42. data/examples/bloopsaphone/working/le_dance_des_rubis.rb +135 -0
  43. data/examples/bloopsaphone/working/pixel_dreams_in_ruby.rb +131 -0
  44. data/examples/bloopsaphone/working/type_rebellion.rb +157 -0
  45. data/examples/border.rb +11 -0
  46. data/examples/check.rb +2 -0
  47. data/examples/download_and_show_image.rb +3 -0
  48. data/examples/flags/finland.rb +15 -0
  49. data/examples/flags/italy.rb +11 -0
  50. data/examples/flags/mauritius.rb +14 -0
  51. data/examples/font_family.rb +17 -0
  52. data/examples/font_shorthand.rb +9 -0
  53. data/examples/gen.rb +4 -0
  54. data/examples/internal_link_navigation.rb +19 -0
  55. data/examples/legacy/not_checked/shoes-manual/append.rb +10 -0
  56. data/examples/legacy/not_checked/shoes-manual/background_change.rb +12 -0
  57. data/examples/legacy/not_checked/shoes-manual/background_pattern.rb +5 -0
  58. data/examples/legacy/not_checked/shoes-manual/basic_app.rb +8 -0
  59. data/examples/legacy/not_checked/shoes-manual/border.rb +9 -0
  60. data/examples/legacy/not_checked/shoes-manual/builtins/FONTS.rb +5 -0
  61. data/examples/legacy/not_checked/shoes-manual/builtins/ask.rb +2 -0
  62. data/examples/legacy/not_checked/shoes-manual/builtins/ask_color.rb +5 -0
  63. data/examples/legacy/not_checked/shoes-manual/builtins/ask_open_file.rb +5 -0
  64. data/examples/legacy/not_checked/shoes-manual/builtins/ask_save_folder.rb +2 -0
  65. data/examples/legacy/not_checked/shoes-manual/builtins/confirm.rb +4 -0
  66. data/examples/legacy/not_checked/shoes-manual/builtins/debug.rb +2 -0
  67. data/examples/legacy/not_checked/shoes-manual/builtins/info.rb +3 -0
  68. data/examples/legacy/not_checked/shoes-manual/button.rb +9 -0
  69. data/examples/legacy/not_checked/shoes-manual/clear.rb +7 -0
  70. data/examples/legacy/not_checked/shoes-manual/custom_header.rb +13 -0
  71. data/examples/legacy/not_checked/shoes-manual/displace.rb +14 -0
  72. data/examples/legacy/not_checked/shoes-manual/edit_box.rb +8 -0
  73. data/examples/legacy/not_checked/shoes-manual/fill_pattern.rb +5 -0
  74. data/examples/legacy/not_checked/shoes-manual/fonts.rb +7 -0
  75. data/examples/legacy/not_checked/shoes-manual/gutter.rb +6 -0
  76. data/examples/legacy/not_checked/shoes-manual/image_web.rb +4 -0
  77. data/examples/legacy/not_checked/shoes-manual/keypress.rb +7 -0
  78. data/examples/legacy/not_checked/shoes-manual/list_box.rb +10 -0
  79. data/examples/legacy/not_checked/shoes-manual/motion.rb +10 -0
  80. data/examples/legacy/not_checked/shoes-manual/mouse.rb +8 -0
  81. data/examples/legacy/not_checked/shoes-manual/move.rb +14 -0
  82. data/examples/legacy/not_checked/shoes-manual/nested_ovals.rb +8 -0
  83. data/examples/legacy/not_checked/shoes-manual/oval.rb +7 -0
  84. data/examples/legacy/not_checked/shoes-manual/ovals.rb +6 -0
  85. data/examples/legacy/not_checked/shoes-manual/ovals_image.rb +8 -0
  86. data/examples/legacy/not_checked/shoes-manual/prepend.rb +7 -0
  87. data/examples/legacy/not_checked/shoes-manual/progress_bar.rb +10 -0
  88. data/examples/legacy/not_checked/shoes-manual/radio.rb +18 -0
  89. data/examples/legacy/not_checked/shoes-manual/radio_alternative_1.rb +7 -0
  90. data/examples/legacy/not_checked/shoes-manual/radio_alternative_2.rb +9 -0
  91. data/examples/legacy/not_checked/shoes-manual/rotate_rectangle.rb +6 -0
  92. data/examples/legacy/not_checked/shoes-manual/shape.rb +11 -0
  93. data/examples/legacy/not_checked/shoes-manual/static/avatar.png +0 -0
  94. data/examples/legacy/not_checked/shoes-manual/stroke.rb +5 -0
  95. data/examples/legacy/not_checked/shoes-manual/style.rb +3 -0
  96. data/examples/legacy/not_checked/shoes-manual/style_alternative_1.rb +4 -0
  97. data/examples/legacy/not_checked/shoes-manual/style_alternative_2.rb +5 -0
  98. data/examples/legacy/not_checked/shoes-manual/style_length.rb +5 -0
  99. data/examples/legacy/not_checked/shoes-manual/timer.rb +6 -0
  100. data/examples/legacy/not_checked/shoes-manual/trigger_window.rb +8 -0
  101. data/examples/legacy/not_checked/shoes-manual/window_owner.rb +8 -0
  102. data/examples/legacy/working/shoes_manual/alert_button.rb +2 -0
  103. data/examples/legacy/working/shoes_manual/animate.rb +7 -0
  104. data/examples/legacy/working/shoes_manual/background_para.rb +4 -0
  105. data/examples/legacy/working/shoes_manual/button_alternative.rb +7 -0
  106. data/examples/legacy/working/shoes_manual/checkbox.rb +17 -0
  107. data/examples/legacy/working/shoes_manual/download.rb +12 -0
  108. data/examples/legacy/working/shoes_manual/edit_box.rb +6 -0
  109. data/examples/legacy/working/shoes_manual/editline.rb +7 -0
  110. data/examples/legacy/working/shoes_manual/fixed_height.rb +8 -0
  111. data/examples/legacy/working/shoes_manual/fixed_width.rb +12 -0
  112. data/examples/legacy/working/shoes_manual/image.rb +5 -0
  113. data/examples/legacy/working/shoes_manual/instance_variable_check.rb +10 -0
  114. data/examples/legacy/working/shoes_manual/message.rb +18 -0
  115. data/examples/legacy/working/shoes_manual/rectangle.rb +6 -0
  116. data/examples/legacy/working/shoes_manual/save_download.rb +12 -0
  117. data/examples/legacy/working/shoes_manual/self_check.rb +10 -0
  118. data/examples/legacy/working/shoes_manual/stack.rb +7 -0
  119. data/examples/legacy/working/shoes_manual/style_info.rb +8 -0
  120. data/examples/legacy/working/shoes_manual/utf8_support.rb +8 -0
  121. data/examples/legacy/working/shoes_manual/width.rb +4 -0
  122. data/examples/local_assets/multi_image.rb +5 -0
  123. data/examples/local_assets/small.png +0 -0
  124. data/examples/local_fonts.rb +3 -0
  125. data/examples/margin.rb +13 -0
  126. data/examples/margin_check.rb +27 -0
  127. data/examples/oval-with-kwargs.rb +3 -0
  128. data/examples/oval.rb +26 -0
  129. data/examples/page_navigation_single_app.rb +42 -0
  130. data/examples/para_font_styles.rb +17 -0
  131. data/examples/para_font_variant.rb +6 -0
  132. data/examples/para_fontweight.rb +13 -0
  133. data/examples/parse_xl_funnies.rb +3 -0
  134. data/examples/rect.rb +1 -1
  135. data/examples/scarpe_ext.rb +3 -0
  136. data/examples/shapes/star.rb +1 -3
  137. data/examples/shoes_subclass_app.rb +25 -0
  138. data/examples/spacing.rb +1 -1
  139. data/examples/span.rb +4 -2
  140. data/examples/url_routing_example.rb +67 -0
  141. data/lacci/Gemfile +0 -2
  142. data/lacci/Gemfile.lock +4 -32
  143. data/lacci/lacci.gemspec +3 -3
  144. data/lacci/lib/lacci/scarpe_cli.rb +0 -1
  145. data/lacci/lib/lacci/version.rb +1 -1
  146. data/lacci/lib/scarpe/niente/app.rb +12 -1
  147. data/lacci/lib/scarpe/niente/display_service.rb +5 -1
  148. data/lacci/lib/scarpe/niente/drawable.rb +2 -0
  149. data/lacci/lib/scarpe/niente/shoes_spec.rb +10 -5
  150. data/lacci/lib/scarpe/niente.rb +15 -2
  151. data/lacci/lib/shoes/app.rb +204 -105
  152. data/lacci/lib/shoes/constants.rb +24 -2
  153. data/lacci/lib/shoes/display_service.rb +43 -4
  154. data/lacci/lib/shoes/drawable.rb +326 -36
  155. data/lacci/lib/shoes/drawables/arc.rb +4 -26
  156. data/lacci/lib/shoes/drawables/arrow.rb +3 -23
  157. data/lacci/lib/shoes/drawables/border.rb +28 -0
  158. data/lacci/lib/shoes/drawables/button.rb +5 -21
  159. data/lacci/lib/shoes/drawables/check.rb +7 -3
  160. data/lacci/lib/shoes/drawables/document_root.rb +4 -4
  161. data/lacci/lib/shoes/drawables/edit_box.rb +6 -5
  162. data/lacci/lib/shoes/drawables/edit_line.rb +5 -4
  163. data/lacci/lib/shoes/drawables/flow.rb +4 -6
  164. data/lacci/lib/shoes/drawables/font_helper.rb +62 -0
  165. data/lacci/lib/shoes/drawables/image.rb +2 -2
  166. data/lacci/lib/shoes/drawables/line.rb +3 -6
  167. data/lacci/lib/shoes/drawables/link.rb +16 -9
  168. data/lacci/lib/shoes/drawables/list_box.rb +8 -5
  169. data/lacci/lib/shoes/drawables/oval.rb +48 -0
  170. data/lacci/lib/shoes/drawables/para.rb +106 -18
  171. data/lacci/lib/shoes/drawables/progress.rb +2 -1
  172. data/lacci/lib/shoes/drawables/radio.rb +5 -3
  173. data/lacci/lib/shoes/drawables/rect.rb +7 -6
  174. data/lacci/lib/shoes/drawables/shape.rb +4 -3
  175. data/lacci/lib/shoes/drawables/slot.rb +102 -9
  176. data/lacci/lib/shoes/drawables/stack.rb +7 -12
  177. data/lacci/lib/shoes/drawables/star.rb +9 -31
  178. data/lacci/lib/shoes/drawables/text_drawable.rb +93 -34
  179. data/lacci/lib/shoes/drawables/video.rb +3 -2
  180. data/lacci/lib/shoes/drawables/widget.rb +9 -4
  181. data/lacci/lib/shoes/drawables.rb +2 -1
  182. data/lacci/lib/shoes/errors.rb +13 -3
  183. data/lacci/lib/shoes/margin_helper.rb +79 -0
  184. data/lacci/lib/shoes.rb +98 -20
  185. data/lacci/test/.gitignore +1 -0
  186. data/lacci/test/test_draw_context.rb +167 -0
  187. data/lacci/test/test_font_helper.rb +57 -0
  188. data/lacci/test/test_helper.rb +31 -4
  189. data/lacci/test/test_lacci.rb +93 -6
  190. data/lacci/test/test_margin_helper.rb +82 -0
  191. data/lacci/test/test_niente_test_infra.rb +40 -0
  192. data/lacci/test/test_oval.rb +82 -0
  193. data/lacci/test/test_parenting.rb +140 -0
  194. data/lacci/test/test_shoes_errors.rb +15 -13
  195. data/lacci/test/test_text_drawables.rb +23 -0
  196. data/lib/scarpe/assets.rb +19 -0
  197. data/lib/scarpe/cats_cradle.rb +57 -98
  198. data/lib/scarpe/shoes_spec.rb +24 -44
  199. data/lib/scarpe/version.rb +1 -1
  200. data/lib/scarpe/wv/app.rb +1 -0
  201. data/lib/scarpe/wv/arc.rb +0 -4
  202. data/lib/scarpe/wv/border.rb +15 -0
  203. data/lib/scarpe/wv/control_interface.rb +2 -10
  204. data/lib/scarpe/wv/document_root.rb +2 -2
  205. data/lib/scarpe/wv/drawable.rb +6 -40
  206. data/lib/scarpe/wv/edit_box.rb +4 -1
  207. data/lib/scarpe/wv/edit_line.rb +4 -1
  208. data/lib/scarpe/wv/image.rb +2 -5
  209. data/lib/scarpe/wv/link.rb +4 -2
  210. data/lib/scarpe/wv/oval.rb +13 -0
  211. data/lib/scarpe/wv/para.rb +1 -0
  212. data/lib/scarpe/wv/scarpe_extensions.rb +8 -0
  213. data/lib/scarpe/wv/shape.rb +10 -5
  214. data/lib/scarpe/wv/text_drawable.rb +72 -14
  215. data/lib/scarpe/wv/web_wrangler.rb +33 -11
  216. data/lib/scarpe/wv/webview_local_display.rb +6 -2
  217. data/lib/scarpe/wv.rb +16 -2
  218. data/scarpe-components/Gemfile +4 -3
  219. data/scarpe-components/Gemfile.lock +6 -37
  220. data/scarpe-components/README.md +2 -2
  221. data/scarpe-components/assets/bootstrap-themes/bootstrap-cerulean.css +12229 -0
  222. data/scarpe-components/assets/bootstrap-themes/bootstrap-cosmo.css +11810 -0
  223. data/scarpe-components/assets/bootstrap-themes/bootstrap-cyborg.css +12210 -0
  224. data/scarpe-components/assets/bootstrap-themes/bootstrap-darkly.css +12153 -0
  225. data/scarpe-components/assets/bootstrap-themes/bootstrap-flatly.css +12126 -0
  226. data/scarpe-components/assets/bootstrap-themes/bootstrap-icons.min.css +5 -0
  227. data/scarpe-components/assets/bootstrap-themes/bootstrap-journal.css +12099 -0
  228. data/scarpe-components/assets/bootstrap-themes/bootstrap-litera.css +12211 -0
  229. data/scarpe-components/assets/bootstrap-themes/bootstrap-lumen.css +12369 -0
  230. data/scarpe-components/assets/bootstrap-themes/bootstrap-lux.css +11928 -0
  231. data/scarpe-components/assets/bootstrap-themes/bootstrap-materia.css +13184 -0
  232. data/scarpe-components/assets/bootstrap-themes/bootstrap-minty.css +12177 -0
  233. data/scarpe-components/assets/bootstrap-themes/bootstrap-morph.css +12750 -0
  234. data/scarpe-components/assets/bootstrap-themes/bootstrap-pulse.css +11890 -0
  235. data/scarpe-components/assets/bootstrap-themes/bootstrap-quartz.css +12622 -0
  236. data/scarpe-components/assets/bootstrap-themes/bootstrap-sandstone.css +12201 -0
  237. data/scarpe-components/assets/bootstrap-themes/bootstrap-simplex.css +12186 -0
  238. data/scarpe-components/assets/bootstrap-themes/bootstrap-sketchy.css +12451 -0
  239. data/scarpe-components/assets/bootstrap-themes/bootstrap-slate.css +12492 -0
  240. data/scarpe-components/assets/bootstrap-themes/bootstrap-solar.css +12149 -0
  241. data/scarpe-components/assets/bootstrap-themes/bootstrap-spacelab.css +12266 -0
  242. data/scarpe-components/assets/bootstrap-themes/bootstrap-superhero.css +12216 -0
  243. data/scarpe-components/assets/bootstrap-themes/bootstrap-united.css +12077 -0
  244. data/scarpe-components/assets/bootstrap-themes/bootstrap-vapor.css +12549 -0
  245. data/scarpe-components/assets/bootstrap-themes/bootstrap-yeti.css +12325 -0
  246. data/scarpe-components/assets/bootstrap-themes/bootstrap-zephyr.css +12283 -0
  247. data/scarpe-components/assets/bootstrap-themes/bootstrap.bundle.min.js +7 -0
  248. data/scarpe-components/lib/scarpe/components/asset_server.rb +219 -0
  249. data/scarpe-components/lib/scarpe/components/base64.rb +22 -0
  250. data/scarpe-components/lib/scarpe/components/calzini/{art_widgets.rb → art_drawables.rb} +42 -18
  251. data/scarpe-components/lib/scarpe/components/calzini/border.rb +38 -0
  252. data/scarpe-components/lib/scarpe/components/calzini/button.rb +6 -8
  253. data/scarpe-components/lib/scarpe/components/calzini/misc.rb +14 -16
  254. data/scarpe-components/lib/scarpe/components/calzini/para.rb +218 -11
  255. data/scarpe-components/lib/scarpe/components/calzini/slots.rb +16 -60
  256. data/scarpe-components/lib/scarpe/components/calzini.rb +88 -1
  257. data/scarpe-components/lib/scarpe/components/errors.rb +4 -0
  258. data/scarpe-components/lib/scarpe/components/html.rb +4 -1
  259. data/scarpe-components/lib/scarpe/components/minitest_export_reporter.rb +11 -3
  260. data/scarpe-components/lib/scarpe/components/minitest_result.rb +41 -0
  261. data/scarpe-components/lib/scarpe/components/port_helpers.rb +30 -0
  262. data/scarpe-components/lib/scarpe/components/print_logger.rb +17 -2
  263. data/scarpe-components/lib/scarpe/components/process_helpers.rb +37 -0
  264. data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +1 -1
  265. data/scarpe-components/lib/scarpe/components/tiranti.rb +42 -100
  266. data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +3 -1
  267. data/scarpe-components/lib/scarpe/components/version.rb +1 -1
  268. data/scarpe-components/scarpe-components.gemspec +1 -1
  269. data/scarpe-components/test/assets/big-image.png +0 -0
  270. data/scarpe-components/test/assets/big-stylesheet.css +497 -0
  271. data/scarpe-components/test/assets/little-image.png +0 -0
  272. data/scarpe-components/test/assets/little-stylesheet.css +1 -0
  273. data/scarpe-components/test/calzini/test_calzini_art_drawables.rb +7 -7
  274. data/scarpe-components/test/calzini/test_calzini_button.rb +7 -5
  275. data/scarpe-components/test/calzini/test_calzini_misc.rb +9 -9
  276. data/scarpe-components/test/calzini/test_calzini_para.rb +6 -9
  277. data/scarpe-components/test/calzini/test_calzini_slots.rb +12 -57
  278. data/scarpe-components/test/calzini/test_calzini_text_drawables.rb +83 -18
  279. data/scarpe-components/test/calzini/test_various.rb +133 -0
  280. data/scarpe-components/test/test_asset_server.rb +72 -0
  281. data/scarpe-components/test/test_components.rb +31 -2
  282. data/scarpe-components/test/test_helper.rb +0 -1
  283. data/scarpe-components/test/test_minitest_result.rb +7 -0
  284. data/scarpe-components/test/test_port_helpers.rb +12 -0
  285. data/scarpe-components/test/test_segmented_app_files.rb +2 -0
  286. data/tasks/check_html_fixtures.rb +140 -0
  287. data/tasks/regenerate_html_fixtures.rb +104 -0
  288. data/templates/class_template_with_shapes.erb +0 -11
  289. metadata +225 -39
  290. data/.rubocop.yml +0 -88
  291. data/lacci/lib/scarpe/niente/logger.rb +0 -29
  292. data/lacci/lib/shoes/drawables/span.rb +0 -27
  293. data/lacci/lib/shoes/spacing.rb +0 -9
  294. data/lib/scarpe/evented_assertions.rb +0 -121
  295. data/lib/scarpe/wv/span.rb +0 -44
  296. data/scarpe-components/lib/scarpe/components/calzini/text_widgets.rb +0 -65
  297. /data/examples/legacy/{not_checked → working}/shoes3-tests/editline/editline.rb +0 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ description: Share timeout and handler context when working with timing-related code
3
+ globs:
4
+ alwaysApply: false
5
+ ---
6
+ # Timeout and Handler Context
7
+
8
+ <rule>
9
+ name: timeout_context
10
+ description: Share relevant timeout and handler documentation when working with timing-related code
11
+ filters:
12
+ - type: file
13
+ pattern: **/*timeout*.rb
14
+ - type: file
15
+ pattern: **/*timeout*.md
16
+ - type: file
17
+ pattern: **/*handler*.rb
18
+ - type: file
19
+ pattern: **/*handler*.md
20
+ - type: file
21
+ pattern: **/*timer*.rb
22
+ - type: file
23
+ pattern: **/*timer*.md
24
+
25
+ actions:
26
+ - type: suggest
27
+ message: |
28
+ # Timeout and Handler Context
29
+
30
+ When working with Scarpe's timeout and handler system, consider:
31
+
32
+ 1. Timeout Implementation
33
+ - [timeouts_and_handlers.md](mdc:docs/timeouts_and_handlers.md) - Core timeout documentation
34
+ - [event_loops.md](mdc:docs/event_loops.md) - Event loop integration
35
+
36
+ 2. Key Concepts:
37
+ ```ruby
38
+ def after(milliseconds, &block)
39
+ register_timeout(Time.now + (milliseconds / 1000.0), block)
40
+ end
41
+ ```
42
+
43
+ 3. Cooperative Nature:
44
+ - Timeouts don't interrupt execution
45
+ - Processed when event loop is ready
46
+ - Timing is approximate, not exact
47
+
48
+ 4. Handler Registration:
49
+ - Handlers registered with specific events
50
+ - Multiple handlers per event possible
51
+ - Order of execution preserved
52
+
53
+ 5. Best Practices:
54
+ - Keep handlers non-blocking
55
+ - Use appropriate timing granularity
56
+ - Consider event loop implications
57
+ - Handle errors appropriately
58
+
59
+ 6. Additional Resources:
60
+ - Wiki: https://github.com/scarpe-team/scarpe/wiki/ScarpeDesign.md#timeouts-and-handlers
61
+ - Related sections:
62
+ * Event Loops
63
+ * Display Service Separation
64
+ * Shoes and Display Events
65
+
66
+ examples:
67
+ - description: "Working with timeouts"
68
+ input: |
69
+ When implementing timeouts:
70
+ 1. Consider cooperative nature
71
+ 2. Use appropriate timing
72
+ 3. Keep handlers non-blocking
73
+ 4. Handle errors properly
74
+
75
+ metadata:
76
+ priority: high
77
+ version: 1.0
78
+ </rule>
@@ -0,0 +1,8 @@
1
+ ---
2
+ description:
3
+ globs: lacci/**/*,lib/scarpe/wv/**/*,lib/scarpe/wv/*.rb
4
+ alwaysApply: false
5
+ ---
6
+ Ensure, that you recognize that a webview (WV) drawable and lacci drawable must BOTH be updated when adding new user DSL/features.
7
+
8
+ You also need to update calzini under scarpe-components
@@ -0,0 +1,22 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ Scarpe is a modern attempt at an implementation of Why The Lucky Stiff's Shoes.rb.
7
+
8
+ It is not complete.
9
+
10
+ It is built on Webview.
11
+
12
+ Our primary goal is to as many shoes apps from `examples/legacy/not_checked` working as possible. So, you can check them for bits of DSL that aren't yet up to scratch. They used to work.
13
+
14
+ `docs/static/manual-en.txt` is our "bible". It is nearly a perfect representation of how Shoes _should_ work. It's what we want to do. With every fibre of your being I want you to help me get the not checked examples working and anything from this manual.
15
+
16
+ It is 3,500 lines long though.
17
+
18
+ To run an example to see if it's working (I'll have to check) run something like:
19
+
20
+ `SCARPE_BOOTSTRAP_THEME=sketchy bundle exec ./exe/scarpe examples/page_navigation_single_app.rb --debug
21
+ `
22
+
@@ -0,0 +1,73 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ # Writing New Rules
7
+
8
+ <rule>
9
+ name: writing_new_rules
10
+ description: Guidelines for creating and formatting new rules in the rules directory
11
+ filters:
12
+ - type: event
13
+ pattern: "new_rule_creation"
14
+
15
+ actions:
16
+ - type: suggest
17
+ message: |
18
+ # Rule Creation Process
19
+
20
+ 1. Always create new rules with .mc extension first:
21
+ - Create file as `.cursor/rules/rule-name.mc`
22
+ - Only convert to .mdc after content is approved
23
+
24
+ 2. Required File Structure:
25
+ ```
26
+ ---
27
+ description: Brief description of the rule's purpose
28
+ globs: "pattern to match files this rule applies to"
29
+ ---
30
+ # Rule Title
31
+
32
+ <rule>
33
+ name: rule_name
34
+ description: Detailed description
35
+ filters:
36
+ - type: event
37
+ pattern: "relevant_event"
38
+
39
+ actions:
40
+ - type: suggest
41
+ message: |
42
+ # Action Title
43
+ Action content...
44
+
45
+ examples:
46
+ - description: "Example scenario"
47
+ input: |
48
+ Example input...
49
+
50
+ metadata:
51
+ priority: level
52
+ version: 1.0
53
+ </rule>
54
+ ```
55
+
56
+ 3. After approval, rename to .mdc:
57
+ ```bash
58
+ mv .cursor/rules/rule-name.mc .cursor/rules/rule-name.mdc
59
+ ```
60
+
61
+ examples:
62
+ - description: "Creating a new rule"
63
+ input: |
64
+ # First create with .mc extension
65
+ touch .cursor/rules/new-feature.mc
66
+
67
+ # After approval, rename to .mdc
68
+ mv .cursor/rules/new-feature.mc .cursor/rules/new-feature.mdc
69
+
70
+ metadata:
71
+ priority: high
72
+ version: 1.0
73
+ </rule>
data/CHANGELOG.md CHANGED
@@ -1,14 +1,55 @@
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
7
- - #-some-pr-number <description> @author-of-pr
6
+ ### Enhancements
7
+ - Added CLAUDE.md for agentic coding assistance
8
+ - Removed bloops as a required dependency - sound is now opt-in (install bloops gem separately if needed)
9
+ - Added base64 gem dependency for Ruby 3.4+ compatibility
8
10
 
9
- ### Changed
11
+ ### Bugs Fixed
12
+ - #569 link(click: "/path") now triggers internal navigation via visit(); paths like "/foo" also fall back to page(:foo) if no URL route matches
13
+ - Support for `class MyApp < Shoes` inheritance pattern with URL routing
14
+ - Fixed background() with remote URLs (now properly wrapped in CSS url())
10
15
 
11
- ### Fixed
16
+ ### Incompatibilities
17
+
18
+ ## [0.4.0] - 2024-05-06 - Strangers
19
+
20
+ Core Scarpe has been relatively stable for awhile. A lot of this release is bugfixes and refactors.
21
+
22
+ ## [0.3.1] - 2023-??-?? - Up
23
+
24
+ Lots of bug fixes. We're also still implementing major Shoes3 features.
25
+ Testing is finally improving at a reasonable rate, but we have a long
26
+ way to go.
27
+
28
+ The Scarpe architecture is still early. We've improved the internal APIs
29
+ for creating drawables significantly, added an asset server and are
30
+ still making big changes.
31
+
32
+ ### Enhancements
33
+
34
+ - Ovals!
35
+ - Lots more text methods: del, sub, sup; lots more text styles: underline, strikethrough, strikecolor, align
36
+ - Features! Shoes.app(feature: [:html, :scarpe]) lets apps declare dependencies on non-classic Shoes!
37
+ - Better handling of :left, :top, :width and :height, :margin and :padding on more drawables
38
+ - The html_class style is a feature to make it easier to do Bootstrap styling on your drawables
39
+ - Directly run Shoes Specs, including with Niente
40
+ - We use Minitest assertion DSL rather than our own everywhere now
41
+
42
+ ### Bugs Fixed
43
+
44
+ - We've changed "module Shoes" to "class Shoes" for Shoes3 compatibility.
45
+ - Several style and method names, including on Para and ListBox, changed to Shoes3 standard.
46
+
47
+ ### Incompatibilities
48
+
49
+ TextDrawables now draw with very different Calzini (HTML renderer) properties
50
+ We're deprecating the CatsCradle test DSL in favour of Shoes-Spec.
51
+ Some error names have changed, with more to come.
52
+ We've changed the Lacci drawable-create event to include the parent ID.
12
53
 
13
54
  ## [0.3.0] - 2023-11-24 - You
14
55
 
data/CLAUDE.md ADDED
@@ -0,0 +1,223 @@
1
+ # Scarpe - AI Assistant Context
2
+
3
+ > *In loving memory of Noah Gibbs, who believed in this project and whose thoughtful documentation lives on in every design decision.*
4
+
5
+ ## What is Scarpe?
6
+
7
+ **Scarpe** (Italian for "shoes") is a modern reimplementation of [Why The Lucky Stiff's Shoes](https://github.com/shoes/shoes-deprecated) - a beloved Ruby GUI toolkit that made desktop app creation accessible to absolute beginners.
8
+
9
+ ```ruby
10
+ # This is all it takes to create a window with a button
11
+ Shoes.app { button("Click me!") { alert("Good job.") } }
12
+ ```
13
+
14
+ Scarpe preserves _why's elegant DSL while building on modern technology (Webview). It is **not yet complete**, but actively maintained.
15
+
16
+ ## The Mission
17
+
18
+ Our primary goal is **backwards compatibility with classic Shoes apps**. We want old Shoes programs to just work.
19
+
20
+ ### The Bible
21
+
22
+ `docs/static/manual.md` (3,500+ lines) is our authoritative reference for how Shoes _should_ work. Every implementation decision should align with this manual.
23
+
24
+ ### The Proving Ground
25
+
26
+ `examples/legacy/not_checked/` contains Shoes apps that **used to work** in classic Shoes. Getting these examples running is our north star.
27
+
28
+ ## Architecture Overview
29
+
30
+ Scarpe has a layered architecture:
31
+
32
+ ### Lacci (The Compatibility Layer)
33
+ **Location:** `lacci/`
34
+
35
+ Lacci (Italian for "laces") translates Shoes commands into display-agnostic operations:
36
+ - Implements the Shoes4 drawing model (stacks, flows, slots)
37
+ - Handles margin calculations, fonts, layout
38
+ - Uses **Niente** (null display service) for testing
39
+
40
+ See: `docs/lacci.md`
41
+
42
+ ### Display Service (The Renderer)
43
+ **Location:** `lib/scarpe/`
44
+
45
+ The display service runs as a **separate process** from the main application:
46
+ - Clear separation between app logic and display logic
47
+ - Different display implementations can be swapped
48
+ - Communication via well-defined message protocol
49
+ - Supports local and relay-based services
50
+
51
+ See: `docs/display_service_separation.md`
52
+
53
+ ### Calzini (The Components)
54
+ Components follow a lifecycle pattern with state management and event handling.
55
+
56
+ See: `docs/calzini_components_and_updates.md`
57
+
58
+ ## Key Documentation
59
+
60
+ All in `docs/`:
61
+
62
+ | Document | Purpose |
63
+ |----------|---------|
64
+ | `static/manual.md` | **THE BIBLE** - How Shoes should work |
65
+ | `lacci.md` | Compatibility layer documentation |
66
+ | `display_service_separation.md` | Architecture decisions |
67
+ | `shoes_and_display_events.md` | Event handling details |
68
+ | `event_loops.md` | Event loop architecture |
69
+ | `timeouts_and_handlers.md` | Timing and callbacks |
70
+ | `calzini_components_and_updates.md` | Component system |
71
+ | `scarpe_shoes_incompatibilities.md` | Known differences from Shoes |
72
+ | `shoes_implementations.md` | History of Shoes implementations |
73
+ | `SCARPE_FEATURES.md` | New features beyond original Shoes |
74
+ | `yard/catscradle.md` | Fiber-based testing approach |
75
+
76
+ ## Running Scarpe
77
+
78
+ ```bash
79
+ # Install dependencies (Linux only - Mac works out of the box)
80
+ sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev # Ubuntu/Debian
81
+
82
+ # Install gems
83
+ bundle install
84
+
85
+ # Run an example
86
+ ./exe/scarpe examples/button.rb --dev --debug
87
+
88
+ # With a theme
89
+ SCARPE_BOOTSTRAP_THEME=sketchy bundle exec ./exe/scarpe examples/button.rb --debug
90
+
91
+ # Optional: For sound support (bloopsaphone examples)
92
+ # gem install bloops # requires portaudio: brew install portaudio (Mac)
93
+ ```
94
+
95
+ ## Testing
96
+
97
+ ```bash
98
+ # Run all tests
99
+ bundle exec rake ci_test
100
+
101
+ # Run component tests
102
+ bundle exec rake lacci_test # Lacci tests
103
+ bundle exec rake component_test # Scarpe-components tests
104
+ bundle exec rake test # Scarpe tests
105
+
106
+ # Check HTML output
107
+ bundle exec rake test:check_html_fixtures
108
+ ```
109
+
110
+ ### Testing Philosophy
111
+
112
+ - Test new features with **Niente** (null display) first
113
+ - Use **Fiber-based testing** for complex event interactions (see CatsCradle)
114
+ - Keep handlers non-blocking
115
+ - Maintain backward compatibility
116
+
117
+ ## Development Workflow
118
+
119
+ ### When Debugging Failed Tests
120
+
121
+ 1. Add strategic `puts` statements to understand the issue
122
+ 2. Run the test and analyze output
123
+ 3. Implement the fix
124
+ 4. Verify the fix
125
+ 5. **Remove all debugging statements before committing**
126
+
127
+ ### Commit Style
128
+
129
+ ```
130
+ Add request validation to UserWidget
131
+
132
+ Prevents invalid requests from reaching the database layer.
133
+ Adds type checking and parameter validation before processing.
134
+
135
+ Impact: Improved error handling and reduced DB load.
136
+ ```
137
+
138
+ - First line: Clear statement of WHAT (50 chars ideal)
139
+ - Empty line after header
140
+ - Body: WHY needed, HOW it works, technical implications
141
+
142
+ ## Code Patterns
143
+
144
+ ### Display Service Singleton
145
+ ```ruby
146
+ class DisplayService < Shoes::DisplayService
147
+ class << self
148
+ attr_accessor :instance
149
+ end
150
+
151
+ def initialize
152
+ if DisplayService.instance
153
+ raise Shoes::Errors::SingletonError, "This is meant to be a singleton!"
154
+ end
155
+ DisplayService.instance = self
156
+ end
157
+ end
158
+ ```
159
+
160
+ ### Event Dispatch
161
+ ```ruby
162
+ def dispatch_event(event_name, event_target, *args, **kwargs)
163
+ handlers = [
164
+ same_name_handlers[:any],
165
+ same_name_handlers[event_target],
166
+ any_name_handlers[:any],
167
+ any_name_handlers[event_target],
168
+ ].compact.inject([], &:+)
169
+ handlers.each { |h| h[:handler].call(*args, **kwargs) }
170
+ end
171
+ ```
172
+
173
+ ## Core Values
174
+
175
+ From the README:
176
+ - **Resiliency** - Tested and trustworthy
177
+ - **User Experience** - Beautiful, easy DSL
178
+ - **Whimsy** - We're here to have fun! Chunky Bacon. 🥓
179
+ - **Empathy** - Help one another
180
+
181
+ ## Adding New Features
182
+
183
+ New features beyond original Shoes require approval and must:
184
+ 1. Not conflict with backwards compatibility
185
+ 2. Be documented in `docs/SCARPE_FEATURES.md`
186
+ 3. Follow existing patterns
187
+
188
+ Example: Page navigation (`page(:home)`, `visit(:another_page)`)
189
+
190
+ ## Project Structure
191
+
192
+ ```
193
+ scarpe/
194
+ ├── lacci/ # Shoes4 compatibility layer
195
+ ├── lib/scarpe/ # Display service implementations
196
+ ├── scarpe-components/ # Shared components
197
+ ├── examples/ # Example apps
198
+ │ └── legacy/not_checked/ # Apps to fix!
199
+ ├── docs/ # Design documentation
200
+ │ └── static/manual.md # THE BIBLE
201
+ ├── test/ # Test suite
202
+ └── exe/scarpe # Main executable
203
+ ```
204
+
205
+ ## Environment Variables
206
+
207
+ | Variable | Purpose |
208
+ |----------|---------|
209
+ | `SCARPE_DISPLAY_SERVICE` | Choose display service (wv_local, wv_relay, etc.) |
210
+ | `SCARPE_TEST_CONTROL` | Path to test control script |
211
+ | `SCARPE_LOG_CONFIG` | YAML file for component log levels |
212
+ | `SCARPE_BOOTSTRAP_THEME` | UI theme (e.g., "sketchy") |
213
+
214
+ ## Links
215
+
216
+ - [GitHub Repository](https://github.com/scarpe-team/scarpe)
217
+ - [Wiki](https://github.com/scarpe-team/scarpe/wiki)
218
+ - [Discord](https://discord.gg/Ca5EHSsGYp)
219
+ - [Nobody Knows Shoes - _why's Manual](https://github.com/whymirror/why-archive/raw/master/shoes/nobody-knows-shoes.pdf)
220
+
221
+ ---
222
+
223
+ *Scarpe Diem: Seize the Shoes*
data/Gemfile CHANGED
@@ -8,7 +8,6 @@ gemspec
8
8
  gem "lacci", path: "lacci"
9
9
  gem "scarpe-components", path: "scarpe-components"
10
10
 
11
- gem "bloops", "~> 0.5" #path: "../bloopsaphone" #git: "https://github.com/scarpe-team/bloopsaphone"
12
11
  gem "rake", "~> 13.0"
13
12
 
14
13
  group :test do
@@ -21,7 +20,8 @@ group :development do
21
20
  gem "redcarpet"
22
21
  gem "debug"
23
22
  gem "rubocop", "~> 1.21"
24
- gem "rubocop-shopify"
23
+ gem "htmlbeautifier"
24
+ gem "diff-lcs"
25
25
  #gem "commonmarker"
26
26
  #gem "github-markup"
27
27
  end
data/Gemfile.lock CHANGED
@@ -1,113 +1,143 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scarpe (0.3.0)
5
- bloops (~> 0.5)
6
- fastimage
7
- lacci
4
+ scarpe (0.4.0)
5
+ base64
6
+ fastimage (~> 2.2.7)
7
+ lacci (~> 0.4.0)
8
8
  logging (~> 2.3.1)
9
- nokogiri
10
- scarpe-components
11
- sqlite3
9
+ nokogiri (~> 1.15.2)
10
+ scarpe-components (~> 0.4.0)
11
+ sqlite3 (~> 1.6.3)
12
+ webrick (~> 1.7.0)
12
13
  webview_ruby (~> 0.1.1)
13
14
 
14
15
  PATH
15
16
  remote: lacci
16
17
  specs:
17
- lacci (0.3.0)
18
- scarpe-components
18
+ lacci (0.4.0)
19
+ scarpe-components (~> 0.4.0)
19
20
 
20
21
  PATH
21
22
  remote: scarpe-components
22
23
  specs:
23
- scarpe-components (0.3.0)
24
+ scarpe-components (0.4.0)
24
25
 
25
26
  GEM
26
27
  remote: https://rubygems.org/
27
28
  specs:
28
29
  ansi (1.5.0)
29
- ast (2.4.2)
30
- bloops (0.5)
31
- builder (3.2.4)
32
- debug (1.8.0)
33
- irb (>= 1.5.0)
34
- reline (>= 0.3.1)
30
+ ast (2.4.3)
31
+ base64 (0.3.0)
32
+ builder (3.3.0)
33
+ date (3.5.1)
34
+ debug (1.11.1)
35
+ irb (~> 1.10)
36
+ reline (>= 0.3.8)
37
+ diff-lcs (1.6.2)
38
+ erb (6.0.1)
35
39
  fastimage (2.2.7)
36
- ffi (1.15.5)
37
- ffi-compiler (1.0.1)
38
- ffi (>= 1.0.0)
40
+ ffi (1.17.2-arm64-darwin)
41
+ ffi (1.17.2-x86_64-darwin)
42
+ ffi (1.17.2-x86_64-linux-gnu)
43
+ ffi-compiler (1.3.2)
44
+ ffi (>= 1.15.5)
39
45
  rake
40
- io-console (0.6.0)
41
- irb (1.6.4)
42
- reline (>= 0.3.0)
43
- json (2.6.3)
46
+ htmlbeautifier (1.4.3)
47
+ io-console (0.8.2)
48
+ irb (1.16.0)
49
+ pp (>= 0.6.0)
50
+ rdoc (>= 4.0.0)
51
+ reline (>= 0.4.2)
52
+ json (2.18.0)
53
+ language_server-protocol (3.17.0.5)
54
+ lint_roller (1.1.0)
44
55
  little-plugger (1.1.4)
45
56
  logging (2.3.1)
46
57
  little-plugger (~> 1.1)
47
58
  multi_json (~> 1.14)
48
- minitest (5.18.0)
49
- minitest-reporters (1.6.0)
59
+ mini_portile2 (2.8.9)
60
+ minitest (5.27.0)
61
+ minitest-reporters (1.7.1)
50
62
  ansi
51
63
  builder
52
64
  minitest (>= 5.0)
53
65
  ruby-progressbar
54
- multi_json (1.15.0)
55
- nokogiri (1.15.2-x86_64-darwin)
56
- racc (~> 1.4)
57
- nokogiri (1.15.2-x86_64-linux)
66
+ multi_json (1.18.0)
67
+ nokogiri (1.15.7)
68
+ mini_portile2 (~> 2.8.2)
58
69
  racc (~> 1.4)
59
- parallel (1.22.1)
60
- parser (3.2.1.0)
70
+ parallel (1.27.0)
71
+ parser (3.3.10.0)
61
72
  ast (~> 2.4.1)
62
- racc (1.7.1)
73
+ racc
74
+ pp (0.6.3)
75
+ prettyprint
76
+ prettyprint (0.2.0)
77
+ prism (1.7.0)
78
+ psych (5.3.1)
79
+ date
80
+ stringio
81
+ racc (1.8.1)
63
82
  rainbow (3.1.1)
64
- rake (13.0.6)
65
- redcarpet (3.6.0)
66
- regexp_parser (2.7.0)
67
- reline (0.3.4)
83
+ rake (13.3.1)
84
+ rdoc (7.0.2)
85
+ erb
86
+ psych (>= 4.0.0)
87
+ tsort
88
+ redcarpet (3.6.1)
89
+ regexp_parser (2.11.3)
90
+ reline (0.6.3)
68
91
  io-console (~> 0.5)
69
- rexml (3.2.5)
70
- rubocop (1.46.0)
92
+ rubocop (1.82.0)
71
93
  json (~> 2.3)
94
+ language_server-protocol (~> 3.17.0.2)
95
+ lint_roller (~> 1.1.0)
72
96
  parallel (~> 1.10)
73
- parser (>= 3.2.0.0)
97
+ parser (>= 3.3.0.2)
74
98
  rainbow (>= 2.2.2, < 4.0)
75
- regexp_parser (>= 1.8, < 3.0)
76
- rexml (>= 3.2.5, < 4.0)
77
- rubocop-ast (>= 1.26.0, < 2.0)
99
+ regexp_parser (>= 2.9.3, < 3.0)
100
+ rubocop-ast (>= 1.48.0, < 2.0)
78
101
  ruby-progressbar (~> 1.7)
79
- unicode-display_width (>= 2.4.0, < 3.0)
80
- rubocop-ast (1.26.0)
81
- parser (>= 3.2.1.0)
82
- rubocop-shopify (2.12.0)
83
- rubocop (~> 1.44)
84
- ruby-progressbar (1.11.0)
85
- sqlite3 (1.6.3-x86_64-darwin)
86
- sqlite3 (1.6.3-x86_64-linux)
87
- unicode-display_width (2.4.2)
102
+ unicode-display_width (>= 2.4.0, < 4.0)
103
+ rubocop-ast (1.48.0)
104
+ parser (>= 3.3.7.2)
105
+ prism (~> 1.4)
106
+ ruby-progressbar (1.13.0)
107
+ sqlite3 (1.6.9)
108
+ mini_portile2 (~> 2.8.0)
109
+ stringio (3.2.0)
110
+ tsort (0.2.0)
111
+ unicode-display_width (3.2.0)
112
+ unicode-emoji (~> 4.1)
113
+ unicode-emoji (4.2.0)
88
114
  webrick (1.7.0)
89
115
  webview_ruby (0.1.2)
90
116
  ffi
91
117
  ffi-compiler
92
118
  rake
93
- yard (0.9.28)
94
- webrick (~> 1.7.0)
119
+ yard (0.9.38)
95
120
 
96
121
  PLATFORMS
122
+ arm64-darwin-21
123
+ arm64-darwin-22
124
+ arm64-darwin-23
97
125
  x86_64-darwin-19
126
+ x86_64-darwin-20
98
127
  x86_64-darwin-22
128
+ x86_64-darwin-23
99
129
  x86_64-linux
100
130
 
101
131
  DEPENDENCIES
102
- bloops (~> 0.5)
103
132
  debug
133
+ diff-lcs
134
+ htmlbeautifier
104
135
  lacci!
105
136
  minitest (~> 5.0)
106
137
  minitest-reporters
107
138
  rake (~> 13.0)
108
139
  redcarpet
109
140
  rubocop (~> 1.21)
110
- rubocop-shopify
111
141
  scarpe!
112
142
  scarpe-components!
113
143
  yard