scarpe 0.2.2 → 0.4.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/.rubocop.yml +7 -1
- data/.yardopts +1 -0
- data/CHANGELOG.md +52 -6
- data/Gemfile +2 -1
- data/Gemfile.lock +20 -6
- data/LICENSE.txt +7 -1
- data/README.md +100 -21
- data/Rakefile +68 -1
- data/examples/Edit_box_Styles.rb +8 -0
- data/examples/Kerning.rb +7 -0
- data/examples/animate.rb +20 -0
- data/examples/arrow.rb +10 -0
- data/examples/border.rb +11 -0
- data/examples/btn_tooltip.rb +7 -0
- data/examples/button_style_changed.rb +7 -0
- data/examples/button_styles_default.rb +6 -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 +12 -8
- data/examples/highlander.rb +3 -3
- data/examples/legacy/README.md +6 -0
- data/examples/legacy/not_checked/shoes-contrib/basic/shoes-notes.rb +1 -1
- 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/not_checked/simple/anim-shapes.rb +1 -1
- data/examples/legacy/not_checked/speedometer_app.rb +55 -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/legacy/working/simple/image-icon.rb +3 -0
- data/examples/legacy/{not_checked → working}/simple/image.rb +1 -1
- data/examples/list_box_choose.rb +17 -0
- data/examples/local_assets/local_file_server.rb +82 -0
- data/examples/local_assets/multi_image.rb +5 -0
- data/examples/local_assets/sample.gif +0 -0
- data/examples/local_assets/sample.mp4 +0 -0
- data/examples/local_assets/small.png +0 -0
- data/examples/local_fonts.rb +5 -2
- data/examples/local_images.rb +2 -3
- 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/para/para_text.rb +14 -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/progress.rb +31 -0
- data/examples/radio/radio_groups.rb +2 -2
- data/examples/rect.rb +4 -0
- data/examples/rotate_shapes.rb +17 -0
- data/examples/scarpe_ext.rb +3 -0
- data/examples/shapes/star.rb +1 -3
- data/examples/simpler-menu.rb +21 -0
- data/examples/spacing.rb +1 -1
- data/examples/span.rb +4 -2
- data/exe/scarpe +2 -1
- data/lacci/Gemfile +2 -0
- data/lacci/Gemfile.lock +8 -1
- data/lacci/lacci.gemspec +2 -2
- data/lacci/lib/lacci/scarpe_cli.rb +2 -2
- data/lacci/lib/lacci/scarpe_core.rb +2 -1
- data/lacci/lib/lacci/version.rb +1 -1
- data/lacci/lib/scarpe/niente/app.rb +23 -0
- data/lacci/lib/scarpe/niente/display_service.rb +66 -0
- data/lacci/lib/scarpe/niente/drawable.rb +59 -0
- data/lacci/lib/scarpe/niente/shoes_spec.rb +93 -0
- data/lacci/lib/scarpe/niente.rb +32 -0
- data/lacci/lib/shoes/app.rb +111 -72
- data/lacci/lib/shoes/background.rb +2 -2
- data/lacci/lib/shoes/border.rb +2 -2
- data/lacci/lib/shoes/builtins.rb +63 -0
- data/lacci/lib/shoes/changelog.rb +52 -0
- data/lacci/lib/shoes/colors.rb +3 -1
- data/lacci/lib/shoes/constants.rb +41 -2
- data/lacci/lib/shoes/display_service.rb +80 -18
- data/lacci/lib/shoes/download.rb +2 -2
- data/lacci/lib/shoes/drawable.rb +654 -0
- data/lacci/lib/shoes/drawables/arc.rb +27 -0
- data/lacci/lib/shoes/drawables/arrow.rb +21 -0
- data/lacci/lib/shoes/drawables/border.rb +28 -0
- data/lacci/lib/shoes/drawables/button.rb +57 -0
- data/lacci/lib/shoes/drawables/check.rb +33 -0
- data/lacci/lib/shoes/drawables/document_root.rb +20 -0
- data/lacci/lib/shoes/{widgets → drawables}/edit_box.rb +9 -8
- data/lacci/lib/shoes/{widgets → drawables}/edit_line.rb +8 -7
- data/lacci/lib/shoes/drawables/flow.rb +20 -0
- data/lacci/lib/shoes/drawables/font_helper.rb +62 -0
- data/lacci/lib/shoes/{widgets → drawables}/image.rb +7 -7
- data/lacci/lib/shoes/drawables/line.rb +17 -0
- data/lacci/lib/shoes/drawables/link.rb +31 -0
- data/lacci/lib/shoes/drawables/list_box.rb +59 -0
- data/lacci/lib/shoes/drawables/oval.rb +48 -0
- data/lacci/lib/shoes/drawables/para.rb +206 -0
- data/lacci/lib/shoes/drawables/progress.rb +15 -0
- data/lacci/lib/shoes/drawables/radio.rb +35 -0
- data/lacci/lib/shoes/drawables/rect.rb +18 -0
- data/lacci/lib/shoes/{widgets → drawables}/shape.rb +8 -8
- data/lacci/lib/shoes/drawables/slot.rb +178 -0
- data/lacci/lib/shoes/drawables/stack.rb +21 -0
- data/lacci/lib/shoes/drawables/star.rb +28 -0
- data/lacci/lib/shoes/drawables/subscription_item.rb +93 -0
- data/lacci/lib/shoes/drawables/text_drawable.rb +122 -0
- data/lacci/lib/shoes/drawables/video.rb +17 -0
- data/lacci/lib/shoes/drawables/widget.rb +74 -0
- data/lacci/lib/shoes/drawables.rb +32 -0
- data/lacci/lib/shoes/errors.rb +38 -0
- data/lacci/lib/shoes/log.rb +2 -2
- data/lacci/lib/shoes/margin_helper.rb +79 -0
- data/lacci/lib/shoes/ruby_extensions.rb +15 -0
- data/lacci/lib/shoes-spec.rb +93 -0
- data/lacci/lib/shoes.rb +31 -10
- 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 +81 -0
- data/lacci/test/test_lacci.rb +99 -3
- data/lacci/test/test_margin_helper.rb +82 -0
- data/lacci/test/test_niente_test_infra.rb +26 -0
- data/lacci/test/test_oval.rb +82 -0
- data/lacci/test/test_parenting.rb +140 -0
- data/lacci/test/test_shoes_errors.rb +49 -0
- data/lacci/test/test_text_drawables.rb +23 -0
- data/lib/scarpe/assets.rb +18 -0
- data/lib/scarpe/cats_cradle.rb +84 -103
- data/lib/scarpe/errors.rb +77 -0
- data/lib/scarpe/shoes_spec.rb +160 -0
- data/lib/scarpe/version.rb +2 -2
- data/lib/scarpe/wv/app.rb +21 -20
- data/lib/scarpe/wv/arc.rb +4 -51
- data/lib/scarpe/wv/arrow.rb +9 -0
- data/lib/scarpe/wv/border.rb +9 -18
- data/lib/scarpe/wv/button.rb +7 -35
- data/lib/scarpe/wv/check.rb +3 -5
- data/lib/scarpe/wv/control_interface.rb +20 -30
- data/lib/scarpe/wv/document_root.rb +81 -4
- data/lib/scarpe/wv/{widget.rb → drawable.rb} +71 -82
- data/lib/scarpe/wv/edit_box.rb +8 -18
- data/lib/scarpe/wv/edit_line.rb +9 -20
- data/lib/scarpe/wv/flow.rb +2 -18
- data/lib/scarpe/wv/image.rb +7 -30
- data/lib/scarpe/wv/line.rb +3 -25
- data/lib/scarpe/wv/link.rb +6 -17
- data/lib/scarpe/wv/list_box.rb +6 -29
- data/lib/scarpe/wv/oval.rb +13 -0
- data/lib/scarpe/wv/para.rb +12 -30
- data/lib/scarpe/wv/progress.rb +19 -0
- data/lib/scarpe/wv/radio.rb +9 -10
- data/lib/scarpe/wv/rect.rb +13 -0
- data/lib/scarpe/wv/scarpe_extensions.rb +8 -0
- data/lib/scarpe/wv/shape.rb +13 -13
- data/lib/scarpe/wv/slot.rb +8 -25
- data/lib/scarpe/wv/stack.rb +2 -18
- data/lib/scarpe/wv/star.rb +3 -53
- data/lib/scarpe/wv/subscription_item.rb +38 -4
- data/lib/scarpe/wv/text_drawable.rb +90 -0
- data/lib/scarpe/wv/video.rb +15 -15
- data/lib/scarpe/wv/web_wrangler.rb +320 -328
- data/lib/scarpe/wv/webview_local_display.rb +52 -33
- data/lib/scarpe/wv/webview_relay_display.rb +12 -12
- data/lib/scarpe/wv/webview_relay_util.rb +7 -10
- data/lib/scarpe/wv/wv_display_worker.rb +2 -2
- data/lib/scarpe/wv.rb +52 -12
- data/lib/scarpe/wv_local.rb +1 -1
- data/lib/scarpe/wv_relay.rb +1 -1
- data/lib/scarpe.rb +1 -0
- data/logger/debug_web_wrangler.json +1 -1
- data/logger/scarpe_wv_test.json +1 -1
- data/scarpe-components/Gemfile +4 -1
- data/scarpe-components/Gemfile.lock +85 -0
- 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 +23 -5
- data/scarpe-components/lib/scarpe/components/calzini/alert.rb +49 -0
- data/scarpe-components/lib/scarpe/components/calzini/art_drawables.rb +227 -0
- data/scarpe-components/lib/scarpe/components/calzini/border.rb +38 -0
- data/scarpe-components/lib/scarpe/components/calzini/button.rb +37 -0
- data/scarpe-components/lib/scarpe/components/calzini/misc.rb +136 -0
- data/scarpe-components/lib/scarpe/components/calzini/para.rb +237 -0
- data/scarpe-components/lib/scarpe/components/calzini/slots.rb +109 -0
- data/scarpe-components/lib/scarpe/components/calzini.rb +236 -0
- data/scarpe-components/lib/scarpe/components/errors.rb +24 -0
- data/scarpe-components/lib/scarpe/components/file_helpers.rb +1 -0
- data/scarpe-components/lib/scarpe/components/html.rb +134 -0
- data/scarpe-components/lib/scarpe/components/minitest_export_reporter.rb +83 -0
- data/scarpe-components/lib/scarpe/components/minitest_import_runnable.rb +98 -0
- data/scarpe-components/lib/scarpe/components/minitest_result.rb +127 -0
- data/scarpe-components/lib/scarpe/components/modular_logger.rb +5 -5
- data/scarpe-components/lib/scarpe/components/print_logger.rb +22 -3
- data/scarpe-components/lib/scarpe/components/process_helpers.rb +37 -0
- data/scarpe-components/lib/scarpe/components/promises.rb +14 -14
- data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +36 -17
- data/scarpe-components/lib/scarpe/components/string_helpers.rb +10 -0
- data/scarpe-components/lib/scarpe/components/tiranti.rb +167 -0
- data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +48 -6
- data/scarpe-components/lib/scarpe/components/version.rb +2 -2
- 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_alert.rb +30 -0
- data/scarpe-components/test/calzini/test_calzini_art_drawables.rb +105 -0
- data/scarpe-components/test/calzini/test_calzini_button.rb +54 -0
- data/scarpe-components/test/calzini/test_calzini_misc.rb +115 -0
- data/scarpe-components/test/calzini/test_calzini_para.rb +34 -0
- data/scarpe-components/test/calzini/test_calzini_slots.rb +85 -0
- data/scarpe-components/test/calzini/test_calzini_text_drawables.rb +106 -0
- data/scarpe-components/test/calzini/test_various.rb +133 -0
- data/scarpe-components/test/mtr_data/exception.json +1 -0
- data/scarpe-components/test/mtr_data/fail_with_message.json +1 -0
- data/scarpe-components/test/mtr_data/skipped_no_message.json +1 -0
- data/scarpe-components/test/mtr_data/skipped_w_msg.json +1 -0
- data/scarpe-components/test/mtr_data/succeed_2_asserts.json +1 -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_dimensions.rb +26 -0
- data/scarpe-components/test/test_helper.rb +20 -1
- data/scarpe-components/test/test_html.rb +65 -0
- data/scarpe-components/test/test_minitest_result.rb +68 -0
- data/scarpe-components/test/test_promises.rb +5 -4
- data/scarpe-components/test/test_segmented_app_files.rb +10 -6
- data/scarpegen.rb +14 -14
- data/sig/scarpe.rbs +1 -1
- data/tasks/check_html_fixtures.rb +140 -0
- data/tasks/regenerate_html_fixtures.rb +104 -0
- data/templates/basic_class_template.erb +13 -14
- data/templates/class_template_with_event_bind.erb +4 -4
- data/templates/class_template_with_shapes.erb +8 -28
- data/templates/example_template.erb +1 -1
- data/templates/module_template.erb +4 -4
- data/templates/webview_template.erb +3 -2
- metadata +286 -80
- data/examples/legacy/not_checked/shoes-contrib/elements/image-icon.rb +0 -3
- data/lacci/lib/shoes/spacing.rb +0 -9
- data/lacci/lib/shoes/widget.rb +0 -218
- data/lacci/lib/shoes/widgets/alert.rb +0 -19
- data/lacci/lib/shoes/widgets/arc.rb +0 -51
- data/lacci/lib/shoes/widgets/button.rb +0 -35
- data/lacci/lib/shoes/widgets/check.rb +0 -28
- data/lacci/lib/shoes/widgets/document_root.rb +0 -20
- data/lacci/lib/shoes/widgets/flow.rb +0 -22
- data/lacci/lib/shoes/widgets/font.rb +0 -14
- data/lacci/lib/shoes/widgets/line.rb +0 -18
- data/lacci/lib/shoes/widgets/link.rb +0 -25
- data/lacci/lib/shoes/widgets/list_box.rb +0 -25
- data/lacci/lib/shoes/widgets/para.rb +0 -68
- data/lacci/lib/shoes/widgets/radio.rb +0 -35
- data/lacci/lib/shoes/widgets/slot.rb +0 -75
- data/lacci/lib/shoes/widgets/span.rb +0 -26
- data/lacci/lib/shoes/widgets/stack.rb +0 -24
- data/lacci/lib/shoes/widgets/star.rb +0 -44
- data/lacci/lib/shoes/widgets/subscription_item.rb +0 -60
- data/lacci/lib/shoes/widgets/text_widget.rb +0 -51
- data/lacci/lib/shoes/widgets/video.rb +0 -15
- data/lacci/lib/shoes/widgets.rb +0 -29
- data/lib/scarpe/evented_assertions.rb +0 -88
- data/lib/scarpe/wv/alert.rb +0 -66
- data/lib/scarpe/wv/background.rb +0 -27
- data/lib/scarpe/wv/control_interface_test.rb +0 -238
- data/lib/scarpe/wv/dimensions.rb +0 -22
- data/lib/scarpe/wv/font.rb +0 -36
- data/lib/scarpe/wv/html.rb +0 -108
- data/lib/scarpe/wv/spacing.rb +0 -41
- data/lib/scarpe/wv/span.rb +0 -68
- data/lib/scarpe/wv/text_widget.rb +0 -30
- /data/examples/legacy/not_checked/{expert → shoes-contrib/basic}/definr.rb +0 -0
- /data/examples/legacy/not_checked/{expert → shoes-contrib/basic}/funnies.rb +0 -0
- /data/examples/legacy/not_checked/shoes-contrib/{elements → basic}/list_box-select-class.rb +0 -0
- /data/examples/legacy/{not_checked → working}/shoes3-tests/editline/editline.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/basic-edit-box.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/basic-fps.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/border-cat.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/check-mate.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/manipulation → working/simple}/clear-slot.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/clock.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/gradient-shoes.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/basic → working/simple}/list_box-shape-report.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/list_box.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/phat-button.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib → working}/simple/simple-calc.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/position → working/simple}/stack-width.rb +0 -0
- /data/examples/legacy/{not_checked/shoes-contrib/elements → working/simple}/width-introspec.rb +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
#!ruby
|
2
|
+
Shoes.app do
|
3
|
+
@list = ['Frances Johnson', 'Ignatius J. Reilly',
|
4
|
+
'Winston Niles Rumfoord']
|
5
|
+
|
6
|
+
stack do
|
7
|
+
@list.map! do |name|
|
8
|
+
flow { @c = check; para name }
|
9
|
+
[@c, name]
|
10
|
+
end
|
11
|
+
|
12
|
+
button "What's been checked?" do
|
13
|
+
selected = @list.map { |c, name| name if c.checked? }.compact
|
14
|
+
alert("You selected: " + selected.join(', '))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!ruby
|
2
|
+
Shoes.app do
|
3
|
+
stack do
|
4
|
+
title "Searching Google", size: 16
|
5
|
+
@status = para "One moment..."
|
6
|
+
|
7
|
+
# Search Google for 'shoes' and print the HTTP headers
|
8
|
+
download "http://www.google.com/search?q=shoes" do |goog|
|
9
|
+
@status.text = "Headers: " + goog.response.headers.inspect
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Shoes.app do
|
2
2
|
background "#eee"
|
3
3
|
@list = stack do
|
4
|
-
@img = image
|
4
|
+
@img = image "#{DIR}/docs/static/man-builds.png"
|
5
5
|
para "Enter a image URL to download:", :margin => [10, 8, 10, 0]
|
6
6
|
flow :margin => 10 do
|
7
7
|
@url = edit_line :width => -120
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Shoes.app(title: "Guessing secret word", width: 500, height: 450) do
|
2
|
+
secret_word = "apple"
|
3
|
+
guess_label = para "Guess the secret word:"
|
4
|
+
guess_input = list_box items: ["apple", "banana", "orange"], choose: "orange"
|
5
|
+
|
6
|
+
button "Guess" do
|
7
|
+
guess = guess_input.text
|
8
|
+
|
9
|
+
if guess == secret_word
|
10
|
+
alert("Yayyy! that's right.")
|
11
|
+
else
|
12
|
+
alert("No, better luck next time😕")
|
13
|
+
end
|
14
|
+
|
15
|
+
guess_input.choose "orange"
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Require the WEBrick library
|
2
|
+
require 'webrick'
|
3
|
+
|
4
|
+
# Configuration for the server
|
5
|
+
configuration = {
|
6
|
+
Port: 4567,
|
7
|
+
DocumentRoot: File.join(File.dirname(__FILE__), '..', '..', 'examples', 'local_assets')
|
8
|
+
}
|
9
|
+
|
10
|
+
# Create a new instance of WEBrick::HTTPServer with the configuration
|
11
|
+
server = WEBrick::HTTPServer.new(configuration)
|
12
|
+
|
13
|
+
# Define a custom servlet to handle file requests
|
14
|
+
class FileServlet < WEBrick::HTTPServlet::AbstractServlet
|
15
|
+
def do_GET(request, response)
|
16
|
+
relative_path = request.path
|
17
|
+
path = File.join(@config[:DocumentRoot], relative_path)
|
18
|
+
|
19
|
+
if File.exist?(path) && !File.directory?(path)
|
20
|
+
begin
|
21
|
+
file_content = File.read(path)
|
22
|
+
|
23
|
+
response.status = 200
|
24
|
+
response['Content-Type'] = WEBrick::HTTPUtils.mime_type(path, WEBrick::HTTPUtils::DefaultMimeTypes)
|
25
|
+
response['Content-Disposition'] = "inline; filename=#{File.basename(path)}"
|
26
|
+
response.body = file_content
|
27
|
+
rescue StandardError => e
|
28
|
+
response.status = 500
|
29
|
+
response.body = 'Internal Server Error'
|
30
|
+
end
|
31
|
+
else
|
32
|
+
response.status = 404
|
33
|
+
response.body = 'File not found'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Mount the custom servlet at the root URL
|
39
|
+
server.mount('/', FileServlet)
|
40
|
+
|
41
|
+
# Set up a signal trap to gracefully shut down the server on interrupt (e.g., Ctrl+C)
|
42
|
+
trap('INT') do
|
43
|
+
server.shutdown
|
44
|
+
end
|
45
|
+
|
46
|
+
# Start the server in a separate thread
|
47
|
+
server_thread = Thread.new { server.start }
|
48
|
+
|
49
|
+
# Shoes application to display the file from the local server
|
50
|
+
Shoes.app do
|
51
|
+
stack do
|
52
|
+
flow do
|
53
|
+
para "Enter the file path: (e.g., sample.gif, sample.mp4)"
|
54
|
+
@file_path = edit_line
|
55
|
+
end
|
56
|
+
|
57
|
+
button "Display File" do
|
58
|
+
file_path = @file_path.text
|
59
|
+
|
60
|
+
begin
|
61
|
+
file_extension = File.extname(file_path).downcase
|
62
|
+
|
63
|
+
case file_extension
|
64
|
+
when '.png', '.jpg', '.jpeg', '.gif'
|
65
|
+
image "http://localhost:4567/#{file_path}"
|
66
|
+
when '.mp4', '.mov'
|
67
|
+
video "http://localhost:4567/#{file_path}"
|
68
|
+
else
|
69
|
+
para "Unsupported file type"
|
70
|
+
end
|
71
|
+
rescue StandardError => e
|
72
|
+
para "Error: #{e.message}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Ensure the Shoes application is closed before stopping the server
|
78
|
+
at_exit do
|
79
|
+
server_thread.join if server_thread.alive?
|
80
|
+
server.shutdown
|
81
|
+
end
|
82
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
data/examples/local_fonts.rb
CHANGED
data/examples/local_images.rb
CHANGED
data/examples/margin.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Shoes.app do
|
2
|
+
|
3
|
+
para "All margins with array input", margin:[60,30,80,40]
|
4
|
+
|
5
|
+
para "All margins with string input", margin: "30 20 10 20"
|
6
|
+
|
7
|
+
para "One Number to set all margins", margin:20
|
8
|
+
|
9
|
+
para "Specific property can overwrite shorthand" , margin:[20,10,20,30], margin_top:100
|
10
|
+
|
11
|
+
para "margins using a hash input" , margin:{left:20,top:100,bottom:10,right:20}
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Shoes.app do
|
2
|
+
background blue
|
3
|
+
|
4
|
+
@stack1 = stack(width: 100, height: 100) do
|
5
|
+
background red
|
6
|
+
b = button("Push me", margin: [10, 25, 5, 10]) do
|
7
|
+
alert "Aha! Click!"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
@stack1 = stack do
|
12
|
+
background aquamarine
|
13
|
+
b = button("Hash margin", margin: { left: 10, right: 5, top: 25, bottom: 10 }) do
|
14
|
+
alert "Aha! Click!"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
stack(width: 100, height: 100) do
|
19
|
+
background yellow
|
20
|
+
button "Middle Button", margin: 5, margin_top: 30
|
21
|
+
end
|
22
|
+
|
23
|
+
@stack2 = stack(width: 100, height: 100) do
|
24
|
+
background green
|
25
|
+
button "OK 2"
|
26
|
+
end
|
27
|
+
end
|
data/examples/oval.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#TODO: Support color methods as argument
|
4
|
+
#TODO: Allow strokewidth to go wider than container?
|
5
|
+
#TODO: Support strokewidth draw context
|
6
|
+
|
7
|
+
Shoes.app(
|
8
|
+
title: "Schwad's unbelievable desktop application that renders an oval",
|
9
|
+
height: 700,
|
10
|
+
) do
|
11
|
+
flow(height: 200) do
|
12
|
+
para "Positional arguments:"
|
13
|
+
oval 30, 30, 80, 200, center: true
|
14
|
+
end
|
15
|
+
flow(height: 200) do
|
16
|
+
para "As a circle"
|
17
|
+
stroke "blue"
|
18
|
+
fill "pink"
|
19
|
+
oval 30, 30, 80, center: true
|
20
|
+
end
|
21
|
+
flow(height: 200) do
|
22
|
+
para "Keyword arguments:"
|
23
|
+
fill "green"
|
24
|
+
oval top: 20, left: 20, height: 160, width: 90, center: true, stroke: "red", strokewidth: 4
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Shoes.app do
|
2
|
+
stack do
|
3
|
+
@note = para " your note will appear here"
|
4
|
+
|
5
|
+
@edit_box = edit_box ""
|
6
|
+
@save_button = button "Save"
|
7
|
+
|
8
|
+
@save_button.click do
|
9
|
+
new_text = @edit_box.text
|
10
|
+
@note.text = new_text
|
11
|
+
alert("Note saved successfully!")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Shoes.app do
|
2
|
+
|
3
|
+
para "this text is in normal styl" , emphasis:"italic"
|
4
|
+
|
5
|
+
para "this text is in italic style" , font: "italic normal bold 16px 'Times New Roman', serif;"
|
6
|
+
|
7
|
+
|
8
|
+
para "this text is in oblique style " , family: "'Pacifico', cursive;"
|
9
|
+
|
10
|
+
para "Text in Helvetica", font: "Helvetica;"
|
11
|
+
|
12
|
+
para "And in Lucida", font: "'Pacifico', cursive;"
|
13
|
+
|
14
|
+
para "From an example", font: "Trebuchet bold"
|
15
|
+
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Shoes.app do
|
2
|
+
para "This is normal"
|
3
|
+
|
4
|
+
para "This is bolder" , font_weight: "bold"
|
5
|
+
|
6
|
+
para "This is a little less bold" , font_weight: 800
|
7
|
+
|
8
|
+
para "This is bolder than the last one " , font_weight: 700
|
9
|
+
|
10
|
+
para "Close to normal " , font_weight: 300
|
11
|
+
|
12
|
+
end
|
13
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Shoes.app(width: 400, height: 300) do
|
2
|
+
flow do
|
3
|
+
stack(width: 0.5) do
|
4
|
+
para "this is initally at 30%"
|
5
|
+
@progress1 = progress fraction: 0.3
|
6
|
+
|
7
|
+
para "this is initally at 60%"
|
8
|
+
@progress2 = progress fraction: 0.6
|
9
|
+
|
10
|
+
para "this is initally at 80%"
|
11
|
+
@progress3 = progress fraction: 0.8
|
12
|
+
|
13
|
+
para "this is a normal progress bar with no initial value"
|
14
|
+
@progress4 = progress
|
15
|
+
end
|
16
|
+
|
17
|
+
stack(width: 0.5) do
|
18
|
+
@start = button "Start"
|
19
|
+
@start.click { start_progress }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def start_progress
|
24
|
+
animate do
|
25
|
+
@progress1.fraction += 0.01
|
26
|
+
@progress2.fraction += 0.015
|
27
|
+
@progress3.fraction += 0.02
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Shoes.app do
|
2
2
|
stack do
|
3
3
|
para "Among these films, which do you prefer?"
|
4
4
|
flow do
|
@@ -13,6 +13,6 @@
|
|
13
13
|
radio :films
|
14
14
|
para "Children of Heaven by Majid Majidi"
|
15
15
|
end
|
16
|
-
|
16
|
+
para "Is radio button checked? #{radio(:films).checked?}"
|
17
17
|
end
|
18
18
|
end
|
data/examples/rect.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Shoes.app(height:600) do
|
2
|
+
rotate 90
|
3
|
+
rect 10, 10, 75, 50, 5
|
4
|
+
rotate 180
|
5
|
+
arrow 100, 100, 30
|
6
|
+
rotate 60
|
7
|
+
arrow 150, 120,40
|
8
|
+
rotate 120
|
9
|
+
arrow 30 ,60 ,40
|
10
|
+
rotate 75
|
11
|
+
arc 50, 50, 120, 100, 60, 225
|
12
|
+
rotate 45
|
13
|
+
arrow :left => 50, :top => 80,
|
14
|
+
:width => 40
|
15
|
+
rotate 180
|
16
|
+
line 100, 100, 200, 200
|
17
|
+
end
|
data/examples/shapes/star.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Cut down from a more complicated example widget
|
2
|
+
|
3
|
+
class MenuPanel < Shoes::Widget
|
4
|
+
@@boxes = []
|
5
|
+
def initialize(color, args)
|
6
|
+
@@boxes << self
|
7
|
+
background color
|
8
|
+
para "Box #{@@boxes.length}",
|
9
|
+
:margin => 18, :align => "center", :size => 20
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Shoes.app :width => 400, :height => 130 do
|
14
|
+
#style(Link, :underline => nil)
|
15
|
+
#style(LinkHover, :fill => nil, :underline => nil)
|
16
|
+
menu_panel green, :width => 175, :height => 120, :margin => 4
|
17
|
+
menu_panel blue, :width => 140, :height => 120, :margin => 4
|
18
|
+
menu_panel red, :width => 135, :height => 120, :margin => 4
|
19
|
+
menu_panel purple, :width => 125, :height => 120, :margin => 4
|
20
|
+
end
|
21
|
+
|
data/examples/spacing.rb
CHANGED
@@ -7,7 +7,7 @@ Shoes.app(title: "Spacing") do
|
|
7
7
|
background "red"
|
8
8
|
para "with 10px margin-left and margin-right, and 20px margin-bottom", stroke: "white"
|
9
9
|
end
|
10
|
-
stack margin: [15,
|
10
|
+
stack margin: [15, nil, 15, 40] do
|
11
11
|
background "blue"
|
12
12
|
para "with 15px margin-left and margin-right, and 40px margin-bottom", stroke: "white"
|
13
13
|
end
|
data/examples/span.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
Shoes.app :height => 500, :width => 500 do
|
2
2
|
stack :margin => 10 do
|
3
|
-
para span("TEXT EDITOR", :stroke =>
|
3
|
+
para span("TEXT EDITOR", :stroke => blue, :fill => green), " * USE ALT-Q TO QUIT", :stroke => red
|
4
4
|
end
|
5
|
-
|
5
|
+
para "Various ", del("text"), " in ", sub("various"), " ", sup("styles"), " can be ", ins("hard to read"), "...\n"
|
6
|
+
|
7
|
+
para "A ", span("wide", underline: "single", undercolor: blue), " ", span("variety", underline: "error", undercolor: green), " ", span("of", underline: "double"), " ", span("underlines", underline: "low", undercolor: darkgreen)
|
6
8
|
end
|
data/exe/scarpe
CHANGED
@@ -38,6 +38,7 @@ add_env_categories("Scarpe::WV" => [
|
|
38
38
|
env_or_default("SCARPE_TEST_CONTROL", "(none)"),
|
39
39
|
env_or_default("SCARPE_TEST_RESULTS", "(none)"),
|
40
40
|
env_or_default("SCARPE_TEST_DEBUG", "(none)"),
|
41
|
+
env_or_default("SCARPE_HTML_RENDERER", "calzini"),
|
41
42
|
])
|
42
43
|
|
43
44
|
verb = "run"
|
@@ -76,7 +77,7 @@ when "-v"
|
|
76
77
|
puts "Lacci #{Lacci::VERSION}"
|
77
78
|
when "run"
|
78
79
|
# Run the Scarpe app file
|
79
|
-
Shoes.run_app
|
80
|
+
Shoes.run_app verb_target
|
80
81
|
when "env"
|
81
82
|
print_env
|
82
83
|
else
|
data/lacci/Gemfile
CHANGED
data/lacci/Gemfile.lock
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../scarpe-components
|
3
|
+
specs:
|
4
|
+
scarpe-components (0.3.0)
|
5
|
+
|
1
6
|
PATH
|
2
7
|
remote: .
|
3
8
|
specs:
|
4
|
-
lacci (0.
|
9
|
+
lacci (0.3.0)
|
10
|
+
scarpe-components
|
5
11
|
|
6
12
|
GEM
|
7
13
|
remote: https://rubygems.org/
|
@@ -66,6 +72,7 @@ DEPENDENCIES
|
|
66
72
|
redcarpet
|
67
73
|
rubocop (~> 1.21)
|
68
74
|
rubocop-shopify
|
75
|
+
scarpe-components!
|
69
76
|
yard
|
70
77
|
|
71
78
|
BUNDLED WITH
|