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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Shoes.app(title: 'Advanced URL Routing Example', width: 300, height: 200) do
|
|
2
|
+
style(Shoes::Para, size: 10)
|
|
3
|
+
style(Shoes::Button, width: 80)
|
|
4
|
+
|
|
5
|
+
url '/', :index
|
|
6
|
+
url '/about', :about
|
|
7
|
+
url '/contact', :contact
|
|
8
|
+
url '/user/(\d+)', :user
|
|
9
|
+
url '/product/(\w+)', :product
|
|
10
|
+
|
|
11
|
+
def index
|
|
12
|
+
background '#f0f0f0'
|
|
13
|
+
title 'Home Page'
|
|
14
|
+
para 'Welcome to the advanced URL routing example!'
|
|
15
|
+
button 'About' do
|
|
16
|
+
visit '/about'
|
|
17
|
+
end
|
|
18
|
+
button 'Contact' do
|
|
19
|
+
visit '/contact'
|
|
20
|
+
end
|
|
21
|
+
button 'User 42' do
|
|
22
|
+
visit '/user/42'
|
|
23
|
+
end
|
|
24
|
+
@user_id = edit_line(1, width: "40%", secret: true)
|
|
25
|
+
button 'Pick a user' do
|
|
26
|
+
visit "/user/#{@user_id.text}"
|
|
27
|
+
end
|
|
28
|
+
button 'Product XYZ' do
|
|
29
|
+
visit '/product/XYZ'
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def about
|
|
34
|
+
background '#DFA5A5'
|
|
35
|
+
title 'About Page'
|
|
36
|
+
para 'This is the About page.'
|
|
37
|
+
home_button
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def contact
|
|
41
|
+
background '#A5DFA5'
|
|
42
|
+
title 'Contact Page'
|
|
43
|
+
para 'This is the Contact page.'
|
|
44
|
+
home_button
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def user(id)
|
|
48
|
+
background '#A5A5DF'
|
|
49
|
+
title 'User Page'
|
|
50
|
+
para "EDIT LINE: #{@user_id&.text}"
|
|
51
|
+
para "This is the page for User #{id}"
|
|
52
|
+
home_button
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def product(name)
|
|
56
|
+
background '#DFDF A5'
|
|
57
|
+
title 'Product Page'
|
|
58
|
+
para "This is the page for Product #{name}"
|
|
59
|
+
home_button
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def home_button
|
|
63
|
+
button 'Home' do
|
|
64
|
+
visit '/'
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
data/lacci/Gemfile
CHANGED
data/lacci/Gemfile.lock
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ../scarpe-components
|
|
3
3
|
specs:
|
|
4
|
-
scarpe-components (0.
|
|
4
|
+
scarpe-components (0.4.0)
|
|
5
5
|
|
|
6
6
|
PATH
|
|
7
7
|
remote: .
|
|
8
8
|
specs:
|
|
9
|
-
lacci (0.
|
|
10
|
-
scarpe-components
|
|
9
|
+
lacci (0.4.0)
|
|
10
|
+
scarpe-components (~> 0.4.0)
|
|
11
11
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
15
|
ansi (1.5.0)
|
|
16
|
-
ast (2.4.2)
|
|
17
16
|
builder (3.2.4)
|
|
18
17
|
debug (1.8.0)
|
|
19
18
|
irb (>= 1.5.0)
|
|
@@ -21,46 +20,21 @@ GEM
|
|
|
21
20
|
io-console (0.6.0)
|
|
22
21
|
irb (1.7.2)
|
|
23
22
|
reline (>= 0.3.6)
|
|
24
|
-
json (2.6.3)
|
|
25
|
-
language_server-protocol (3.17.0.3)
|
|
26
23
|
minitest (5.18.1)
|
|
27
24
|
minitest-reporters (1.6.0)
|
|
28
25
|
ansi
|
|
29
26
|
builder
|
|
30
27
|
minitest (>= 5.0)
|
|
31
28
|
ruby-progressbar
|
|
32
|
-
parallel (1.23.0)
|
|
33
|
-
parser (3.2.2.3)
|
|
34
|
-
ast (~> 2.4.1)
|
|
35
|
-
racc
|
|
36
|
-
racc (1.7.1)
|
|
37
|
-
rainbow (3.1.1)
|
|
38
29
|
rake (13.0.6)
|
|
39
30
|
redcarpet (3.6.0)
|
|
40
|
-
regexp_parser (2.8.1)
|
|
41
31
|
reline (0.3.6)
|
|
42
32
|
io-console (~> 0.5)
|
|
43
|
-
rexml (3.2.5)
|
|
44
|
-
rubocop (1.54.1)
|
|
45
|
-
json (~> 2.3)
|
|
46
|
-
language_server-protocol (>= 3.17.0)
|
|
47
|
-
parallel (~> 1.10)
|
|
48
|
-
parser (>= 3.2.2.3)
|
|
49
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
50
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
51
|
-
rexml (>= 3.2.5, < 4.0)
|
|
52
|
-
rubocop-ast (>= 1.28.0, < 2.0)
|
|
53
|
-
ruby-progressbar (~> 1.7)
|
|
54
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
|
55
|
-
rubocop-ast (1.29.0)
|
|
56
|
-
parser (>= 3.2.1.0)
|
|
57
|
-
rubocop-shopify (2.14.0)
|
|
58
|
-
rubocop (~> 1.51)
|
|
59
33
|
ruby-progressbar (1.13.0)
|
|
60
|
-
unicode-display_width (2.4.2)
|
|
61
34
|
yard (0.9.34)
|
|
62
35
|
|
|
63
36
|
PLATFORMS
|
|
37
|
+
arm64-darwin-21
|
|
64
38
|
x86_64-darwin-22
|
|
65
39
|
|
|
66
40
|
DEPENDENCIES
|
|
@@ -70,8 +44,6 @@ DEPENDENCIES
|
|
|
70
44
|
minitest-reporters
|
|
71
45
|
rake (~> 13.0)
|
|
72
46
|
redcarpet
|
|
73
|
-
rubocop (~> 1.21)
|
|
74
|
-
rubocop-shopify
|
|
75
47
|
scarpe-components!
|
|
76
48
|
yard
|
|
77
49
|
|
data/lacci/lacci.gemspec
CHANGED
|
@@ -16,21 +16,21 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
|
17
17
|
|
|
18
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
19
|
-
spec.metadata["source_code_uri"] = "https://github.com/scarpe-team/scarpe"
|
|
19
|
+
#spec.metadata["source_code_uri"] = "https://github.com/scarpe-team/scarpe"
|
|
20
20
|
spec.metadata["changelog_uri"] = "https://github.com/scarpe-team/scarpe/blob/main/CHANGELOG.md"
|
|
21
21
|
|
|
22
22
|
# Specify which files should be added to the gem when it is released.
|
|
23
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
24
24
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
25
25
|
`git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|tasks)/|\.(?:git|travis|circleci)|appveyor)})
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
spec.bindir = "exe"
|
|
30
30
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
31
31
|
spec.require_paths = ["lib"]
|
|
32
32
|
|
|
33
|
-
spec.add_dependency "scarpe-components"
|
|
33
|
+
spec.add_dependency "scarpe-components", "~>0.4.0"
|
|
34
34
|
|
|
35
35
|
# For more information and examples about making a new gem, check out our
|
|
36
36
|
# guide at: https://bundler.io/guides/creating_gem.html
|
|
@@ -28,7 +28,6 @@ module Scarpe
|
|
|
28
28
|
"Lacci" => [
|
|
29
29
|
env_or_default("SCARPE_DISPLAY_SERVICE", "(none)"),
|
|
30
30
|
env_or_default("SCARPE_LOG_CONFIG", "(default)#{Shoes::Log::DEFAULT_LOG_CONFIG.inspect}"),
|
|
31
|
-
env_or_default("SCARPE_APP_TEST", "(none)"),
|
|
32
31
|
],
|
|
33
32
|
"Ruby and Shell" => [
|
|
34
33
|
["RUBY_DESCRIPTION", RUBY_DESCRIPTION],
|
data/lacci/lib/lacci/version.rb
CHANGED
|
@@ -14,7 +14,18 @@ module Niente
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def run
|
|
17
|
-
send_shoes_event("
|
|
17
|
+
send_shoes_event("return", event_name: "custom_event_loop")
|
|
18
|
+
|
|
19
|
+
@do_shutdown = false
|
|
20
|
+
bind_shoes_event(event_name: "destroy") do
|
|
21
|
+
@do_shutdown = true
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
at_exit do
|
|
25
|
+
until @do_shutdown
|
|
26
|
+
Shoes::DisplayService.dispatch_event("heartbeat", nil)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
18
29
|
end
|
|
19
30
|
|
|
20
31
|
def destroy
|
|
@@ -29,7 +29,7 @@ module Niente
|
|
|
29
29
|
# @param properties [Hash] a JSON-serialisable Hash with the drawable's Shoes styles
|
|
30
30
|
# @param is_widget [Boolean] whether the class is a user-defined Shoes::Widget subclass
|
|
31
31
|
# @return [Webview::Drawable] the newly-created Webview drawable
|
|
32
|
-
def create_display_drawable_for(drawable_class_name, drawable_id, properties, is_widget:)
|
|
32
|
+
def create_display_drawable_for(drawable_class_name, drawable_id, properties, parent_id:, is_widget:)
|
|
33
33
|
existing = query_display_drawable_for(drawable_id, nil_ok: true)
|
|
34
34
|
if existing
|
|
35
35
|
@log.warn("There is already a display drawable for #{drawable_id.inspect}! Returning #{existing.class.name}.")
|
|
@@ -47,6 +47,10 @@ module Niente
|
|
|
47
47
|
display_drawable.shoes_type = drawable_class_name
|
|
48
48
|
set_drawable_pairing(drawable_id, display_drawable)
|
|
49
49
|
|
|
50
|
+
# Nil parent is okay for DocumentRoot and TextDrawables, so we have to specify it.
|
|
51
|
+
parent = DisplayService.instance.query_display_drawable_for(parent_id, nil_ok: true)
|
|
52
|
+
display_drawable.set_parent(parent)
|
|
53
|
+
|
|
50
54
|
return display_drawable
|
|
51
55
|
end
|
|
52
56
|
|
|
@@ -12,6 +12,7 @@ module Niente
|
|
|
12
12
|
|
|
13
13
|
super(linkable_id: @shoes_linkable_id)
|
|
14
14
|
|
|
15
|
+
# This should only be used for reparenting after a drawable was initially created.
|
|
15
16
|
bind_shoes_event(event_name: "parent", target: shoes_linkable_id) do |new_parent_id|
|
|
16
17
|
display_parent = DisplayService.instance.query_display_drawable_for(new_parent_id)
|
|
17
18
|
if @parent != display_parent
|
|
@@ -28,6 +29,7 @@ module Niente
|
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
bind_shoes_event(event_name: "destroy", target: shoes_linkable_id) do
|
|
32
|
+
set_parent(nil)
|
|
31
33
|
end
|
|
32
34
|
end
|
|
33
35
|
|
|
@@ -8,7 +8,7 @@ module Niente; end
|
|
|
8
8
|
class Niente::Test
|
|
9
9
|
def self.run_shoes_spec_test_code(code, class_name: nil, test_name: nil)
|
|
10
10
|
if @shoes_spec_init
|
|
11
|
-
raise Shoes::Errors::MultipleShoesSpecRunsError, "
|
|
11
|
+
raise Shoes::Errors::MultipleShoesSpecRunsError, "Niente can only run a single Shoes spec per process!"
|
|
12
12
|
end
|
|
13
13
|
@shoes_spec_init = true
|
|
14
14
|
|
|
@@ -21,7 +21,7 @@ class Niente::Test
|
|
|
21
21
|
Shoes::DisplayService.subscribe_to_event("heartbeat", nil) do
|
|
22
22
|
unless @hb_init
|
|
23
23
|
Minitest.run []
|
|
24
|
-
Shoes
|
|
24
|
+
Shoes.APPS.each(&:destroy)
|
|
25
25
|
end
|
|
26
26
|
@hb_init = true
|
|
27
27
|
end
|
|
@@ -30,7 +30,6 @@ class Niente::Test
|
|
|
30
30
|
Object.const_set(Scarpe::Components::StringHelpers.camelize(class_name), test_class)
|
|
31
31
|
test_name = "test_" + test_name unless test_name.start_with?("test_")
|
|
32
32
|
test_class.define_method(test_name) do
|
|
33
|
-
STDERR.puts "Started running #{class_name.inspect}::#{test_name.inspect}"
|
|
34
33
|
eval(code)
|
|
35
34
|
end
|
|
36
35
|
end
|
|
@@ -41,15 +40,21 @@ class Niente::ShoesSpecTest < Minitest::Test
|
|
|
41
40
|
finder_name = drawable_class.dsl_name
|
|
42
41
|
|
|
43
42
|
define_method(finder_name) do |*args|
|
|
44
|
-
|
|
43
|
+
drawables = Shoes::App.find_drawables_by(drawable_class, *args)
|
|
45
44
|
|
|
46
|
-
drawables = app.find_drawables_by(drawable_class, *args)
|
|
47
45
|
raise Shoes::Errors::MultipleDrawablesFoundError, "Found more than one #{finder_name} matching #{args.inspect}!" if drawables.size > 1
|
|
48
46
|
raise Shoes::Errors::NoDrawablesFoundError, "Found no #{finder_name} matching #{args.inspect}!" if drawables.empty?
|
|
49
47
|
|
|
50
48
|
Niente::ShoesSpecProxy.new(drawables[0])
|
|
51
49
|
end
|
|
52
50
|
end
|
|
51
|
+
|
|
52
|
+
def drawable(*specs)
|
|
53
|
+
drawables = Shoes::App.find_drawables_by(*specs)
|
|
54
|
+
raise Shoes::Errors::MultipleDrawablesFoundError, "Found more than one #{finder_name} matching #{args.inspect}!" if drawables.size > 1
|
|
55
|
+
raise Shoes::Errors::NoDrawablesFoundError, "Found no #{finder_name} matching #{args.inspect}!" if drawables.empty?
|
|
56
|
+
Niente::ShoesSpecProxy.new(drawables[0])
|
|
57
|
+
end
|
|
53
58
|
end
|
|
54
59
|
|
|
55
60
|
class Niente::ShoesSpecProxy
|
data/lacci/lib/scarpe/niente.rb
CHANGED
|
@@ -6,8 +6,16 @@
|
|
|
6
6
|
# how a real display service should act.
|
|
7
7
|
module Niente; end
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
Shoes::Log.instance =
|
|
9
|
+
require "scarpe/components/print_logger"
|
|
10
|
+
Shoes::Log.instance = Scarpe::Components::PrintLogImpl.new
|
|
11
|
+
if ENV["NIENTE_LOG_LEVEL"]
|
|
12
|
+
pl = Scarpe::Components::PrintLogImpl::PrintLogger
|
|
13
|
+
level = ENV["NIENTE_LOG_LEVEL"].strip.downcase.to_sym
|
|
14
|
+
unless pl::LEVELS.key?(level)
|
|
15
|
+
raise "Unrecognized Niente log level: #{level.inspect}!"
|
|
16
|
+
end
|
|
17
|
+
pl.min_level = pl::LEVELS[level]
|
|
18
|
+
end
|
|
11
19
|
|
|
12
20
|
require_relative "niente/drawable"
|
|
13
21
|
require_relative "niente/app"
|
|
@@ -16,5 +24,10 @@ require_relative "niente/display_service"
|
|
|
16
24
|
require_relative "niente/shoes_spec"
|
|
17
25
|
Shoes::Spec.instance = Niente::Test
|
|
18
26
|
|
|
27
|
+
require "scarpe/components/segmented_file_loader"
|
|
28
|
+
loader = Scarpe::Components::SegmentedFileLoader.new
|
|
29
|
+
Shoes.add_file_loader loader
|
|
30
|
+
|
|
19
31
|
Shoes::DisplayService.set_display_service_class(Niente::DisplayService)
|
|
20
32
|
|
|
33
|
+
Shoes::FEATURES.push(:multi_app)
|