atome 0.5.6.5.4 → 0.5.6.5.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: 40ed4954cd1a97e3ebffa9a25d44de095ea8f1b825b91abab913ce9cf61535f6
4
- data.tar.gz: c6da10feae807b7e738065951de242abfd3dcb31558552d2f47135bd41e67433
3
+ metadata.gz: 68520365f777d89089e99069c4aeea1209fd49d16b0c30ece6661e2baeae2b19
4
+ data.tar.gz: d0e89c48a346f113eed4e0f6358a06a564979c178832e402ffc7cda26ffb14d3
5
5
  SHA512:
6
- metadata.gz: 496ec64689699de33f6538034ba9ace545628ae2fcaa996521c747ffbb89d86461de0ac35580052d93ed1feb0518954cefc2e07afd6cab33f672ea44785ea299
7
- data.tar.gz: 102a1c8266be193f3781154a597c1715e906e1da63f7df1e070e50c399f078a651947bc5f39d5f4f3a9423833fc0a7966dada61dc1199d280f086061dbe1bdce
6
+ metadata.gz: 1ee22c49e15973e262a2a6c889070e53055cf6321eefba4651102bb68ee997a6c80cbe5eb3c4bdfff4f40dac3ca18b9419d1a610615ae265b0ed7b6fe76c5bd4
7
+ data.tar.gz: 48ee8736a2a7bee1c798352c14b4ba9275f1a0c62ca4dac4351624f673899561d4875db85e6ccc267a6f34ce7e8e94df1261099d9a987b662dc5eea9942d7649
@@ -7,16 +7,16 @@ new({ particle: :connection, category: :communication, type: :hash }) do |params
7
7
  end
8
8
 
9
9
  new({ particle: :message, category: :communication, type: :hash }) do |params, bloc|
10
- params = { data: params } unless params.instance_of? Hash
11
- # params[:user] = 'dfghg4df5gdfgh654'
12
- # params[:pass] = 'gfhkzrhgzr4h98948'
13
- # instance_variable_set('@message_code', {}) unless instance_variable_get('@message_code')
14
- # store_proc= instance_variable_get('@message_code')
15
- message_id= "msg_#{Universe.messages.length}"
16
- params[:message_id]=message_id
17
- # store_proc[mmessage_id]=bloc
18
- Universe.store_messages({msg_nb:message_id, proc: bloc })
19
- html.send_message(params)
10
+ if Universe.database_ready
11
+ params = { data: params } unless params.instance_of? Hash
12
+ message_id= "msg_#{Universe.messages.length}"
13
+ params[:message_id]=message_id
14
+ Universe.store_messages({msg_nb:message_id, proc: bloc })
15
+ html.send_message(params)
16
+ else
17
+ puts "server not ready "
18
+ end
19
+
20
20
 
21
21
  end
22
22
 
@@ -50,14 +50,12 @@ new({ sanitizer: :attached }) do |children_ids|
50
50
  end
51
51
 
52
52
  new({ particle: :apply, category: :hierarchy, type: :string, render: false, store: false }) do |parents_ids, &user_proc|
53
-
54
53
  @apply ||= []
55
54
  parents_ids = [parents_ids] unless parents_ids.instance_of?(Array)
56
55
  parents_ids.each do |parent_id|
57
56
  @apply.delete(parent_id)
58
57
  @apply << parent_id
59
58
  end
60
- puts affect
61
59
  parents_ids = @apply
62
60
  children_ids = [id]
63
61
  parents_ids.each do |parent_id|
@@ -162,7 +162,7 @@ def init_database # this method is call from JS (atome/communication) at WS conn
162
162
 
163
163
  particles = Universe.particle_list
164
164
  # now we populate the DB
165
- A.sync({ action: :crate_db_table, data: { table: :user } }) do |_db_state|
165
+ A.sync({ action: :crate_db_table, data: { table: :user, type: :string } }) do |_db_state|
166
166
  # puts "===> #{_db_state}"
167
167
  end
168
168
 
@@ -243,9 +243,7 @@ class Universe
243
243
  def historicize(id, operation, element, params)
244
244
 
245
245
  if @allow_history && @database_ready
246
- # sync
247
246
  A.sync({ action: :historicize, data: { table: :user } }) do |_db_state|
248
- # puts "===> #{_db_state}"
249
247
  end
250
248
  operation_timing = Time.now.strftime("%Y%m%d%H%M%S%3N") + @increment.to_s
251
249
  @increment += 1
@@ -306,8 +306,6 @@ class Atome
306
306
 
307
307
  def refresh
308
308
  # we get the current color because they will be removed
309
- # prev_color=color
310
- # alert color.class
311
309
  particles_found = to_hash
312
310
  particles_found.each do |particle_found, value_found|
313
311
  send(particle_found, value_found)
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.5.4'
5
+ VERSION = '0.5.6.5.7'
6
6
  end
@@ -37,6 +37,11 @@ new({ renderer: :html, method: :apply, type: :string }) do |parent_found, _user_
37
37
  blue = parent_found.blue * 255
38
38
  alpha = parent_found.alpha
39
39
  html.style(:backgroundColor, "rgba(#{red}, #{green}, #{blue}, #{alpha})")
40
+ if type.to_sym ==:border
41
+ affect.each do |at_found|
42
+ grab(at_found).html.style(:border, "solid 2px rgba(#{red},#{green},#{blue},#{alpha})")
43
+ end
44
+ end
40
45
  when :paint
41
46
  # if when found colors when use it for the gradient , else whe use the colors within the current atome
42
47
  # gradient_found = params[:colors] || @apply
@@ -66,3 +66,33 @@ end
66
66
  # # b.attached([col.id])
67
67
  # c.border({ thickness: 5, pattern: :dotted })
68
68
  # b.border({ thickness: 5, attached: col.id, pattern: :dotted })
69
+ bb=box({top: 50, left: 100})
70
+ bb.text(:touch_me)
71
+ bord=bb.border({ thickness: 3, pattern: :dotted})
72
+ bb.touch(true) do
73
+ col=bord.color({red: 1 })
74
+
75
+ wait 2 do
76
+ col.green(1)
77
+ end
78
+ # bord.apply(:titi)
79
+ # puts 'opk'
80
+ end
81
+
82
+
83
+ # c=color(:pink)
84
+ # # red: 1, green: 1, blue: 0, alpha: 1,
85
+ # wait 0.2 do
86
+ # bord.red(1)
87
+ # wait 0.2 do
88
+ # bord.green(1)
89
+ # wait 0.2 do
90
+ # bord.blue(1)
91
+ # wait 0.2 do
92
+ # bord.alpha(1)
93
+ # bord.apply(c.id)
94
+ # end
95
+ # end
96
+ # end
97
+ #
98
+ # end
@@ -22,7 +22,8 @@ def matrix(id, horizontal_nb, vertical_nb, spacing, size)
22
22
  end
23
23
  box_width = available_width / horizontal_nb
24
24
  box_height = available_height / vertical_nb
25
- background=box({id: :background, width: 666, height: 666, color:{alpha: 0}})
25
+ background=box({id: "#{id}_background", width: 666, height: 666, color:{alpha: 0}})
26
+
26
27
  vertical_nb.times do |y|
27
28
  horizontal_nb.times do |x|
28
29
  id_generated = "#{id}_#{x}_#{y}"
@@ -147,7 +148,8 @@ wait 1 do
147
148
  @current_matrix.width(33)
148
149
  end
149
150
  @current_matrix.drag(true)
151
+ alert @current_matrix.id
150
152
  wait 2 do
151
- grab(:background).left(666)
152
- grab(:background).drag(true)
153
+ grab(:vie_0_background).left(666)
154
+ grab(:vie_0_background).drag(true)
153
155
  end
@@ -9,11 +9,25 @@ class Database
9
9
  Sequel.connect("sqlite://eden.sqlite3")
10
10
  end
11
11
 
12
- def create_table(table_name)
12
+ def create_table(table_name, type)
13
13
  eden = Sequel.connect("sqlite://eden.sqlite3")
14
+ type= case type
15
+
16
+ when 'string'
17
+ String
18
+ when 'int'
19
+ Integer
20
+ when 'hash'
21
+ JSON
22
+ when 'date'
23
+ DateTime
24
+ else
25
+ Integer
26
+ end
14
27
  unless eden.table_exists?(table_name)
15
28
  eden.create_table table_name.to_sym do
16
- primary_key "#{table_name}_id".to_sym
29
+ # primary_key "#{table_name}_id".to_sym
30
+ column "#{table_name}_id".to_sym, type, primary_key: true
17
31
  end
18
32
  end
19
33
  end
@@ -101,7 +101,9 @@ class EDen
101
101
 
102
102
  def crate_db_table(data, message_id)
103
103
  table = data['table']
104
- Database.create_table(table)
104
+ type = data['type']
105
+ primary = data['primary']
106
+ Database.create_table(table, type)
105
107
  { data: { message: "table #{table} added" }, message_id: message_id }
106
108
  end
107
109
 
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.5.4
4
+ version: 0.5.6.5.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-05 00:00:00.000000000 Z
11
+ date: 2024-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: artoo