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
@@ -1,18 +1,50 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# toolbox method here
|
4
|
+
require 'json'
|
4
5
|
class Atome
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
class << self
|
7
|
+
def controller_sender(message)
|
8
|
+
return if $host == :html
|
9
|
+
json_msg = message.to_json
|
10
|
+
js_json_msg = json_msg.inspect
|
11
|
+
js_command = "atomeJS.controller_sender(#{js_json_msg})"
|
12
|
+
JS.eval(js_command)
|
13
|
+
end
|
10
14
|
|
11
|
-
|
12
|
-
|
15
|
+
# def global_monitoring(instance, methods_to_monitor, variables_to_monitor)
|
16
|
+
# methods_to_monitor.each do |methode|
|
17
|
+
# original_method = instance.method(methode)
|
18
|
+
# instance.define_singleton_method(methode) do |*args, &block|
|
19
|
+
# value_before = instance.instance_variable_get("@#{methode}")
|
20
|
+
# result = original_method.call(*args, &block)
|
21
|
+
# value_after = instance.instance_variable_get("@#{methode}")
|
22
|
+
# if args.empty?
|
23
|
+
# # "read monitoring: #{methode}"
|
24
|
+
# elsif value_before != value_after
|
25
|
+
# affect.each do |targeted_atome|
|
26
|
+
# # get the content of the affect instance_variable and send it
|
27
|
+
# # to the affect method to apply the atome to all atome children
|
28
|
+
# grab(targeted_atome).render(:apply, self)
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
# result
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
# variables_to_monitor.each do |var|
|
35
|
+
# instance.define_singleton_method(var) do
|
36
|
+
# instance_variable_get("@#{var}")
|
37
|
+
# end
|
38
|
+
# instance.define_singleton_method("#{var}=") do |value|
|
39
|
+
# instance_variable_set("@#{var}", value)
|
40
|
+
# end
|
41
|
+
# end
|
42
|
+
# end
|
13
43
|
|
14
44
|
end
|
15
45
|
|
46
|
+
# local server messaging
|
47
|
+
|
16
48
|
def response_listener(hashed_msg)
|
17
49
|
js_action = hashed_msg.JS[:action]
|
18
50
|
js_body = hashed_msg.JS[:body]
|
@@ -20,251 +52,232 @@ class Atome
|
|
20
52
|
end
|
21
53
|
|
22
54
|
def self.controller_listener
|
55
|
+
return if $host == :html
|
23
56
|
|
24
|
-
|
25
|
-
|
26
|
-
atome_js.JS.controller_listener()
|
27
|
-
|
57
|
+
atome_js.JS.controller_listener() # js folder atome/helipers/atome/communication
|
28
58
|
end
|
29
59
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
#
|
34
|
-
# def self.mode
|
35
|
-
# "@atome_mode"
|
36
|
-
# end
|
37
|
-
|
38
|
-
def collapse
|
39
|
-
@atome.each do |element, value|
|
60
|
+
def collapse(new_atome)
|
61
|
+
# TODO : try to optimise the two lines below to avoid conditions
|
62
|
+
new_atome.each do |element, value|
|
40
63
|
send(element, value)
|
41
64
|
end
|
42
65
|
end
|
43
66
|
|
44
|
-
def
|
45
|
-
|
67
|
+
def particle_main(element, params, &user_proc)
|
68
|
+
# TODO : optimise below removing all conditions if possible
|
69
|
+
if Atome.instance_variable_get("@main_#{element}").is_a?(Proc) # post is before rendering and broadcasting
|
70
|
+
result = instance_exec(params, user_proc, self, &Atome.instance_variable_get("@main_#{element}"))
|
71
|
+
params = result if result && !result.instance_of?(Atome)
|
72
|
+
end
|
73
|
+
params
|
74
|
+
end
|
75
|
+
|
76
|
+
def particle_read(element, params, &user_proc)
|
77
|
+
if Atome.instance_variable_get("@read_#{element}").is_a?(Proc) # post is before rendering and broadcasting
|
78
|
+
params = instance_exec(params, user_proc, self, &Atome.instance_variable_get("@read_#{element}"))
|
79
|
+
end
|
80
|
+
params
|
46
81
|
end
|
47
82
|
|
48
|
-
def
|
83
|
+
def particle_sanitizer(element, params, &user_proc)
|
84
|
+
|
49
85
|
bloc_found = Universe.get_sanitizer_method(element)
|
86
|
+
# sanitizer occurs before any treatment
|
87
|
+
# it's call at the very start when a new atome is created : in genesis.rb /new_atome
|
88
|
+
# it's also call when creating a new particle in genesis/ new_particle befre creating the particle
|
89
|
+
# and also before creating additional method in genesis/ additional_particle_methods
|
50
90
|
params = instance_exec(params, user_proc, &bloc_found) if bloc_found.is_a?(Proc)
|
51
91
|
params
|
52
92
|
end
|
53
93
|
|
54
|
-
def
|
55
|
-
"
|
94
|
+
def particle_pre(element, params, &user_proc)
|
95
|
+
if Atome.instance_variable_get("@pre_#{element}").is_a?(Proc) # post is before rendering and broadcasting
|
96
|
+
params = instance_exec(params, user_proc, self, &Atome.instance_variable_get("@pre_#{element}"))
|
97
|
+
end
|
98
|
+
params
|
56
99
|
end
|
57
100
|
|
58
|
-
def
|
59
|
-
|
60
|
-
|
61
|
-
if particle_monitored[:particles].include?(element)
|
62
|
-
code_found = particle_monitored[:code]
|
63
|
-
instance_exec(self, element, params, &code_found) if code_found.is_a?(Proc)
|
64
|
-
end
|
101
|
+
def particle_post(element, params, &user_proc)
|
102
|
+
if Atome.instance_variable_get("@post_#{element}").is_a?(Proc) # post is after rendering and broadcasting
|
103
|
+
params = instance_exec(params, user_proc, self, &Atome.instance_variable_get("@post_#{element}"))
|
65
104
|
end
|
105
|
+
params
|
66
106
|
end
|
67
107
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
if params
|
72
|
-
monitoring = atome[:monitor] ||= {}
|
73
|
-
params[:atomes].each do |atome_id|
|
74
|
-
target_broadcaster = grab(atome_id).instance_variable_get('@broadcast')
|
75
|
-
monitor_id = params[:id] || "monitor#{target_broadcaster.length}"
|
76
|
-
monitoring[monitor_id] = params.merge({ code: proc_monitoring })
|
77
|
-
target_broadcaster[monitor_id] = { particles: params[:particles], code: proc_monitoring }
|
78
|
-
end
|
79
|
-
else
|
80
|
-
atome[:monitor]
|
108
|
+
def particle_after(element, params, &user_proc)
|
109
|
+
if Atome.instance_variable_get("@after_#{element}").is_a?(Proc) # after is post saving
|
110
|
+
params = instance_exec(params, user_proc, self, &Atome.instance_variable_get("@after_#{element}"))
|
81
111
|
end
|
82
|
-
|
112
|
+
params
|
83
113
|
end
|
84
114
|
|
85
|
-
def
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
115
|
+
def atome_pre_process(element, params, &user_proc)
|
116
|
+
if Atome.instance_variable_get("@pre_#{element}").is_a?(Proc)
|
117
|
+
params = instance_exec(params, self, user_proc, &Atome.instance_variable_get("@pre_#{element}"))
|
118
|
+
end
|
119
|
+
params
|
90
120
|
end
|
91
121
|
|
92
|
-
def
|
93
|
-
|
94
|
-
|
95
|
-
atome[particle_found] = value_found
|
96
|
-
end
|
97
|
-
else
|
98
|
-
atome
|
99
|
-
end
|
122
|
+
def atome_sanitizer(element, params, &user_proc)
|
123
|
+
# Attention: the method is the same as the one used for the partcicle
|
124
|
+
particle_sanitizer(element, params)
|
100
125
|
end
|
101
126
|
|
102
|
-
def
|
127
|
+
def atome_post_process(element, params, new_atome, &user_proc)
|
103
128
|
|
104
|
-
|
105
|
-
|
129
|
+
return unless Atome.instance_variable_get("@post_#{element}").is_a?(Proc)
|
130
|
+
new_atome.instance_exec(params, user_proc, &Atome.instance_variable_get("@post_#{element}"))
|
106
131
|
|
107
|
-
def add_to_integer(_atome_found, _particle_found, &_user_proc)
|
108
|
-
puts "there's no interest to add anything to an integer!"
|
109
132
|
end
|
110
133
|
|
111
|
-
def
|
112
|
-
|
113
|
-
|
134
|
+
def atome_processor(element, params, &user_proc)
|
135
|
+
# TODO: replace with the line below but need extensive testing as it crash some demos ex: animation
|
136
|
+
params = atome_common(element, params)
|
114
137
|
|
115
|
-
|
116
|
-
puts "there's no interest to add anything to an integer!"
|
117
|
-
end
|
138
|
+
atome_pre_process(element, params, &user_proc)
|
118
139
|
|
119
|
-
|
120
|
-
|
140
|
+
new_atome = send("set_#{element}", params, &user_proc) # it call Atome.define_method "set_#{element}" in new_atome method
|
141
|
+
# TODO : check if we don't have a security issue allowing atome modification after creation
|
142
|
+
# if we have one find another solution the keep this facility
|
143
|
+
atome_post_process(element, params, new_atome, &user_proc)
|
144
|
+
|
145
|
+
new_atome
|
121
146
|
end
|
122
147
|
|
123
|
-
def
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
values.each do |value_id, value|
|
128
|
-
@atome[particle][value_id] = value
|
148
|
+
def store(params)
|
149
|
+
params.each do |particle_to_save, data|
|
150
|
+
# @!atome[particle_to_save]=data
|
151
|
+
# instance_variable_set(particle_to_save,data)
|
129
152
|
end
|
130
|
-
end
|
131
153
|
|
132
|
-
def add_to_array(particle, value, &_user_proc)
|
133
|
-
@atome[:add][particle] = true
|
134
|
-
# we update the holder of any new particle if user pass a bloc
|
135
|
-
@atome[particle] << value
|
136
154
|
end
|
137
155
|
|
138
|
-
def
|
139
|
-
|
140
|
-
|
141
|
-
@atome[:add][atome_type] = particle_found
|
142
|
-
send(atome_type, particle_found, &user_proc)
|
156
|
+
def history(filter = {})
|
157
|
+
filter[:id] = @id
|
158
|
+
Universe.story(filter)
|
143
159
|
end
|
144
160
|
|
145
|
-
def
|
161
|
+
# def broadcasting(element)
|
162
|
+
# params = instance_variable_get("@#{element}")
|
163
|
+
# @broadcast.each_value do |particle_monitored|
|
164
|
+
# if particle_monitored[:particles].include?(element)
|
165
|
+
# code_found = particle_monitored[:code]
|
166
|
+
# instance_exec(self, element, params, &code_found) if code_found.is_a?(Proc)
|
167
|
+
# end
|
168
|
+
# end
|
169
|
+
# end
|
146
170
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
171
|
+
def store_proc(element, params = true, &user_proc)
|
172
|
+
instance_variable_set("@#{element}_code", {}) unless instance_variable_get("@#{element}_code")
|
173
|
+
# TODO : we may have to change this code if we need multiple proc for an particle
|
174
|
+
# FIXME : find a better algorithm can be found to avoid test if option is a Hash
|
175
|
+
Object.attr_accessor "#{element}_code"
|
176
|
+
elem_code = "@#{element}_code"
|
177
|
+
if params.instance_of? Hash
|
178
|
+
option_found = params.values[0]
|
179
|
+
instance_variable_get(elem_code)["#{option_found}_code"] = user_proc
|
180
|
+
else
|
181
|
+
instance_variable_get(elem_code)[element] = user_proc
|
153
182
|
end
|
183
|
+
# the commented line below will automatically execute the callback method
|
184
|
+
# we keep it commented because sometime the execution is conditioned, ex : run callbck on a touch
|
185
|
+
# send("#{element}_callback")
|
154
186
|
end
|
155
187
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
# particles.each do |particle, value|
|
161
|
-
# particle_type = Universe.particle_list[particle] || 'atome'
|
162
|
-
# puts "<<<<<< this the place to b ....>>>>>>#{particles} #{particle_type}"
|
163
|
-
# send("add_to_#{particle_type}", particle, value, &user_proc)
|
164
|
-
# end
|
165
|
-
end
|
166
|
-
|
167
|
-
def refresh
|
168
|
-
collapse
|
169
|
-
end
|
170
|
-
|
171
|
-
# def collector(params = {}, &bloc)
|
172
|
-
# atome_type = :collector
|
173
|
-
# # generated_render = params[:renderers] || []
|
174
|
-
# # generated_id = params[:id] || identity_generator(atome_type)
|
175
|
-
# #
|
176
|
-
# # generated_parents = params[:parents] || [id]
|
177
|
-
# params = atome_common(atome_type, params)
|
178
|
-
# Batch.new({ atome_type => params }, &bloc)
|
188
|
+
# this method is used to automatically create a callback method sufifxed par '_callbback' ex :.shell => shell_callback
|
189
|
+
# it can be override if you create a method like:
|
190
|
+
# new({callback: :shell}) do |params, bloc|
|
191
|
+
# # …write what you want …
|
179
192
|
# end
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
instance_exec(
|
193
|
+
def particle_callback(element)
|
194
|
+
Atome.define_method "#{element}_callback" do
|
195
|
+
proc_found = instance_variable_get("@#{element}_code")[element]
|
196
|
+
# instance_exec(@callback[element], proc_found)if proc_found.is_a? Proc
|
197
|
+
proc_found.call(@callback[element]) if proc_found.is_a? Proc
|
184
198
|
end
|
185
199
|
end
|
186
200
|
|
187
|
-
|
188
|
-
|
201
|
+
# this method generate the method accessible for end developers
|
202
|
+
# it's the send the method define in "particle_callback"
|
203
|
+
def call(element)
|
204
|
+
send("#{element}_callback")
|
189
205
|
end
|
190
206
|
|
191
|
-
def
|
192
|
-
|
207
|
+
def callback(data)
|
208
|
+
@callback[data.keys[0]] = data[data.keys[0]]
|
193
209
|
end
|
194
210
|
|
195
|
-
def
|
196
|
-
if
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
# collected_atomes = []
|
203
|
-
# value[range].each do |atome_found|
|
204
|
-
# collected_atomes << atome_found
|
205
|
-
# end
|
206
|
-
# collector_object.data(collected_atomes)
|
207
|
-
Batch.new(value[range])
|
208
|
-
# return collector_object
|
211
|
+
def particles(particles_found = nil)
|
212
|
+
if particles_found
|
213
|
+
particles_found.each do |particle_found, value_found|
|
214
|
+
atome[particle_found] = value_found
|
215
|
+
end
|
216
|
+
else
|
217
|
+
atome
|
209
218
|
end
|
210
|
-
|
211
219
|
end
|
212
220
|
|
213
|
-
def
|
214
|
-
#
|
215
|
-
|
221
|
+
def atome
|
222
|
+
# allow to get all atomes instance variables available as a Hash
|
223
|
+
instance_variables.each_with_object({}) do |var, hash|
|
224
|
+
hash[var[1..-1].to_sym] = instance_variable_get(var) # var[1..-1] enlève le '@' au début
|
225
|
+
end
|
216
226
|
end
|
217
227
|
|
218
|
-
def
|
219
|
-
|
220
|
-
|
228
|
+
def to_hash
|
229
|
+
hash = {}
|
230
|
+
instance_variables.each do |var|
|
231
|
+
next if %i[@html_object @history].include?(var)
|
232
|
+
|
233
|
+
hash[var.to_s.delete('@').to_sym] = instance_variable_get(var)
|
221
234
|
end
|
235
|
+
hash
|
222
236
|
end
|
223
237
|
|
224
|
-
def
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
end
|
229
|
-
else
|
230
|
-
send(particle_to_remove, 0)
|
238
|
+
def refresh
|
239
|
+
particles_found = to_hash
|
240
|
+
particles_found.each do |particle_found, value_found|
|
241
|
+
send(particle_found, value_found)
|
231
242
|
end
|
243
|
+
|
232
244
|
end
|
233
245
|
|
234
|
-
def
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
shapes_found = atome[:shape] || []
|
239
|
-
web_found = atome[:web] || []
|
240
|
-
texts_found = atome[:text] || []
|
241
|
-
images_found.concat(videos_found).concat(shapes_found).concat(web_found).concat(texts_found)
|
246
|
+
def each(&proc)
|
247
|
+
collect.each do |val|
|
248
|
+
instance_exec(val, &proc) if proc.is_a?(Proc)
|
249
|
+
end
|
242
250
|
end
|
243
251
|
|
252
|
+
def <<(item)
|
253
|
+
collect << item
|
254
|
+
end
|
244
255
|
|
245
|
-
def
|
246
|
-
|
247
|
-
|
248
|
-
types.each do |type|
|
249
|
-
ids_found = self.send(type)
|
250
|
-
next unless ids_found
|
256
|
+
def include?(value)
|
257
|
+
include?(value)
|
258
|
+
end
|
251
259
|
|
252
|
-
|
253
|
-
|
254
|
-
|
260
|
+
def set(params)
|
261
|
+
params.each do |particle, value|
|
262
|
+
send(particle, value)
|
255
263
|
end
|
256
|
-
atomes_found
|
257
264
|
end
|
258
265
|
|
259
266
|
def detach_atome(atome_id_to_detach)
|
260
267
|
atome_to_detach = grab(atome_id_to_detach)
|
261
268
|
# TODO: remove the condition below and find why it try to detach an atome that doesn't exist
|
262
|
-
|
263
|
-
|
264
|
-
atome_id_found = atome_to_detach.atome[:id]
|
265
|
-
@atome[atome_type_found].delete(atome_id_found)
|
266
|
-
@atome[:attached].delete(atome_id_to_detach)
|
269
|
+
nil unless atome_to_detach
|
270
|
+
end
|
267
271
|
|
272
|
+
def debug(msg)
|
273
|
+
puts msg
|
268
274
|
end
|
269
275
|
|
276
|
+
def set_current_user(user_id)
|
277
|
+
if Universe.users[user_id]
|
278
|
+
Universe.current_user = user_id
|
279
|
+
else
|
280
|
+
debug "#{user_id} not found"
|
281
|
+
end
|
282
|
+
end
|
270
283
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Black_matter
|
2
|
+
class << self
|
3
|
+
def encode(string)
|
4
|
+
JS.global.sha256(string.to_s)
|
5
|
+
end
|
6
|
+
|
7
|
+
def check_password(input_password, stored_hash)
|
8
|
+
input_hash = encode(input_password)
|
9
|
+
input_hash == stored_hash
|
10
|
+
end
|
11
|
+
|
12
|
+
def set_password(hashed_pass)
|
13
|
+
@password = hashed_pass
|
14
|
+
end
|
15
|
+
|
16
|
+
def password
|
17
|
+
@password
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -2,31 +2,35 @@
|
|
2
2
|
|
3
3
|
# universe method here
|
4
4
|
class Universe
|
5
|
-
@counter=0
|
5
|
+
@counter = 0
|
6
6
|
@atomes = {}
|
7
|
-
@classes = {}
|
8
7
|
@atome_list = []
|
9
8
|
@particle_list = {}
|
10
|
-
@renderer_list = %i[html browser headless server]
|
11
|
-
@options = {}
|
9
|
+
@renderer_list = %i[html browser headless server log]
|
12
10
|
@sanitizers = {}
|
11
|
+
@specificities = {}
|
12
|
+
@history = {}
|
13
|
+
@users = {}
|
14
|
+
|
13
15
|
class << self
|
14
|
-
attr_reader :atomes, :renderer_list, :atome_list, :particle_list, :classes, :counter
|
16
|
+
attr_reader :atomes, :renderer_list, :atome_list, :particle_list, :classes, :counter, :atomes_specificities
|
15
17
|
|
16
18
|
def add_to_particle_list(particle = nil, type)
|
17
|
-
instance_variable_get('@particle_list')[particle]=type
|
19
|
+
instance_variable_get('@particle_list')[particle] = type
|
18
20
|
end
|
19
21
|
|
20
|
-
def
|
21
|
-
|
22
|
-
# puts "3 => #{method_name}"
|
23
|
-
instance_variable_get('@options').merge!({ method_name => method_proc })
|
24
|
-
# puts "====> #{instance_variable_get('@options')[method_name]}"
|
22
|
+
def add_atomes_specificities atome_type_to_add
|
23
|
+
@specificities[atome_type_to_add] = {}
|
25
24
|
end
|
26
25
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
26
|
+
def set_atomes_specificities params
|
27
|
+
particle_found = params[:method].to_sym
|
28
|
+
specificity = "#{params[:specific]}_".to_sym
|
29
|
+
@specificities[params[:specific]][particle_found] = specificity
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_atomes_specificities
|
33
|
+
@specificities
|
30
34
|
end
|
31
35
|
|
32
36
|
def add_sanitizer_method(method_name, &method_proc)
|
@@ -44,9 +48,8 @@ class Universe
|
|
44
48
|
end
|
45
49
|
|
46
50
|
def add_to_atomes(id, atome)
|
47
|
-
# instance_variable_get('@atomes').merge!(atome)
|
48
51
|
@atomes[id] = atome
|
49
|
-
@counter
|
52
|
+
@counter = @counter + 1
|
50
53
|
end
|
51
54
|
|
52
55
|
def update_atome_id(id, atome, prev_id)
|
@@ -54,6 +57,26 @@ class Universe
|
|
54
57
|
@atomes.delete(prev_id)
|
55
58
|
end
|
56
59
|
|
60
|
+
def user_atomes
|
61
|
+
collected_id = []
|
62
|
+
@atomes.each do |id_found, atome_found|
|
63
|
+
unless atome_found.tag && atome_found.tag[:system]
|
64
|
+
collected_id << id_found
|
65
|
+
end
|
66
|
+
end
|
67
|
+
collected_id
|
68
|
+
end
|
69
|
+
|
70
|
+
def system_atomes
|
71
|
+
collected_id = []
|
72
|
+
@atomes.each do |id_found, atome_found|
|
73
|
+
if atome_found.tag && atome_found.tag[:system]
|
74
|
+
collected_id << id_found
|
75
|
+
end
|
76
|
+
end
|
77
|
+
collected_id
|
78
|
+
end
|
79
|
+
|
57
80
|
def app_identity
|
58
81
|
# each app hav its own identity, this allow to generate new user identities from th
|
59
82
|
@app_identity = 369
|
@@ -79,29 +102,105 @@ class Universe
|
|
79
102
|
platform
|
80
103
|
end
|
81
104
|
|
82
|
-
def
|
105
|
+
def platform_type
|
106
|
+
case RUBY_PLATFORM
|
107
|
+
when /win/i
|
108
|
+
"Windows"
|
109
|
+
when /darwin/i
|
110
|
+
"macOS"
|
111
|
+
when /linux/i
|
112
|
+
"Linux"
|
113
|
+
when /unix/i
|
114
|
+
"Unix"
|
115
|
+
else
|
116
|
+
"Plate-forme inconnue"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def engine
|
83
121
|
platform = RUBY_PLATFORM.downcase
|
84
|
-
output =
|
122
|
+
output = if platform == :opal
|
123
|
+
platform = JS.global[:navigator][:userAgent].to_s.downcase
|
124
|
+
platform.include?('win32') ? 'ipconfig /all' : 'ifconfig'
|
125
|
+
# `#{platform =~ /win32/ ? 'ipconfig /all' : 'ifconfig'}`
|
126
|
+
elsif platform == 'wasm32-wasi'
|
127
|
+
'ifconfig'
|
128
|
+
elsif platform_type == :windows
|
129
|
+
'ipconfig'
|
130
|
+
else
|
131
|
+
'ifconfig'
|
132
|
+
end
|
85
133
|
current_machine_decision(platform, output)
|
86
134
|
# TODO: check the code above and create a sensible identity
|
87
135
|
end
|
88
136
|
|
137
|
+
def current_server
|
138
|
+
return unless RUBY_ENGINE.downcase == 'opal' # Remplacez 'atome' par la valeur correcte pour votre environnement Atome
|
139
|
+
JS.global[:location][:href].to_s
|
140
|
+
|
141
|
+
end
|
142
|
+
|
89
143
|
def current_user
|
90
144
|
@user
|
91
145
|
end
|
92
146
|
|
93
|
-
def
|
94
|
-
|
147
|
+
def add_user=(id)
|
148
|
+
@users[id] = true
|
95
149
|
end
|
96
150
|
|
97
|
-
def
|
151
|
+
def users
|
152
|
+
@users
|
153
|
+
end
|
154
|
+
|
155
|
+
def current_user=(user_id)
|
98
156
|
# TODO: create or load an existing user
|
99
157
|
# if user needs to be create the current_user will be eVe
|
100
|
-
@user =
|
158
|
+
@user = user_id
|
159
|
+
end
|
160
|
+
|
161
|
+
def current_machine
|
162
|
+
@machine
|
101
163
|
end
|
102
164
|
|
103
|
-
def
|
104
|
-
|
165
|
+
def current_machine=(machine_id)
|
166
|
+
# TODO: create or load an existing user
|
167
|
+
# if user needs to be create the current_user will be eVe
|
168
|
+
@machine = machine_id
|
169
|
+
end
|
170
|
+
|
171
|
+
def internet
|
172
|
+
if RUBY_ENGINE.downcase != :native
|
173
|
+
grab(:view).html.internet
|
174
|
+
else
|
175
|
+
# write code here for native
|
176
|
+
end
|
105
177
|
end
|
178
|
+
|
179
|
+
def synchronised(action_nb, pass)
|
180
|
+
return unless Black_matter.encode(pass) == Black_matter.password[:read][:atome]
|
181
|
+
|
182
|
+
@history[action_nb][:sync] = true
|
183
|
+
end
|
184
|
+
|
185
|
+
def historicize(id, operation, element, params)
|
186
|
+
@history[@history.length] = { id => { operation => { element => params } }, sync: false, time: Time.now }
|
187
|
+
end
|
188
|
+
|
189
|
+
def story(filter)
|
190
|
+
# temp algo awaiting db to be ready, just for POC and tests
|
191
|
+
return unless filter
|
192
|
+
|
193
|
+
operation = filter[:operation]
|
194
|
+
atome_id = filter[:id]
|
195
|
+
particle = filter[:particle]
|
196
|
+
filtered_history = []
|
197
|
+
@history.each do |operation_number, alteration|
|
198
|
+
if alteration[atome_id] && (alteration[atome_id][operation]) && (alteration[atome_id][operation][particle])
|
199
|
+
filtered_history << { operation: operation_number, filter[:particle] => alteration[atome_id][operation][particle], sync: alteration[:sync], time: alteration[:time] }
|
200
|
+
end
|
201
|
+
end
|
202
|
+
filtered_history
|
203
|
+
end
|
204
|
+
|
106
205
|
end
|
107
206
|
end
|