atome 0.5.6.6.5 → 0.5.6.6.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f9be61ee0a8afe7d2d0945221f3b5939b87c8b580042008b3074af983e82093
4
- data.tar.gz: d070e19b2b11923efeae91f05c28c0e309ab787c6f93570f44bac6b2d4a2e999
3
+ metadata.gz: 87ddaa0a11d052fcc0831dd5b4c864fbfdfbd415cf091996cdc3570a53a4ba12
4
+ data.tar.gz: 844fb1b1f1ec14eb29e7c427981538a569ba3ca54728834b02300322484285c7
5
5
  SHA512:
6
- metadata.gz: 3b0e7f9c9fffea9072d6e4d09b91f99b5dc2ee2d465837b77ab7ad9fdaa20f56fd7897bc1befb047e8f81a60751ea1d074122abf30e7cf17dc72eba3109d87bf
7
- data.tar.gz: 127a3ce37bb809b9e664c5188cdf2f0478624da98f89357f671e5de6af4a5544cb9ee35b99efe305a53e1b26fbb43a53d00a72a6103aff6eb6bfb6677ebcdd48
6
+ metadata.gz: dd4f1bfbd2293042fdc9a9d80017aa959b1dac775ede3a01a442f02a79b913af7f7bdc0978e99d129629daf298170e761435ad33c8cafa6330c438aa2bd88e92
7
+ data.tar.gz: 672c33212a50f6bef201fab3cf3e2d5ac5b318777dccfaa54da5ce9c5e73ec46c0824cff258044fa9d2eb5647f5107c34a6ffacdc617d8323fdb63debb4520f3
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
3
  require 'fileutils'
5
4
  require 'securerandom'
6
5
  require 'digest/sha2'
@@ -13,7 +12,7 @@ load 'exe/atome'
13
12
  # folder_name = 'lib/eVe'
14
13
  #
15
14
  # # allow or deny eVe gem content to be copied to local eVe or not
16
- refresh_eVe=true
15
+ # refresh_eVe=true
17
16
  #
18
17
  # # if refresh_eVe
19
18
  # # # doesn't work
@@ -87,8 +86,8 @@ def generate_resolved_file(source_file_path)
87
86
  resolve_requires(source_file_path, root_path)
88
87
  end
89
88
 
90
- def wasm_params(source, destination, project_name, wasi_file, host_mode, script_source, refresh_eVe)
91
- create_application(source, destination, project_name, refresh_eVe)
89
+ def wasm_params(source, destination, project_name, wasi_file, host_mode, script_source)
90
+ create_application(source, destination, project_name)
92
91
  wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
93
92
  end
94
93
 
@@ -114,19 +113,19 @@ task :test_wasm do
114
113
  destination = './tmp'
115
114
  script_source = './test/application'
116
115
 
117
- wasm_params(source, destination, project_name, wasi_file, host_mode, script_source,refresh_eVe)
116
+ wasm_params(source, destination, project_name, wasi_file, host_mode, script_source)
118
117
  system "open", file_path
119
118
  when /linux|bsd/
120
119
  destination = './tmp'
121
120
  script_source = './test/application'
122
121
  wasi_file = 'wasi-vfs-unix pack tmp'
123
- wasm_params(source, destination, project_name, wasi_file, host_mode, script_source,refresh_eVe)
122
+ wasm_params(source, destination, project_name, wasi_file, host_mode, script_source)
124
123
  system "xdg-open", file_path
125
124
  when /mswin|mingw|cygwin/
126
125
  destination = '.\\tmp'
127
126
  script_source = '.\\test\\application'
128
127
  wasi_file = 'wasi-vfs.exe pack'
129
- wasm_params(source, destination, project_name, wasi_file, host_mode, script_source,refresh_eVe)
128
+ wasm_params(source, destination, project_name, wasi_file, host_mode, script_source)
130
129
  system "start", file_path
131
130
  else
132
131
  raise "Système d'exploitation non reconnu"
@@ -140,7 +139,7 @@ task :test_opal do
140
139
  source = '.'
141
140
  destination = './tmp'
142
141
  script_source = './test/application'
143
- create_application(source, destination, project_name, refresh_eVe)
142
+ create_application(source, destination, project_name)
144
143
  # the line below is to add addition script to the application folder (useful for test per example)
145
144
  add_to_application_folder(script_source, destination, project_name)
146
145
  # build opal
@@ -158,7 +157,8 @@ task :test_opal do
158
157
  # open the app
159
158
  if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
160
159
  # code to exec for Windows
161
- `start #{destination}\\#{project_name}\\src\\index_opal.html`
160
+ # `start \\tmp\\#{project_name}\\src\\index_opal.html`
161
+ `start "" "#{destination}\\#{project_name}\\src\\index_opal.html"`
162
162
  elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
163
163
  # code to exec for MacOS
164
164
  `open #{destination}/#{project_name}/src/index_opal.html`
@@ -169,6 +169,7 @@ task :test_opal do
169
169
 
170
170
  puts 'atome opal is build and running!'
171
171
  end
172
+
172
173
  task :test_server_wasm do
173
174
  project_name = :test
174
175
  source = '.'
@@ -176,7 +177,7 @@ task :test_server_wasm do
176
177
  script_source = './test/application'
177
178
  wasi_file = 'wasi-vfs-osx_arm'
178
179
  host_mode = 'pure_wasm'
179
- create_application(source, destination, project_name, refresh_eVe)
180
+ create_application(source, destination, project_name)
180
181
  wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
181
182
  puts 'atome wasm is build and running!'
182
183
  threads = []
@@ -200,12 +201,14 @@ task :test_server_wasm do
200
201
  build_for_wasm_server(destination, project_name, 9292, :production)
201
202
 
202
203
  end
204
+
205
+
203
206
  task :test_server do
204
207
  project_name = :test
205
208
  source = '.'
206
209
  destination = './tmp'
207
210
  script_source = './test/application'
208
- create_application(source, destination, project_name, refresh_eVe)
211
+ create_application(source, destination, project_name)
209
212
  # the line below is to add addition script to the application folder (useful for test per example)
210
213
  add_to_application_folder(script_source, destination, project_name)
211
214
  # build opal
@@ -230,7 +233,6 @@ task :test_server do
230
233
  if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
231
234
  # code to exec for Windows
232
235
  `start http://localhost:9292?date=#{timestamp}`
233
- # `start #{destination}\\#{project_name}\\src\\index_server.html`
234
236
 
235
237
  elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
236
238
  # code to exec for MacOS
@@ -241,16 +243,15 @@ task :test_server do
241
243
  end
242
244
 
243
245
  end
244
- build_for_opal_server(destination, project_name, 9292, :production)
246
+ build_for_opal_server(destination, project_name, 9292, :production, true)
245
247
  end
246
248
 
247
-
248
249
  task :opal_server_rebuild do
249
250
  project_name = :test
250
251
  source = '.'
251
252
  destination = './tmp'
252
253
  script_source = './test/application'
253
- create_application(source, destination, project_name, refresh_eVe)
254
+ create_application(source, destination, project_name)
254
255
  # the line below is to add addition script to the application folder (useful for test per example)
255
256
  add_to_application_folder(script_source, destination, project_name)
256
257
  # build opal
@@ -296,7 +297,7 @@ task :test_osx do
296
297
  script_source = './test/application'
297
298
  wasi_file = 'wasi-vfs-osx_arm'
298
299
  host_mode = 'tauri'
299
- create_application(source, destination, project_name, refresh_eVe)
300
+ create_application(source, destination, project_name)
300
301
  wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
301
302
  destination = './tmp'
302
303
  # build and open the app
@@ -311,7 +312,7 @@ task :build_osx do
311
312
  script_source = './test/application'
312
313
  wasi_file = 'wasi-vfs-osx_arm'
313
314
  host_mode = 'tauri'
314
- create_application(source, destination, project_name, refresh_eVe)
315
+ create_application(source, destination, project_name)
315
316
  wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
316
317
  destination = './tmp'
317
318
  # build and open the app
@@ -337,7 +338,7 @@ task :osx_server do
337
338
  source = '.'
338
339
  destination = './tmp'
339
340
  script_source = './test/application'
340
- create_application(source, destination, project_name, refresh_eVe)
341
+ create_application(source, destination, project_name)
341
342
  # the line below is to add addition script to the application folder (useful for test per example)
342
343
  add_to_application_folder(script_source, destination, project_name)
343
344
  # build opal
@@ -360,7 +361,7 @@ task :osx_server do
360
361
  script_source = './test/application'
361
362
  wasi_file = 'wasi-vfs-osx_arm'
362
363
  host_mode = 'tauri'
363
- create_application(source, destination, project_name, refresh_eVe)
364
+ create_application(source, destination, project_name)
364
365
  wasm_common(source, destination, project_name, wasi_file, host_mode, script_source)
365
366
  destination = './tmp'
366
367
  threads = []
@@ -401,7 +402,6 @@ task :build_gem do
401
402
  puts 'atome gem built and installed'
402
403
  end
403
404
 
404
-
405
405
  task :push_gem do
406
406
 
407
407
  # building gem
@@ -434,7 +434,6 @@ task :push_gem do
434
434
  puts "#{latest_file} pushed"
435
435
  end
436
436
 
437
-
438
437
  task :full_test do
439
438
 
440
439
  # building the gem
@@ -460,7 +459,7 @@ task :full_test do
460
459
  source = '.'
461
460
  destination = './tmp'
462
461
  script_source = './test/application'
463
- create_application(source, destination, project_name, refresh_eVe)
462
+ create_application(source, destination, project_name)
464
463
  # the line below is to add addition script to the application folder (useful for test per example)
465
464
  add_to_application_folder(script_source, destination, project_name)
466
465
  # build opal
data/exe/atome CHANGED
@@ -169,7 +169,7 @@ def build_opal_library(atome_source, destination, project_name, production = nil
169
169
  end
170
170
  end
171
171
 
172
- def create_application(source, destination, project_name, eVe_copy=true)
172
+ def create_application(source, destination, project_name)
173
173
  project_path = "#{destination}/#{project_name}"
174
174
  FileUtils.mkdir_p(destination) unless Dir.exist?(destination)
175
175
  FileUtils.mkdir_p(project_path) unless Dir.exist?(project_path)
@@ -392,7 +392,36 @@ def build_for_osx(destination, mode = :dev)
392
392
 
393
393
  end
394
394
 
395
- def build_for_opal_server(destination, project_name, port, production)
395
+ def init_server(destination, project_name, port, prod, ru_file)
396
+
397
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
398
+ # code to exec with Windows
399
+ File.open("#{destination}\\#{project_name}\\server\\config.ru", "w") do |f|
400
+ f.write(ru_file)
401
+ end
402
+ # `cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}`
403
+ # system("start cmd /c cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}")
404
+ system("cd /d \"#{destination}\\#{project_name}\\server\" && puma --port #{port} #{prod}")
405
+
406
+ elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
407
+ # code to exec with MacOS
408
+ File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
409
+ f.write(ru_file)
410
+ end
411
+ # `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
412
+ system("cd #{destination}/#{project_name}/server && puma --port #{port} #{prod}")
413
+
414
+ else
415
+ # code to exec with Unix/Linux
416
+ File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
417
+ f.write(ru_file)
418
+ end
419
+ # `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
420
+ system("cd #{destination}/#{project_name}/server && puma --port #{port} #{prod}")
421
+ end
422
+ end
423
+
424
+ def build_for_opal_server(destination, project_name, port, production, run_server = true)
396
425
  if production
397
426
  prod = '--env production'
398
427
  ru_file = <<STR
@@ -410,31 +439,13 @@ run Unreloader
410
439
  require './atome_server.rb'
411
440
  STR
412
441
  end
413
-
414
- if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
415
- # code to exec with Windows
416
- File.open("#{destination}\\#{project_name}\\server\\config.ru", "w") do |f|
417
- f.write(ru_file)
418
- end
419
- `cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}`
420
- elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
421
- # code to exec with MacOS
422
- File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
423
- f.write(ru_file)
424
- end
425
- `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
426
- else
427
- # code to exec with Unix/Linux
428
- File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
429
- f.write(ru_file)
430
- end
431
- `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
442
+ if run_server ==true
443
+ init_server(destination, project_name, port, prod, ru_file)
432
444
  end
433
445
 
434
446
  end
435
447
 
436
-
437
- def build_for_wasm_server(destination, project_name, port, production)
448
+ def build_for_wasm_server(destination, project_name, port, production, run_server = true)
438
449
  if production
439
450
  prod = '--env production'
440
451
  ru_file = <<STR
@@ -452,33 +463,29 @@ run Unreloader
452
463
  require './atome_server.rb'
453
464
  STR
454
465
  end
466
+ if run_server ==true
467
+ init_server(destination, project_name, port, prod, ru_file)
468
+ end
469
+ # if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
470
+ # # code to exec with Windows
471
+ # File.open("#{destination}\\#{project_name}\\server\\config.ru", "w") do |f|
472
+ # f.write(ru_file)
473
+ # end
474
+ # `cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}`
475
+ # elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
476
+ # # code to exec with MacOS
477
+ # File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
478
+ # f.write(ru_file)
479
+ # end
480
+ # `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
481
+ # else
482
+ # # code to exec with Unix/Linux
483
+ # File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
484
+ # f.write(ru_file)
485
+ # end
486
+ # `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
487
+ # end
455
488
 
456
- if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
457
-
458
- # code to exec with Windows
459
- File.open("#{destination}\\#{project_name}\\server\\config.ru", "w") do |f|
460
- f.write(ru_file)
461
- end
462
- `cd /d #{destination}\\#{project_name}\\server && puma --port #{port} #{prod}`
463
- elsif RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
464
- # code to exec with MacOS
465
- File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
466
- f.write(ru_file)
467
- end
468
- # puts 'w-a'
469
-
470
- `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
471
- # puts 'w-b'
472
-
473
- else
474
- # puts 'e'
475
- # code to exec with Unix/Linux
476
- File.open("#{destination}/#{project_name}/server/config.ru", "w") do |f|
477
- f.write(ru_file)
478
- end
479
- `cd #{destination}/#{project_name}/server;puma --port #{port} #{prod}`
480
- end
481
- # puts 'f'
482
489
  end
483
490
 
484
491
  # utils
@@ -826,7 +833,7 @@ else
826
833
  if ARGV.include?('server_refresh')
827
834
  puts 're building Server'
828
835
  build_opal_application(nil, destination, project_name)
829
- timestamp=Time.now.strftime("%Y%m%d%H%M%S")
836
+ timestamp = Time.now.strftime("%Y%m%d%H%M%S")
830
837
 
831
838
  if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
832
839
  # code to exec with Windows
data/lib/atome/atome.rb CHANGED
@@ -47,8 +47,11 @@ class Atome
47
47
 
48
48
  @id = new_atome[:id] || @aid
49
49
  Universe.atomes.each do |_aid,atome_f|
50
+ # we affect the already existing atome to target
50
51
  if atome_f.id == @id
51
- puts "===> no for #{@id}"
52
+ new_atome[:affect].each do |affected|
53
+ grab(affected).apply(@id)
54
+ end
52
55
  return false
53
56
  end
54
57
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- new({ particle: :creator, category: :atome, type: :hash, store: false })
3
+ new({ particle: :creator, category: :atome, type: :hash })
4
4
  new({ particle: :aid, category: :atome, type: :string, store: false })
@@ -143,7 +143,7 @@ def atome_genesis
143
143
  atome_infos
144
144
  A.server({ address: 'localhost:9292', type: 'ws' })
145
145
  A.init_websocket do |msg|
146
- puts "websocket initailsaed #{msg}"
146
+ puts "websocket initialised #{msg}"
147
147
  end
148
148
  end
149
149
 
data/lib/atome/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.6.5'
5
+ VERSION = '0.5.6.6.7'
6
6
  end
@@ -1,10 +1,84 @@
1
- # frozen_string_literal: true
1
+ # # frozen_string_literal: true
2
2
 
3
- puts "current user: #{Universe.current_user}"
4
- human({ id: :jeezs, login: true })
3
+ # puts "current user: #{Universe.current_user}"
4
+ # human({ id: :jeezs, login: true })
5
+ #
6
+ # puts "current user: #{Universe.current_user}"
7
+ # wait 2 do
8
+ # human({ id: :toto, login: true })
9
+ # puts "current user: #{Universe.current_user}"
10
+ # end
5
11
 
6
- puts "current user: #{Universe.current_user}"
7
- wait 2 do
8
- human({ id: :toto, login: true })
9
- puts "current user: #{Universe.current_user}"
10
- end
12
+ puts 'ok1'
13
+
14
+ # Vérification que les champs email et password ne sont pas envoyés vides :
15
+ # if (email_text.data.nil? || email_text.data.strip.empty?) && (password_text.data.nil? || password_text.data.strip.empty?)
16
+ # puts "Veuillez renseigner votre adresse email et votre mot de passe."
17
+ # elsif email_text.data.nil? || email_text.data.strip.empty?
18
+ # puts "Veuillez renseigner votre adresse email."
19
+ # elsif password_text.data.nil? || password_text.data.strip.empty?
20
+ # puts "Veuillez renseigner votre mot de passe."
21
+ # else
22
+
23
+ mail = 'tretre'
24
+ pass = 'poipoi'
25
+ pass = Black_matter.encode(pass)
26
+
27
+
28
+ # A.message({ action: :authentication, data: { table: :user, particles: {email: mail, password: pass} } }) do |response|
29
+ # puts "authentication : #{response}"
30
+ # end
31
+
32
+ mail_message = false
33
+ mail_response = nil
34
+ password_message = false
35
+ password_response = nil
36
+ wait 3 do
37
+ A.message({ action: :authentication, data: { table: :user, particles: {email: mail} } }) do |response|
38
+ puts "Full authentication response: #{response.inspect}"
39
+ if response.key?('mail_authorized')
40
+ # Logique si 'authorized' est présent dans la réponse
41
+ puts "response mail authorized: #{response['mail_authorized']}"
42
+ # Si le mail et le password sont ok, on log le user et on stocke l'info en local storage
43
+ mail_message = JS.global[:localStorage].setItem('logged', response['mail_authorized'])
44
+ mail_response = response['mail_authorized']
45
+ puts "mail_response : #{mail_response}"
46
+ # On efface le formulaire si le serveur renvoie que l'user est loggé
47
+ # view.delete(true)
48
+ JS.global[:localStorage].setItem('user_id', response['user_id'])
49
+ else
50
+ # Gestion du cas où 'authorized' est absent
51
+ end
52
+
53
+ end
54
+
55
+ A.message({ action: :authorization, data: { table: :user, particles: {password: pass} } }) do |response|
56
+ puts "authorization : #{response}"
57
+ if response.key?('password_authorized')
58
+ authorized = response['password_authorized'] || false # Utilisez false comme valeur par défaut si 'authorized' est absent
59
+ puts "response password : #{response['password_authorized']}"
60
+ # Si le mail et le password sont ok, on log le user et on stocke l'info en local storage
61
+ password_message = JS.global[:localStorage].setItem('logged', response['password_authorized'])
62
+ password_response = response['password_authorized']
63
+ puts "password_response : #{password_response}"
64
+ # On efface le formulaire si le serveur renvoie que l'user est loggé
65
+ # view.delete(true)
66
+ JS.global[:localStorage].setItem('user_id', response['user_id'])
67
+ else
68
+ # Gestion du cas où 'authorized' est absent
69
+ end
70
+ end
71
+ end
72
+
73
+
74
+ # # # On efface le formulaire si le serveur renvoie que l'user est loggé
75
+ # if (mail_response == "true" || password_response == "true")
76
+ # view.delete(true)
77
+ # puts 'deleted!'
78
+ # # JS.global[:localStorage].setItem('user_id',response['user_id'])
79
+ # # puts "response user_id : #{response['user_id']}"
80
+ # end
81
+
82
+ # end
83
+
84
+ puts 'ok2'
@@ -1,49 +1,318 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- color({ id: :creation_layer_col, alpha: 1 })
4
-
5
- b = box({ top: :auto, bottom: 0, id: :box_tool })
6
-
7
- b.touch(:down) do
8
- creation_layer = box({ top: 0, left: 0, id: :creation_layer, width: '100%', height: '100%', apply: :creation_layer_col })
9
- creation_layer.touch(:down) do |event|
10
- left_found = event[:pageX].to_i
11
- top_found = event[:pageY].to_i
12
- box({ left: left_found, top: top_found ,id: "tutu_#{Universe.atomes.length}", color: :red})
13
- creation_layer.delete(true)
14
- creation_layer.touch({ remove: :down })
15
- puts Universe.atomes.length
16
- puts "=> #{Universe.user_atomes}"
3
+ # color({ id: :creation_layer_col, alpha: 1 })
4
+ #
5
+ # b = box({ top: :auto, bottom: 0, id: :box_tool })
6
+ #
7
+ # b.touch(:down) do
8
+ # creation_layer = box({ top: 0, left: 0, id: :creation_layer, width: '100%', height: '100%', apply: :creation_layer_col })
9
+ # creation_layer.touch(:down) do |event|
10
+ # left_found = event[:pageX].to_i
11
+ # top_found = event[:pageY].to_i
12
+ # box({ left: left_found, top: top_found ,id: "tutu_#{Universe.atomes.length}", color: :red})
13
+ # creation_layer.delete(true)
14
+ # creation_layer.touch({ remove: :down })
15
+ # puts Universe.atomes.length
16
+ # puts "=> #{Universe.user_atomes}"
17
+ # end
18
+ # end
19
+
20
+
21
+
22
+ ######################
23
+
24
+ # frozen_string_literal: true
25
+ class Atome
26
+
27
+ def build_tool(&bloc)
28
+ # alert params[:tool]
29
+ a = Atome.instance_exec(&bloc)
30
+ puts "===> a is : #{a[:action]}"
31
+ # check below
32
+ # wait 2 do
33
+ # send a[:action]
34
+ # end
35
+ grab(:toolbox).box({color: :white, width: Intuition.style[:tool][:width], height: Intuition.style[:tool][:width]})
17
36
  end
18
37
  end
19
38
 
20
- # c= color({ red: 1, id: :toto })
21
- # # puts c.aid
22
- # puts Universe.atomes.length
23
- # wait 0.5 do
24
- # c= color({ red: 1, id: :toto })
25
- # # puts c.aid
26
- # puts Universe.atomes.length
27
- # end
39
+ class Object
40
+ def new(params, &bloc)
41
+ # Genesis = Genesis.Genesis
42
+ if params.key?(:atome)
43
+ Universe.add_atomes_specificities params[:atome]
44
+ Genesis.build_atome(params[:atome], &bloc)
45
+ elsif params.key?(:particle)
46
+ Atome.instance_variable_set("@main_#{params[:particle]}", bloc)
47
+ # render indicate if the particle needs to be rendered
48
+ # store tell the system if it need to store the particle value
49
+ # type help the system what type of type the particle will receive and store
50
+ Genesis.build_particle(params[:particle], { render: params[:render], return: params[:return],
51
+ store: params[:store], type: params[:type] }, &bloc)
52
+ elsif params.key?(:sanitizer)
53
+ Genesis.build_sanitizer(params[:sanitizer], &bloc)
54
+ elsif params.key?(:pre)
55
+ Atome.instance_variable_set("@pre_#{params[:pre]}", bloc)
56
+ elsif params.key?(:post)
57
+ Atome.instance_variable_set("@post_#{params[:post]}", bloc)
58
+ elsif params.key?(:after)
59
+ Atome.instance_variable_set("@after_#{params[:after]}", bloc)
60
+ elsif params.key?(:read)
61
+ Atome.instance_variable_set("@read_#{params[:read]}", bloc)
62
+ elsif params[:renderer]
63
+ renderer_found = params[:renderer]
64
+ if params[:specific]
65
+ Universe.set_atomes_specificities(params)
66
+ params[:specific] = "#{params[:specific]}_"
67
+ end
68
+ render_method = "#{renderer_found}_#{params[:specific]}#{params[:method]}"
69
+ Genesis.build_render(render_method, &bloc)
70
+ elsif params.key?(:callback)
71
+ particle_targetted = params[:callback]
72
+ Atome.define_method "#{particle_targetted}_callback" do
73
+ bloc.call
74
+ end
75
+ elsif params.key?(:tool)
76
+ A.build_tool(&bloc)
77
+ end
78
+ end
79
+ end
28
80
 
29
- # wait 1 do
30
- # c= color({ red: 1, id: :toto })
31
- # puts c.aid
32
- # puts Universe.atomes.length
33
- # wait 1 do
34
- # c= color({ red: 1, id: :toto })
35
- # puts c.aid
36
- # puts Universe.atomes.length
37
- # wait 1 do
38
- # c= color({ red: 1, id: :toto })
39
- # puts c.aid
40
- # puts Universe.atomes.length
41
- # wait 1 do
42
- # c= color({ red: 1, id: :toto })
43
- # puts c.aid
44
- # puts Universe.atomes.length
45
- # alert "=> #{Universe.user_atomes}"
46
- # end
47
- # end
81
+
82
+ def record_tool
83
+ grab(Universe.current_user).selection
84
+ alert "must get selection to treat it "
85
+ end
86
+
87
+
88
+ module Intuition
89
+ class << self
90
+ def style
91
+ size=39
92
+ style={}
93
+ style[:toolbox]={width: size}
94
+ style[:toolbox]={height: size}
95
+ style[:tool]={width: size}
96
+ style[:tool]={height: size}
97
+
98
+ style
99
+ end
100
+ def intuition_int8
101
+ # tool taxonomy and list
102
+ {
103
+ capture: { int8: { french: :enregistrement, english: :record, german: :datensatz } },
104
+ communication: { french: :communication, english: :communication, german: :communication },
105
+ tool: { french: :outils, english: :tools, german: :werkzeuge },
106
+ view: { french: :vue, english: :view, german: :aussicht },
107
+ time: { french: :horloge, english: :clock, german: :Uhr },
108
+ find: { french: :trouve, english: :find, german: :finden },
109
+ home: { french: :accueil, english: :home, german: :zuhause },
110
+ code: { french: :code, english: :code, german: :code },
111
+ impulse: { french: :impulse, english: :impulse, german: :impulse },
112
+ }
113
+ end
114
+ def intuition_taxonomy
115
+
116
+ end
117
+
118
+ def impulse
119
+ # tool start point
120
+ [:capture, :communication, :tool, :view, :time, :find, :home]
121
+ end
122
+ end
123
+
124
+
125
+ # def capture
126
+ # categories=ATOME.methods_categories
127
+ # [categories[:inputs]]
128
+ # end
129
+ #
130
+ # def communication
131
+ # categories=ATOME.methods_categories
132
+ # [categories[:communications]]
133
+ # end
134
+ #
135
+ # def toolz
136
+ # categories=ATOME.methods_categories
137
+ # [categories[:spatials],categories[:helpers],categories[:materials],
138
+ # categories[:geometries],categories[:effects],
139
+ # categories[:medias],categories[:hierarchies],categories[:utilities],categories[:events]]
140
+ # end
141
+ #
142
+ # def tool_style(size = 33)
143
+ # # styling
144
+ # shadows = [{ x: size / 15, y: size / 15, thickness: 0, blur: size / 3, color: { red: 0, green: 0, blue: 0, alpha: 0.3 } }, { x: -size / 15, y: -size / 15, thickness: 0, blur: size / 6, color: { red: 1, green: 1, blue: 1, alpha: 0.3 } }]
145
+ # style = { type: :tool, content: { points: 4 }, color: { red: 0.9, green: 0.9, blue: 0.9, alpha: 0.15 }, parent: :intuition, shadow: shadows, blur: { value: 6, invert: true } }
146
+ # return style
147
+ # end
148
+ #
149
+ # def open_tool(tool_id, widthness=3, orientation=:x, speed=0.6)
150
+ # if orientation == :x
151
+ # orientation = :width
152
+ # value = grab(tool_id).width
153
+ # else
154
+ # orientation = :height
155
+ # value = grab(tool_id).height
156
+ # end
157
+ # animate({
158
+ # start: { orientation => value },
159
+ # end: { orientation => value * widthness },
160
+ # duration: speed * 1000,
161
+ # loop: 0,
162
+ # curve: :easing,
163
+ # target: tool_id
164
+ # })
165
+ # notification "find why this id #{self.atome_id}, add annimation callback to set overflow when anim complete"
166
+ # grab(tool_id).overflow(:visible)
167
+ # end
168
+ #
169
+ # def close_tool(tool_id, widthness, orientation, speed)
170
+ # if orientation == :x
171
+ # orientation = :width
172
+ # value = grab(tool_id).width
173
+ # else
174
+ # orientation = :height
175
+ # value = grab(tool_id).height
176
+ # end
177
+ # animate({
178
+ # start: { orientation => value * widthness },
179
+ # end: { orientation => value },
180
+ # duration: speed * 1000,
181
+ # loop: 0,
182
+ # curve: :easing,
183
+ # target: tool_id
184
+ # })
185
+ # # grab(tool_id).overflow(:hidden)
186
+ # end
187
+ #
188
+ # def create_tool(tool_name, size = 33, x_pos = 0, y_pos = 33, offsset=0)
189
+ # tool_created = tool(self.tool_style(size).merge({ parent: :main_menu, atome_id: "tool_" + tool_name, id: "tool_" + tool_name,
190
+ # width: size, height: size, smooth: size / 9, overflow: :hidden, x: x_pos, y: y_pos, z: 1, content: [] }))
191
+ # icon=tool_created.shape({ path: tool_name, width: size - size / 2, height: size - size / 2, center: true })
192
+ # # name = intuition_list[tool_name][language]
193
+ # particle({ atome_id: :tools_property_container, color: { red: 0.6, green: 0.6, blue: 0.6 } })
194
+ # # we get the plugin code only if the plugin hasn't been interpreted before (unless condition below)
195
+ # unless grab(:intuition).content.include? tool_name
196
+ # ATOME.reader("./medias/e_rubies/tools/#{tool_name}.rb") do |data|
197
+ # # todo add a security parser here
198
+ # # we set the variable tool that can be used to facilitate plugin creation
199
+ # data="tool=grab(:#{tool_created.atome_id})\n"+data
200
+ # compile(data)
201
+ # # we add the tool to the intuition content so it won't be loaded twice
202
+ # grab(:intuition).content |= [tool_name]
203
+ # end
204
+ # end
205
+ # # end
206
+ # tool_created.active({ exec: false })
207
+ # tool_created.inactive({ exec: false })
208
+ # icon.touch(stop: true) do
209
+ # if tool_created.active[:exec] == true
210
+ # tool_created.color(:transparent)
211
+ # tool_created.active(exec: false, proc: tool_created.active[:proc] )
212
+ # tool_created.inactive(exec: true, proc: tool_created.inactive[:proc] )
213
+ # else
214
+ # tool_created.color({alpha: 0.3})
215
+ # tool_created.active({ exec: true, proc: tool_created.active[:proc] })
216
+ # end
217
+ # end
218
+ # end
219
+ #
220
+ # # we get menu entry point
221
+ # def open_intuition(position = {})
222
+ # position = { x: 0, yy: 0, size: 33, orientation: :vertical, offset: 0 }.merge(position)
223
+ # # we get content language from view's language
224
+ # if grab(:main_menu)
225
+ # grab(:main_menu).delete
226
+ # else
227
+ # grab(:view).language
228
+ # self.language(grab(:view).language)
229
+ # orientation = position.delete(:orientation)
230
+ # size = position.delete(:size)
231
+ # offset = position.delete(:offset)
232
+ # # positioning and scaling
233
+ # if orientation == :vertical
234
+ # requested_width = size
235
+ # requested_height = (size+offset)* impulse.length
236
+ # else
237
+ # requested_width = (size+offset) * impulse.length
238
+ # requested_height = size
239
+ # end
240
+ # tool({ atome_id: :main_menu, parent: :intuition, color: { alpha: 0 } }.merge(position).merge(width: requested_width, height: requested_height))
241
+ # impulse.each_with_index do |item, index|
242
+ # if orientation == :vertical
243
+ # create_tool(item, size, 0, index * (size+offset))
244
+ # else
245
+ # create_tool(item, size, index * (size+offset), 0)
246
+ # end
247
+ # end
248
+ # end
249
+ # end
250
+ end
251
+ # atome class extension for eVe
252
+
253
+ class Atome
254
+ include Intuition
255
+ # def atome(requested_property)
256
+ # # add component list iin the content we maybe ahave to create a tool object because box can't handle this type of content
257
+ # new_atome=self.tool({ atome_id: "#{self.atome_id}_#{requested_property}_atome_#{self.content.length}", x: 66})
258
+ # new_atome.touch({ stop: true, option: :down}) do
259
+ # color(:red)
260
+ # new_atome.height = new_atome.height*3
261
+ # end
262
+ # new_atome.touch({ stop: true, option: :up}) do
263
+ # color(:red)
264
+ # new_atome.height = new_atome.height/3
265
+ # end
266
+ # notification "now we have to add an object or a new property (style) to store complete tool style including size and
267
+ # orientation so we can position the new atome correctly"
268
+ # # alert self.content.class
269
+ # # alert self.content.length
270
+ # # alert tool_style
271
+ # end
272
+ end
273
+
274
+ # # we initialise the toolbox here :
275
+ #
276
+ # # the launch bar
277
+ # launch_bar = box({ x: 0, y: 0, width: 33, height: "100%", parent: :intuition, z: 0, color: { alpha: 0 } })
278
+ # launch_bar.touch({ option: :long }) do |evt|
279
+ # size = 33
280
+ # yy_touch_position = grab(:view).convert(:height) - evt.page_y
281
+ # if yy_touch_position < size
282
+ # #if the long touch is within the wanted area( in this at bottom of the screen) we open the menu
283
+ # # launch_bar.open_intuition({ x: size, yy: 6,offset: 6, orientation: :horizontal, size: size })
284
+ # launch_bar.open_intuition({ x: 6, yy: size,offset: 6, orientation: :vertical, size: size })
48
285
  # end
49
- # end
286
+ # end
287
+ #
288
+ # # # # # # # # # # # # # # # tests below # # # # # # # # # # # # #
289
+ #
290
+ # list = molecule_analysis(@molecules_list)
291
+ # notif list[:tools]
292
+ # notif "======"
293
+ # notif list[:molecules]
294
+ # notif "======"
295
+ # notif list[:atomes]
296
+ # notif "======"
297
+ # notif list[:molecules][:shadow]
298
+ # let's build the toolbox
299
+ grab(:intuition).box({id: :toolbox, top: :auto, bottom: 0, left: 0, width: Intuition.style[:toolbox][:width], height: 255})
300
+
301
+ # tool builder
302
+
303
+ new({ tool: :capture }) do |params|
304
+ tool = { id: :rec_01,
305
+ name: :record, icon: :record, action: {open: [:sub_menu]}, code: :record_tool, position: { root: 1 }, # position can be multiple
306
+ option: { opt1: :method_2 }, int8: { french: :enregistrement, english: :record, german: :datensatz } }
307
+ tool
308
+ end
309
+ # Intuition::toolbox_style
310
+ # Intuition.toolbox_style
311
+ # puts A.impulse
312
+ # def fill_toolzone(tools_ids)
313
+ #
314
+ # end
315
+ #
316
+ # fill_toolzone(%i[files edition select group link copy undo settings])
317
+
318
+
@@ -28,25 +28,32 @@ class EDen
28
28
  # database connexion :
29
29
  db = db_access
30
30
  # retrieving data from the 'identity' table
31
- identity_items = db[:identity]
31
+ identity_items = db[:user]
32
32
  # retrieving sent data
33
- user_email = data["email"]
33
+ user_email = data["particles"]["email"]
34
34
  # data cleansing of superfluous characters
35
35
  sanitized_email = sanitize_email(user_email)
36
36
  # database search
37
37
  mail_exists = identity_items.where(email: sanitized_email).first
38
-
38
+ # mail_exists = identity_items.where(email: user_email).first
39
+ puts 'ok'
39
40
  if !mail_exists
40
- return { return: 'Email non trouvé, erreur', authorized: false, message_id: message_id }
41
+ @@pass = nil
42
+ puts "authentication @@pass : #{@@pass}"
43
+ return { return: 'Email non trouvé, erreur', message_id: message_id }
41
44
  else
42
45
  @@mail = user_email
46
+ puts "authentication @@mail du else : #{@@mail}"
47
+ puts "authentication @@pass du else : #{@@pass}"
43
48
  if @@mail && @@pass
49
+ puts "authentication @@mail du else v2 : #{@@mail}"
50
+ puts "authentication @@pass du else v2 : #{@@pass}"
44
51
  @@mail = nil
45
52
  @@pass = nil
46
- return { return: 'logged', authorized: true, message_id: message_id }
53
+ return { return: 'logged', mail_authorized: true, user_id: mail_exists[:user_id], message_id: message_id }
47
54
  # Send the user account template
48
55
  else
49
- return { return: 'Email trouvé, cherche mdp', authorized: true, message_id: message_id }
56
+ return { return: 'Email trouvé, cherche mdp', mail_authorized: false, message_id: message_id }
50
57
  end
51
58
  end
52
59
  end
@@ -55,25 +62,32 @@ class EDen
55
62
  # database connexion :
56
63
  db = db_access
57
64
  # retrieving data from the 'security' table
58
- security_items = db[:security]
65
+ security_items = db[:user]
59
66
  # retrieving sent data
60
- user_password = data["password"]
67
+ user_password = data["particles"]["password"]
61
68
  # database search
62
69
  user_exists = security_items.where(password: user_password).first
70
+ puts "user_exists : #{user_exists}"
63
71
 
64
72
  if !user_exists
65
- puts "password recu : :#{user_password}, @@mail : #{ @@mail} , pass : #{ @@pass}"
66
- return { return: 'Password non trouvé, erreur', authorized: false, message_id: message_id }
73
+ @@mail = nil
74
+ puts "authorization @@mail du else : #{@@mail}"
75
+ return { return: 'Password non trouvé, erreur', message_id: message_id }
67
76
  else
68
77
  @@pass = user_password
78
+ puts "authorization @@pass : #{@@pass}"
79
+ puts "authorization @@mail du else : #{@@mail}"
69
80
  if @@mail && @@pass
81
+ puts "authorization @@pass v2 : #{@@pass}"
82
+ puts "authorization @@mail du else v2 : #{@@mail}"
70
83
  # reset variables containing mail and password
71
84
  @@mail = nil
72
85
  @@pass = nil
73
- return { return: 'logged', authorized: true, message_id: message_id }
86
+ # return { return: 'Password trouvé, cherche mdp', password_authorized: false, message_id: message_id }
87
+ return { return: 'logged', password_authorized: true, user_id: user_exists[:user_id], message_id: message_id }
74
88
  # Send the user account template
75
89
  else
76
- return { return: 'Password trouvé, cherche mdp', authorized: true, message_id: message_id }
90
+ return { return: 'Password trouvé, cherche mdp', password_authorized: false, message_id: message_id }
77
91
  end
78
92
  end
79
93
  end
@@ -1,5 +1,5 @@
1
1
  const communication = {
2
- websocket: null,
2
+ websocket: null,// websocket init for server
3
3
  initialize: function () {
4
4
  this.websocket = new WebSocket('ws://localhost:9292')
5
5
  // this.websocket = new WebSocket(address);
@@ -22,7 +22,7 @@ const communication = {
22
22
  event.preventDefault();
23
23
  console.log('connection lost!')
24
24
  };
25
- },
25
+ },// Controller for native core
26
26
  controller_sender: function (msg) {
27
27
  let json_msg = JSON.parse(msg);
28
28
 
@@ -62,6 +62,7 @@ const communication = {
62
62
  }
63
63
  },
64
64
  connect: function (type, server, user, pass, atomes, particles) {
65
+ // websocket for server
65
66
  this.websocket = new WebSocket(type + '://' + server);
66
67
  this.websocket.onopen = function (event) {
67
68
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6.6.5
4
+ version: 0.5.6.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Eric Godard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: artoo