atome 0.5.6.1.9 → 0.5.6.2.0

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: c9f271978fff8b31e480fd6d7dd63b4714f22f658c602a2725234bdb747e29bc
4
- data.tar.gz: 7d61a71ff963c9b68b15dbbbe0a6469865d1aa82e958dca9b5cfffc4ad5ffd8c
3
+ metadata.gz: cc8ade696d1fa0d4ebc29a7ffbb336e1537d1f2b5c83c7772a6651f2b4558d0d
4
+ data.tar.gz: 0b849380beee8851a6e3571bb4f9df756524b0dab2746e146c5f35dc1b545ea3
5
5
  SHA512:
6
- metadata.gz: c9b78286af7e45b82ab00792ab2a4a11ec008c2fee10cd110666cd38a9ae11c1b5d8e6bc520854f3e033018a05046fb4d92296da7360522d4d9ef4a1ec0de1ea
7
- data.tar.gz: 365f481ee7933540065b259b4ea5d3b55515dc0b2b96f0dfc57231c55c927b54e307a41a551b208c8825e81dfe535b9be006b2dd05330ecfa78be32678d31c02
6
+ metadata.gz: 16319a956d2d2221eeb0b19ad60c305e811ae2fdec974e99ec33db58f6d1a11e3d71ea08bd73c1cfae4fb19c81aa3170c39ba64435fa155054bdea212e9bc908
7
+ data.tar.gz: 01df5f2b3923c04e05028ba711b9c83fdf431755685507dab92072eba959b1ee37e50a14dfe0c373f55f277def9c349e41fe76727f4b9828fcda389cc345b4f9
data/lib/atome/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  # return atome version
4
4
  class Atome
5
- VERSION = '0.5.6.1.9'
5
+ VERSION = '0.5.6.2.0'
6
6
  end
7
7
 
@@ -1,20 +1,23 @@
1
- # frozen_string_literal: true
1
+ # # frozen_string_literal: true
2
+ #
3
+ A.message({ action: :insert, data: { table: :security, particle: :password, data: 'my_pass'} })
2
4
 
3
- A.message({ action: :insert, data: { table: :security, particle: :email, data: 'jeezs@jeezs.net' } })
4
- A.message({ action: :insert, data: { table: :security, particle: :name, data: 'jeezs' } }) do |data_received_from_server|
5
+ A.message({ action: :insert, data: { table: :identity, particle: :name, data: 'jeezs' } }) do |data_received_from_server|
5
6
  puts "my first insert #{data_received_from_server}"
6
7
  end
8
+
7
9
  A.message({ action: :query, data: { table: :identity } }) do |data_received_from_server|
8
10
  puts "another insert : #{data_received_from_server}"
9
11
  end
12
+
10
13
  A.message({ action: :query, data: { table: :identity } }) do |data_received|
11
14
  puts "received : #{data_received}"
12
15
  end
13
16
 
14
- A.message({ action: :insert, data: { table: :security, particle: :name, data: 'jeezs' } }) do |result|
17
+ A.message({ action: :insert, data: { table: :identity, particle: :name, data: 'jeezs' } }) do |result|
15
18
  puts "insert done : #{result}"
16
19
  end
17
20
 
18
- A.message({ action: :insert, data: { table: :security, particle: :name, data: 'jeezs' } }) do |result|
21
+ A.message({ action: :insert, data: { table: :identity, particle: :name, data: 'jeezs' } }) do |result|
19
22
  puts "last message received: #{result}"
20
23
  end
@@ -22,16 +22,16 @@ class EDen
22
22
  end
23
23
 
24
24
  def self.terminal(cmd, option, ws, value, user, pass)
25
- {return: `#{cmd}` }
25
+ { return: `#{cmd}` }
26
26
  end
27
27
 
28
28
  def self.pass(cmd, option, ws, value, user, pass)
29
- {return: 'pass received' }
29
+ { return: 'pass received' }
30
30
  end
31
31
 
32
32
  def self.init_db(cmd, option, ws, value, user, pass)
33
33
  # Database.
34
- {return: 'database initialised' }
34
+ { return: 'database initialised' }
35
35
  end
36
36
 
37
37
  def self.query(cmd, option, ws, value, user, pass)
@@ -40,10 +40,23 @@ class EDen
40
40
  { action: :query, data: cmd['table'], return: result }
41
41
  end
42
42
 
43
- def self.insert(cmd, option, ws, value, user, pass)
44
- identity_table = db_access[:identity]
45
- identity_table.insert(email: 'tre@tre')
46
- { action: :insert, data: cmd, return: { email: 'tre@tre' } }
43
+ # def self.insert(cmd, option, ws, value, user, pass)
44
+ # identity_table = db_access[:identity]
45
+ # identity_table.insert(email: 'tre@tre')
46
+ # { action: :insert, data: cmd, return: { email: 'tre@tre' } }
47
+ # end
48
+
49
+ def self.insert(params, option, ws, value, user, pass)
50
+ table = params['table']
51
+ particle = params['particle']
52
+ data = params['data']
53
+ identity_table = db_access[table.to_sym]
54
+ # identity_table = db_access[:identity]
55
+ #######
56
+ identity_table.insert(particle => data )
57
+ # identity_table.insert(email: 'tre@tre')
58
+ #
59
+ { return: "column : #{particle}, in table : #{table}, updated with : #{data}" }
47
60
  end
48
61
 
49
62
  # def self.authentification(cmd, option, ws, value, user, pass)
@@ -80,7 +93,7 @@ class EDen
80
93
  def self.file(source, operation, ws, value, user, pass)
81
94
  file_content = File.send(operation, source, value).to_s
82
95
  file_content = file_content.gsub("'", "\"")
83
- {return: "=> operation: #{operation}, source: #{source} , content : #{file_content}" }
96
+ { return: "=> operation: #{operation}, source: #{source} , content : #{file_content}" }
84
97
  end
85
98
 
86
99
  # return_message = EDen.safe_send(action_requested, data,option, current_user, user_pass)
@@ -91,7 +104,7 @@ class EDen
91
104
  if eden_methods.include?(method_sym)
92
105
  send(method_sym, *args)
93
106
  else
94
- {return: "forbidden action: #{method_name}" }
107
+ { return: "forbidden action: #{method_name}" }
95
108
  end
96
109
  end
97
110
  end
@@ -344,7 +357,7 @@ class App < Roda
344
357
  if Faye::WebSocket.websocket?(r.env)
345
358
  ws = Faye::WebSocket.new(r.env)
346
359
  ws.on :open do |event|
347
- ws.send({return: 'server ready' }.to_json)
360
+ ws.send({ return: 'server ready' }.to_json)
348
361
  # ws.send('asking for synchro data'.to_json)
349
362
  end
350
363
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6.1.9
4
+ version: 0.5.6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Eric Godard