atome 0.5.4.1.7 → 0.5.5.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile +3 -1
- data/README.md +70 -1
- data/Rakefile +246 -75
- data/app_builder_helpers/Rakefile +276 -288
- data/documentation/basic.md +242 -0
- data/documentation/deep learning/architecture.txt +3763 -0
- data/documentation/deep learning/atome.png +0 -0
- data/documentation/deep learning/basic_infos.txt +227 -0
- data/documentation/deep learning/example_of_users_code.rb +1810 -0
- data/documentation/deep learning/misc.txt +24 -0
- data/documentation/deep learning/ruby_js_example.rb +272 -0
- data/documentation/deep learning/wasm_script_help.text +14 -0
- data/documentation/framework/enhance_atome.md +1 -1
- data/documentation/tutorials/tutorials.md +7 -0
- data/exe/atome +308 -208
- data/lib/atome/atome.rb +52 -156
- data/lib/atome/extensions/atome.rb +129 -47
- data/lib/atome/extensions/mathematics.rb +20 -0
- data/lib/atome/extensions/ping.rb +2 -3
- data/lib/atome/genesis/generators/atome.rb +57 -30
- data/lib/atome/genesis/generators/communication.rb +9 -0
- data/lib/atome/genesis/generators/effect.rb +0 -1
- data/lib/atome/genesis/generators/event.rb +279 -43
- data/lib/atome/genesis/generators/geometry.rb +1 -10
- data/lib/atome/genesis/generators/hierarchy.rb +103 -0
- data/lib/atome/genesis/generators/identity.rb +45 -84
- data/lib/atome/genesis/generators/material.rb +31 -34
- data/lib/atome/genesis/generators/property.rb +31 -0
- data/lib/atome/genesis/generators/security.rb +31 -0
- data/lib/atome/genesis/generators/spatial.rb +3 -5
- data/lib/atome/genesis/generators/time.rb +0 -1
- data/lib/atome/genesis/generators/utility.rb +181 -66
- data/lib/atome/genesis/genesis.rb +152 -55
- data/lib/atome/genesis/sparkle.rb +59 -75
- data/lib/atome/helpers/color_helper/color/rgb/colors.rb +1 -1
- data/lib/atome/helpers/color_helper/color/rgb.rb +1 -1
- data/lib/atome/helpers/color_helper/color.rb +226 -7
- data/lib/atome/helpers/essentials.rb +22 -26
- data/lib/atome/helpers/security.rb +71 -0
- data/lib/atome/helpers/utilities.rb +191 -178
- data/lib/atome/kernel/black_matter.rb +22 -0
- data/lib/atome/kernel/universe.rb +123 -24
- data/lib/atome/presets/atome.rb +39 -35
- data/lib/atome/version.rb +3 -2
- data/lib/atome.rb +12 -12
- data/lib/atome_relative.rb +36 -0
- data/lib/{atome/renderers → platform_specific}/opal/atome_opal_extensions.rb +4 -1
- data/lib/{atome/renderers → platform_specific}/opal/extensions/color.rb +12 -5
- data/lib/{atome/renderers → platform_specific}/opal/extensions/geolocation.rb +1 -0
- data/lib/platform_specific/opal/extensions/js.rb +21 -0
- data/lib/platform_specific/opal/extensions/object.rb +6 -0
- data/lib/platform_specific/opal/extensions/ping.rb +31 -0
- data/lib/{atome/renderers → platform_specific}/opal/extensions/sha.rb +4 -2
- data/lib/platform_specific/wasm/atome_wasm_extensions.rb +11 -0
- data/lib/renderers/headless/headless.rb +18 -0
- data/lib/renderers/headless/index.rb +6 -0
- data/lib/renderers/headless/index_relative.rb +6 -0
- data/lib/renderers/headless/utility.rb +6 -0
- data/{vendor/assets/src/medias/rubies/examples/top.rb → lib/renderers/html/atome.rb} +0 -1
- data/lib/renderers/html/atome_html.rb +22 -0
- data/lib/renderers/html/effect.rb +26 -0
- data/lib/renderers/html/event.rb +43 -0
- data/lib/renderers/html/geometry.rb +31 -0
- data/lib/renderers/html/hierarchy.rb +233 -0
- data/lib/renderers/html/html.rb +1112 -0
- data/lib/renderers/html/identity.rb +84 -0
- data/lib/renderers/html/index.rb +19 -0
- data/lib/renderers/html/index_relative.rb +20 -0
- data/lib/renderers/html/material.rb +53 -0
- data/lib/renderers/html/property.rb +24 -0
- data/lib/renderers/html/spatial.rb +46 -0
- data/lib/renderers/html/time.rb +1 -0
- data/lib/renderers/html/utility.rb +38 -0
- data/lib/renderers/renderer.rb +16 -0
- data/lib/renderers/server/index.rb +4 -0
- data/lib/renderers/server/index_relative.rb +4 -0
- data/lib/renderers/server/utility.rb +4 -0
- data/sig/atome.rbs +6 -0
- data/sig/object.rbs +4 -0
- data/sig/universe.rbs +3 -0
- data/vendor/assets/Rakefile +3 -3
- data/vendor/assets/application/examples/a_concat.rb +16 -0
- data/vendor/assets/application/examples/affect.rb +8 -0
- data/vendor/assets/application/examples/animation.rb +96 -0
- data/vendor/assets/application/examples/apply.rb +8 -0
- data/vendor/assets/application/examples/atome.rb +5 -0
- data/vendor/assets/application/examples/attach.rb +34 -0
- data/vendor/assets/application/examples/attached.rb +38 -0
- data/vendor/assets/application/examples/basic_understanding.rb +52 -0
- data/vendor/assets/application/examples/browse.rb +17 -0
- data/vendor/assets/application/examples/callback.rb +20 -0
- data/vendor/assets/application/examples/category.rb +12 -0
- data/vendor/assets/application/examples/clear.rb +96 -0
- data/vendor/assets/application/examples/clones.rb +177 -0
- data/vendor/assets/application/examples/code.rb +13 -0
- data/vendor/assets/application/examples/color.rb +54 -0
- data/vendor/assets/application/examples/convert.rb +163 -0
- data/vendor/assets/application/examples/copy.rb +25 -0
- data/vendor/assets/application/examples/copybck.rb +68 -0
- data/vendor/assets/application/examples/debug.rb +78 -0
- data/vendor/assets/application/examples/delete.rb +93 -0
- data/vendor/assets/application/examples/display.rb +279 -0
- data/vendor/assets/application/examples/display_bck.rb +164 -0
- data/vendor/assets/application/examples/drag.rb +45 -0
- data/vendor/assets/application/examples/drop.rb +35 -0
- data/vendor/assets/application/examples/duplicate.rb +64 -0
- data/vendor/assets/application/examples/edit.rb +21 -0
- data/vendor/assets/application/examples/encode.rb +6 -0
- data/vendor/assets/application/examples/file.rb +50 -0
- data/vendor/assets/application/examples/find.rb +157 -0
- data/vendor/assets/application/examples/generator_and_build.rb +15 -0
- data/vendor/assets/application/examples/getter.rb +16 -0
- data/vendor/assets/application/examples/grab.rb +14 -0
- data/vendor/assets/application/examples/gradient.rb +35 -0
- data/vendor/assets/application/examples/group.rb +44 -0
- data/vendor/assets/application/examples/hierarchy.rb +21 -0
- data/vendor/assets/application/examples/history.rb +31 -0
- data/vendor/assets/application/examples/hypertext.rb +113 -0
- data/vendor/assets/application/examples/image.rb +5 -0
- data/vendor/assets/application/examples/keyboard.rb +59 -0
- data/vendor/assets/application/examples/layout.rb +227 -0
- data/vendor/assets/application/examples/login.rb +10 -0
- data/vendor/assets/application/examples/markup.rb +4 -0
- data/vendor/assets/application/examples/match.rb +115 -0
- data/vendor/assets/application/examples/messaging.rb +16 -0
- data/vendor/assets/application/examples/monitor.rb +14 -0
- data/vendor/assets/application/examples/on_resize.rb +7 -0
- data/vendor/assets/{src/medias/rubies/examples/get_renderer_list.rb → application/examples/online.rb} +1 -1
- data/vendor/assets/application/examples/over.rb +29 -0
- data/vendor/assets/application/examples/paint.rb +23 -0
- data/vendor/assets/application/examples/particles.rb +4 -0
- data/vendor/assets/application/examples/percent_to_px.rb +4 -0
- data/vendor/assets/application/examples/play.rb +50 -0
- data/vendor/assets/application/examples/presets.rb +33 -0
- data/vendor/assets/application/examples/random.rb +42 -0
- data/vendor/assets/application/examples/raw_html.rb +48 -0
- data/vendor/assets/application/examples/read.rb +11 -0
- data/vendor/assets/application/examples/refresh.rb +62 -0
- data/vendor/assets/application/examples/remove.rb +47 -0
- data/vendor/assets/application/examples/repeat.rb +26 -0
- data/vendor/assets/application/examples/resize.rb +17 -0
- data/vendor/assets/application/examples/scroll.rb +11 -0
- data/vendor/assets/application/examples/security.rb +76 -0
- data/vendor/assets/application/examples/selected.rb +30 -0
- data/vendor/assets/application/examples/shadow.rb +46 -0
- data/vendor/assets/application/examples/shapes.rb +6 -0
- data/vendor/assets/{src/medias/rubies → application}/examples/smooth.rb +5 -1
- data/vendor/assets/application/examples/style.rb +4 -0
- data/vendor/assets/application/examples/sync.rb +39 -0
- data/vendor/assets/application/examples/tagged.rb +24 -0
- data/vendor/assets/application/examples/terminal.rb +4 -0
- data/vendor/assets/application/examples/text.rb +5 -0
- data/vendor/assets/application/examples/touch.rb +38 -0
- data/vendor/assets/application/examples/type_mutation.rb +18 -0
- data/vendor/assets/application/examples/universe.rb +8 -0
- data/vendor/assets/application/examples/vector.rb +24 -0
- data/vendor/assets/application/examples/video.rb +14 -0
- data/vendor/assets/application/examples/wait.rb +6 -0
- data/vendor/assets/application/examples/www.rb +10 -0
- data/vendor/assets/application/index.rb +1 -1
- data/vendor/assets/application/test.rb +29 -0
- data/vendor/assets/application/works/photos.rb +672 -0
- data/vendor/assets/application/works/photos2.rb +218 -0
- data/vendor/assets/application/works/photos3.rb +343 -0
- data/vendor/assets/application/works/photos4.rb +34 -0
- data/vendor/assets/application/works/photos6.rb +6 -0
- data/vendor/assets/application/works/trigga.rb +0 -0
- data/vendor/assets/application/works/vie.rb +74 -0
- data/vendor/assets/server/atome_server.rb +37 -41
- data/vendor/assets/server/atome_server_wasm.rb +112 -0
- data/vendor/assets/server/capture.rb +10 -0
- data/vendor/assets/server/config.ru +5 -4
- data/vendor/assets/src/css/style.css +29 -4
- data/vendor/assets/src/index.html +31 -38
- data/vendor/assets/src/index_opal.html +42 -0
- data/vendor/assets/src/index_server.html +43 -0
- data/vendor/assets/src/index_server_wasm.html +46 -0
- data/vendor/assets/src/js/atome/atome.js +170 -150
- data/vendor/assets/src/js/atome/atome_helpers/add_font.js +46 -0
- data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +3 -1
- data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +12 -7
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +126 -0
- data/vendor/assets/src/js/atome/atome_helpers/{atome_file.js → file.js} +1 -1
- data/vendor/assets/src/js/atome/specific/opal.js +3 -0
- data/vendor/assets/src/js/atome/specific/wasm.js +12 -0
- data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +13 -0
- data/vendor/assets/src/js/third_parties/fabric.min.js +1 -1
- data/vendor/assets/src/js/third_parties/html-to-image.min.js +2 -0
- data/vendor/assets/src/js/third_parties/jsencrypt.min.js +2 -0
- data/vendor/assets/src/js/third_parties/papaparse.min.js +7 -0
- data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +202 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- data/vendor/assets/src/medias/images/logos/Facebook.svg +1 -1
- data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +109 -0
- data/vendor/assets/src/medias/images/logos/LinkedIn.svg +11 -0
- data/vendor/assets/src/medias/images/logos/X.svg +5 -0
- data/vendor/assets/src-tauri/Cargo.toml +1 -1
- data/vendor/assets/src-tauri/src/main.rs +59 -5
- data/vendor/assets/src-tauri/tauri.conf.json +1 -1
- data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
- metadata +188 -180
- data/lib/atome/extensions/mathematic.rb +0 -20
- data/lib/atome/extensions/matrix.rb +0 -346
- data/lib/atome/helpers/callbacks.rb +0 -133
- data/lib/atome/kernel/batch.rb +0 -26
- data/lib/atome/kernel/essentials.rb +0 -23
- data/lib/atome/renderers/browser/atome.rb +0 -158
- data/lib/atome/renderers/browser/browser.rb +0 -47
- data/lib/atome/renderers/browser/effect.rb +0 -23
- data/lib/atome/renderers/browser/event.rb +0 -96
- data/lib/atome/renderers/browser/geometry.rb +0 -27
- data/lib/atome/renderers/browser/helpers/animation_helper.rb +0 -69
- data/lib/atome/renderers/browser/helpers/browser_helper.rb +0 -101
- data/lib/atome/renderers/browser/helpers/color_helper.rb +0 -80
- data/lib/atome/renderers/browser/helpers/drag_helper.rb +0 -52
- data/lib/atome/renderers/browser/helpers/drop_helper.rb +0 -13
- data/lib/atome/renderers/browser/helpers/effect_helper.rb +0 -23
- data/lib/atome/renderers/browser/helpers/event_helper.rb +0 -76
- data/lib/atome/renderers/browser/helpers/image_helper.rb +0 -27
- data/lib/atome/renderers/browser/helpers/over_helper.rb +0 -13
- data/lib/atome/renderers/browser/helpers/shadow_helper.rb +0 -74
- data/lib/atome/renderers/browser/helpers/shape_helper.rb +0 -22
- data/lib/atome/renderers/browser/helpers/text_helper.rb +0 -38
- data/lib/atome/renderers/browser/helpers/video_helper.rb +0 -50
- data/lib/atome/renderers/browser/helpers/web_helper.rb +0 -26
- data/lib/atome/renderers/browser/identity.rb +0 -61
- data/lib/atome/renderers/browser/material.rb +0 -121
- data/lib/atome/renderers/browser/opal_add_on.rb +0 -31
- data/lib/atome/renderers/browser/opal_browser.rb +0 -6
- data/lib/atome/renderers/browser/spatial.rb +0 -59
- data/lib/atome/renderers/browser/time.rb +0 -3
- data/lib/atome/renderers/browser/utility.rb +0 -49
- data/lib/atome/renderers/headless/headless.rb +0 -10
- data/lib/atome/renderers/headless/utility.rb +0 -6
- data/lib/atome/renderers/html/atome.rb +0 -49
- data/lib/atome/renderers/html/effect.rb +0 -19
- data/lib/atome/renderers/html/event.rb +0 -9
- data/lib/atome/renderers/html/geometry.rb +0 -11
- data/lib/atome/renderers/html/html.rb +0 -42
- data/lib/atome/renderers/html/identity.rb +0 -14
- data/lib/atome/renderers/html/opal_browser.rb +0 -6
- data/lib/atome/renderers/html/spatial.rb +0 -28
- data/lib/atome/renderers/html/utility.rb +0 -17
- data/lib/atome/renderers/opal/extensions/atome.rb +0 -29
- data/lib/atome/renderers/opal/extensions/ping.rb +0 -18
- data/lib/atome/renderers/renderer.rb +0 -15
- data/lib/atome/renderers/server/server.rb +0 -10
- data/lib/atome/renderers/server/utility.rb +0 -6
- data/vendor/assets/aui.rb +0 -5
- data/vendor/assets/r&d/misc.rb +0 -219
- data/vendor/assets/r&d/ping.rb +0 -3
- data/vendor/assets/r&d/storage.rb +0 -9
- data/vendor/assets/r&d/view_example.rb +0 -21
- data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +0 -40
- data/vendor/assets/src/medias/javascripts/test.js +0 -1
- data/vendor/assets/src/medias/rubies/demos.rb +0 -63
- data/vendor/assets/src/medias/rubies/examples/add.rb +0 -24
- data/vendor/assets/src/medias/rubies/examples/animation.rb +0 -81
- data/vendor/assets/src/medias/rubies/examples/atome_new.rb +0 -27
- data/vendor/assets/src/medias/rubies/examples/attach.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/attached.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/auto_height.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/auto_width.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/batch.rb +0 -17
- data/vendor/assets/src/medias/rubies/examples/blur.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/bottom.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/box.rb +0 -20
- data/vendor/assets/src/medias/rubies/examples/center.rb +0 -21
- data/vendor/assets/src/medias/rubies/examples/circle.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/class.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/clear.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/clone.rb +0 -35
- data/vendor/assets/src/medias/rubies/examples/code.rb +0 -11
- data/vendor/assets/src/medias/rubies/examples/color.rb +0 -73
- data/vendor/assets/src/medias/rubies/examples/create_atome_in_atome.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/cursor.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/delete.rb +0 -42
- data/vendor/assets/src/medias/rubies/examples/depth.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/detached.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/drag.rb +0 -98
- data/vendor/assets/src/medias/rubies/examples/drop.rb +0 -26
- data/vendor/assets/src/medias/rubies/examples/edit.rb +0 -12
- data/vendor/assets/src/medias/rubies/examples/element.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/empty_atome.rb +0 -12
- data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/grab.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/height.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/hide.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/id.rb +0 -14
- data/vendor/assets/src/medias/rubies/examples/image.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/left.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/link.rb +0 -22
- data/vendor/assets/src/medias/rubies/examples/markers.rb +0 -48
- data/vendor/assets/src/medias/rubies/examples/materials.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/matrix.rb +0 -102
- data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +0 -483
- data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +0 -32
- data/vendor/assets/src/medias/rubies/examples/monitoring.rb +0 -70
- data/vendor/assets/src/medias/rubies/examples/mute.rb +0 -22
- data/vendor/assets/src/medias/rubies/examples/on.rb +0 -26
- data/vendor/assets/src/medias/rubies/examples/opacity.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/over.rb +0 -21
- data/vendor/assets/src/medias/rubies/examples/pause.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/physical.rb +0 -19
- data/vendor/assets/src/medias/rubies/examples/play.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/read.rb +0 -11
- data/vendor/assets/src/medias/rubies/examples/refresh.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/remove.rb +0 -16
- data/vendor/assets/src/medias/rubies/examples/repeat.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/right.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/rotate.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/schedule.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/shadow.rb +0 -84
- data/vendor/assets/src/medias/rubies/examples/size.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/sort.rb +0 -18
- data/vendor/assets/src/medias/rubies/examples/style.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/tags.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/text.rb +0 -39
- data/vendor/assets/src/medias/rubies/examples/time.rb +0 -18
- data/vendor/assets/src/medias/rubies/examples/to_px.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/touch.rb +0 -56
- data/vendor/assets/src/medias/rubies/examples/vector.rb +0 -39
- data/vendor/assets/src/medias/rubies/examples/video.rb +0 -65
- data/vendor/assets/src/medias/rubies/examples/wait.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/web.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/width.rb +0 -6
- data/vendor/assets/src/medias/rubies/test.rb +0 -1
- data/vendor/assets/src/medias/rubies/text_read.rb +0 -1
- data/vendor/assets/src/medias/rubies/unstable/!run.rb +0 -16
- data/vendor/assets/src/medias/rubies/unstable/_2_solve.rb +0 -72
- data/vendor/assets/src/medias/rubies/unstable/_attach.rb +0 -12
- data/vendor/assets/src/medias/rubies/unstable/_audio.rb +0 -231
- data/vendor/assets/src/medias/rubies/unstable/_dataset.rb +0 -257
- data/vendor/assets/src/medias/rubies/unstable/_matrix.rb +0 -58
- data/vendor/assets/src/medias/rubies/unstable/_os.rb +0 -29
- data/vendor/assets/src/medias/rubies/unstable/_table2.rb +0 -108
- data/vendor/assets/src/medias/rubies/unstable/_vie.rb +0 -211
- data/vendor/assets/src/medias/rubies/users/code.rb +0 -6
- /data/lib/{atome/renderers → platform_specific}/opal/opal.rb +0 -0
- /data/lib/{atome/renderers → platform_specific}/opal/opal_parser.rb +0 -0
- /data/{vendor/assets/src/utilities/mode.rb → lib/renderers/html/communication.rb} +0 -0
- /data/{vendor/assets/src/medias/rubies/unstable/_test.rb → lib/renderers/html/security.rb} +0 -0
data/exe/atome
CHANGED
@@ -4,206 +4,339 @@
|
|
4
4
|
require 'fileutils'
|
5
5
|
require 'securerandom'
|
6
6
|
require 'digest/sha2'
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
require 'pathname'
|
8
|
+
require 'opal'
|
9
|
+
require 'parser'
|
10
|
+
require 'uglifier'
|
11
|
+
|
12
|
+
# utils
|
13
|
+
|
14
|
+
def modify_and_copy_file(source_path, destination_path, destination_dir)
|
15
|
+
|
16
|
+
file_content = File.read(source_path)
|
17
|
+
cleaned_content = file_content.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
18
|
+
modified_code = cleaned_content.gsub(/require\s+(['"])(.*?)\1/) do |match|
|
19
|
+
quote = $1
|
20
|
+
relative_path = $2
|
21
|
+
if relative_path.start_with?('./')
|
22
|
+
relative_path_copy = "#{relative_path}"
|
23
|
+
relative_path_copy.slice!(0, 2)
|
24
|
+
destination_dir_copy = "#{destination_dir}"
|
25
|
+
destination_dir_copy.slice!(0, 2)
|
26
|
+
"require #{quote}#{relative_path_copy}#{quote}"
|
27
|
+
else
|
28
|
+
match
|
29
|
+
end
|
17
30
|
|
18
|
-
def found_path(arg_name)
|
19
|
-
project_name = ARGV[ARGV.find_index(arg_name) + 1]
|
20
|
-
path = `pwd`.chomp
|
21
|
-
if ARGV[ARGV.find_index(arg_name) + 1] == 'production'
|
22
|
-
app_builder_helpers = File.join(File.dirname(__FILE__), '../app_builder_helpers')
|
23
|
-
`cd #{app_builder_helpers};rake minimizer[#{path}]`
|
24
31
|
end
|
25
|
-
|
26
|
-
test_path(project_name, arg_name, path)
|
32
|
+
File.write(destination_path, modified_code)
|
27
33
|
end
|
28
34
|
|
29
|
-
def
|
30
|
-
Dir.foreach(dir) do |e|
|
31
|
-
next if %w[. ..].include? e
|
35
|
+
def process_directories(source_dir, destination_dir)
|
32
36
|
|
33
|
-
|
34
|
-
if
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
Dir.entries(source_dir).each do |entry|
|
38
|
+
next if entry == '.' || entry == '..'
|
39
|
+
|
40
|
+
source_path = File.join(source_dir, entry)
|
41
|
+
destination_path = File.join(destination_dir, entry)
|
42
|
+
|
43
|
+
if File.directory?(source_path)
|
44
|
+
Dir.mkdir(destination_path) unless Dir.exist?(destination_path)
|
45
|
+
process_directories(source_path, destination_path)
|
46
|
+
elsif File.file?(source_path)
|
47
|
+
modify_and_copy_file(source_path, destination_path, destination_dir)
|
38
48
|
end
|
39
49
|
end
|
40
|
-
Dir.delete(dir) if user_application && dir != 'application'
|
41
50
|
end
|
42
51
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
<<~STR
|
52
|
+
# builders
|
53
|
+
def build_aui(destination, project_name)
|
54
|
+
path = "#{destination}/#{project_name}/src/utilities/"
|
55
|
+
FileUtils.mkdir_p(path) unless Dir.exist?(path)
|
56
|
+
uuid = SecureRandom.uuid
|
57
|
+
sha = Digest::SHA256.hexdigest(uuid)
|
58
|
+
coded_id = sha.gsub('-', '_')
|
59
|
+
aui_file = <<~STR
|
52
60
|
class Atome
|
53
61
|
def self.aui
|
54
62
|
"#{coded_id}"
|
55
63
|
end
|
56
64
|
end
|
57
65
|
STR
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
+
File.new("#{path}aui.rb", 'w')
|
67
|
+
File.open("#{path}aui.rb", 'w') do |f|
|
68
|
+
f.puts aui_file
|
69
|
+
end
|
70
|
+
# now building opal version
|
71
|
+
js_directory = "#{destination}/#{project_name}/src/js"
|
72
|
+
opal_js = "#{js_directory}/aui.js"
|
73
|
+
File.new opal_js, 'w'
|
74
|
+
# we add platform_specific script to the Opal framework
|
75
|
+
opal_content = Opal::Builder.build("#{path}aui.rb").to_s
|
76
|
+
File.open(opal_js, 'w') do |f|
|
77
|
+
f.puts opal_content
|
66
78
|
end
|
79
|
+
|
67
80
|
end
|
68
81
|
|
69
|
-
def
|
70
|
-
|
71
|
-
unless
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
82
|
+
def build_host_mode(destination, project_name, mode)
|
83
|
+
path = "#{destination}/#{project_name}/src/utilities/"
|
84
|
+
FileUtils.mkdir_p(path) unless Dir.exist?(path)
|
85
|
+
host_type = <<~STR
|
86
|
+
class Atome
|
87
|
+
def self.host
|
88
|
+
"#{mode}"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
STR
|
92
|
+
File.new("#{path}host_mode.rb", 'w')
|
93
|
+
File.open("#{path}host_mode.rb", 'w') do |f|
|
94
|
+
f.puts host_type
|
95
|
+
end
|
96
|
+
# now building opal version
|
97
|
+
js_directory = "#{destination}/#{project_name}/src/js"
|
98
|
+
opal_js = "#{js_directory}/host_mode.js"
|
99
|
+
File.new opal_js, 'w'
|
100
|
+
# we add platform_specific script to the Opal framework
|
101
|
+
opal_content = Opal::Builder.build("#{path}host_mode.rb").to_s
|
102
|
+
File.open(opal_js, 'w') do |f|
|
103
|
+
f.puts opal_content
|
79
104
|
end
|
80
|
-
new_app_creation
|
81
105
|
end
|
82
106
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
Dir.
|
88
|
-
|
89
|
-
entry = "#{File.dirname(__FILE__)}/../vendor/assets/#{entry}"
|
90
|
-
FileUtils.cp_r entry, target_template_location
|
91
|
-
end
|
107
|
+
# opal compilation
|
108
|
+
def build_opal_application(_source, destination, project_name)
|
109
|
+
# first we need to remplace all './require ' with require so opal can parse the path
|
110
|
+
Dir.mkdir("#{destination}/#{project_name}/tmp") unless Dir.exist?("#{destination}/#{project_name}/tmp")
|
111
|
+
unless Dir.exist?("#{destination}/#{project_name}/tmp/application")
|
112
|
+
Dir.mkdir("#{destination}/#{project_name}/tmp/application")
|
92
113
|
end
|
93
|
-
#
|
94
|
-
|
114
|
+
process_directories("#{destination}/#{project_name}/application", "#{destination}/#{project_name}/tmp/application")
|
115
|
+
|
116
|
+
opal_compiler_content = <<STR
|
117
|
+
# frozen_string_literal: true
|
118
|
+
|
119
|
+
require 'opal'
|
120
|
+
application_js = "../../src/js/application.js"
|
121
|
+
builder = Opal::Builder.new
|
122
|
+
builder.append_paths("./")
|
123
|
+
application_content = builder.build("./index.rb").to_s
|
124
|
+
File.open(application_js, 'w') do |f|
|
125
|
+
f.puts application_content
|
95
126
|
end
|
127
|
+
STR
|
96
128
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
build_atome_resources(current_path, project_name, production)
|
102
|
-
return unless new_app_creation
|
103
|
-
|
104
|
-
# now adding name to the app
|
105
|
-
index_html = "#{current_path}/#{project_name}/src/index.html"
|
106
|
-
index_html_content = File.open(index_html).read
|
107
|
-
index_html_content = index_html_content.gsub('<title>atome</title>', "<title>#{project_name}</title>")
|
108
|
-
File.open(index_html, 'w') do |f|
|
109
|
-
f.puts index_html_content
|
129
|
+
# we create an hidden file
|
130
|
+
opal_compiler = "#{destination}/#{project_name}/tmp/application/.opal_compiler.rb"
|
131
|
+
File.open(opal_compiler, 'w') do |f|
|
132
|
+
f.puts opal_compiler_content
|
110
133
|
end
|
134
|
+
`cd #{destination}/#{project_name}/tmp/application/;pwd;ruby .opal_compiler.rb`
|
111
135
|
end
|
112
136
|
|
113
|
-
def
|
114
|
-
|
115
|
-
|
137
|
+
def add_to_application_folder(script_source, destination, project_name)
|
138
|
+
# this method is to add addition script to the application folder (useful for test per example)
|
139
|
+
destination_dir = "#{destination}/#{project_name}/application"
|
140
|
+
FileUtils.cp_r(Dir["#{script_source}/*"], destination_dir)
|
116
141
|
end
|
117
142
|
|
118
|
-
def
|
119
|
-
|
120
|
-
|
143
|
+
def build_opal_library(atome_source, destination, project_name, production = nil)
|
144
|
+
user_project_path = "#{destination}/#{project_name}"
|
145
|
+
opal_directory = "#{user_project_path}/src/js/opal"
|
146
|
+
opal_js = "#{opal_directory}/opal.js"
|
147
|
+
Dir.mkdir(opal_directory) unless File.directory?(opal_directory)
|
148
|
+
File.new opal_js, 'w'
|
149
|
+
# we add platform_specific script to the Opal framework
|
150
|
+
opal_content = Opal::Builder.build("#{atome_source}/lib/platform_specific/opal/opal.rb").to_s
|
151
|
+
File.open(opal_js, 'w') do |f|
|
152
|
+
f.puts opal_content
|
121
153
|
end
|
122
|
-
nil unless ARGV.include?('guard')
|
123
154
|
end
|
124
155
|
|
125
|
-
def
|
126
|
-
|
127
|
-
|
128
|
-
|
156
|
+
def create_application(source, destination, project_name)
|
157
|
+
project_path = "#{destination}/#{project_name}"
|
158
|
+
FileUtils.mkdir_p(destination) unless Dir.exist?(destination)
|
159
|
+
FileUtils.mkdir_p(project_path) unless Dir.exist?(project_path)
|
160
|
+
files_list = ['application', 'server', 'src', 'src-tauri', 'src-wasm', 'Guardfile', 'Rakefile']
|
161
|
+
file_to_refresh = ['application', 'server', 'src', 'src-tauri', 'Rakefile']
|
162
|
+
# we delete many folder to ensure they'll refreshed
|
163
|
+
file_to_refresh.each do |file|
|
164
|
+
FileUtils.rm_rf("#{destination}/#{project_name}/#{file}")
|
165
|
+
end
|
166
|
+
# we copy all folder to be refreshed
|
167
|
+
files_list.each do |file|
|
168
|
+
FileUtils.cp_r("#{source}/vendor/assets/#{file}", "#{destination}/#{project_name}/#{file}") unless Dir.exist?(file)
|
169
|
+
end
|
170
|
+
build_aui(destination, project_name)
|
129
171
|
end
|
130
172
|
|
131
|
-
def
|
132
|
-
|
173
|
+
def update_application(source, destination, project_name)
|
174
|
+
project_path = "#{destination}/#{project_name}"
|
175
|
+
FileUtils.mkdir_p(destination) unless Dir.exist?(destination)
|
176
|
+
FileUtils.mkdir_p(project_path) unless Dir.exist?(project_path)
|
177
|
+
files_list = ['application', 'server', 'src', 'src-tauri', 'src-wasm', 'Guardfile', 'Rakefile']
|
178
|
+
file_to_refresh = ['application', 'server', 'src',]
|
179
|
+
# we delete many folder to ensure they'll refreshed
|
180
|
+
file_to_refresh.each do |file|
|
181
|
+
FileUtils.rm_rf("#{destination}/#{project_name}/#{file}")
|
182
|
+
end
|
183
|
+
# we copy all folder to be refreshed
|
184
|
+
files_list.each do |file|
|
185
|
+
FileUtils.cp_r("#{source}/vendor/assets/#{file}", "#{destination}/#{project_name}/#{file}") unless Dir.exist?(file)
|
186
|
+
end
|
187
|
+
build_aui(destination, project_name)
|
133
188
|
end
|
134
189
|
|
135
|
-
def
|
136
|
-
`cd #{location}/src`
|
137
|
-
guard_check
|
138
|
-
end
|
190
|
+
def build_opal_parser(source, destination, project_name)
|
139
191
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
192
|
+
parser_js = "#{destination}/#{project_name}/src/js/opal/opal_parser.js"
|
193
|
+
File.new parser_js, 'w'
|
194
|
+
parser_content = Opal::Builder.build("#{source}/lib/platform_specific/opal/opal_parser.rb").to_s
|
195
|
+
File.open(parser_js, 'w') do |f|
|
196
|
+
f.puts parser_content
|
145
197
|
end
|
146
|
-
`cd #{location}/server;rackup --server puma --port #{port} --env production`
|
147
198
|
end
|
148
199
|
|
149
|
-
def
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
when :native
|
160
|
-
# freebsd
|
161
|
-
else
|
162
|
-
guard_check
|
200
|
+
def build_atome_kernel_for_opal(source, destination, project_name)
|
201
|
+
# now lets build the atome kernel
|
202
|
+
atome_directory = "#{destination}/#{project_name}/src/js/atome"
|
203
|
+
kernel_js = "#{atome_directory}/kernel.js"
|
204
|
+
File.new kernel_js, 'w'
|
205
|
+
builder = Opal::Builder.new
|
206
|
+
builder.append_paths("#{source}/lib/")
|
207
|
+
kernel_content = builder.build("#{source}/lib/atome.rb").to_s
|
208
|
+
File.open(kernel_js, 'w') do |f|
|
209
|
+
f.puts kernel_content
|
163
210
|
end
|
164
211
|
end
|
165
212
|
|
166
|
-
def
|
167
|
-
|
168
|
-
|
213
|
+
def build_opal_extensions(source, destination, project_name)
|
214
|
+
opal_directory = "#{destination}/#{project_name}/src/js/opal"
|
215
|
+
extensions_js = "#{opal_directory}/atome_opal_extensions.js"
|
216
|
+
File.new extensions_js, 'w'
|
217
|
+
builder = Opal::Builder.new
|
218
|
+
builder.append_paths("#{source}/lib/platform_specific/opal/")
|
219
|
+
extensions_content = builder.build("#{source}/lib/platform_specific/opal/atome_opal_extensions.rb").to_s
|
220
|
+
File.open(extensions_js, 'w') do |f|
|
221
|
+
f.puts extensions_content
|
222
|
+
end
|
169
223
|
end
|
170
224
|
|
171
|
-
#
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
225
|
+
# wasm compilation
|
226
|
+
def wasm_common(source, destination, project_name, wasi_file, host_mode, script_source = nil)
|
227
|
+
# create_application(source, destination, project_name)
|
228
|
+
# the line below is to add addition script to the application folder (useful for test per example)
|
229
|
+
add_to_application_folder(script_source, destination, project_name) if script_source
|
230
|
+
# build host_mode
|
231
|
+
build_host_mode(destination, project_name, host_mode)
|
232
|
+
# build wasm
|
233
|
+
build_for_wasm(source, destination, project_name, wasi_file)
|
234
|
+
end
|
176
235
|
|
177
|
-
|
236
|
+
def wasm_initialize (source, destination, project_name, wasi_source)
|
237
|
+
application_location = "#{destination}/#{project_name}"
|
238
|
+
wasm_location = "#{application_location}/src/wasm/"
|
239
|
+
Dir.mkdir(wasm_location) unless Dir.exist?(wasm_location)
|
240
|
+
|
241
|
+
wasm_temp_folder = "#{application_location}/tmp"
|
242
|
+
Dir.mkdir(wasm_temp_folder) unless Dir.exist?(wasm_temp_folder)
|
243
|
+
#### IMPORTANT TO REFRESH RUBY WASM TO THE LATEST VERSION, (when ruby_browser get far too large)
|
244
|
+
# and UNCOMMENT the line below : ('curl -LO ....')
|
245
|
+
unless File.exist?("#{wasm_temp_folder}/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz")
|
246
|
+
# `cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/latest/download/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
247
|
+
`cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
248
|
+
# debug : https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-minimal-js-debug.tar.gz
|
249
|
+
# standard : `cd #{wasm_temp_folder};curl -LO https://github.com/ruby/ruby.wasm/releases/download/2023-11-17-a/ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
250
|
+
end
|
251
|
+
`cd #{wasm_temp_folder}; tar xfz ruby-3_2-wasm32-unknown-wasi-full-js.tar.gz`
|
252
|
+
`mv #{wasm_temp_folder}/3_2-wasm32-unknown-wasi-full-js/usr/local/bin/ruby #{wasm_temp_folder}/system_ruby_browser.wasm`
|
253
|
+
`rm -f #{application_location}/src/wasm/ruby_browser.wasm`
|
254
|
+
cmd = <<~STRDELIM
|
255
|
+
#{application_location}/src-wasm/wasm/#{wasi_source} pack #{wasm_temp_folder}/system_ruby_browser.wasm
|
256
|
+
--mapdir usr::#{wasm_temp_folder}/3_2-wasm32-unknown-wasi-full-js/usr
|
257
|
+
--mapdir lib::#{source}/lib/
|
258
|
+
--mapdir /::#{application_location}/application/
|
259
|
+
--mapdir utilities::#{application_location}/src/utilities/
|
260
|
+
-o #{application_location}/src/wasm/ruby_browser.wasm
|
261
|
+
STRDELIM
|
262
|
+
cleaned_cmd = cmd.lines.reject { |line| line.start_with?('#') }.join
|
263
|
+
command = cleaned_cmd.chomp.gsub("\n", ' ')
|
264
|
+
system(command)
|
265
|
+
end
|
178
266
|
|
179
|
-
|
267
|
+
def guard_check
|
268
|
+
loop do
|
269
|
+
sleep 1
|
270
|
+
end
|
271
|
+
nil unless ARGV.include?('guard')
|
272
|
+
end
|
180
273
|
|
181
|
-
|
274
|
+
def build_for_wasm(source, destination, project_name, wasi_file)
|
275
|
+
wasm_initialize(source, destination, project_name, wasi_file)
|
276
|
+
end
|
182
277
|
|
183
|
-
|
184
|
-
#
|
278
|
+
def build_for_osx(destination, mode = :dev)
|
279
|
+
# dev or build
|
185
280
|
|
186
|
-
|
281
|
+
`cd #{destination};cargo tauri #{mode}`
|
187
282
|
|
188
|
-
platforms.each do |platform|
|
189
|
-
build_target = platform if ARGV.include?(platform)
|
190
283
|
end
|
191
284
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
create_application(project_name, force, production)
|
285
|
+
def build_for_server(destination, project_name, port, production)
|
286
|
+
prod = '--env production' if production
|
287
|
+
`cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
|
196
288
|
end
|
197
289
|
|
198
|
-
|
199
|
-
|
200
|
-
|
290
|
+
# def run_application(build_target, location, port = 9292, production = false)
|
291
|
+
# build_app(location, nil)
|
292
|
+
# run_case(build_target, location, port, production)
|
293
|
+
# end
|
294
|
+
|
295
|
+
# below we analyse the ARGV
|
296
|
+
location = '/'
|
297
|
+
project_name = ARGV[1]
|
298
|
+
destination = `pwd`.chomp
|
299
|
+
source = Pathname(__FILE__).parent.parent.to_s
|
300
|
+
|
301
|
+
wasi_file = 'wasi-vfs-osx_arm' # default to osx arm
|
302
|
+
# TODO : get wasi params from ARG to allow compile on windows / Unix
|
303
|
+
if ARGV.include?('create')
|
304
|
+
create_application(source, destination, project_name)
|
305
|
+
# create_application(source, destination, project_name, production)
|
306
|
+
wasm_common(source, destination, project_name, wasi_file, :universal)
|
307
|
+
# build opal
|
308
|
+
build_opal_library(source, destination, project_name)
|
309
|
+
# build parser
|
310
|
+
build_opal_parser(source, destination, project_name)
|
311
|
+
# build atome kernel
|
312
|
+
build_atome_kernel_for_opal(source, destination, project_name)
|
313
|
+
# build Opal extensions
|
314
|
+
build_opal_extensions(source, destination, project_name)
|
315
|
+
# build application
|
316
|
+
build_opal_application(source, destination, project_name)
|
201
317
|
end
|
202
318
|
|
203
319
|
if ARGV.include?('update')
|
204
320
|
# TODO: also update index.html and all other files except the application folder
|
205
|
-
|
206
|
-
|
321
|
+
# first we delete everything but application
|
322
|
+
folders_to_keep = ['application']
|
323
|
+
Dir.foreach(destination) do |item|
|
324
|
+
item_path = File.join(destination, item)
|
325
|
+
if File.directory?(item_path) && !folders_to_keep.include?(item)
|
326
|
+
FileUtils.rm_rf(item_path) unless item == '.' || item == '..'
|
327
|
+
elsif File.file?(item_path)
|
328
|
+
File.delete(item_path)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
# now we update
|
332
|
+
puts "#{source}/vendor/assets"
|
333
|
+
|
334
|
+
update_source = "#{source}/vendor/assets"
|
335
|
+
|
336
|
+
Dir.glob("#{update_source}/*").each do |item|
|
337
|
+
target = File.join(destination, File.basename(item))
|
338
|
+
FileUtils.cp_r(item, target) unless File.exist?(target)
|
339
|
+
end
|
207
340
|
end
|
208
341
|
|
209
342
|
if ARGV.include?('guard')
|
@@ -215,78 +348,45 @@ if ARGV.include?('guard')
|
|
215
348
|
end
|
216
349
|
end
|
217
350
|
|
218
|
-
def set_atome_mode(location, mode)
|
219
|
-
mode_file = "#{location}/src/utilities/mode.rb"
|
220
|
-
file_found = File.open(mode_file)
|
221
|
-
atome_mode=<<~STR
|
222
|
-
$host = :#{mode}
|
223
|
-
STR
|
224
|
-
File.open(file_found, 'w') do |f|
|
225
|
-
f.puts atome_mode
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
351
|
if ARGV.include?('run')
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
end
|
243
|
-
demos_list_file = "#{demo_location}/demos_list.rb"
|
244
|
-
File.open(demos_list_file, 'w') do |f|
|
245
|
-
# f.puts "class Atome_demo\n def demos_list\n #{demos_list_content}\n end\nend"
|
246
|
-
f.puts "def demos_list\n #{demos_list_content}\nend"
|
247
|
-
end
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
case build_target
|
252
|
-
when 'android'
|
253
|
-
set_atome_mode(path,'tauri')
|
254
|
-
# TODO: write code here
|
255
|
-
when 'browser'
|
256
|
-
set_atome_mode(path,'browser')
|
257
|
-
run_application(:browser, path)
|
258
|
-
when 'freebsd'
|
259
|
-
set_atome_mode(path,'native')
|
260
|
-
# TODO: write code here
|
261
|
-
when 'ios'
|
262
|
-
set_atome_mode(path,'tauri')
|
263
|
-
# TODO: write code here
|
264
|
-
when 'linux'
|
265
|
-
# TODO: write code here
|
266
|
-
when 'osx'
|
267
|
-
set_atome_mode(path,'tauri')
|
268
|
-
run_application(:osx, path)
|
352
|
+
current_path = `pwd`.chomp
|
353
|
+
segments = current_path.split("/")
|
354
|
+
project_name = segments.last
|
355
|
+
destination = segments[0...-1].join("/")
|
356
|
+
case ARGV[1]
|
357
|
+
when 'opal'
|
358
|
+
build_opal_application(nil, destination, project_name)
|
359
|
+
`open #{destination}/#{project_name}/src/index_opal.html`
|
360
|
+
when 'wasm' # osx wasi
|
361
|
+
wasi_file = 'wasi-vfs-osx_arm'
|
362
|
+
wasm_common(source, destination, project_name, wasi_file, :pure_wasi)
|
363
|
+
`open #{current_path}/src/index.html`
|
269
364
|
when 'server'
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
text = text.gsub('run App.freeze.app', '')
|
276
|
-
text = text.gsub(/^$\n/, '')
|
277
|
-
text = if production == 'production'
|
278
|
-
"#{text}run App.freeze.app"
|
279
|
-
else
|
280
|
-
"#{text}run Unreloader"
|
281
|
-
end
|
282
|
-
File.open(config_location, 'w') do |f|
|
283
|
-
f.puts text
|
365
|
+
build_opal_application(nil, destination, project_name)
|
366
|
+
threads = []
|
367
|
+
threads << Thread.new do
|
368
|
+
sleep 1
|
369
|
+
`open http://localhost:9292`
|
284
370
|
end
|
285
|
-
|
371
|
+
build_for_server(destination, project_name, 9292, :production)
|
372
|
+
when 'osx'
|
373
|
+
wasi_file = 'wasi-vfs-osx_arm'
|
374
|
+
wasm_common(source, destination, project_name, wasi_file, :tauri)
|
375
|
+
build_for_osx(destination)
|
376
|
+
when 'android'
|
377
|
+
# to be filled
|
378
|
+
when 'ios'
|
379
|
+
# to be filled
|
286
380
|
when 'windows'
|
287
|
-
#
|
381
|
+
# to be filled
|
382
|
+
when 'linux'
|
383
|
+
# to be filled
|
384
|
+
when 'freebsd'
|
385
|
+
# to be filled
|
288
386
|
else
|
289
|
-
|
387
|
+
wasi_file = 'wasi-vfs-osx_arm'
|
388
|
+
wasm_common(source, destination, project_name, wasi_file, 'pure_wasm')
|
389
|
+
`open #{current_path}/src/index.html`
|
290
390
|
end
|
291
391
|
|
292
392
|
end
|