scarpe 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.yardopts +12 -0
- data/CHANGELOG.md +16 -2
- data/Gemfile +3 -0
- data/Gemfile.lock +116 -0
- data/README.md +53 -30
- data/Rakefile +13 -1
- data/docs/yard/catscradle.md +44 -0
- data/docs/yard/template/default/fulldoc/html/setup.rb +13 -0
- data/docs/yard/template/default/layout/html/setup.rb +9 -0
- data/examples/animate.rb +20 -0
- data/examples/arrow.rb +10 -0
- data/examples/background_with_image.rb +16 -0
- data/examples/bloopsaphone/working/bronx_army_knife.rb +66 -0
- data/examples/bloopsaphone/working/morning_serenity.rb +21 -0
- data/examples/bloopsaphone/working/simpsons_theme_song_by_why.rb +6 -4
- data/examples/btn_tooltip.rb +7 -0
- data/examples/button_go_away.rb +1 -1
- data/examples/button_style_changed.rb +7 -0
- data/examples/button_styles_default.rb +6 -0
- data/examples/check.rb +18 -0
- data/examples/clear_and_append.rb +24 -0
- data/examples/download_and_show_image.rb +28 -0
- data/examples/edit_box.rb +3 -5
- data/examples/fonts.rb +2 -2
- data/examples/gen.rb +8 -8
- data/examples/get_headers.rb +10 -0
- data/examples/highlander.rb +4 -2
- 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/simple/anim-shapes.rb +1 -1
- data/examples/legacy/not_checked/speedometer_app.rb +55 -0
- data/examples/legacy/working/simple/image-icon.rb +3 -0
- data/examples/legacy/{not_checked → working}/simple/image.rb +1 -1
- data/examples/link.rb +2 -2
- data/examples/list_box_choose.rb +17 -0
- data/examples/local_assets/local_file_server.rb +82 -0
- data/examples/local_assets/sample.gif +0 -0
- data/examples/local_assets/sample.mp4 +0 -0
- data/examples/local_fonts.rb +4 -0
- data/examples/local_images.rb +3 -0
- data/examples/motion_events.rb +20 -0
- data/examples/para/para_text.rb +14 -0
- data/examples/parse_xl_funnies.rb +58 -0
- data/examples/progress.rb +31 -0
- data/examples/radio/radio.rb +16 -0
- data/examples/radio/radio_groups.rb +18 -0
- data/examples/radio/radio_same_slot.rb +6 -0
- data/examples/rect.rb +4 -0
- data/examples/rotate_shapes.rb +17 -0
- data/examples/ruby_racer.rb +13 -15
- data/examples/selfitude.rb +18 -0
- data/examples/shapes/shapes_fill.rb +4 -3
- data/examples/shoes_school.rb +2 -4
- data/examples/show_hide.rb +6 -0
- data/examples/simpler-menu.rb +21 -0
- data/examples/skip_ci/change_my_audio_source.rb +21 -0
- data/examples/skip_ci/guitar_fretboard.rb +137 -0
- data/examples/video.rb +10 -0
- data/exe/scarpe +43 -66
- data/fonts/Pacifico.ttf +0 -0
- data/lacci/Gemfile +24 -0
- data/lacci/Gemfile.lock +79 -0
- data/lacci/Rakefile +12 -0
- data/lacci/lacci.gemspec +37 -0
- data/lacci/lib/lacci/scarpe_cli.rb +71 -0
- data/lacci/lib/lacci/scarpe_core.rb +22 -0
- data/lacci/lib/lacci/version.rb +13 -0
- data/lacci/lib/scarpe/niente/app.rb +23 -0
- data/lacci/lib/scarpe/niente/display_service.rb +62 -0
- data/lacci/lib/scarpe/niente/drawable.rb +57 -0
- data/lacci/lib/scarpe/niente/logger.rb +29 -0
- data/lacci/lib/scarpe/niente/shoes_spec.rb +87 -0
- data/lacci/lib/scarpe/niente.rb +20 -0
- data/lacci/lib/shoes/app.rb +309 -0
- data/{lib/scarpe → lacci/lib/shoes}/background.rb +2 -2
- data/{lib/scarpe → lacci/lib/shoes}/border.rb +2 -2
- data/lacci/lib/shoes/builtins.rb +63 -0
- data/lacci/lib/shoes/changelog.rb +52 -0
- data/{lib/scarpe → lacci/lib/shoes}/colors.rb +3 -1
- data/lacci/lib/shoes/constants.rb +47 -0
- data/{lib/scarpe → lacci/lib/shoes}/display_service.rb +71 -53
- data/lacci/lib/shoes/download.rb +123 -0
- data/lacci/lib/shoes/drawable.rb +380 -0
- data/lacci/lib/shoes/drawables/arc.rb +49 -0
- data/lacci/lib/shoes/drawables/arrow.rb +41 -0
- data/lacci/lib/shoes/drawables/button.rb +73 -0
- data/lacci/lib/shoes/drawables/check.rb +29 -0
- data/lacci/lib/shoes/drawables/document_root.rb +20 -0
- data/lacci/lib/shoes/drawables/edit_box.rb +29 -0
- data/{lib/scarpe → lacci/lib/shoes/drawables}/edit_line.rb +6 -6
- data/lacci/lib/shoes/drawables/flow.rb +22 -0
- data/{lib/scarpe → lacci/lib/shoes/drawables}/image.rb +7 -11
- data/lacci/lib/shoes/drawables/line.rb +20 -0
- data/lacci/lib/shoes/drawables/link.rb +34 -0
- data/lacci/lib/shoes/drawables/list_box.rb +56 -0
- data/lacci/lib/shoes/drawables/para.rb +118 -0
- data/lacci/lib/shoes/drawables/progress.rb +14 -0
- data/lacci/lib/shoes/drawables/radio.rb +33 -0
- data/lacci/lib/shoes/drawables/rect.rb +17 -0
- data/lacci/lib/shoes/drawables/shape.rb +36 -0
- data/lacci/lib/shoes/drawables/slot.rb +87 -0
- data/{lib/scarpe → lacci/lib/shoes/drawables}/span.rb +8 -7
- data/lacci/lib/shoes/drawables/stack.rb +26 -0
- data/lacci/lib/shoes/drawables/star.rb +50 -0
- data/lacci/lib/shoes/drawables/subscription_item.rb +93 -0
- data/lacci/lib/shoes/drawables/text_drawable.rb +63 -0
- data/lacci/lib/shoes/drawables/video.rb +16 -0
- data/lacci/lib/shoes/drawables/widget.rb +69 -0
- data/lacci/lib/shoes/drawables.rb +31 -0
- data/lacci/lib/shoes/errors.rb +28 -0
- data/lacci/lib/shoes/log.rb +71 -0
- data/lacci/lib/shoes/ruby_extensions.rb +15 -0
- data/lacci/lib/shoes/spacing.rb +9 -0
- data/lacci/lib/shoes-spec.rb +93 -0
- data/lacci/lib/shoes.rb +147 -0
- data/lacci/test/test_colors.rb +39 -0
- data/lacci/test/test_helper.rb +63 -0
- data/lacci/test/test_lacci.rb +18 -0
- data/lacci/test/test_shoes_errors.rb +49 -0
- data/lib/scarpe/cats_cradle.rb +271 -0
- data/lib/scarpe/errors.rb +77 -0
- data/lib/scarpe/evented_assertions.rb +121 -0
- data/lib/scarpe/shoes_spec.rb +181 -0
- data/lib/scarpe/version.rb +2 -2
- data/lib/scarpe/wv/app.rb +45 -23
- data/lib/scarpe/wv/arc.rb +4 -48
- data/lib/scarpe/wv/arrow.rb +9 -0
- data/lib/scarpe/wv/button.rb +7 -33
- data/lib/scarpe/wv/check.rb +27 -0
- data/lib/scarpe/wv/control_interface.rb +32 -40
- data/lib/scarpe/wv/document_root.rb +66 -31
- data/lib/scarpe/wv/drawable.rb +273 -0
- data/lib/scarpe/wv/edit_box.rb +4 -19
- data/lib/scarpe/wv/edit_line.rb +4 -18
- data/lib/scarpe/wv/flow.rb +2 -28
- data/lib/scarpe/wv/image.rb +10 -25
- data/lib/scarpe/wv/line.rb +3 -28
- data/lib/scarpe/wv/link.rb +3 -15
- data/lib/scarpe/wv/list_box.rb +6 -29
- data/lib/scarpe/wv/para.rb +11 -28
- data/lib/scarpe/wv/progress.rb +19 -0
- data/lib/scarpe/wv/radio.rb +33 -0
- data/lib/scarpe/wv/rect.rb +13 -0
- data/lib/scarpe/wv/shape.rb +41 -10
- data/lib/scarpe/wv/slot.rb +64 -0
- data/lib/scarpe/wv/span.rb +3 -25
- data/lib/scarpe/wv/stack.rb +2 -38
- data/lib/scarpe/wv/star.rb +3 -54
- data/lib/scarpe/wv/subscription_item.rb +84 -0
- data/lib/scarpe/wv/text_drawable.rb +32 -0
- data/lib/scarpe/wv/video.rb +34 -0
- data/lib/scarpe/wv/web_wrangler.rb +449 -299
- data/lib/scarpe/wv/webview_local_display.rb +63 -26
- data/lib/scarpe/wv/webview_relay_display.rb +24 -125
- data/lib/scarpe/wv/webview_relay_util.rb +140 -0
- data/lib/scarpe/wv/wv_display_worker.rb +19 -6
- data/lib/scarpe/wv.rb +76 -14
- data/lib/scarpe/wv_local.rb +1 -1
- data/lib/scarpe/wv_relay.rb +1 -1
- data/lib/scarpe.rb +4 -32
- data/logger/debug_web_wrangler.json +1 -1
- data/logger/scarpe_wv_test.json +1 -1
- data/scarpe-components/.gitignore +1 -0
- data/scarpe-components/Gemfile +22 -0
- data/scarpe-components/Gemfile.lock +86 -0
- data/scarpe-components/README.md +35 -0
- data/scarpe-components/Rakefile +12 -0
- data/scarpe-components/lib/scarpe/components/base64.rb +25 -0
- data/scarpe-components/lib/scarpe/components/calzini/alert.rb +49 -0
- data/scarpe-components/lib/scarpe/components/calzini/art_widgets.rb +203 -0
- data/scarpe-components/lib/scarpe/components/calzini/button.rb +39 -0
- data/scarpe-components/lib/scarpe/components/calzini/misc.rb +146 -0
- data/scarpe-components/lib/scarpe/components/calzini/para.rb +35 -0
- data/scarpe-components/lib/scarpe/components/calzini/slots.rb +155 -0
- data/scarpe-components/lib/scarpe/components/calzini/text_widgets.rb +65 -0
- data/scarpe-components/lib/scarpe/components/calzini.rb +149 -0
- data/scarpe-components/lib/scarpe/components/errors.rb +20 -0
- data/scarpe-components/lib/scarpe/components/file_helpers.rb +66 -0
- data/scarpe-components/lib/scarpe/components/html.rb +131 -0
- data/scarpe-components/lib/scarpe/components/minitest_export_reporter.rb +75 -0
- data/scarpe-components/lib/scarpe/components/minitest_import_runnable.rb +98 -0
- data/scarpe-components/lib/scarpe/components/minitest_result.rb +86 -0
- data/scarpe-components/lib/scarpe/components/modular_logger.rb +113 -0
- data/scarpe-components/lib/scarpe/components/print_logger.rb +47 -0
- data/{lib/scarpe → scarpe-components/lib/scarpe/components}/promises.rb +115 -48
- data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +189 -0
- data/scarpe-components/lib/scarpe/components/string_helpers.rb +10 -0
- data/scarpe-components/lib/scarpe/components/tiranti.rb +225 -0
- data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +257 -0
- data/scarpe-components/lib/scarpe/components/version.rb +7 -0
- data/scarpe-components/scarpe-components.gemspec +38 -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 +52 -0
- data/scarpe-components/test/calzini/test_calzini_misc.rb +115 -0
- data/scarpe-components/test/calzini/test_calzini_para.rb +37 -0
- data/scarpe-components/test/calzini/test_calzini_slots.rb +130 -0
- data/scarpe-components/test/calzini/test_calzini_text_drawables.rb +41 -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_components.rb +9 -0
- data/scarpe-components/test/test_dimensions.rb +26 -0
- data/scarpe-components/test/test_helper.rb +43 -0
- data/scarpe-components/test/test_html.rb +65 -0
- data/scarpe-components/test/test_minitest_result.rb +61 -0
- data/scarpe-components/test/test_promises.rb +261 -0
- data/scarpe-components/test/test_segmented_app_files.rb +184 -0
- data/scarpegen.rb +14 -14
- data/sig/scarpe.rbs +1 -1
- data/{lib/scarpe → spikes}/glibui/widget.rb +2 -2
- data/{lib/scarpe → spikes}/glibui.rb +1 -1
- 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 -17
- data/templates/example_template.erb +1 -1
- data/templates/module_template.erb +4 -4
- data/templates/webview_template.erb +3 -5
- metadata +236 -145
- data/examples/fill.rb +0 -25
- data/examples/legacy/not_checked/shoes-contrib/basic/class-book.yaml +0 -387
- data/examples/legacy/not_checked/shoes-contrib/elements/image-icon.rb +0 -3
- data/examples/legacy/not_checked/shoes-contrib/good/good-clock.rb +0 -51
- data/examples/legacy/not_checked/shoes-contrib/good/good-follow.rb +0 -26
- data/examples/legacy/not_checked/shoes-contrib/good/good-reminder.rb +0 -174
- data/examples/legacy/not_checked/shoes-contrib/good/good-vjot.rb +0 -56
- data/examples/legacy/not_checked/shoes-contrib/simple/simple-timer.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/good-clock.rb +0 -51
- data/examples/legacy/not_checked/shoes-dep-samples/good-follow.rb +0 -26
- data/examples/legacy/not_checked/shoes-dep-samples/good-reminder.rb +0 -174
- data/examples/legacy/not_checked/shoes-dep-samples/good-vjot.rb +0 -56
- data/examples/legacy/not_checked/shoes-dep-samples/simple-accordion.rb +0 -75
- data/examples/legacy/not_checked/shoes-dep-samples/simple-anim-shapes.rb +0 -17
- data/examples/legacy/not_checked/shoes-dep-samples/simple-anim-text.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-arc.rb +0 -23
- data/examples/legacy/not_checked/shoes-dep-samples/simple-bounce.rb +0 -24
- data/examples/legacy/not_checked/shoes-dep-samples/simple-calc.rb +0 -70
- data/examples/legacy/not_checked/shoes-dep-samples/simple-chipmunk.rb +0 -26
- data/examples/legacy/not_checked/shoes-dep-samples/simple-control-sizes.rb +0 -24
- data/examples/legacy/not_checked/shoes-dep-samples/simple-curve.rb +0 -26
- data/examples/legacy/not_checked/shoes-dep-samples/simple-dialogs.rb +0 -29
- data/examples/legacy/not_checked/shoes-dep-samples/simple-draw.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-editor.rb +0 -28
- data/examples/legacy/not_checked/shoes-dep-samples/simple-form.rb +0 -28
- data/examples/legacy/not_checked/shoes-dep-samples/simple-form.shy +0 -0
- data/examples/legacy/not_checked/shoes-dep-samples/simple-mask.rb +0 -21
- data/examples/legacy/not_checked/shoes-dep-samples/simple-menu.rb +0 -31
- data/examples/legacy/not_checked/shoes-dep-samples/simple-menu1.rb +0 -35
- data/examples/legacy/not_checked/shoes-dep-samples/simple-rubygems.rb +0 -29
- data/examples/legacy/not_checked/shoes-dep-samples/simple-slide.rb +0 -45
- data/examples/legacy/not_checked/shoes-dep-samples/simple-sphere.rb +0 -28
- data/examples/legacy/not_checked/shoes-dep-samples/simple-sqlite3.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-timer.rb +0 -13
- data/examples/legacy/not_checked/shoes-dep-samples/simple-video.rb +0 -13
- data/examples/legacy/not_checked/simple/anim-text.rb +0 -13
- data/examples/legacy/not_checked/simple/arc.rb +0 -23
- data/examples/legacy/not_checked/simple/bounce.rb +0 -24
- data/examples/legacy/not_checked/simple/chipmunk.rb +0 -26
- data/examples/legacy/not_checked/simple/curve.rb +0 -26
- data/examples/legacy/not_checked/simple/dialogs.rb +0 -29
- data/examples/legacy/not_checked/simple/downloader.rb +0 -40
- data/examples/legacy/not_checked/simple/draw.rb +0 -13
- data/examples/legacy/not_checked/simple/mask.rb +0 -21
- data/examples/legacy/not_checked/simple/slide.rb +0 -45
- data/examples/legacy/not_checked/simple/sphere.rb +0 -28
- data/lib/constants.rb +0 -5
- data/lib/scarpe/alert.rb +0 -19
- data/lib/scarpe/app.rb +0 -78
- data/lib/scarpe/arc.rb +0 -49
- data/lib/scarpe/button.rb +0 -35
- data/lib/scarpe/document_root.rb +0 -20
- data/lib/scarpe/edit_box.rb +0 -24
- data/lib/scarpe/fill.rb +0 -23
- data/lib/scarpe/flow.rb +0 -19
- data/lib/scarpe/line.rb +0 -25
- data/lib/scarpe/link.rb +0 -25
- data/lib/scarpe/list_box.rb +0 -25
- data/lib/scarpe/logger.rb +0 -155
- data/lib/scarpe/para.rb +0 -90
- data/lib/scarpe/shape.rb +0 -19
- data/lib/scarpe/spacing.rb +0 -9
- data/lib/scarpe/stack.rb +0 -70
- data/lib/scarpe/star.rb +0 -47
- data/lib/scarpe/text_widget.rb +0 -42
- data/lib/scarpe/unit_test_helpers.rb +0 -163
- data/lib/scarpe/widget.rb +0 -198
- data/lib/scarpe/widgets.rb +0 -30
- data/lib/scarpe/wv/alert.rb +0 -65
- data/lib/scarpe/wv/background.rb +0 -18
- data/lib/scarpe/wv/border.rb +0 -22
- data/lib/scarpe/wv/control_interface_test.rb +0 -253
- data/lib/scarpe/wv/dimensions.rb +0 -22
- data/lib/scarpe/wv/fill.rb +0 -30
- data/lib/scarpe/wv/html.rb +0 -107
- data/lib/scarpe/wv/shape_helper.rb +0 -44
- data/lib/scarpe/wv/spacing.rb +0 -41
- data/lib/scarpe/wv/text_widget.rb +0 -30
- data/lib/scarpe/wv/widget.rb +0 -181
- data/scarpe-0.2.0.gem +0 -0
- /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/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
- /data/{lib/scarpe → spikes}/glibui/README.md +0 -0
- /data/{lib/scarpe → spikes}/glibui/alert.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/app.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/background.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/border.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/button.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/dimensions.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/document_root.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/edit_box.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/edit_line.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/flow.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/html.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/image.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/link.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/local_display.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/para.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/spacing.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/stack.rb +0 -0
- /data/{lib/scarpe → spikes}/glibui/text_widget.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/alert.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/button.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/colors.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/core.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/flow.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/libui.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/notepad.md +0 -0
- /data/{lib/scarpe → spikes}/libui/para.rb +0 -0
- /data/{lib/scarpe → spikes}/libui/stack.rb +0 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
def printish(msg)
|
2
|
+
#$stderr.puts msg
|
3
|
+
File.open("/tmp/shoesy_stuff.txt", "a") do |f|
|
4
|
+
f.write(msg + "\n")
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
Shoes.app do
|
9
|
+
printish "Self top: #{self.inspect}" # It's an instance of Shoes::App, yes
|
10
|
+
stack do
|
11
|
+
printish "Self in stack: #{self.inspect}" # Yup, here too
|
12
|
+
end
|
13
|
+
button("Clickity") do
|
14
|
+
alert("You clicked me!")
|
15
|
+
printish "Self in button handler: #{self.inspect}" # And here too
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -1,10 +1,11 @@
|
|
1
1
|
Shoes.app do
|
2
2
|
shape do
|
3
3
|
fill "blue"
|
4
|
-
|
4
|
+
stroke "green" # Lines use stroke, not fill, for their color
|
5
5
|
line 0,0, 100, 100
|
6
|
+
|
6
7
|
fill "red"
|
8
|
+
stroke "black" # Change the stroke back to black for the star
|
7
9
|
star 23, 0, 6, 50, 25
|
8
10
|
end
|
9
|
-
|
10
|
-
|
11
|
+
end
|
data/examples/shoes_school.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Shoes.app(title: "Shoes School", height:
|
1
|
+
Shoes.app(title: "Shoes School", height: 800, width: 1000) do
|
2
2
|
CHAPTERS = [
|
3
3
|
[
|
4
4
|
%(
|
@@ -37,9 +37,7 @@ Shoes.app(title: "Shoes School", height: 700, width: 1000) do
|
|
37
37
|
end
|
38
38
|
stack do
|
39
39
|
flow do
|
40
|
-
IDE = edit_box(height: 300, width: "100%")
|
41
|
-
CHAPTERS[current_chapter][0]
|
42
|
-
end
|
40
|
+
IDE = edit_box(CHAPTERS[current_chapter][0], height: 300, width: "100%")
|
43
41
|
end
|
44
42
|
flow do
|
45
43
|
LECTURE = para CHAPTERS[current_chapter][1], size: 30
|
@@ -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
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# brew install switchaudio-osx
|
2
|
+
|
3
|
+
Shoes.app height: 450, width: 450, title: "Change Audio Source 🔊" do
|
4
|
+
flow do
|
5
|
+
background beige
|
6
|
+
border black, strokewidth: 6
|
7
|
+
banner "Change Audio Source", align: "center"
|
8
|
+
ins "Requires SwitchAudioSource, install with:"
|
9
|
+
ins strong "brew install switchaudio-osx"
|
10
|
+
end
|
11
|
+
current = `SwitchAudioSource -c`.chomp
|
12
|
+
@current_source = tagline "Current audio source: #{current}"
|
13
|
+
sources = `SwitchAudioSource -a`.split("\n").map do |source|
|
14
|
+
flow do
|
15
|
+
button source do
|
16
|
+
`SwitchAudioSource -s "#{source.chomp}"`
|
17
|
+
@current_source.replace "Current audio source: #{source.chomp}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require 'bloops'
|
2
|
+
|
3
|
+
class Fret
|
4
|
+
def initialize(string, fret_idx, note, octave)
|
5
|
+
@string = string
|
6
|
+
@fret_idx = fret_idx
|
7
|
+
@note = note
|
8
|
+
@octave = octave
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_reader :note
|
12
|
+
attr_reader :fret_idx
|
13
|
+
attr_reader :string
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
"#{@note}#{@octave}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class GuitarString
|
21
|
+
NOTES = %w{a a# b c c# d d# e f f# g g#}
|
22
|
+
FRET_COUNT = 23
|
23
|
+
|
24
|
+
include Enumerable
|
25
|
+
|
26
|
+
attr_reader :frets
|
27
|
+
attr_reader :fret_radios
|
28
|
+
|
29
|
+
def initialize(idx, open_note, starting_octave)
|
30
|
+
@root_note_index = NOTES.index(open_note)
|
31
|
+
octave = starting_octave
|
32
|
+
|
33
|
+
|
34
|
+
fret_index = 0
|
35
|
+
@frets = NOTES.cycle
|
36
|
+
.take(FRET_COUNT + @root_note_index)
|
37
|
+
.to_a[@root_note_index..-1]
|
38
|
+
.map { |note|
|
39
|
+
if note == NOTES.first
|
40
|
+
octave +=1
|
41
|
+
end
|
42
|
+
Fret.new(idx, fret_index, note, octave)
|
43
|
+
}
|
44
|
+
@fret_radios = {}
|
45
|
+
end
|
46
|
+
|
47
|
+
def render(app)
|
48
|
+
frets = @frets
|
49
|
+
string = self
|
50
|
+
|
51
|
+
app.flow(height: "15%") do
|
52
|
+
frets.each do |f|
|
53
|
+
flow width: "3%" do
|
54
|
+
border black, strokewidth: 1
|
55
|
+
background linen
|
56
|
+
string.fret_radios[f] = radio(f.string)
|
57
|
+
caption f.note
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class Tunings
|
65
|
+
STANDARD = %w{ e a d g b e }
|
66
|
+
DSTANDARD = %w{ d g c f a d }
|
67
|
+
DADGAD = %w{ d a d g a d }
|
68
|
+
|
69
|
+
def self.get(constname)
|
70
|
+
tconst = constname.upcase.gsub(" ", "")
|
71
|
+
const_get(tconst).reverse.map.with_index do |n, idx|
|
72
|
+
GuitarString.new(idx, n, 2)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def bloops
|
78
|
+
@bloops ||= Bloops.new
|
79
|
+
end
|
80
|
+
|
81
|
+
def play_chord(notes)
|
82
|
+
bloops.clear
|
83
|
+
sound = bloops.sound Bloops::SQUARE
|
84
|
+
sound.sustain = 0.05
|
85
|
+
sound.decay = 0.35
|
86
|
+
|
87
|
+
notes.each do |n|
|
88
|
+
bloops.tune sound, n
|
89
|
+
end
|
90
|
+
|
91
|
+
bloops.play
|
92
|
+
end
|
93
|
+
|
94
|
+
Shoes.app(width: 1280, height: 400) do
|
95
|
+
@tuning = "standard"
|
96
|
+
@strings = Tunings::get(@tuning)
|
97
|
+
@fretboard = []
|
98
|
+
|
99
|
+
render_strings = ->(app) {
|
100
|
+
@strings.each do |string|
|
101
|
+
string.render(app)
|
102
|
+
end
|
103
|
+
}
|
104
|
+
|
105
|
+
flow do
|
106
|
+
@current_tuning = title @tuning
|
107
|
+
@fretboard = stack width: "100%", margin: 20, &render_strings
|
108
|
+
|
109
|
+
stack do
|
110
|
+
button "Play" do
|
111
|
+
fretted_notes = @strings.flat_map { |s|
|
112
|
+
s.fret_radios.select { |k, v| v.checked? }.keys
|
113
|
+
}.map(&:to_s)
|
114
|
+
|
115
|
+
play_chord(fretted_notes)
|
116
|
+
|
117
|
+
@strings.map do |s|
|
118
|
+
s.fret_radios.map { |_, r| r.checked = false }
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
flow do
|
123
|
+
caption "Select a tuning:"
|
124
|
+
@tuning_select = list_box(
|
125
|
+
items: ["d standard", "dadgad", "standard"]
|
126
|
+
).change { |tuning| @tuning = tuning }
|
127
|
+
|
128
|
+
button "Change Tuning" do
|
129
|
+
self.instance_variable_set("@strings", Tunings::get(@tuning))
|
130
|
+
@fretboard.clear
|
131
|
+
@fretboard.append(&render_strings)
|
132
|
+
@current_tuning.replace @tuning
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
data/examples/video.rb
ADDED
data/exe/scarpe
CHANGED
@@ -1,58 +1,45 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
#
|
4
|
-
# correctly in earlier Rubies and can successfully give the version-check error.
|
5
|
-
if RUBY_VERSION[0..2] < "3.2"
|
6
|
-
STDERR.puts("Scarpe requires Ruby 3.2 or higher!")
|
7
|
-
exit(-1)
|
8
|
-
end
|
3
|
+
# First we need to load Scarpe and Lacci, which means figuring out where from.
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
scarpe [OPTIONS] run <scarpe app file>
|
14
|
-
scarpe [OPTIONS] env # print Scarpe environment settings
|
15
|
-
scarpe -v # print the Scarpe gem version and exit
|
16
|
-
Options:
|
17
|
-
--dev Use development local scarpe, not an installed gem
|
18
|
-
--debug Turn on application debug mode
|
19
|
-
USAGE
|
20
|
-
end
|
5
|
+
# --dev option applies to all actions
|
6
|
+
use_dev = ARGV.delete("--dev") ? true : false
|
7
|
+
use_debug = ARGV.delete("--debug") ? true : false
|
21
8
|
|
22
|
-
|
23
|
-
|
9
|
+
# Default to local webview display if not otherwise given
|
10
|
+
ENV['SCARPE_DISPLAY'] ||= 'wv_local'
|
11
|
+
|
12
|
+
if use_debug
|
13
|
+
ENV['SCARPE_DEBUG'] = 'true'
|
14
|
+
end
|
15
|
+
if use_dev
|
16
|
+
dev_path = File.expand_path("../lib", __dir__)
|
17
|
+
$LOAD_PATH.prepend dev_path
|
24
18
|
end
|
25
19
|
|
26
|
-
|
27
|
-
|
20
|
+
if use_dev
|
21
|
+
require 'bundler/setup'
|
22
|
+
Bundler.require(:default)
|
28
23
|
end
|
24
|
+
require "scarpe"
|
25
|
+
require "lacci/scarpe_cli"
|
26
|
+
|
27
|
+
include Scarpe::CLI
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
#{env_or_none("SCARPE_TEST_CONTROL")}
|
37
|
-
#{env_or_none("SCARPE_TEST_RESULTS")}
|
38
|
-
#{env_or_none("SCARPE_DEBUG")}
|
39
|
-
Ruby and shell environment:
|
40
|
-
RUBY_DESCRIPTION: #{RUBY_DESCRIPTION.inspect}
|
41
|
-
RUBY_PLATFORM: #{RUBY_PLATFORM.inspect}
|
42
|
-
RUBY_ENGINE: #{RUBY_ENGINE.inspect}
|
43
|
-
#{env_or_none("SHELL")}
|
44
|
-
#{env_or_none("PATH")}
|
45
|
-
#{env_or_none("LD_LIBRARY_PATH")}
|
46
|
-
#{env_or_none("DYLD_LIBRARY_PATH")}
|
47
|
-
#{env_or_none("GEM_ROOT")}
|
48
|
-
#{env_or_none("GEM_HOME")}
|
49
|
-
#{env_or_none("GEM_PATH")}
|
50
|
-
SCARPE_ENV
|
29
|
+
# We need to not use syntactic features of very recent Rubies in this file, so that it parses
|
30
|
+
# correctly in earlier Rubies and can successfully give the version-check error.
|
31
|
+
version_check
|
32
|
+
|
33
|
+
def print_usage
|
34
|
+
puts DEFAULT_USAGE
|
51
35
|
end
|
52
36
|
|
53
|
-
|
54
|
-
|
55
|
-
|
37
|
+
add_env_categories("Scarpe::WV" => [
|
38
|
+
env_or_default("SCARPE_TEST_CONTROL", "(none)"),
|
39
|
+
env_or_default("SCARPE_TEST_RESULTS", "(none)"),
|
40
|
+
env_or_default("SCARPE_TEST_DEBUG", "(none)"),
|
41
|
+
env_or_default("SCARPE_HTML_RENDERER", "calzini"),
|
42
|
+
])
|
56
43
|
|
57
44
|
verb = "run"
|
58
45
|
verb_target = nil
|
@@ -83,26 +70,16 @@ else
|
|
83
70
|
verb_target = ARGV[0]
|
84
71
|
end
|
85
72
|
|
86
|
-
if use_debug
|
87
|
-
ENV['SCARPE_DEBUG'] = 'true'
|
88
|
-
end
|
89
|
-
if use_dev
|
90
|
-
dev_path = File.expand_path("../lib", __dir__)
|
91
|
-
$LOAD_PATH.prepend dev_path
|
92
|
-
end
|
93
|
-
# We mustn't require Scarpe sooner than this so that the --dev setting is respected
|
94
|
-
require "scarpe"
|
95
|
-
|
96
|
-
Shoes = Scarpe unless defined?(Shoes)
|
97
|
-
|
98
73
|
case verb
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
74
|
+
when "-v"
|
75
|
+
puts "Scarpe #{Scarpe::VERSION}"
|
76
|
+
puts "Scarpe-Components #{Scarpe::Components::VERSION}"
|
77
|
+
puts "Lacci #{Lacci::VERSION}"
|
78
|
+
when "run"
|
79
|
+
# Run the Scarpe app file
|
80
|
+
Shoes.run_app verb_target
|
81
|
+
when "env"
|
82
|
+
print_env
|
83
|
+
else
|
84
|
+
raise "Internal error! Unknown ./exe/scarpe verb!"
|
108
85
|
end
|
data/fonts/Pacifico.ttf
ADDED
Binary file
|
data/lacci/Gemfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gemspec
|
6
|
+
|
7
|
+
gem "scarpe-components", path: "../scarpe-components"
|
8
|
+
|
9
|
+
gem "rake", "~> 13.0"
|
10
|
+
|
11
|
+
group :test do
|
12
|
+
gem "minitest", "~> 5.0"
|
13
|
+
gem "minitest-reporters"
|
14
|
+
end
|
15
|
+
|
16
|
+
group :development do
|
17
|
+
gem "yard"
|
18
|
+
gem "redcarpet"
|
19
|
+
gem "debug"
|
20
|
+
gem "rubocop", "~> 1.21"
|
21
|
+
gem "rubocop-shopify"
|
22
|
+
#gem "commonmarker"
|
23
|
+
#gem "github-markup"
|
24
|
+
end
|
data/lacci/Gemfile.lock
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../scarpe-components
|
3
|
+
specs:
|
4
|
+
scarpe-components (0.3.0)
|
5
|
+
|
6
|
+
PATH
|
7
|
+
remote: .
|
8
|
+
specs:
|
9
|
+
lacci (0.3.0)
|
10
|
+
scarpe-components
|
11
|
+
|
12
|
+
GEM
|
13
|
+
remote: https://rubygems.org/
|
14
|
+
specs:
|
15
|
+
ansi (1.5.0)
|
16
|
+
ast (2.4.2)
|
17
|
+
builder (3.2.4)
|
18
|
+
debug (1.8.0)
|
19
|
+
irb (>= 1.5.0)
|
20
|
+
reline (>= 0.3.1)
|
21
|
+
io-console (0.6.0)
|
22
|
+
irb (1.7.2)
|
23
|
+
reline (>= 0.3.6)
|
24
|
+
json (2.6.3)
|
25
|
+
language_server-protocol (3.17.0.3)
|
26
|
+
minitest (5.18.1)
|
27
|
+
minitest-reporters (1.6.0)
|
28
|
+
ansi
|
29
|
+
builder
|
30
|
+
minitest (>= 5.0)
|
31
|
+
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
|
+
rake (13.0.6)
|
39
|
+
redcarpet (3.6.0)
|
40
|
+
regexp_parser (2.8.1)
|
41
|
+
reline (0.3.6)
|
42
|
+
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
|
+
ruby-progressbar (1.13.0)
|
60
|
+
unicode-display_width (2.4.2)
|
61
|
+
yard (0.9.34)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
x86_64-darwin-22
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
debug
|
68
|
+
lacci!
|
69
|
+
minitest (~> 5.0)
|
70
|
+
minitest-reporters
|
71
|
+
rake (~> 13.0)
|
72
|
+
redcarpet
|
73
|
+
rubocop (~> 1.21)
|
74
|
+
rubocop-shopify
|
75
|
+
scarpe-components!
|
76
|
+
yard
|
77
|
+
|
78
|
+
BUNDLED WITH
|
79
|
+
2.4.10
|
data/lacci/Rakefile
ADDED
data/lacci/lacci.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/lacci/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "lacci"
|
7
|
+
spec.version = Lacci::VERSION
|
8
|
+
spec.authors = ["Marco Concetto Rudilosso", "Noah Gibbs"]
|
9
|
+
spec.email = ["marcoc.r@outlook.com", "the.codefolio.guy@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Lacci - a portable Shoes DSL with switchable display backends, part of Scarpe"
|
12
|
+
spec.homepage = "https://github.com/scarpe-team/scarpe"
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = ">= 3.2.0"
|
15
|
+
|
16
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/scarpe-team/scarpe"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/scarpe-team/scarpe/blob/main/CHANGELOG.md"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_dependency "scarpe-components" # Scarpe-Components has no dependencies, and includes useful infrastructure
|
34
|
+
|
35
|
+
# For more information and examples about making a new gem, check out our
|
36
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
37
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Scarpe
|
4
|
+
module CLI
|
5
|
+
DEFAULT_USAGE = <<~'USAGE'
|
6
|
+
Usage: scarpe_core [OPTIONS] <scarpe app file> # Same as "scarpe run"
|
7
|
+
scarpe_core [OPTIONS] run <scarpe app file>
|
8
|
+
scarpe_core [OPTIONS] env # print Scarpe environment settings
|
9
|
+
scarpe_core -v # print the Scarpe gem version and exit
|
10
|
+
Options:
|
11
|
+
--dev Use development local scarpe, not an installed gem
|
12
|
+
--debug Turn on application debug mode
|
13
|
+
USAGE
|
14
|
+
|
15
|
+
def version_check
|
16
|
+
if RUBY_VERSION[0..2] < "3.2"
|
17
|
+
raise "Scarpe and Lacci require Ruby 3.2 or higher!"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def env_or_default(env_var, default_val)
|
22
|
+
[env_var, ENV[env_var] ? ENV[env_var].inspect : default_val]
|
23
|
+
end
|
24
|
+
|
25
|
+
def default_env_categories
|
26
|
+
require "shoes"
|
27
|
+
{
|
28
|
+
"Lacci" => [
|
29
|
+
env_or_default("SCARPE_DISPLAY_SERVICE", "(none)"),
|
30
|
+
env_or_default("SCARPE_LOG_CONFIG", "(default)#{Shoes::Log::DEFAULT_LOG_CONFIG.inspect}"),
|
31
|
+
env_or_default("SCARPE_APP_TEST", "(none)"),
|
32
|
+
],
|
33
|
+
"Ruby and Shell" => [
|
34
|
+
["RUBY_DESCRIPTION", RUBY_DESCRIPTION],
|
35
|
+
["RUBY_PLATFORM", RUBY_PLATFORM],
|
36
|
+
["RUBY_ENGINE", RUBY_ENGINE],
|
37
|
+
env_or_default("SHELL", "(none)"),
|
38
|
+
env_or_default("PATH", "(none)"),
|
39
|
+
env_or_default("LD_LIBRARY_PATH", "(none)"),
|
40
|
+
env_or_default("DYLD_LIBRARY_PATH", "(none)"),
|
41
|
+
env_or_default("GEM_ROOT", "(none)"),
|
42
|
+
env_or_default("GEM_HOME", "(none)"),
|
43
|
+
env_or_default("GEM_PATH", "(none)"),
|
44
|
+
],
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def env_categories
|
49
|
+
@env_categories ||= default_env_categories
|
50
|
+
@env_categories
|
51
|
+
end
|
52
|
+
|
53
|
+
def add_env_categories(categories)
|
54
|
+
unless categories.is_a?(Hash)
|
55
|
+
raise("Please supply a hash with categories names as keys and an array of two-elt arrays as values!")
|
56
|
+
end
|
57
|
+
|
58
|
+
# Try to get categories into the *start* of the hash, insertion-order-wise
|
59
|
+
@env_categories = categories.merge(env_categories)
|
60
|
+
end
|
61
|
+
|
62
|
+
def print_env
|
63
|
+
env_categories.each do |category, entries|
|
64
|
+
puts "#{category} environment:"
|
65
|
+
entries.each do |name, val|
|
66
|
+
puts " #{name}: #{val}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Lacci is one place we put components that have no hard gem requirements.
|
4
|
+
# It needs to connect to Scarpe, mostly via the Shoes DisplayService.
|
5
|
+
# Some display services, like Wasm, cannot install or otherwise tolerate
|
6
|
+
# Scarpe's need for a variety of gems, especially those with native extensions.
|
7
|
+
# So we need a simple require-able Scarpe core here in Lacci that can be
|
8
|
+
# required from display services that cannot link with the base Scarpe gem.
|
9
|
+
|
10
|
+
if RUBY_VERSION[0..2] < "3.2"
|
11
|
+
Shoes::Log.logger("Scarpe").error("Scarpe requires Ruby 3.2 or higher!")
|
12
|
+
exit(-1)
|
13
|
+
end
|
14
|
+
|
15
|
+
module Scarpe; end
|
16
|
+
|
17
|
+
# The base error class for Scarpe errors, but not necessarily {Shoes::Error}s
|
18
|
+
class Shoes::Error < StandardError; end
|
19
|
+
class Scarpe::Error < StandardError; end
|
20
|
+
|
21
|
+
require "lacci/version"
|
22
|
+
require "scarpe/components/version"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The name "scarpe" means "shoes" in Italian. "Lacci"
|
4
|
+
# means "laces." Lacci is the display-independent part
|
5
|
+
# of Scarpe, tying the Shoes API to the display service
|
6
|
+
# of your choice.
|
7
|
+
#
|
8
|
+
# Almost nothing is called Lacci in your program. It's
|
9
|
+
# mostly invisible. Instead, look at the {Shoes} module
|
10
|
+
# to see what's in Lacci.
|
11
|
+
module Lacci
|
12
|
+
VERSION = "0.3.0"
|
13
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Niente
|
4
|
+
class App < Drawable
|
5
|
+
def initialize(properties)
|
6
|
+
super
|
7
|
+
|
8
|
+
bind_shoes_event(event_name: "init") { init }
|
9
|
+
bind_shoes_event(event_name: "run") { run }
|
10
|
+
bind_shoes_event(event_name: "destroy") { destroy }
|
11
|
+
end
|
12
|
+
|
13
|
+
def init
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
send_shoes_event("wait", event_name: "custom_event_loop")
|
18
|
+
end
|
19
|
+
|
20
|
+
def destroy
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|