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.
- checksums.yaml +4 -4
- data/.cursor/rules/commit-style-preferences.mdc +72 -0
- data/.cursor/rules/component_context.mdc +82 -0
- data/.cursor/rules/debug-failed-tests.mdc +100 -0
- data/.cursor/rules/display_service_context.mdc +80 -0
- data/.cursor/rules/event_handling_context.mdc +100 -0
- data/.cursor/rules/git-pager-handling.mdc +64 -0
- data/.cursor/rules/lacci-context.mdc +52 -0
- data/.cursor/rules/scarpe_design_context.mdc +46 -0
- data/.cursor/rules/shoes_compatibility_context.mdc +75 -0
- data/.cursor/rules/timeout_context.mdc +78 -0
- data/.cursor/rules/update_lacci_and_wv.mdc +8 -0
- data/.cursor/rules/what_is_scarpe.mdc +22 -0
- data/.cursor/rules/writing-new-rules.mdc +73 -0
- data/CHANGELOG.md +46 -5
- data/CLAUDE.md +223 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +85 -55
- data/LICENSE.txt +7 -1
- data/README.md +80 -20
- data/Rakefile +73 -14
- data/docs/SCARPE_FEATURES.md +38 -0
- data/docs/_config.yml +13 -0
- data/docs/calzini_components_and_updates.md +78 -0
- data/docs/display_service_separation.md +39 -0
- data/docs/documentation.md +43 -0
- data/docs/event_loops.md +66 -0
- data/docs/image.png +0 -0
- data/docs/index.md +118 -0
- data/docs/lacci.md +121 -0
- data/docs/scarpe_shoes_incompatibilities.md +71 -0
- data/docs/shoes_and_display_events.md +55 -0
- data/docs/shoes_implementations.md +79 -0
- data/docs/static/manual.md +5 -0
- data/docs/static/scarpe-logo.png +0 -0
- data/docs/timeouts_and_handlers.md +66 -0
- data/docs/web_archaeology.md +76 -0
- data/examples/Edit_box_Styles.rb +8 -0
- data/examples/Kerning.rb +7 -0
- data/examples/background_with_image.rb +14 -5
- data/examples/bloopsaphone/working/feepogram.rb +1 -1
- data/examples/bloopsaphone/working/le_dance_des_rubis.rb +135 -0
- data/examples/bloopsaphone/working/pixel_dreams_in_ruby.rb +131 -0
- data/examples/bloopsaphone/working/type_rebellion.rb +157 -0
- data/examples/border.rb +11 -0
- data/examples/check.rb +2 -0
- data/examples/download_and_show_image.rb +3 -0
- data/examples/flags/finland.rb +15 -0
- data/examples/flags/italy.rb +11 -0
- data/examples/flags/mauritius.rb +14 -0
- data/examples/font_family.rb +17 -0
- data/examples/font_shorthand.rb +9 -0
- data/examples/gen.rb +4 -0
- data/examples/internal_link_navigation.rb +19 -0
- data/examples/legacy/not_checked/shoes-manual/append.rb +10 -0
- data/examples/legacy/not_checked/shoes-manual/background_change.rb +12 -0
- data/examples/legacy/not_checked/shoes-manual/background_pattern.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/basic_app.rb +8 -0
- data/examples/legacy/not_checked/shoes-manual/border.rb +9 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/FONTS.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/ask.rb +2 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/ask_color.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/ask_open_file.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/ask_save_folder.rb +2 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/confirm.rb +4 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/debug.rb +2 -0
- data/examples/legacy/not_checked/shoes-manual/builtins/info.rb +3 -0
- data/examples/legacy/not_checked/shoes-manual/button.rb +9 -0
- data/examples/legacy/not_checked/shoes-manual/clear.rb +7 -0
- data/examples/legacy/not_checked/shoes-manual/custom_header.rb +13 -0
- data/examples/legacy/not_checked/shoes-manual/displace.rb +14 -0
- data/examples/legacy/not_checked/shoes-manual/edit_box.rb +8 -0
- data/examples/legacy/not_checked/shoes-manual/fill_pattern.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/fonts.rb +7 -0
- data/examples/legacy/not_checked/shoes-manual/gutter.rb +6 -0
- data/examples/legacy/not_checked/shoes-manual/image_web.rb +4 -0
- data/examples/legacy/not_checked/shoes-manual/keypress.rb +7 -0
- data/examples/legacy/not_checked/shoes-manual/list_box.rb +10 -0
- data/examples/legacy/not_checked/shoes-manual/motion.rb +10 -0
- data/examples/legacy/not_checked/shoes-manual/mouse.rb +8 -0
- data/examples/legacy/not_checked/shoes-manual/move.rb +14 -0
- data/examples/legacy/not_checked/shoes-manual/nested_ovals.rb +8 -0
- data/examples/legacy/not_checked/shoes-manual/oval.rb +7 -0
- data/examples/legacy/not_checked/shoes-manual/ovals.rb +6 -0
- data/examples/legacy/not_checked/shoes-manual/ovals_image.rb +8 -0
- data/examples/legacy/not_checked/shoes-manual/prepend.rb +7 -0
- data/examples/legacy/not_checked/shoes-manual/progress_bar.rb +10 -0
- data/examples/legacy/not_checked/shoes-manual/radio.rb +18 -0
- data/examples/legacy/not_checked/shoes-manual/radio_alternative_1.rb +7 -0
- data/examples/legacy/not_checked/shoes-manual/radio_alternative_2.rb +9 -0
- data/examples/legacy/not_checked/shoes-manual/rotate_rectangle.rb +6 -0
- data/examples/legacy/not_checked/shoes-manual/shape.rb +11 -0
- data/examples/legacy/not_checked/shoes-manual/static/avatar.png +0 -0
- data/examples/legacy/not_checked/shoes-manual/stroke.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/style.rb +3 -0
- data/examples/legacy/not_checked/shoes-manual/style_alternative_1.rb +4 -0
- data/examples/legacy/not_checked/shoes-manual/style_alternative_2.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/style_length.rb +5 -0
- data/examples/legacy/not_checked/shoes-manual/timer.rb +6 -0
- data/examples/legacy/not_checked/shoes-manual/trigger_window.rb +8 -0
- data/examples/legacy/not_checked/shoes-manual/window_owner.rb +8 -0
- data/examples/legacy/working/shoes_manual/alert_button.rb +2 -0
- data/examples/legacy/working/shoes_manual/animate.rb +7 -0
- data/examples/legacy/working/shoes_manual/background_para.rb +4 -0
- data/examples/legacy/working/shoes_manual/button_alternative.rb +7 -0
- data/examples/legacy/working/shoes_manual/checkbox.rb +17 -0
- data/examples/legacy/working/shoes_manual/download.rb +12 -0
- data/examples/legacy/working/shoes_manual/edit_box.rb +6 -0
- data/examples/legacy/working/shoes_manual/editline.rb +7 -0
- data/examples/legacy/working/shoes_manual/fixed_height.rb +8 -0
- data/examples/legacy/working/shoes_manual/fixed_width.rb +12 -0
- data/examples/legacy/working/shoes_manual/image.rb +5 -0
- data/examples/legacy/working/shoes_manual/instance_variable_check.rb +10 -0
- data/examples/legacy/working/shoes_manual/message.rb +18 -0
- data/examples/legacy/working/shoes_manual/rectangle.rb +6 -0
- data/examples/legacy/working/shoes_manual/save_download.rb +12 -0
- data/examples/legacy/working/shoes_manual/self_check.rb +10 -0
- data/examples/legacy/working/shoes_manual/stack.rb +7 -0
- data/examples/legacy/working/shoes_manual/style_info.rb +8 -0
- data/examples/legacy/working/shoes_manual/utf8_support.rb +8 -0
- data/examples/legacy/working/shoes_manual/width.rb +4 -0
- data/examples/local_assets/multi_image.rb +5 -0
- data/examples/local_assets/small.png +0 -0
- data/examples/local_fonts.rb +3 -0
- data/examples/margin.rb +13 -0
- data/examples/margin_check.rb +27 -0
- data/examples/oval-with-kwargs.rb +3 -0
- data/examples/oval.rb +26 -0
- data/examples/page_navigation_single_app.rb +42 -0
- data/examples/para_font_styles.rb +17 -0
- data/examples/para_font_variant.rb +6 -0
- data/examples/para_fontweight.rb +13 -0
- data/examples/parse_xl_funnies.rb +3 -0
- data/examples/rect.rb +1 -1
- data/examples/scarpe_ext.rb +3 -0
- data/examples/shapes/star.rb +1 -3
- data/examples/shoes_subclass_app.rb +25 -0
- data/examples/spacing.rb +1 -1
- data/examples/span.rb +4 -2
- data/examples/url_routing_example.rb +67 -0
- data/lacci/Gemfile +0 -2
- data/lacci/Gemfile.lock +4 -32
- data/lacci/lacci.gemspec +3 -3
- data/lacci/lib/lacci/scarpe_cli.rb +0 -1
- data/lacci/lib/lacci/version.rb +1 -1
- data/lacci/lib/scarpe/niente/app.rb +12 -1
- data/lacci/lib/scarpe/niente/display_service.rb +5 -1
- data/lacci/lib/scarpe/niente/drawable.rb +2 -0
- data/lacci/lib/scarpe/niente/shoes_spec.rb +10 -5
- data/lacci/lib/scarpe/niente.rb +15 -2
- data/lacci/lib/shoes/app.rb +204 -105
- data/lacci/lib/shoes/constants.rb +24 -2
- data/lacci/lib/shoes/display_service.rb +43 -4
- data/lacci/lib/shoes/drawable.rb +326 -36
- data/lacci/lib/shoes/drawables/arc.rb +4 -26
- data/lacci/lib/shoes/drawables/arrow.rb +3 -23
- data/lacci/lib/shoes/drawables/border.rb +28 -0
- data/lacci/lib/shoes/drawables/button.rb +5 -21
- data/lacci/lib/shoes/drawables/check.rb +7 -3
- data/lacci/lib/shoes/drawables/document_root.rb +4 -4
- data/lacci/lib/shoes/drawables/edit_box.rb +6 -5
- data/lacci/lib/shoes/drawables/edit_line.rb +5 -4
- data/lacci/lib/shoes/drawables/flow.rb +4 -6
- data/lacci/lib/shoes/drawables/font_helper.rb +62 -0
- data/lacci/lib/shoes/drawables/image.rb +2 -2
- data/lacci/lib/shoes/drawables/line.rb +3 -6
- data/lacci/lib/shoes/drawables/link.rb +16 -9
- data/lacci/lib/shoes/drawables/list_box.rb +8 -5
- data/lacci/lib/shoes/drawables/oval.rb +48 -0
- data/lacci/lib/shoes/drawables/para.rb +106 -18
- data/lacci/lib/shoes/drawables/progress.rb +2 -1
- data/lacci/lib/shoes/drawables/radio.rb +5 -3
- data/lacci/lib/shoes/drawables/rect.rb +7 -6
- data/lacci/lib/shoes/drawables/shape.rb +4 -3
- data/lacci/lib/shoes/drawables/slot.rb +102 -9
- data/lacci/lib/shoes/drawables/stack.rb +7 -12
- data/lacci/lib/shoes/drawables/star.rb +9 -31
- data/lacci/lib/shoes/drawables/text_drawable.rb +93 -34
- data/lacci/lib/shoes/drawables/video.rb +3 -2
- data/lacci/lib/shoes/drawables/widget.rb +9 -4
- data/lacci/lib/shoes/drawables.rb +2 -1
- data/lacci/lib/shoes/errors.rb +13 -3
- data/lacci/lib/shoes/margin_helper.rb +79 -0
- data/lacci/lib/shoes.rb +98 -20
- data/lacci/test/.gitignore +1 -0
- data/lacci/test/test_draw_context.rb +167 -0
- data/lacci/test/test_font_helper.rb +57 -0
- data/lacci/test/test_helper.rb +31 -4
- data/lacci/test/test_lacci.rb +93 -6
- data/lacci/test/test_margin_helper.rb +82 -0
- data/lacci/test/test_niente_test_infra.rb +40 -0
- data/lacci/test/test_oval.rb +82 -0
- data/lacci/test/test_parenting.rb +140 -0
- data/lacci/test/test_shoes_errors.rb +15 -13
- data/lacci/test/test_text_drawables.rb +23 -0
- data/lib/scarpe/assets.rb +19 -0
- data/lib/scarpe/cats_cradle.rb +57 -98
- data/lib/scarpe/shoes_spec.rb +24 -44
- data/lib/scarpe/version.rb +1 -1
- data/lib/scarpe/wv/app.rb +1 -0
- data/lib/scarpe/wv/arc.rb +0 -4
- data/lib/scarpe/wv/border.rb +15 -0
- data/lib/scarpe/wv/control_interface.rb +2 -10
- data/lib/scarpe/wv/document_root.rb +2 -2
- data/lib/scarpe/wv/drawable.rb +6 -40
- data/lib/scarpe/wv/edit_box.rb +4 -1
- data/lib/scarpe/wv/edit_line.rb +4 -1
- data/lib/scarpe/wv/image.rb +2 -5
- data/lib/scarpe/wv/link.rb +4 -2
- data/lib/scarpe/wv/oval.rb +13 -0
- data/lib/scarpe/wv/para.rb +1 -0
- data/lib/scarpe/wv/scarpe_extensions.rb +8 -0
- data/lib/scarpe/wv/shape.rb +10 -5
- data/lib/scarpe/wv/text_drawable.rb +72 -14
- data/lib/scarpe/wv/web_wrangler.rb +33 -11
- data/lib/scarpe/wv/webview_local_display.rb +6 -2
- data/lib/scarpe/wv.rb +16 -2
- data/scarpe-components/Gemfile +4 -3
- data/scarpe-components/Gemfile.lock +6 -37
- data/scarpe-components/README.md +2 -2
- data/scarpe-components/assets/bootstrap-themes/bootstrap-cerulean.css +12229 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-cosmo.css +11810 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-cyborg.css +12210 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-darkly.css +12153 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-flatly.css +12126 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-icons.min.css +5 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-journal.css +12099 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-litera.css +12211 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-lumen.css +12369 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-lux.css +11928 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-materia.css +13184 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-minty.css +12177 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-morph.css +12750 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-pulse.css +11890 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-quartz.css +12622 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-sandstone.css +12201 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-simplex.css +12186 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-sketchy.css +12451 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-slate.css +12492 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-solar.css +12149 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-spacelab.css +12266 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-superhero.css +12216 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-united.css +12077 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-vapor.css +12549 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-yeti.css +12325 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap-zephyr.css +12283 -0
- data/scarpe-components/assets/bootstrap-themes/bootstrap.bundle.min.js +7 -0
- data/scarpe-components/lib/scarpe/components/asset_server.rb +219 -0
- data/scarpe-components/lib/scarpe/components/base64.rb +22 -0
- data/scarpe-components/lib/scarpe/components/calzini/{art_widgets.rb → art_drawables.rb} +42 -18
- data/scarpe-components/lib/scarpe/components/calzini/border.rb +38 -0
- data/scarpe-components/lib/scarpe/components/calzini/button.rb +6 -8
- data/scarpe-components/lib/scarpe/components/calzini/misc.rb +14 -16
- data/scarpe-components/lib/scarpe/components/calzini/para.rb +218 -11
- data/scarpe-components/lib/scarpe/components/calzini/slots.rb +16 -60
- data/scarpe-components/lib/scarpe/components/calzini.rb +88 -1
- data/scarpe-components/lib/scarpe/components/errors.rb +4 -0
- data/scarpe-components/lib/scarpe/components/html.rb +4 -1
- data/scarpe-components/lib/scarpe/components/minitest_export_reporter.rb +11 -3
- data/scarpe-components/lib/scarpe/components/minitest_result.rb +41 -0
- data/scarpe-components/lib/scarpe/components/port_helpers.rb +30 -0
- data/scarpe-components/lib/scarpe/components/print_logger.rb +17 -2
- data/scarpe-components/lib/scarpe/components/process_helpers.rb +37 -0
- data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +1 -1
- data/scarpe-components/lib/scarpe/components/tiranti.rb +42 -100
- data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +3 -1
- data/scarpe-components/lib/scarpe/components/version.rb +1 -1
- data/scarpe-components/scarpe-components.gemspec +1 -1
- data/scarpe-components/test/assets/big-image.png +0 -0
- data/scarpe-components/test/assets/big-stylesheet.css +497 -0
- data/scarpe-components/test/assets/little-image.png +0 -0
- data/scarpe-components/test/assets/little-stylesheet.css +1 -0
- data/scarpe-components/test/calzini/test_calzini_art_drawables.rb +7 -7
- data/scarpe-components/test/calzini/test_calzini_button.rb +7 -5
- data/scarpe-components/test/calzini/test_calzini_misc.rb +9 -9
- data/scarpe-components/test/calzini/test_calzini_para.rb +6 -9
- data/scarpe-components/test/calzini/test_calzini_slots.rb +12 -57
- data/scarpe-components/test/calzini/test_calzini_text_drawables.rb +83 -18
- data/scarpe-components/test/calzini/test_various.rb +133 -0
- data/scarpe-components/test/test_asset_server.rb +72 -0
- data/scarpe-components/test/test_components.rb +31 -2
- data/scarpe-components/test/test_helper.rb +0 -1
- data/scarpe-components/test/test_minitest_result.rb +7 -0
- data/scarpe-components/test/test_port_helpers.rb +12 -0
- data/scarpe-components/test/test_segmented_app_files.rb +2 -0
- data/tasks/check_html_fixtures.rb +140 -0
- data/tasks/regenerate_html_fixtures.rb +104 -0
- data/templates/class_template_with_shapes.erb +0 -11
- metadata +225 -39
- data/.rubocop.yml +0 -88
- data/lacci/lib/scarpe/niente/logger.rb +0 -29
- data/lacci/lib/shoes/drawables/span.rb +0 -27
- data/lacci/lib/shoes/spacing.rb +0 -9
- data/lib/scarpe/evented_assertions.rb +0 -121
- data/lib/scarpe/wv/span.rb +0 -44
- data/scarpe-components/lib/scarpe/components/calzini/text_widgets.rb +0 -65
- /data/examples/legacy/{not_checked → working}/shoes3-tests/editline/editline.rb +0 -0
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
|
|
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
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](https://github.com/Shopify/ruby-style-guide)
|
|
6
6
|
[](https://discord.gg/Ca5EHSsGYp)
|
|
7
7
|
|
|
8
|
-
<img src="
|
|
8
|
+
<img src="docs/static/scarpe-logo.png">
|
|
9
9
|
|
|
10
|
-
"Scarpe" means shoes in Italian. "Scarpe" also means [Shoes](https://github.com/shoes/shoes-deprecated) in modern Ruby and
|
|
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
|
|
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
|
|
|
@@ -52,26 +52,23 @@ More examples can be found in the [`examples` folder](https://github.com/scarpe-
|
|
|
52
52
|
|
|
53
53
|
## Wiki
|
|
54
54
|
|
|
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 contributor or an experienced user, the Wiki provides valuable information to enhance your Scarpe experience.
|
|
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.
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
## Scarpe in Development
|
|
59
59
|
|
|
60
60
|
### Quickstart
|
|
61
61
|
|
|
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 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.
|
|
63
63
|
|
|
64
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.
|
|
65
65
|
|
|
66
66
|
```
|
|
67
|
-
# dependencies - Mac version
|
|
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)
|
|
71
67
|
# dependencies - Ubuntu Linux version
|
|
72
|
-
sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev
|
|
68
|
+
sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev
|
|
73
69
|
|
|
74
|
-
for any other
|
|
70
|
+
# for any other Linux or Windows please see the webview docs for your platform:
|
|
71
|
+
# https://github.com/webview/webview#prerequisites
|
|
75
72
|
|
|
76
73
|
# get it
|
|
77
74
|
git clone http://github.com/scarpe-team/scarpe
|
|
@@ -83,33 +80,71 @@ cd scarpe; bundle install
|
|
|
83
80
|
|
|
84
81
|
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.
|
|
85
82
|
|
|
86
|
-
|
|
83
|
+
## Run Test
|
|
84
|
+
|
|
85
|
+
To Run all availble tests run command
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
bundle exec rake ci_test
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### To Run Tests separately
|
|
93
|
+
|
|
94
|
+
Scarpe is composed of [various sub-libraries](https://github.com/scarpe-team/scarpe/wiki/ShoesArchitecture.md). You can run some tests separately.
|
|
95
|
+
|
|
96
|
+
Run Lacci Tests:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
bundle exec rake lacci_test
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Run Scarpe-Components Tests:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
bundle exec rake component_test
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Run Scarpe Tests:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
bundle exec rake test
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Check HTML Output:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
bundle exec rake test:check_html_fixtures
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Finer Details
|
|
87
122
|
|
|
88
123
|
First, clone the [main GitHub repository](https://github.com/scarpe-team/scarpe).
|
|
89
124
|
|
|
90
|
-
`bundle install` dependencies like
|
|
125
|
+
`bundle install` dependencies like Webview from the cloned directory in your Ruby of choice.
|
|
91
126
|
|
|
92
127
|
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.
|
|
93
128
|
|
|
94
129
|
Most commonly we are all using this command: `./exe/scarpe examples/button.rb --dev --debug`
|
|
95
130
|
|
|
96
|
-
The `--dev` flag points to your local
|
|
131
|
+
The `--dev` flag points to your local Scarpe rather than an installed Scarpe gem.
|
|
97
132
|
|
|
98
133
|
The `--debug` flag will dump a ton of useful information to the console if you want to see what's happening with your app.
|
|
99
134
|
|
|
100
|
-
It's very early in
|
|
135
|
+
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.
|
|
101
136
|
|
|
102
137
|
We'd love the help!
|
|
103
138
|
|
|
104
|
-
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
|
|
139
|
+
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.
|
|
105
140
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## Are we done yet?
|
|
141
|
+
## Are We Done Yet?
|
|
109
142
|
|
|
110
143
|
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.
|
|
111
144
|
|
|
112
|
-
|
|
145
|
+
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.
|
|
146
|
+
|
|
147
|
+
### Examples Passing with the Webview Display Service
|
|
113
148
|
|
|
114
149
|

|
|
115
150
|
|
|
@@ -134,6 +169,31 @@ The SCARPE_TEST_CONTROL environment variable can contain a path to a test-contro
|
|
|
134
169
|
|
|
135
170
|
If you run ./exe/scarpe --dev env, you can see all current environment settings.
|
|
136
171
|
|
|
172
|
+
## Shoes-Spec
|
|
173
|
+
|
|
174
|
+
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.
|
|
175
|
+
|
|
176
|
+
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.
|
|
177
|
+
|
|
178
|
+
They're often packaged in .sspec files that look like this:
|
|
179
|
+
|
|
180
|
+
~~~
|
|
181
|
+
---
|
|
182
|
+
----------- app code
|
|
183
|
+
Shoes.app do
|
|
184
|
+
@b = button "OK" do
|
|
185
|
+
@b.text = "Clicked"
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
----------- test code
|
|
190
|
+
assert_equal "OK", button().text
|
|
191
|
+
button().trigger_click
|
|
192
|
+
assert_equal "Clicked", button().text
|
|
193
|
+
~~~
|
|
194
|
+
|
|
195
|
+
See [https://github.com/scarpe-team/shoes-spec] for more details.
|
|
196
|
+
|
|
137
197
|
## More info
|
|
138
198
|
|
|
139
199
|
* [Nobody Knows Shoes manual](https://github.com/whymirror/why-archive/raw/master/shoes/nobody-knows-shoes.pdf)
|
data/Rakefile
CHANGED
|
@@ -1,27 +1,86 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
require 'rake/testtask'
|
|
5
|
+
|
|
6
|
+
# Rakefile
|
|
7
|
+
|
|
8
|
+
task :ci_test do
|
|
9
|
+
puts "
|
|
10
|
+
\033[1;32;4;47mInstalling Dependencies\033[0m
|
|
11
|
+
"
|
|
12
|
+
|
|
13
|
+
system('brew install pkg-config portaudio')
|
|
14
|
+
|
|
15
|
+
puts "
|
|
16
|
+
\033[1;32;4;47mCheckout Code\033[0m
|
|
17
|
+
"
|
|
18
|
+
system('git checkout main')
|
|
19
|
+
|
|
20
|
+
puts "
|
|
21
|
+
\033[1;32;4;47mSetup Ruby and install Gems\033[0m
|
|
22
|
+
"
|
|
23
|
+
system('bundle install')
|
|
24
|
+
|
|
25
|
+
# Run tests
|
|
26
|
+
|
|
27
|
+
puts "
|
|
28
|
+
\033[1;32;4;47mRun Lacci Tests\033[0m
|
|
29
|
+
"
|
|
30
|
+
system('CI_RUN=true bundle exec rake lacci_test')
|
|
31
|
+
|
|
32
|
+
puts "
|
|
33
|
+
\033[1;32;4;47mRun Scarpe-Component Tests\033[0m
|
|
34
|
+
"
|
|
35
|
+
|
|
36
|
+
system('CI_RUN=true bundle exec rake component_test')
|
|
37
|
+
|
|
38
|
+
puts "
|
|
39
|
+
\033[1;32;4;47mRun Scarpe Tests\033[0m
|
|
40
|
+
"
|
|
41
|
+
system('CI_RUN=true bundle exec rake test')
|
|
42
|
+
|
|
43
|
+
puts "
|
|
44
|
+
\033[1;32;4;47mCheck HTML Output\033[0m
|
|
45
|
+
"
|
|
46
|
+
system('bundle exec rake test:check_html_fixtures')
|
|
47
|
+
|
|
48
|
+
puts "
|
|
49
|
+
\033[1;32;4;47mUpload Fail logs\033[0m
|
|
50
|
+
"
|
|
51
|
+
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')
|
|
52
|
+
end
|
|
6
53
|
|
|
7
54
|
Rake::TestTask.new(:test) do |t|
|
|
8
|
-
t.libs <<
|
|
9
|
-
t.libs <<
|
|
10
|
-
t.test_files = FileList[
|
|
55
|
+
t.libs << 'test'
|
|
56
|
+
t.libs << 'lib'
|
|
57
|
+
t.test_files = FileList['test/**/test_*.rb']
|
|
11
58
|
end
|
|
12
59
|
|
|
13
60
|
Rake::TestTask.new(:lacci_test) do |t|
|
|
14
|
-
t.libs <<
|
|
15
|
-
t.libs <<
|
|
16
|
-
t.test_files = FileList[
|
|
61
|
+
t.libs << 'lacci/test'
|
|
62
|
+
t.libs << 'lacci/lib'
|
|
63
|
+
t.test_files = FileList['lacci/test/**/test_*.rb']
|
|
17
64
|
end
|
|
18
65
|
|
|
19
66
|
Rake::TestTask.new(:component_test) do |t|
|
|
20
|
-
t.libs <<
|
|
21
|
-
t.libs <<
|
|
22
|
-
t.test_files = FileList[
|
|
67
|
+
t.libs << 'scarpe-components/test'
|
|
68
|
+
t.libs << 'scarpe-components/lib'
|
|
69
|
+
t.test_files = FileList['scarpe-components/test/**/test_*.rb']
|
|
23
70
|
end
|
|
24
71
|
|
|
25
|
-
|
|
72
|
+
namespace :test do
|
|
73
|
+
desc 'Regenerate HTML fixtures'
|
|
74
|
+
task :regenerate_html_fixtures do |_t|
|
|
75
|
+
ENV['SELECTED_FILE'] = ARGV[-1] if ARGV[-1].include?('.rb')
|
|
76
|
+
load 'tasks/regenerate_html_fixtures.rb'
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
desc 'Check HTML fixtures against latest output'
|
|
80
|
+
task :check_html_fixtures do |_t|
|
|
81
|
+
ENV['SELECTED_FILE'] = ARGV[-1] if ARGV[-1].include?('.rb')
|
|
82
|
+
load 'tasks/check_html_fixtures.rb'
|
|
83
|
+
end
|
|
84
|
+
end
|
|
26
85
|
|
|
27
|
-
task default: [
|
|
86
|
+
task default: %i[test lacci_test component_test]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: Scarpe Features
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Extending _why's Legacy
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
The leading mission for Scarpe has been to implement as much backwards compatibility as possible for _why's original
|
|
11
|
+
Shoes library. This remains true. _why's taste and DSL are celebrated and preserved. However, at the discretion of
|
|
12
|
+
core maintainers, new features may be added. They must be approved by Noah Gibbs or Nick Schwaderer, and described
|
|
13
|
+
in this file. They cannot conflict or damage backwards compatibility with the original Shoes library.
|
|
14
|
+
|
|
15
|
+
## Page Navigation
|
|
16
|
+
|
|
17
|
+
Similar to URL navigation. see `url_navigation_single_app.rb` for an example. Unlike URLs, they do not accept parameters,
|
|
18
|
+
only the name of the page. They are simply declared and named in blocks.
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
Shoes.app do
|
|
22
|
+
page(:home) do
|
|
23
|
+
title "Home Page"
|
|
24
|
+
para "Welcome to the home page"
|
|
25
|
+
button "Go to another page" do
|
|
26
|
+
visit(:another_page)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
page(:another_page) do
|
|
31
|
+
title "Another Page"
|
|
32
|
+
para "Welcome to another page"
|
|
33
|
+
button "Go to home page" do
|
|
34
|
+
visit(:home)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
```
|
data/docs/_config.yml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: calzini components and updates
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Calzini Components and Updates
|
|
7
|
+
|
|
8
|
+
Calzini is Scarpe's component system, providing a modern approach to UI components while maintaining Shoes compatibility.
|
|
9
|
+
|
|
10
|
+
## Component Structure
|
|
11
|
+
|
|
12
|
+
Components in Calzini follow this structure:
|
|
13
|
+
|
|
14
|
+
1. **Base Components**
|
|
15
|
+
- Built-in widgets (Button, EditLine, etc.)
|
|
16
|
+
- Layout components (Stack, Flow)
|
|
17
|
+
- Custom components
|
|
18
|
+
|
|
19
|
+
2. **Component Lifecycle**
|
|
20
|
+
```ruby
|
|
21
|
+
class CalziniComponent
|
|
22
|
+
def initialize
|
|
23
|
+
setup_state
|
|
24
|
+
register_handlers
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def update
|
|
28
|
+
calculate_layout
|
|
29
|
+
trigger_display_update
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## State Management
|
|
35
|
+
|
|
36
|
+
Components manage state through:
|
|
37
|
+
|
|
38
|
+
1. **Internal State**
|
|
39
|
+
- Local component state
|
|
40
|
+
- Cached calculations
|
|
41
|
+
- Temporary values
|
|
42
|
+
|
|
43
|
+
2. **External State**
|
|
44
|
+
- Props from parent components
|
|
45
|
+
- Global application state
|
|
46
|
+
- Shared resources
|
|
47
|
+
|
|
48
|
+
## Update Mechanism
|
|
49
|
+
|
|
50
|
+
Updates in Calzini happen through:
|
|
51
|
+
|
|
52
|
+
1. **Change Detection**
|
|
53
|
+
- State changes trigger updates
|
|
54
|
+
- Props changes propagate
|
|
55
|
+
- Layout changes cascade
|
|
56
|
+
|
|
57
|
+
2. **Update Process**
|
|
58
|
+
- Changes are batched
|
|
59
|
+
- Updates are scheduled
|
|
60
|
+
- Display is refreshed efficiently
|
|
61
|
+
|
|
62
|
+
## Best Practices
|
|
63
|
+
|
|
64
|
+
When working with Calzini components:
|
|
65
|
+
|
|
66
|
+
1. Keep components focused and small
|
|
67
|
+
2. Use proper state management
|
|
68
|
+
3. Optimize update triggers
|
|
69
|
+
4. Handle errors gracefully
|
|
70
|
+
|
|
71
|
+
## Shoes Compatibility
|
|
72
|
+
|
|
73
|
+
Calzini maintains compatibility with Shoes:
|
|
74
|
+
|
|
75
|
+
- Similar API structure
|
|
76
|
+
- Familiar component names
|
|
77
|
+
- Compatible event handling
|
|
78
|
+
- Consistent behavior
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: Display Service Separation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Display Service Separation
|
|
7
|
+
|
|
8
|
+
The display service in Scarpe is separated from the main application to provide better isolation and flexibility. This design choice allows for:
|
|
9
|
+
|
|
10
|
+
1. Clear separation between the application logic and display logic
|
|
11
|
+
2. Ability to swap out display implementations
|
|
12
|
+
3. Better testing capabilities through isolation
|
|
13
|
+
4. Reduced coupling between components
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
The display service runs as a separate process from the main Scarpe application. Communication happens through a well-defined protocol that includes:
|
|
18
|
+
|
|
19
|
+
- Event messages for user interactions
|
|
20
|
+
- Display update commands
|
|
21
|
+
- State synchronization messages
|
|
22
|
+
|
|
23
|
+
## Benefits
|
|
24
|
+
|
|
25
|
+
This separation provides several key benefits:
|
|
26
|
+
|
|
27
|
+
1. **Security**: The display service can run with different permissions
|
|
28
|
+
2. **Stability**: Issues in the display layer won't crash the main application
|
|
29
|
+
3. **Flexibility**: Different display implementations can be used without changing the core application
|
|
30
|
+
4. **Testing**: Components can be tested in isolation
|
|
31
|
+
|
|
32
|
+
## Implementation Details
|
|
33
|
+
|
|
34
|
+
The display service communicates with the main application through a message-passing interface. This allows for:
|
|
35
|
+
|
|
36
|
+
- Asynchronous updates
|
|
37
|
+
- Clean separation of concerns
|
|
38
|
+
- Easy testing and mocking
|
|
39
|
+
- Future extensibility
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: Documentation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation
|
|
7
|
+
|
|
8
|
+
## The Shoes Manual
|
|
9
|
+
|
|
10
|
+
The comprehensive guide to Shoes — everything you need to know.
|
|
11
|
+
|
|
12
|
+
**[Read the Manual →](static/manual)**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Architecture & Internals
|
|
17
|
+
|
|
18
|
+
For contributors and the curious.
|
|
19
|
+
|
|
20
|
+
| Document | Description |
|
|
21
|
+
|----------|-------------|
|
|
22
|
+
| [Lacci](lacci) | The Shoes compatibility layer |
|
|
23
|
+
| [Display Service](display_service_separation) | How Scarpe separates app logic from rendering |
|
|
24
|
+
| [Events](shoes_and_display_events) | Event handling in Scarpe |
|
|
25
|
+
| [Event Loops](event_loops) | Understanding the event loop architecture |
|
|
26
|
+
| [Timeouts & Handlers](timeouts_and_handlers) | Timing and callback patterns |
|
|
27
|
+
| [Calzini Components](calzini_components_and_updates) | The HTML rendering component system |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Reference
|
|
32
|
+
|
|
33
|
+
| Document | Description |
|
|
34
|
+
|----------|-------------|
|
|
35
|
+
| [Scarpe Features](SCARPE_FEATURES) | New features beyond original Shoes |
|
|
36
|
+
| [Incompatibilities](scarpe_shoes_incompatibilities) | Known differences from Shoes 3 |
|
|
37
|
+
| [Shoes Implementations](shoes_implementations) | History of Shoes reimplementations |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<p style="text-align: center; margin-top: 2rem;">
|
|
42
|
+
<a href="./">← Back to Home</a>
|
|
43
|
+
</p>
|
data/docs/event_loops.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: event loops
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Event Loops
|
|
7
|
+
|
|
8
|
+
Scarpe's event loop system is a core part of its architecture, handling both UI events and application logic.
|
|
9
|
+
|
|
10
|
+
## Main Event Loop
|
|
11
|
+
|
|
12
|
+
The main event loop is responsible for:
|
|
13
|
+
|
|
14
|
+
1. Processing user input
|
|
15
|
+
2. Handling timer events
|
|
16
|
+
3. Managing display updates
|
|
17
|
+
4. Coordinating between components
|
|
18
|
+
|
|
19
|
+
## Implementation Details
|
|
20
|
+
|
|
21
|
+
The event loop is implemented with these key features:
|
|
22
|
+
|
|
23
|
+
### Event Queue
|
|
24
|
+
- Events are queued in order of arrival
|
|
25
|
+
- Priority system for critical events
|
|
26
|
+
- Efficient processing of batched events
|
|
27
|
+
|
|
28
|
+
### Handler Registration
|
|
29
|
+
```ruby
|
|
30
|
+
class EventLoop
|
|
31
|
+
def register_handler(event_type, &block)
|
|
32
|
+
handlers[event_type] << block
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Event Processing
|
|
38
|
+
- Events are processed in a single thread
|
|
39
|
+
- Non-blocking operations where possible
|
|
40
|
+
- Careful handling of long-running tasks
|
|
41
|
+
|
|
42
|
+
## Cooperative Multitasking
|
|
43
|
+
|
|
44
|
+
Scarpe uses cooperative multitasking where:
|
|
45
|
+
|
|
46
|
+
1. Tasks yield control voluntarily
|
|
47
|
+
2. Long operations are broken into smaller chunks
|
|
48
|
+
3. The event loop maintains responsiveness
|
|
49
|
+
|
|
50
|
+
## Best Practices
|
|
51
|
+
|
|
52
|
+
When working with the event loop:
|
|
53
|
+
|
|
54
|
+
1. Keep handlers fast and focused
|
|
55
|
+
2. Avoid blocking operations
|
|
56
|
+
3. Use async operations for long-running tasks
|
|
57
|
+
4. Handle errors appropriately
|
|
58
|
+
|
|
59
|
+
## Integration with Display Service
|
|
60
|
+
|
|
61
|
+
The event loop coordinates closely with the display service:
|
|
62
|
+
|
|
63
|
+
- Synchronizes state updates
|
|
64
|
+
- Manages display refresh timing
|
|
65
|
+
- Handles animation frames
|
|
66
|
+
- Coordinates user input
|
data/docs/image.png
ADDED
|
Binary file
|
data/docs/index.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
title: Scarpe - Shoes in Modern Ruby
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<div style="text-align: center; margin-bottom: 2rem;">
|
|
7
|
+
<img src="static/scarpe-logo.png" alt="Scarpe Logo" style="max-width: 400px; width: 100%;">
|
|
8
|
+
<p style="font-size: 1.4rem; color: #666; font-style: italic; margin-top: 1rem;">Scarpe Diem: Seize the Shoes</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
**Scarpe** (Italian for "shoes") is a modern reimplementation of [Why The Lucky Stiff's Shoes](https://github.com/shoes/shoes-deprecated) — the beloved Ruby GUI toolkit that made desktop app creation accessible to everyone.
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
Shoes.app do
|
|
17
|
+
button "Click me!" do
|
|
18
|
+
alert "Hello, Shoes!"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
That's it. That's a desktop app.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Why Scarpe?
|
|
28
|
+
|
|
29
|
+
Shoes was magic. Write a few lines of Ruby, get a real desktop application. No frameworks, no build tools, no complexity. Just pure, joyful programming.
|
|
30
|
+
|
|
31
|
+
But old Shoes stopped working. Scarpe brings it back — built on modern Ruby and [Webview](https://github.com/niclas-pehrsson/webview_ruby), running on macOS, Linux, and Windows.
|
|
32
|
+
|
|
33
|
+
<div style="display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0;">
|
|
34
|
+
<div style="flex: 1; min-width: 200px; padding: 1rem; background: #f8f8f8; border-radius: 8px;">
|
|
35
|
+
<h3>Simple</h3>
|
|
36
|
+
<p>Write desktop apps in pure Ruby. No ceremony, no boilerplate.</p>
|
|
37
|
+
</div>
|
|
38
|
+
<div style="flex: 1; min-width: 200px; padding: 1rem; background: #f8f8f8; border-radius: 8px;">
|
|
39
|
+
<h3>Beautiful</h3>
|
|
40
|
+
<p>Elegant DSL for layouts, text, images, shapes, and animations.</p>
|
|
41
|
+
</div>
|
|
42
|
+
<div style="flex: 1; min-width: 200px; padding: 1rem; background: #f8f8f8; border-radius: 8px;">
|
|
43
|
+
<h3>Fun</h3>
|
|
44
|
+
<p>Programming should be joyful. Scarpe keeps the whimsy alive.</p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
gem install scarpe
|
|
54
|
+
|
|
55
|
+
# Create hello.rb
|
|
56
|
+
echo 'Shoes.app { para "Hello, World!" }' > hello.rb
|
|
57
|
+
|
|
58
|
+
# Run it!
|
|
59
|
+
scarpe hello.rb
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## A Taste of Scarpe
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
Shoes.app(title: "My App", width: 400, height: 300) do
|
|
68
|
+
background "#f5f5f5"
|
|
69
|
+
|
|
70
|
+
stack margin: 20 do
|
|
71
|
+
title "Welcome!"
|
|
72
|
+
para "Scarpe makes GUI programming simple."
|
|
73
|
+
|
|
74
|
+
flow do
|
|
75
|
+
button("Say Hello") { alert("Hello!") }
|
|
76
|
+
button("Goodbye") { exit }
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Stacks and flows for layout. Buttons and text with one line each. Blocks for callbacks. Ruby as it should be.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
<div style="display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0;">
|
|
89
|
+
<a href="static/manual" style="flex: 1; min-width: 150px; padding: 1rem; background: #CC342D; color: white; text-align: center; border-radius: 8px; text-decoration: none;">
|
|
90
|
+
<strong>The Manual</strong><br>
|
|
91
|
+
<small>Complete reference</small>
|
|
92
|
+
</a>
|
|
93
|
+
<a href="documentation" style="flex: 1; min-width: 150px; padding: 1rem; background: #666; color: white; text-align: center; border-radius: 8px; text-decoration: none;">
|
|
94
|
+
<strong>All Docs</strong><br>
|
|
95
|
+
<small>Architecture & internals</small>
|
|
96
|
+
</a>
|
|
97
|
+
<a href="https://github.com/scarpe-team/scarpe" style="flex: 1; min-width: 150px; padding: 1rem; background: #333; color: white; text-align: center; border-radius: 8px; text-decoration: none;">
|
|
98
|
+
<strong>GitHub</strong><br>
|
|
99
|
+
<small>Source & issues</small>
|
|
100
|
+
</a>
|
|
101
|
+
<a href="https://discord.gg/Ca5EHSsGYp" style="flex: 1; min-width: 150px; padding: 1rem; background: #5865F2; color: white; text-align: center; border-radius: 8px; text-decoration: none;">
|
|
102
|
+
<strong>Discord</strong><br>
|
|
103
|
+
<small>Community chat</small>
|
|
104
|
+
</a>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## In Memory
|
|
110
|
+
|
|
111
|
+
*Scarpe is developed in loving memory of [Noah Gibbs](https://codefol.io/), who believed in this project and whose thoughtful documentation lives on in every design decision.*
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
<div style="text-align: center; margin-top: 3rem; color: #999;">
|
|
116
|
+
<p>Made with Ruby and whimsy.</p>
|
|
117
|
+
<p><small>Scarpe is open source under the MIT license.</small></p>
|
|
118
|
+
</div>
|