atome 0.5.6.1.9 → 0.5.6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc8ade696d1fa0d4ebc29a7ffbb336e1537d1f2b5c83c7772a6651f2b4558d0d
|
|
4
|
+
data.tar.gz: 0b849380beee8851a6e3571bb4f9df756524b0dab2746e146c5f35dc1b545ea3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16319a956d2d2221eeb0b19ad60c305e811ae2fdec974e99ec33db58f6d1a11e3d71ea08bd73c1cfae4fb19c81aa3170c39ba64435fa155054bdea212e9bc908
|
|
7
|
+
data.tar.gz: 01df5f2b3923c04e05028ba711b9c83fdf431755685507dab92072eba959b1ee37e50a14dfe0c373f55f277def9c349e41fe76727f4b9828fcda389cc345b4f9
|
data/lib/atome/version.rb
CHANGED
|
@@ -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: :
|
|
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: :
|
|
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: :
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
360
|
+
ws.send({ return: 'server ready' }.to_json)
|
|
348
361
|
# ws.send('asking for synchro data'.to_json)
|
|
349
362
|
end
|
|
350
363
|
|