atome 0.5.4.1.9 → 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/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 -177
- 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 -95
- 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 -32
- 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,121 +1,105 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# let's create the Universe
|
4
|
-
def eval_protection
|
5
|
-
binding
|
6
|
-
end
|
7
|
-
|
8
|
-
# Let's set the default's parameters according to ruby interpreter
|
9
|
-
if RUBY_ENGINE.downcase == 'opal'
|
10
|
-
Essentials.new_default_params({ render_engines: [:browser] })
|
11
|
-
else
|
12
|
-
Essentials.new_default_params({ render_engines: [:headless] })
|
13
|
-
eval "require 'atome/extensions/geolocation'", eval_protection, __FILE__, __LINE__
|
14
|
-
eval "require 'atome/extensions/ping'", eval_protection, __FILE__, __LINE__
|
15
|
-
eval "require 'atome/extensions/sha'", eval_protection, __FILE__, __LINE__
|
16
|
-
end
|
17
|
-
|
18
3
|
# now let's get the default render engine
|
19
|
-
default_render = Essentials.default_params[:render_engines]
|
20
4
|
|
5
|
+
# Lets create the U.I.
|
21
6
|
|
22
|
-
|
23
|
-
puts "atome version: #{Atome::VERSION}"
|
24
|
-
# puts "application identity: #{Universe.app_identity}"
|
25
|
-
puts "application identity: #{Atome::aui}"
|
26
|
-
# puts "application mode: #{Atome.mode}"
|
27
|
-
puts "host framework: #{$host}"
|
28
|
-
puts "script mode: #{Universe.current_machine}"
|
29
|
-
puts "user: #{Universe.current_user}"
|
30
|
-
puts "server: #{Universe.current_server}"
|
31
|
-
end
|
32
|
-
|
33
|
-
Universe.current_user = :jeezs
|
34
|
-
|
35
|
-
|
36
|
-
atome_infos
|
37
|
-
|
7
|
+
default_render = Essentials.default_params[:render_engines]
|
38
8
|
Atome.new(
|
39
|
-
{
|
9
|
+
{ renderers: [], id: :eDen, type: :element, tag: { system: true } }
|
40
10
|
)
|
41
|
-
|
42
11
|
Atome.new(
|
43
|
-
{
|
44
|
-
attach:
|
12
|
+
{ renderers: [], id: :user_view, type: :element, tag: { system: true },
|
13
|
+
attach: :eDen }
|
45
14
|
)
|
46
15
|
|
47
16
|
# color creation
|
48
17
|
Atome.new(
|
49
|
-
{
|
50
|
-
|
18
|
+
{ renderers: default_render, id: :view_color, type: :color, tag: ({ system: true, persistent: true }),
|
19
|
+
red: 0.15, green: 0.15, blue: 0.15, alpha: 1, top: 12, left: 12, diffusion: :linear }
|
51
20
|
)
|
52
21
|
|
53
22
|
Atome.new(
|
54
|
-
{
|
55
|
-
|
23
|
+
{ renderers: default_render, id: :shape_color, type: :color, tag: ({ system: true, persistent: true }),
|
24
|
+
red: 0.4, green: 0.4, blue: 0.4, alpha: 1 }
|
56
25
|
)
|
57
26
|
|
58
27
|
Atome.new(
|
59
|
-
{
|
60
|
-
|
28
|
+
{ renderers: default_render, id: :box_color, type: :color, tag: ({ system: true, persistent: true }),
|
29
|
+
red: 0.5, green: 0.5, blue: 0.5, alpha: 1 }
|
61
30
|
)
|
62
31
|
|
63
32
|
Atome.new(
|
64
|
-
{
|
65
|
-
|
33
|
+
{ renderers: default_render, id: :invisible_color, type: :color, tag: ({ system: true, persistent: true }),
|
34
|
+
red: 0, green: 0, blue: 0, alpha: 1 }
|
66
35
|
)
|
67
36
|
|
68
37
|
Atome.new(
|
69
|
-
{
|
70
|
-
|
38
|
+
{ renderers: default_render, id: :text_color, type: :color, tag: ({ system: true, persistent: true }),
|
39
|
+
red: 0.9, green: 0.9, blue: 0.9, alpha: 1 }
|
71
40
|
)
|
72
41
|
|
73
42
|
Atome.new(
|
74
|
-
{
|
75
|
-
|
76
|
-
)
|
77
|
-
|
78
|
-
Atome.new(
|
79
|
-
|
80
|
-
{ color: { renderers: default_render, id: :matrix_color, type: :color,tag: ({persistent: true}),
|
81
|
-
left: 0, top: 0, red: 0.7, green: 0.7, blue: 0.7, alpha: 1, diffusion: :linear } }
|
43
|
+
{ renderers: default_render, id: :circle_color, type: :color, tag: ({ system: true, persistent: true }),
|
44
|
+
red: 0.6, green: 0.6, blue: 0.6, alpha: 1 }
|
82
45
|
)
|
83
46
|
|
84
47
|
# system object creation
|
85
48
|
# the black_matter is used to store un materialized atomes
|
86
49
|
Atome.new(
|
87
|
-
{
|
88
|
-
|
89
|
-
}
|
50
|
+
{ renderers: default_render, id: :black_matter, type: :shape, attach: :user_view,
|
51
|
+
left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0, overflow: :hidden, tag: { system: true }
|
52
|
+
})
|
90
53
|
|
91
54
|
# view port
|
92
55
|
Atome.new(
|
93
|
-
{
|
94
|
-
|
95
|
-
}
|
56
|
+
{ renderers: default_render, id: :view, type: :shape, attach: :user_view, apply: [:view_color],
|
57
|
+
tag: { system: true }, left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
|
96
58
|
}
|
59
|
+
|
97
60
|
)
|
98
61
|
|
99
|
-
#unreal port
|
62
|
+
# unreal port, hold system object and tools
|
100
63
|
Atome.new(
|
101
|
-
{
|
102
|
-
|
103
|
-
}
|
64
|
+
{ renderers: default_render, id: :intuition, type: :shape, attach: :user_view, tag: { system: true },
|
65
|
+
left: 0, top: 0, width: 0, height: 0, overflow: :visible
|
104
66
|
}
|
105
67
|
)
|
106
68
|
|
107
|
-
|
69
|
+
machine_id = :dummy_machine
|
70
|
+
# attention we must used two separate pass to avoid the password to be encode twice
|
71
|
+
machine_password = { read: { atome: :star_wars }, write: { atome: :star_wars } }
|
72
|
+
user_password = { read: { atome: :star_wars }, write: { atome: :star_wars } }
|
108
73
|
|
109
|
-
#
|
74
|
+
# copy basket
|
75
|
+
Atome.new({ renderers: [:html], id: :copy, collect: [], type: :group, tag: { system: true } })
|
110
76
|
|
111
|
-
# use atome.atome to create a new atome using a more permissive syntax less performances but params must be formatted
|
112
|
-
# and ordered correctly
|
113
77
|
|
114
|
-
#
|
115
|
-
|
116
|
-
|
117
|
-
# red: 0.15, green: 0.15, blue: 0.15, alpha: 1 } } })
|
78
|
+
#machine
|
79
|
+
Atome.new({ renderers: default_render, id: machine_id, type: :machine, password: machine_password,
|
80
|
+
name: :macAir, data: { date: '10090717' }, tag: { system: true } })
|
118
81
|
|
119
|
-
#
|
120
|
-
|
121
|
-
|
82
|
+
#user
|
83
|
+
human({ id: :anonymous, login: true, password: user_password, data: { birthday: '10/05/1996' },selection: [], tag: { system: true } , attach: :user_view })
|
84
|
+
|
85
|
+
Universe.current_machine = machine_id
|
86
|
+
# the constant A is used to access alla atomes methods
|
87
|
+
A = Atome.new(
|
88
|
+
{ renderers: default_render, id: :atome, type: :element, tag: { system: true } }
|
89
|
+
)
|
90
|
+
# atome infos
|
91
|
+
def atome_infos
|
92
|
+
puts "atome version: #{Atome::VERSION}"
|
93
|
+
puts "device identity: #{Universe.app_identity}"
|
94
|
+
puts "application identity: #{Atome::aui}"
|
95
|
+
puts "host framework: #{Atome::host}"
|
96
|
+
puts "engine: #{Universe.engine}"
|
97
|
+
puts "users: #{Universe.users}"
|
98
|
+
puts "current user: #{Universe.current_user}"
|
99
|
+
puts "machine: #{Universe.current_machine}"
|
100
|
+
server = Universe.current_server
|
101
|
+
server ||= 'disconnected'
|
102
|
+
puts "server: #{server}"
|
103
|
+
end
|
104
|
+
|
105
|
+
atome_infos
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# Old code
|
1
2
|
# :title: Color -- Colour Management with Ruby
|
2
3
|
# :main: README.rdoc
|
3
4
|
|
@@ -140,13 +141,18 @@ class << Color
|
|
140
141
|
|
141
142
|
alias normalize_16bit normalize_word
|
142
143
|
end
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
require 'atome/helpers/color_helper/color/
|
144
|
+
require_relative 'color/rgb'
|
145
|
+
require_relative 'color/cmyk'
|
146
|
+
require_relative 'color/grayscale'
|
147
|
+
require_relative 'color/hsl'
|
148
|
+
require_relative 'color/yiq'
|
149
|
+
require_relative 'color/css'
|
150
|
+
# require 'atome/helpers/color_helper/color/rgb'
|
151
|
+
# require 'atome/helpers/color_helper/color/cmyk'
|
152
|
+
# require 'atome/helpers/color_helper/color/grayscale'
|
153
|
+
# require 'atome/helpers/color_helper/color/hsl'
|
154
|
+
# require 'atome/helpers/color_helper/color/yiq'
|
155
|
+
# require 'atome/helpers/color_helper/color/css'
|
150
156
|
|
151
157
|
class << Color
|
152
158
|
def const_missing(name)
|
@@ -194,3 +200,216 @@ class << Color
|
|
194
200
|
color.to_hsl
|
195
201
|
end
|
196
202
|
end
|
203
|
+
|
204
|
+
|
205
|
+
######################################
|
206
|
+
# new code:
|
207
|
+
|
208
|
+
# # :title: Color -- Colour Management with Ruby
|
209
|
+
# # :main: README.rdoc
|
210
|
+
#
|
211
|
+
# # = Colour Management with Ruby
|
212
|
+
#
|
213
|
+
# module Colour
|
214
|
+
# module Color
|
215
|
+
# COLOR_VERSION = '1.8'
|
216
|
+
#
|
217
|
+
# class RGB; end
|
218
|
+
#
|
219
|
+
# class CMYK; end
|
220
|
+
#
|
221
|
+
# class HSL; end
|
222
|
+
#
|
223
|
+
# class GrayScale; end
|
224
|
+
#
|
225
|
+
# class YIQ; end
|
226
|
+
#
|
227
|
+
# # The maximum "resolution" for colour math; if any value is less than or
|
228
|
+
# # equal to this value, it is treated as zero.
|
229
|
+
# COLOR_EPSILON = 1e-5
|
230
|
+
# # The tolerance for comparing the components of two colours. In general,
|
231
|
+
# # colours are considered equal if all of their components are within this
|
232
|
+
# # tolerance value of each other.
|
233
|
+
# COLOR_TOLERANCE = 1e-4
|
234
|
+
#
|
235
|
+
# # Compares the +other+ colour to this one. The +other+ colour will be
|
236
|
+
# # coerced to the same type as the current colour. Such converted colour
|
237
|
+
# # comparisons will always be more approximate than non-converted
|
238
|
+
# # comparisons.
|
239
|
+
# #
|
240
|
+
# # If the +other+ colour cannot be coerced to the current colour class, a
|
241
|
+
# # +NoMethodError+ exception will be raised.
|
242
|
+
# #
|
243
|
+
# # All values are compared as floating-point values, so two colours will be
|
244
|
+
# # reported equivalent if all component values are within COLOR_TOLERANCE
|
245
|
+
# # of each other.
|
246
|
+
# def ==(other)
|
247
|
+
# Color.equivalent?(self, other)
|
248
|
+
# end
|
249
|
+
#
|
250
|
+
# # The primary name for the colour.
|
251
|
+
# def name
|
252
|
+
# names.first
|
253
|
+
# end
|
254
|
+
#
|
255
|
+
# # All names for the colour.
|
256
|
+
# def names
|
257
|
+
# self.names = nil unless defined? @names
|
258
|
+
# @names
|
259
|
+
# end
|
260
|
+
#
|
261
|
+
# def names=(n)
|
262
|
+
# # :nodoc:
|
263
|
+
# @names = Array(n).flatten.compact.map(&:to_s).map(&:downcase).sort.uniq
|
264
|
+
# end
|
265
|
+
#
|
266
|
+
# alias_method :name=, :names=
|
267
|
+
# end
|
268
|
+
#
|
269
|
+
# class << Color
|
270
|
+
# # Returns +true+ if the value is less than COLOR_EPSILON.
|
271
|
+
# def near_zero?(value)
|
272
|
+
# (value.abs <= Color::COLOR_EPSILON)
|
273
|
+
# end
|
274
|
+
#
|
275
|
+
# # Returns +true+ if the value is within COLOR_EPSILON of zero or less than
|
276
|
+
# # zero.
|
277
|
+
# def near_zero_or_less?(value)
|
278
|
+
# (value < 0.0 or near_zero?(value))
|
279
|
+
# end
|
280
|
+
#
|
281
|
+
# # Returns +true+ if the value is within COLOR_EPSILON of one.
|
282
|
+
# def near_one?(value)
|
283
|
+
# near_zero?(value - 1.0)
|
284
|
+
# end
|
285
|
+
#
|
286
|
+
# # Returns +true+ if the value is within COLOR_EPSILON of one or more than
|
287
|
+
# # one.
|
288
|
+
# def near_one_or_more?(value)
|
289
|
+
# (value > 1.0 or near_one?(value))
|
290
|
+
# end
|
291
|
+
#
|
292
|
+
# # Returns +true+ if the two values provided are near each other.
|
293
|
+
# def near?(x, y)
|
294
|
+
# (x - y).abs <= Color::COLOR_TOLERANCE
|
295
|
+
# end
|
296
|
+
#
|
297
|
+
# # Returns +true+ if the two colours are roughly equivalent. If colour
|
298
|
+
# # conversions are required, this all conversions will be implemented
|
299
|
+
# # using the default conversion mechanism.
|
300
|
+
# def equivalent?(a, b)
|
301
|
+
# return false unless a.kind_of?(Color) && b.kind_of?(Color)
|
302
|
+
# a.to_a.zip(a.coerce(b).to_a).all? { |(x, y)| near?(x, y) }
|
303
|
+
# end
|
304
|
+
#
|
305
|
+
# # Coerces, if possible, the second given colour object to the first
|
306
|
+
# # given colour object type. This will probably involve colour
|
307
|
+
# # conversion and therefore a loss of fidelity.
|
308
|
+
# def coerce(a, b)
|
309
|
+
# a.coerce(b)
|
310
|
+
# end
|
311
|
+
#
|
312
|
+
# # Normalizes the value to the range (0.0) .. (1.0).
|
313
|
+
# def normalize(value)
|
314
|
+
# if near_zero_or_less? value
|
315
|
+
# 0.0
|
316
|
+
# elsif near_one_or_more? value
|
317
|
+
# 1.0
|
318
|
+
# else
|
319
|
+
# value
|
320
|
+
# end
|
321
|
+
# end
|
322
|
+
#
|
323
|
+
# alias normalize_fractional normalize
|
324
|
+
#
|
325
|
+
# # Normalizes the value to the specified range.
|
326
|
+
# def normalize_to_range(value, range)
|
327
|
+
# range = (range.end..range.begin) if (range.end < range.begin)
|
328
|
+
#
|
329
|
+
# if value <= range.begin
|
330
|
+
# range.begin
|
331
|
+
# elsif value >= range.end
|
332
|
+
# range.end
|
333
|
+
# else
|
334
|
+
# value
|
335
|
+
# end
|
336
|
+
# end
|
337
|
+
#
|
338
|
+
# # Normalize the value to the range (0) .. (255).
|
339
|
+
# def normalize_byte(value)
|
340
|
+
# normalize_to_range(value, 0..255).to_i
|
341
|
+
# end
|
342
|
+
#
|
343
|
+
# alias normalize_8bit normalize_byte
|
344
|
+
#
|
345
|
+
# # Normalize the value to the range (0) .. (65535).
|
346
|
+
# def normalize_word(value)
|
347
|
+
# normalize_to_range(value, 0..65535).to_i
|
348
|
+
# end
|
349
|
+
#
|
350
|
+
# alias normalize_16bit normalize_word
|
351
|
+
# end
|
352
|
+
#
|
353
|
+
# require_relative 'color/rgb'
|
354
|
+
# require_relative 'color/cmyk'
|
355
|
+
# require_relative 'color/grayscale'
|
356
|
+
# require_relative 'color/hsl'
|
357
|
+
# require_relative 'color/yiq'
|
358
|
+
# require_relative 'color/css'
|
359
|
+
# # require 'atome/helpers/color_helper/color/rgb'
|
360
|
+
# # require 'atome/helpers/color_helper/color/cmyk'
|
361
|
+
# # require 'atome/helpers/color_helper/color/grayscale'
|
362
|
+
# # require 'atome/helpers/color_helper/color/hsl'
|
363
|
+
# # require 'atome/helpers/color_helper/color/yiq'
|
364
|
+
# # require 'atome/helpers/color_helper/color/css'
|
365
|
+
#
|
366
|
+
# class << Color
|
367
|
+
# def const_missing(name)
|
368
|
+
# #:nodoc:
|
369
|
+
# case name
|
370
|
+
# when "VERSION", :VERSION, "COLOR_TOOLS_VERSION", :COLOR_TOOLS_VERSION
|
371
|
+
# warn "Color::#{name} has been deprecated. Use Color::COLOR_VERSION instead."
|
372
|
+
# Color::COLOR_VERSION
|
373
|
+
# else
|
374
|
+
# if Color::RGB.const_defined?(name)
|
375
|
+
# warn "Color::#{name} has been deprecated. Use Color::RGB::#{name} instead."
|
376
|
+
# Color::RGB.const_get(name)
|
377
|
+
# else
|
378
|
+
# super
|
379
|
+
# end
|
380
|
+
# end
|
381
|
+
# end
|
382
|
+
#
|
383
|
+
# # Provides a thin veneer over the Color module to make it seem like this
|
384
|
+
# # is Color 0.1.0 (a class) and not Color 1.4 (a module). This
|
385
|
+
# # "constructor" will be removed in the future.
|
386
|
+
# #
|
387
|
+
# # mode = :hsl:: +values+ must be an array of [ hue deg, sat %, lum % ].
|
388
|
+
# # A Color::HSL object will be created.
|
389
|
+
# # mode = :rgb:: +values+ will either be an HTML-style colour string or
|
390
|
+
# # an array of [ red, green, blue ] (range 0 .. 255). A
|
391
|
+
# # Color::RGB object will be created.
|
392
|
+
# # mode = :cmyk:: +values+ must be an array of [ cyan %, magenta %, yellow
|
393
|
+
# # %, black % ]. A Color::CMYK object will be created.
|
394
|
+
#
|
395
|
+
# end
|
396
|
+
#
|
397
|
+
# def new(values, mode = :rgb)
|
398
|
+
# warn "Color.new has been deprecated. Use Color::#{mode.to_s.upcase}.new instead."
|
399
|
+
# color = case mode
|
400
|
+
# when :hsl
|
401
|
+
# Colour::Color::HSL.new(*values)
|
402
|
+
# when :rgb
|
403
|
+
# values = [values].flatten
|
404
|
+
# if values.size == 1
|
405
|
+
# Colour::Color::RGB.from_html(*values) # Modification ici
|
406
|
+
# else
|
407
|
+
# Colour::Color::RGB.new(*values) # Et ici
|
408
|
+
# end
|
409
|
+
# when :cmyk
|
410
|
+
# Colour::Color::CMYK.new(*values) # Et ici
|
411
|
+
# end
|
412
|
+
# color.to_hsl
|
413
|
+
# end
|
414
|
+
# end
|
415
|
+
|
@@ -11,37 +11,33 @@ module Essentials
|
|
11
11
|
<path d="M1679.33,410.731C1503.98,413.882 1402.52,565.418 1402.72,691.803C1402.91,818.107 1486.13,846.234 1498.35,1056.78C1501.76,1313.32 1173.12,1490.47 987.025,1492.89C257.861,1502.39 73.275,904.061 71.639,735.381C70.841,653.675 1.164,647.648 2.788,737.449C12.787,1291.4 456.109,1712.79 989.247,1706.24C1570.67,1699.09 1982.31,1234 1965.76,683.236C1961.3,534.95 1835.31,407.931 1679.33,410.731Z" style="fill:rgb(201,12,125);"/>
|
12
12
|
</g>
|
13
13
|
</g>
|
14
|
-
STR
|
14
|
+
STR
|
15
|
+
|
15
16
|
@default_params = {
|
16
17
|
# Warning : type must be define first
|
17
|
-
render_engines: [:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
element: { type: :element, renderers: [], attach: [:black_matter] },
|
24
|
-
matrix: { type: :shape, width: 99, height: 99,
|
25
|
-
attached: :matrix_color,
|
26
|
-
left: 100, top: 100, clones: [], preset: :matrix, attach: [:view] },
|
18
|
+
render_engines: [:html],
|
19
|
+
image: { type: :image },
|
20
|
+
# FIXME : look at build_atome FIXME to resolve default parent attachment problem
|
21
|
+
video: { type: :video },
|
22
|
+
animation: { type: :animation, attach: :black_matter },
|
23
|
+
element: { type: :element, renderers: [], attach: :black_matter },
|
27
24
|
box: { type: :shape, width: 99, height: 99,
|
28
|
-
|
29
|
-
left: 100, top: 100,
|
30
|
-
vector: { type: :
|
31
|
-
|
32
|
-
left: 100, top: 100, clones: [], preset: :vector , definition: corp},
|
25
|
+
apply: [:box_color],
|
26
|
+
left: 100, top: 100, preset: :box },
|
27
|
+
vector: { type: :vector, width: 99, height: 99,
|
28
|
+
left: 100, top: 100, preset: :vector, definition: corp },
|
33
29
|
circle: { type: :shape, width: 99, height: 99, smooth: '100%',
|
34
|
-
|
35
|
-
left: 100, top: 100,
|
30
|
+
apply: [:circle_color],
|
31
|
+
left: 100, top: 100, preset: :circle },
|
36
32
|
shape: { type: :shape, width: 99, height: 99,
|
37
|
-
|
38
|
-
left: 100, top: 100
|
39
|
-
text: { type: :text,
|
40
|
-
|
41
|
-
|
42
|
-
drm: { type: :drm, attach:
|
43
|
-
shadow: { type: :shadow,
|
44
|
-
color: {
|
33
|
+
apply: [:shape_color],
|
34
|
+
left: 100, top: 100 },
|
35
|
+
text: { type: :text, component: { size: 18 },
|
36
|
+
apply: [:text_color],
|
37
|
+
width: :auto, height: :auto },
|
38
|
+
drm: { type: :drm, attach: :black_matter },
|
39
|
+
shadow: { type: :shadow, red: 0, green: 0, blue: 0, alpha: 0 },
|
40
|
+
color: { type: :color, red: 0, green: 0, blue: 0, alpha: 1}
|
45
41
|
}
|
46
42
|
|
47
43
|
def self.default_params
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# extensions for security
|
4
|
+
class Atome
|
5
|
+
def authorise(autorisations)
|
6
|
+
autorisations[:read]&.each do |k, v|
|
7
|
+
autorisations[:read][k] = Black_matter.encode(v)
|
8
|
+
end
|
9
|
+
autorisations[:write]&.each do |k, v|
|
10
|
+
autorisations[:write][k] = Black_matter.encode(v)
|
11
|
+
end
|
12
|
+
|
13
|
+
@authorisations = autorisations
|
14
|
+
end
|
15
|
+
|
16
|
+
def check_password_destruction(operation, element)
|
17
|
+
return unless @authorisations[:destroy]
|
18
|
+
|
19
|
+
@authorisations[operation].delete(element)
|
20
|
+
end
|
21
|
+
|
22
|
+
def write_auth(element)
|
23
|
+
if (@password && @password[:write]) && @authorisations && @authorisations[:write]
|
24
|
+
if !@authorisations[:write][element]
|
25
|
+
return false
|
26
|
+
elsif @password[:write][element] == @authorisations[:write][element]
|
27
|
+
# we check if we a specific password to read the particle
|
28
|
+
check_password_destruction(:write, element)
|
29
|
+
return true
|
30
|
+
elsif @authorisations[:write][:atome] == @password[:write][:atome]
|
31
|
+
|
32
|
+
puts "#{@authorisations[:write][:atome]} == #{@password[:write][:atome]}"
|
33
|
+
check_password_destruction(:write, element)
|
34
|
+
# we check if we a a password that allow to read the whole atome so all the particles
|
35
|
+
return true
|
36
|
+
else
|
37
|
+
check_password_destruction(:write, element)
|
38
|
+
return false
|
39
|
+
end
|
40
|
+
|
41
|
+
check_password_destruction(:write, element)
|
42
|
+
else
|
43
|
+
true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def read_auth(element)
|
48
|
+
|
49
|
+
if (@password && @password[:read]) && @authorisations && @authorisations[:read]
|
50
|
+
if !@authorisations[:read][element]
|
51
|
+
return false
|
52
|
+
elsif @password[:read][element] == @authorisations[:read][element]
|
53
|
+
check_password_destruction(:read, element)
|
54
|
+
# we check if we a specific password to read the particle
|
55
|
+
return true
|
56
|
+
elsif @authorisations[:read][:atome] == @password[:read][:atome]
|
57
|
+
check_password_destruction(:read, element)
|
58
|
+
# we check if we a a password that allow to read the whole atome so all the particles
|
59
|
+
return true
|
60
|
+
else
|
61
|
+
check_password_destruction(:read, element)
|
62
|
+
|
63
|
+
return false
|
64
|
+
end
|
65
|
+
|
66
|
+
check_password_destruction(:read, element)
|
67
|
+
else
|
68
|
+
true
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|