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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c83fb76fc149cffa58c679978dc3647689acb5b418d7e65a931bddfb1687b250
4
- data.tar.gz: 2b73dae2f9f5be78d6b5637d605b089c3031b14aff91acc1eced51f021283f5a
3
+ metadata.gz: 63b4c563ff3a88126429d53ed2be981c0cf91f0469622ae46663102459bd77f7
4
+ data.tar.gz: 90201e43c50859ebfe9468228fc7380245c9c18f4faba21ffb49333dc4aa7a61
5
5
  SHA512:
6
- metadata.gz: 6da8066857ec4241252fcca4bbe01a60c369260b618a65f44384666a4ed67311ee3bd065ab68bed79f7084e3f8c5ba7c8db3244c3cbcf9e166d1ad5130ccb43d
7
- data.tar.gz: b8ba6762940cc53078e1461024f26b762acd302a99cb6fccd965b4c4018ac1452ad85821c78c8ab59b28db572ac899781d1e84bacd77bce602a9edeb0fe84a85
6
+ metadata.gz: 82d1332c1f875dba16af4891b9da1923e334f3b95f78faaca604783cfe907b05b9abf8bded7c4212d5e27546bbb4e4ee18ba3458ceeb8612a2f9b661bcf0a323
7
+ data.tar.gz: cd7814ee2024f9f69a0e21281e097e2aa4aef4805f43b271c36913cca47c32d58fdf2ac4272fce305f26c60a8753abfd9f4251dc837f20c6864b96a2bbafb76c
@@ -0,0 +1,72 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ # Commit Style Preferences
7
+
8
+ <rule>
9
+ name: commit_style_preferences
10
+ description: Guidelines for writing commit messages
11
+ filters:
12
+ - type: event
13
+ pattern: "pre_commit"
14
+
15
+ actions:
16
+ - type: suggest
17
+ message: |
18
+ # Format Requirements
19
+
20
+ 1. First line (50 chars ideal):
21
+ - Clear, direct statement of WHAT changed
22
+ - Start with verb (Add, Fix, Update, etc.)
23
+
24
+ 2. Empty line after header
25
+
26
+ 3. Body must include:
27
+ - WHY the change was needed
28
+ - HOW it addresses the problem
29
+ - Technical implications
30
+ - Impact on stability/maintenance
31
+
32
+ 4. For API changes:
33
+ - Explicitly state if using private/internal APIs
34
+ - Note any technical debt implications
35
+ - Include upstream context for dependency changes
36
+
37
+ examples:
38
+ - description: "Standard feature change"
39
+ input: |
40
+ Add request validation to UserWidget
41
+
42
+ Prevents invalid requests from reaching the database layer.
43
+ Adds type checking and parameter validation before processing.
44
+
45
+ Impact: Improved error handling and reduced DB load.
46
+
47
+ - description: "Private API change"
48
+ input: |
49
+ Update FrobWidget to use internal Foo::Bar API
50
+
51
+ Rails changed their implementation from X to Y. While both
52
+ are private APIs, this change is required to maintain
53
+ compatibility.
54
+
55
+ Note: Created ticket RAIL-123 to track moving to public
56
+ APIs when available.
57
+
58
+ - description: "Dependency update"
59
+ input: |
60
+ Bump rails to 7737f646773
61
+
62
+ Updates our rails checkout to latest main. Key changes:
63
+ - Journey routing internals refactored
64
+ - ActiveSupport::TimeZone improvements
65
+ - New ActionMailer configuration options
66
+
67
+ Test plan: Full CI suite + extra routing specs
68
+
69
+ metadata:
70
+ priority: high
71
+ version: 1.0
72
+ </rule>
@@ -0,0 +1,82 @@
1
+ ---
2
+ description:
3
+ globs: **/calzini/**/*.rb
4
+ alwaysApply: false
5
+ ---
6
+ # Component Context
7
+
8
+ <rule>
9
+ name: component_context
10
+ description: Share relevant component documentation when working with Calzini components and widgets
11
+ filters:
12
+ - type: file
13
+ pattern: **/*component*.rb
14
+ - type: file
15
+ pattern: **/*component*.md
16
+ - type: file
17
+ pattern: **/*calzini*.rb
18
+ - type: file
19
+ pattern: **/*calzini*.md
20
+ - type: file
21
+ pattern: **/*widget*.rb
22
+ - type: file
23
+ pattern: **/*widget*.md
24
+
25
+ actions:
26
+ - type: suggest
27
+ message: |
28
+ # Component Context
29
+
30
+ When working with Scarpe's component system (Calzini), consider:
31
+
32
+ 1. Component Architecture
33
+ - [calzini_components_and_updates.md](mdc:docs/calzini_components_and_updates.md) - Core component documentation
34
+ - [scarpe_shoes_incompatibilities.md](mdc:docs/scarpe_shoes_incompatibilities.md) - API differences from Shoes
35
+
36
+ 2. Component Lifecycle:
37
+ ```ruby
38
+ class CalziniComponent
39
+ def initialize
40
+ setup_state
41
+ register_handlers
42
+ end
43
+
44
+ def update
45
+ calculate_layout
46
+ trigger_display_update
47
+ end
48
+ end
49
+ ```
50
+
51
+ 3. State Management:
52
+ - Internal component state
53
+ - Props from parent components
54
+ - Global application state
55
+ - Shared resources
56
+
57
+ 4. Best Practices:
58
+ - Keep components focused and single-purpose
59
+ - Handle state updates efficiently
60
+ - Consider compatibility with original Shoes
61
+ - Maintain proper event handling
62
+
63
+ 5. Additional Resources:
64
+ - Wiki: https://github.com/scarpe-team/scarpe/wiki/ScarpeDesign.md#calzini-components-and-updates
65
+ - Related sections:
66
+ * Display Service Separation
67
+ * Event Loops
68
+ * Shoes and Display Events
69
+
70
+ examples:
71
+ - description: "Working with components"
72
+ input: |
73
+ When implementing components:
74
+ 1. Follow the component lifecycle
75
+ 2. Handle state updates properly
76
+ 3. Consider compatibility implications
77
+ 4. Use proper event handling patterns
78
+
79
+ metadata:
80
+ priority: high
81
+ version: 1.0
82
+ </rule>
@@ -0,0 +1,100 @@
1
+ ---
2
+ description: A rule to guide the debugging process when tests fail by adding puts statements, analyzing output, fixing the issue, and cleaning up.
3
+ globs: "**/*_test.rb"
4
+ ---
5
+ # Debug Failed Tests
6
+
7
+ A rule that guides you to add debugging statements when a test fails, run the test again to understand the issue, implement a fix, and then remove the debugging statements once everything works.
8
+
9
+ <rule>
10
+ name: debug_failed_tests
11
+ description: When a test fails, add debugging statements before implementing a fix
12
+ filters:
13
+ - type: event
14
+ pattern: "test_failed"
15
+
16
+ actions:
17
+ - type: suggest
18
+ message: |
19
+ # Add debugging statements
20
+
21
+ Identify the failing test and add strategic 'puts' statements to print relevant variables, state, or execution flow information that might help diagnose the issue.
22
+
23
+ Example:
24
+ ```ruby
25
+ # Before
26
+ def calculate_total(items)
27
+ items.sum { |item| item[:price] * item[:quantity] }
28
+ end
29
+
30
+ # After adding debugging
31
+ def calculate_total(items)
32
+ puts "Items received: #{items.inspect}"
33
+ total = items.sum do |item|
34
+ puts "Processing item: #{item[:name]}, price: #{item[:price]}, quantity: #{item[:quantity]}"
35
+ item[:price] * item[:quantity]
36
+ end
37
+ puts "Calculated total: #{total}"
38
+ total
39
+ end
40
+ ```
41
+
42
+ - type: suggest
43
+ message: |
44
+ # Run the test with debugging
45
+
46
+ Run the failing test again and analyze the debugging output to understand what's happening and why the test is failing.
47
+
48
+ - type: suggest
49
+ message: |
50
+ # Implement a fix
51
+
52
+ Now that you understand the issue better from the debugging output, implement a solution to fix the failing test.
53
+
54
+ - type: suggest
55
+ message: |
56
+ # Verify the fix
57
+
58
+ Run the test again to ensure your fix resolves the issue and the test now passes.
59
+
60
+ - type: suggest
61
+ message: |
62
+ # Clean up debugging statements
63
+
64
+ Now that the test is passing, remove all the debugging statements you added to keep the code clean and production-ready.
65
+
66
+ Example:
67
+ ```ruby
68
+ # Before (with debugging)
69
+ def calculate_total(items)
70
+ puts "Items received: #{items.inspect}"
71
+ total = items.sum do |item|
72
+ puts "Processing item: #{item[:name]}, price: #{item[:price]}, quantity: #{item[:quantity]}"
73
+ item[:price] * item[:quantity]
74
+ end
75
+ puts "Calculated total: #{total}"
76
+ total
77
+ end
78
+
79
+ # After (debugging removed)
80
+ def calculate_total(items)
81
+ items.sum { |item| item[:price] * item[:quantity] }
82
+ end
83
+ ```
84
+
85
+ examples:
86
+ - input: |
87
+ # A failing test for a calculation method
88
+ def test_calculate_total
89
+ items = [
90
+ { name: "Item 1", price: 10, quantity: 2 },
91
+ { name: "Item 2", price: 15, quantity: 3 }
92
+ ]
93
+ assert_equal 65, calculate_total(items)
94
+ end
95
+ output: "Added debugging, fixed the issue, and removed debugging statements"
96
+
97
+ metadata:
98
+ priority: medium
99
+ version: 1.0
100
+ </rule>
@@ -0,0 +1,80 @@
1
+ ---
2
+ description:
3
+ globs: **/*display*.rb,**/*display_service*.rb,**/*display*.md
4
+ alwaysApply: false
5
+ ---
6
+ # Display Service Context
7
+
8
+ <rule>
9
+ name: display_service_context
10
+ description: Share relevant display service documentation and implementation details when working with display service files
11
+ filters:
12
+ - type: file
13
+ pattern: **/*display*.rb
14
+ - type: file
15
+ pattern: **/*display_service*.rb
16
+ - type: file
17
+ pattern: **/*display*.md
18
+
19
+ actions:
20
+ - type: suggest
21
+ message: |
22
+ # Display Service Context
23
+
24
+ When working with Scarpe's display service, it's important to understand the core architectural decisions:
25
+
26
+ 1. The display service runs as a separate process from the main application
27
+ 2. Communication happens through a well-defined protocol
28
+ 3. Different display implementations can be swapped out
29
+ 4. The system supports both local and relay-based display services
30
+
31
+ Key files and concepts:
32
+ - [display_service_separation.md](mdc:docs/display_service_separation.md) - Core architectural documentation
33
+ - `Shoes::DisplayService` - Base display service class
34
+ - `Scarpe::Webview::DisplayService` - Webview implementation
35
+ - `Scarpe::Webview::RelayDisplayService` - Process separation implementation
36
+
37
+ Implementation patterns:
38
+ ```ruby
39
+ # Display service singleton pattern
40
+ class DisplayService < Shoes::DisplayService
41
+ class << self
42
+ attr_accessor :instance
43
+ end
44
+
45
+ def initialize
46
+ if DisplayService.instance
47
+ raise Shoes::Errors::SingletonError, "ERROR! This is meant to be a singleton!"
48
+ end
49
+ DisplayService.instance = self
50
+ end
51
+ end
52
+ ```
53
+
54
+ Event handling:
55
+ ```ruby
56
+ # Event dispatch pattern
57
+ def dispatch_event(event_name, event_target, *args, **kwargs)
58
+ handlers = [
59
+ same_name_handlers[:any], # Same name, any target
60
+ same_name_handlers[event_target], # Same name, same target
61
+ any_name_handlers[:any], # Any name, any target
62
+ any_name_handlers[event_target], # Any name, same target
63
+ ].compact.inject([], &:+)
64
+ handlers.each { |h| h[:handler].call(*args, **kwargs) }
65
+ end
66
+ ```
67
+
68
+ examples:
69
+ - description: "Working with display service implementation"
70
+ input: |
71
+ When implementing a new display service or modifying an existing one:
72
+ 1. Follow the singleton pattern for display service instances
73
+ 2. Implement proper event handling and dispatch
74
+ 3. Ensure clean process separation if using relay approach
75
+ 4. Handle drawable creation and management consistently
76
+
77
+ metadata:
78
+ priority: high
79
+ version: 1.0
80
+ </rule>
@@ -0,0 +1,100 @@
1
+ ---
2
+ description: Share event handling context when working with event-related files
3
+ globs:
4
+ alwaysApply: false
5
+ ---
6
+ # Event Handling Context
7
+
8
+ <rule>
9
+ name: event_handling_context
10
+ description: Share relevant event handling and testing documentation when working with event-related files
11
+ filters:
12
+ - type: file
13
+ pattern: **/*event*.rb
14
+ - type: file
15
+ pattern: **/*event*.md
16
+ - type: file
17
+ pattern: **/*loop*.rb
18
+ - type: file
19
+ pattern: **/*loop*.md
20
+ - type: file
21
+ pattern: **/*fiber*.rb
22
+ - type: file
23
+ pattern: **/*fiber*.md
24
+ - type: file
25
+ pattern: **/*catscradle*.rb
26
+ - type: file
27
+ pattern: **/*catscradle*.md
28
+
29
+ actions:
30
+ - type: suggest
31
+ message: |
32
+ # Event Handling Context
33
+
34
+ When working with Scarpe's event system, it's important to understand:
35
+
36
+ 1. Event Loop Architecture
37
+ - [event_loops.md](mdc:docs/event_loops.md) - Core event loop documentation
38
+ - [shoes_and_display_events.md](mdc:docs/shoes_and_display_events.md) - Event handling details
39
+ - [catscradle.md](mdc:docs/yard/catscradle.md) - Fiber-based testing approach
40
+
41
+ 2. Key Testing Concepts:
42
+ ```ruby
43
+ # Example of Fiber-based test
44
+ def test_html_dom_multiple_update
45
+ run_test_scarpe_code(<<-'SCARPE_APP', app_test_code: <<-'TEST_CODE')
46
+ Shoes.app do
47
+ para "Hello World"
48
+ end
49
+ SCARPE_APP
50
+ on_heartbeat do
51
+ p = para()
52
+ assert_include dom_html, "Hello World"
53
+ p.replace("Goodbye World")
54
+ wait fully_updated
55
+ assert_include dom_html, "Goodbye World"
56
+ test_finished
57
+ end
58
+ TEST_CODE
59
+ end
60
+ ```
61
+
62
+ 3. Event Types:
63
+ - Mouse events (click, hover, etc.)
64
+ - Keyboard events
65
+ - Window events
66
+ - Custom events
67
+ - Heartbeat events
68
+
69
+ 4. Implementation Details:
70
+ - Events are queued in order of arrival
71
+ - Priority system for critical events
72
+ - Fiber-based coordination for testing
73
+ - Cooperative multitasking approach
74
+
75
+ 5. Best Practices:
76
+ - Keep handlers fast and focused
77
+ - Use Fiber-based testing for complex interactions
78
+ - Handle errors appropriately
79
+ - Maintain proper process separation
80
+
81
+ 6. Additional Resources:
82
+ - Wiki: https://github.com/scarpe-team/scarpe/wiki/ScarpeDesign.md#event-loops
83
+ - Related sections:
84
+ * Display Service Separation
85
+ * Shoes and Display Events
86
+ * Timeouts and handlers
87
+
88
+ examples:
89
+ - description: "Working with event handlers"
90
+ input: |
91
+ When implementing event handling:
92
+ 1. Consider using Fiber-based testing for complex scenarios
93
+ 2. Keep handlers non-blocking
94
+ 3. Use proper event dispatch patterns
95
+ 4. Consider process separation implications
96
+
97
+ metadata:
98
+ priority: high
99
+ version: 1.0
100
+ </rule>
@@ -0,0 +1,64 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: false
5
+ ---
6
+ <rule>
7
+ name: git_pager_handling
8
+ description: When running git commands that would normally use a pager, append | cat to prevent breaking automated environments
9
+
10
+ filters:
11
+ - type: command
12
+ pattern: "^git (diff|log|show|blame)"
13
+ - type: command
14
+ pattern: "^git.*\\|(\\s+)?less"
15
+ - type: command
16
+ pattern: "^git.*\\|(\\s+)?more"
17
+
18
+ actions:
19
+ - type: suggest
20
+ message: |
21
+ # Git Pager Handling
22
+
23
+ When running git commands that would normally use a pager (like `git diff`, `git log`, etc.), always append `| cat` to prevent the pager from breaking the output. This is especially important in automated environments.
24
+
25
+ ## Examples
26
+
27
+ ```bash
28
+ # Good
29
+ git diff HEAD~1 HEAD | cat
30
+ git log | cat
31
+ git show | cat
32
+
33
+ # Bad
34
+ git diff HEAD~1 HEAD
35
+ git log
36
+ git show
37
+ ```
38
+
39
+ ## Common Commands Needing `| cat`
40
+
41
+ - `git diff`
42
+ - `git log`
43
+ - `git show`
44
+ - `git blame`
45
+ - Any other git command that might produce paginated output
46
+
47
+ ## Why?
48
+
49
+ The pager (usually `less` or `more`) expects user interaction, which isn't available in automated environments. Piping to `cat` ensures we get the full output without pagination.
50
+
51
+ examples:
52
+ - description: "Running git diff in automated environment"
53
+ input: |
54
+ git diff HEAD~1 HEAD | cat
55
+
56
+ metadata:
57
+ priority: high
58
+ version: 1.0
59
+ </rule>
60
+
61
+ metadata:
62
+ priority: high
63
+ version: 1.0
64
+ </rule>
@@ -0,0 +1,52 @@
1
+ ---
2
+ description:
3
+ globs: lacci/**/*
4
+ alwaysApply: false
5
+ ---
6
+ # Lacci Context
7
+
8
+ <rule>
9
+ name: lacci_context
10
+ description: Provides information about Lacci's purpose and operation
11
+ filters:
12
+ - type: glob
13
+ pattern: "lacci/**/*"
14
+
15
+ actions:
16
+ - type: suggest
17
+ message: |
18
+ # Working with Lacci
19
+
20
+ [lacci.md](mdc:docs/lacci.md)
21
+
22
+ You are currently working in Lacci, the Shoes4 compatibility layer for Scarpe.
23
+ For detailed documentation, see: docs/lacci.md
24
+
25
+ Key points to remember:
26
+ 1. Lacci translates Shoes4 commands to display-agnostic operations
27
+ 2. Uses Niente (null display service) for testing
28
+ 3. Implements drawing context inheritance
29
+ 4. Handles margins, fonts, and layout
30
+
31
+ Common patterns:
32
+ - Test new features with Niente first
33
+ - Follow existing error handling patterns
34
+ - Maintain backward compatibility
35
+ - Document changes thoroughly
36
+
37
+ examples:
38
+ - description: "Adding a new drawing primitive"
39
+ input: |
40
+ # Example of adding a new shape
41
+ module Shoes
42
+ class Triangle < Shape
43
+ def initialize(app, left, top, width, height, **styles)
44
+ super(app, left, top, width, height, **styles)
45
+ end
46
+ end
47
+ end
48
+
49
+ metadata:
50
+ priority: high
51
+ version: 1.0
52
+ </rule>
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: Share Scarpe design context when working on related files
3
+ globs: docs/*.md
4
+ alwaysApply: false
5
+ ---
6
+ # Scarpe Design Context
7
+
8
+ <rule>
9
+ name: scarpe_design_context
10
+ description: Share relevant Scarpe design documentation when working on related files
11
+ filters:
12
+ - type: file
13
+ pattern: "docs/*.md"
14
+
15
+ actions:
16
+ - type: suggest
17
+ message: |
18
+ # Scarpe Design Context
19
+
20
+ When working on Scarpe-related files, it's important to consider the design principles and decisions made during its development. Here are key documents that provide context:
21
+
22
+ - @display_service_separation.md
23
+ - @shoes_and_display_events.md
24
+ - @event_loops.md
25
+ - @timeouts_and_handlers.md
26
+ - @calzini_components_and_updates.md
27
+ - @scarpe_shoes_incompatibilities.md
28
+ - @shoes_implementations.md
29
+ - @web_archaeology.md
30
+
31
+ These documents cover various aspects of Scarpe's design, including its relationship with Shoes, event handling, and component updates. Refer to them for a deeper understanding of the project's architecture and design choices.
32
+
33
+ examples:
34
+ - description: "Working on a Scarpe component"
35
+ input: |
36
+ # Working on a new Scarpe component
37
+
38
+ When creating a new component, it's crucial to understand how Scarpe handles updates and events. Refer to the following documents for guidance:
39
+
40
+ - @calzini_components_and_updates.md
41
+ - @shoes_and_display_events.md
42
+
43
+ metadata:
44
+ priority: medium
45
+ version: 1.0
46
+ </rule>
@@ -0,0 +1,75 @@
1
+ ---
2
+ description:
3
+ globs: **/*shoes*.rb,**/*shoes*.md
4
+ alwaysApply: false
5
+ ---
6
+ # Shoes Compatibility Context
7
+
8
+ <rule>
9
+ name: shoes_compatibility_context
10
+ description: Share relevant compatibility documentation when working with Shoes implementations
11
+ filters:
12
+ - type: file
13
+ pattern: **/*shoes*.rb
14
+ - type: file
15
+ pattern: **/*shoes*.md
16
+ - type: file
17
+ pattern: **/*compatibility*.rb
18
+ - type: file
19
+ pattern: **/*compatibility*.md
20
+ - type: file
21
+ pattern: **/*compat*.rb
22
+ - type: file
23
+ pattern: **/*compat*.md
24
+
25
+ actions:
26
+ - type: suggest
27
+ message: |
28
+ # Shoes Compatibility Context
29
+
30
+ When working with Shoes compatibility, consider:
31
+
32
+ 1. Implementation History
33
+ - @docs/shoes_implementations.md - Various Shoes implementations
34
+ - @docs/scarpe_shoes_incompatibilities.md - Known differences
35
+ - @docs/web_archaeology.md - Historical context
36
+
37
+ 2. Key Differences:
38
+ - Method names and signatures
39
+ - Event handling behavior
40
+ - Layout system changes
41
+ - API modifications
42
+
43
+ 3. Implementation Types:
44
+ - Original Shoes (C/Ruby)
45
+ - Green Shoes (GTK+)
46
+ - Purple Shoes (Windows)
47
+ - Scarpe (Web-based)
48
+
49
+ 4. Best Practices:
50
+ - Document incompatibilities clearly
51
+ - Provide migration paths when possible
52
+ - Consider cross-implementation testing
53
+ - Maintain historical context
54
+
55
+ 5. Additional Resources:
56
+ - Wiki: https://github.com/scarpe-team/scarpe/wiki/ScarpeDesign.md#scarpe-shoes-incompatibilities
57
+ - Related sections:
58
+ * Display Service Separation
59
+ * Event Loops
60
+ * Timeouts and handlers
61
+ * Calzini Components
62
+
63
+ examples:
64
+ - description: "Working with Shoes compatibility"
65
+ input: |
66
+ When handling compatibility:
67
+ 1. Check implementation differences
68
+ 2. Document API changes
69
+ 3. Consider migration paths
70
+ 4. Test across implementations
71
+
72
+ metadata:
73
+ priority: high
74
+ version: 1.0
75
+ </rule>