dialog_ruby 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +0 -0
- data/_dev/get_full_botapi.rb +59 -0
- data/_dev/inlinekb_pubsub.rb +69 -0
- data/_dev/main.rb +127 -0
- data/_dev/restriction.rb +32 -0
- data/_dev/ru.yml +79 -0
- data/_dev/sidekiq.rb +28 -0
- data/_dev/tdlib.rb +154 -0
- data/dialog.sh +51 -0
- data/dialog_ruby.gemspec +41 -0
- data/lib/architecture.md +22 -0
- data/lib/configuration.rb +117 -0
- data/lib/dialogStart.rb +189 -0
- data/lib/dialog_ruby.rb +59 -0
- data/lib/exec.sh +61 -0
- data/lib/exec_conf/cli_config +7 -0
- data/lib/exec_conf/dialog__sync.service +14 -0
- data/lib/exec_conf/dialog__sync.timer +11 -0
- data/lib/exec_conf/dialog_bot@.path +6 -0
- data/lib/exec_conf/dialog_bot@.service +18 -0
- data/lib/exec_conf/dialog_bot_dev@.path +6 -0
- data/lib/exec_conf/dialog_bot_dev_pre@.service +16 -0
- data/lib/exec_conf/dialog_bot_pre@.service +16 -0
- data/lib/exec_conf/dialog_redis@.service +14 -0
- data/lib/exec_conf/post-merge +5 -0
- data/lib/exec_conf/redis_global.conf +49 -0
- data/lib/exec_conf/redis_local.conf +4 -0
- data/lib/lang/global_ru.yml +29 -0
- data/lib/lib/dialect/canvas/canvas.rb +35 -0
- data/lib/lib/dialect/canvas/element/convert/SearchBaloo.rb +45 -0
- data/lib/lib/dialect/canvas/element/data/search.rb +34 -0
- data/lib/lib/dialect/canvas/element/send/Inline_query_result.rb +32 -0
- data/lib/lib/dialect/canvas/element/send/bot_message.rb +38 -0
- data/lib/lib/dialect/canvas/element/send/keyboards.rb +59 -0
- data/lib/lib/dialect/canvas/element/send/recognize.rb +51 -0
- data/lib/lib/dialect/canvas/element/send/restrict.rb +42 -0
- data/lib/lib/dialect/canvas/element/send/tdlib_chat.rb +33 -0
- data/lib/lib/dialect/canvas/element/send/tdlib_message.rb +38 -0
- data/lib/lib/dialect/canvas/mod/send/_Inline_query_result.rb +38 -0
- data/lib/lib/dialect/canvas/mod/send/_keyboards.rb +40 -0
- data/lib/lib/dialect/canvas/mod/send/func.rb +98 -0
- data/lib/lib/dialect/canvas/mod/send/general/_heads.rb +27 -0
- data/lib/lib/dialect/canvas/mod/send/general/chat.rb +38 -0
- data/lib/lib/dialect/canvas/mod/send/general/common.rb +32 -0
- data/lib/lib/dialect/canvas/mod/send/general/message.rb +37 -0
- data/lib/lib/dialect/canvas/mod/send/general/user.rb +36 -0
- data/lib/lib/dialect/canvas/mod/send/inline_query_result/common.rb +36 -0
- data/lib/lib/dialect/codegen/codegen.rb +74 -0
- data/lib/lib/dialect/codegen/erb/data/1.ModReceive2GetData.erb +27 -0
- data/lib/lib/dialect/codegen/erb/data/2.GetData2Elements.erb +27 -0
- data/lib/lib/dialect/codegen/erb/data/3.GenData2Dest.erb +34 -0
- data/lib/lib/dialect/codegen/erb/functional/1.Expect2Events.erb +37 -0
- data/lib/lib/dialect/codegen/erb/functional/2.1.Events2AppEvent.erb +26 -0
- data/lib/lib/dialect/codegen/erb/functional/2.2.1.Events2ModReceive.erb +73 -0
- data/lib/lib/dialect/codegen/erb/functional/2.2.2.ModReceive2AppEvent.erb +59 -0
- data/lib/lib/dialect/codegen/erb/functional/3.Appevent2EventBus.erb +35 -0
- data/lib/lib/dialect/codegen/erb/functional/4.1.AppEvent2Elements.erb +72 -0
- data/lib/lib/dialect/codegen/erb/functional/5.1.Element2ModElements.erb +70 -0
- data/lib/lib/dialect/codegen/erb/functional/5.2.Element2ModSend.erb +69 -0
- data/lib/lib/dialect/codegen/erb/functional/7.ElementChains.erb +91 -0
- data/lib/lib/dialect/codegen/repack/constructor/DockedGroupings2AppFunctions.rb +36 -0
- data/lib/lib/dialect/codegen/repack/constructor/Element2ModSend.rb +49 -0
- data/lib/lib/dialect/codegen/repack/constructor/ElementsInElements.rb +34 -0
- data/lib/lib/dialect/codegen/repack/functional/1.Expect2Events.rb +35 -0
- data/lib/lib/dialect/codegen/repack/functional/2.2.1.Events2ModReceive.rb +71 -0
- data/lib/lib/dialect/codegen/repack/functional/2.2.2.ModReceive2AppEvent.rb +45 -0
- data/lib/lib/dialect/codegen/repack/functional/5.1.Element2ModElements.rb +90 -0
- data/lib/lib/dialect/codegen/repack/functional/5.2.Element2ModSend.rb +60 -0
- data/lib/lib/dialect/codegen/repack/functional/7.ElementChains.rb +88 -0
- data/lib/lib/dialect/codegen/run.rb +79 -0
- data/lib/lib/metamess/_run.rb +162 -0
- data/lib/lib/metamess/content/content_o-command_f.rb +100 -0
- data/lib/lib/metamess/content/content_o-media_f.rb +149 -0
- data/lib/lib/metamess/content/content_o-simple_f.rb +35 -0
- data/lib/lib/metamess/content/content_o.rb +245 -0
- data/lib/lib/metamess/event/notify_o-chatmember_f.rb +124 -0
- data/lib/lib/metamess/event/notify_o-chattitle_f.rb +34 -0
- data/lib/lib/metamess/event/notify_o-create_f.rb +42 -0
- data/lib/lib/metamess/event/notify_o-migrate_f.rb +34 -0
- data/lib/lib/metamess/event/notify_o-pinned_f.rb +34 -0
- data/lib/lib/metamess/event/notify_o.rb +28 -0
- data/lib/lib/metamess/event_c.rb +26 -0
- data/lib/lib/metamess/func.rb +220 -0
- data/lib/lib/metamess/service/service_o-callback_f.rb +33 -0
- data/lib/lib/metamess/service/service_o-inline_f.rb +55 -0
- data/lib/lib/metamess/service/service_o.rb +26 -0
- data/lib/lib/naming.rb +130 -0
- data/lib/lib/storage/redis/redisPubSub.rb +51 -0
- data/lib/lib/storage/redis/rediscached.rb +97 -0
- data/lib/lib/tdlib/auth.rb +141 -0
- data/lib/lib/tdlib/func.rb +34 -0
- data/lib/lib/tdlib/init.rb +39 -0
- data/lib/lib/telegram/botapi.rb +71 -0
- data/lib/lib/telegram/infra_info.rb +50 -0
- data/lib/lib/telegram/wrappers.rb +41 -0
- data/lib/lib/tooling/lang.rb +24 -0
- data/lib/lib/tooling/log.rb +54 -0
- data/lib/lib/tooling/ruby.rb +25 -0
- data/lib/version.rb +3 -0
- data/logo.png +0 -0
- metadata +305 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
def repack_constructors_ElementsInElements(args, name, viewId)
|
17
|
+
args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack] = {}
|
18
|
+
repack_constructors_ElementsInElements_fFqn(args, name, viewId, :fFqn)
|
19
|
+
end
|
20
|
+
|
21
|
+
def repack_constructors_ElementsInElements_fFqn(args, name, viewId, repackName)
|
22
|
+
res = {}
|
23
|
+
args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][repackName] ||= {}
|
24
|
+
args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:lookup].each do |tName, hash_tNameProp|
|
25
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
26
|
+
res[hash_fNameProp[:fFqn]] = hash_fNameProp
|
27
|
+
end
|
28
|
+
end
|
29
|
+
args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][repackName] = res
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
|
17
|
+
def repack_Expect2Events(args, name, viewId)
|
18
|
+
repack_Expect2Events_tEID_root(args, name, viewId, :tEID_root)
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def repack_Expect2Events_tEID_root(args, name, viewId, repackName)
|
23
|
+
res = {}
|
24
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
25
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
26
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
27
|
+
res[hash_fNameProp[:tEID]] = {root: hash_fNameProp[:tFqn]}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
|
17
|
+
def repack_Events2ModReceive(args, name, viewId)
|
18
|
+
repack_Events2ModReceive_fOID2tFqn(args, name, viewId, :fOID2tFqn)
|
19
|
+
repack_Events2ModReceive_fEID2tFqn(args, name, viewId, :fEID2tFqn)
|
20
|
+
repack_Events2ModReceive_tOID2fOID(args, name, viewId, :tOID2fOID)
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
def repack_Events2ModReceive_fEID2tFqn(args, name, viewId, repackName)
|
25
|
+
res = {}
|
26
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
27
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
28
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
29
|
+
res[hash_fNameProp[:fEID]] ||= {}
|
30
|
+
res[hash_fNameProp[:fEID]][hash_fNameProp[:tFqn]] ||= {}
|
31
|
+
res[hash_fNameProp[:fEID]][hash_fNameProp[:tFqn]][hash_fNameProp[:tProp][:scope]] ||= {}
|
32
|
+
res[hash_fNameProp[:fEID]][hash_fNameProp[:tFqn]][hash_fNameProp[:tProp][:scope]][hash_fNameProp[:tOID]] = hash_fNameProp
|
33
|
+
end
|
34
|
+
end
|
35
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
36
|
+
end
|
37
|
+
|
38
|
+
def repack_Events2ModReceive_fOID2tFqn(args, name, viewId, repackName)
|
39
|
+
res = {}
|
40
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
41
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
42
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
43
|
+
res[hash_fNameProp[:fOID]] ||= {}
|
44
|
+
res[hash_fNameProp[:fOID]][hash_fNameProp[:tFqn]] ||= {}
|
45
|
+
res[hash_fNameProp[:fOID]][hash_fNameProp[:tFqn]][hash_fNameProp[:tProp][:scope]] ||= {}
|
46
|
+
res[hash_fNameProp[:fOID]][hash_fNameProp[:tFqn]][hash_fNameProp[:tProp][:scope]][hash_fNameProp[:tOID]] = hash_fNameProp
|
47
|
+
end
|
48
|
+
end
|
49
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def repack_Events2ModReceive_tOID2fOID(args, name, viewId, repackName)
|
54
|
+
res = {}
|
55
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
56
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][:fOID2tFqn].each do |fOID, hash_tFqn|
|
57
|
+
hash_tFqn.each do |tFqn, hash_Scope|
|
58
|
+
hash_Scope.each do |scope, hash_tOID|
|
59
|
+
hash_tOID.each do |tOID, prop|
|
60
|
+
res[tOID] ||= {}
|
61
|
+
res[tOID][:fOID] = fOID
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
|
17
|
+
def repack_ModReceive2AppEvent(args, name, viewId)
|
18
|
+
repack_ModReceive2AppEvent_parentOID2EID(args, name, viewId,:parentOID2EID)
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
# args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][:tOID][hash_fNameProp[:fOID]] = hash_fNameProp
|
23
|
+
|
24
|
+
|
25
|
+
def repack_ModReceive2AppEvent_parentOID2EID(args, name, viewId, repackName)
|
26
|
+
res = {}
|
27
|
+
i = 1
|
28
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
29
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
30
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
31
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive][:repack][:tOID2fOID].has_key?(hash_fNameProp[:tOID])
|
32
|
+
# lookupDebug(name, hash_fNameProp)
|
33
|
+
parentOID = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive][:repack][:tOID2fOID][hash_fNameProp[:tOID]][:fOID]
|
34
|
+
res[parentOID] ||= {}
|
35
|
+
res[parentOID][hash_fNameProp[:fEID]] ||= {}
|
36
|
+
res[parentOID][hash_fNameProp[:fEID]][hash_fNameProp[:tOID]] = hash_fNameProp
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
def repack_Element2ModElements(args, name, viewId)
|
17
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack] = {}
|
18
|
+
repack_Element2ModElements_fFqn(args, name, viewId, :fFqn)
|
19
|
+
repack_Element2ModElements_atoms(args, name, viewId, :atoms)
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def repack_Element2ModElements_fFqn(args, name, viewId, repackName)
|
24
|
+
res = {}
|
25
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
26
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
27
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
28
|
+
|
29
|
+
# Dialog.logger.debug "### repack_Element2ModElements_fFqn - #{hash_fNameProp}"
|
30
|
+
if args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:DockedGroupings2AppFunctions][:repack][:tEID][hash_fNameProp[:fEID]]
|
31
|
+
res[hash_fNameProp[:fFqn].to_sym] ||= {}
|
32
|
+
res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] ||= {}
|
33
|
+
res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] = hash_fNameProp[:tProp]
|
34
|
+
res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] = hash_fNameProp[:tProp]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def repack_Element2ModElements_atoms(args, name, viewId, repackName)
|
43
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements].is_a?(Hash)
|
44
|
+
res = {atoms: {}, elements: {}}
|
45
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
46
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
47
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
48
|
+
|
49
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID].has_key?(hash_fNameProp[:fOID].to_sym)
|
50
|
+
# lookupDebug(name, hash_fNameProp)
|
51
|
+
case hash_fNameProp[:tFqn]
|
52
|
+
when 'DialogModElementReply_keyboardButton', 'DialogModElementInline_keyboardButton', /DialogModElementInline_query_result*/
|
53
|
+
row = hash_fNameProp[:tProp][:pos].split(":")[0]
|
54
|
+
col = hash_fNameProp[:tProp][:pos].split(":")[1]
|
55
|
+
res[:keyboards] ||= {}
|
56
|
+
res[:keyboards][hash_fNameProp[:fOID]] ||= {}
|
57
|
+
res[:keyboards][hash_fNameProp[:fOID]][hash_fNameProp[:fFqn].to_sym] ||= {}
|
58
|
+
res[:keyboards][hash_fNameProp[:fOID]][hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] ||= {}
|
59
|
+
res[:keyboards][hash_fNameProp[:fOID]][hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym][row] ||= {}
|
60
|
+
res[:keyboards][hash_fNameProp[:fOID]][hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym][row][col] = {:tName => hash_fNameProp[:tName], :tValue => hash_fNameProp[:tProp][:value]}
|
61
|
+
|
62
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModElementsSpecs].is_a?(Hash)
|
63
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModElementsSpecs][:repack][:tOID].has_key?(hash_fNameProp[:tOID].to_sym)
|
64
|
+
base = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModElementsSpecs][:repack][:tOID][hash_fNameProp[:tOID].to_sym]
|
65
|
+
key = base[:fFqn].to_s.split /(?=[A-Z])/
|
66
|
+
res[:keyboards][hash_fNameProp[:fOID]][hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym][row][col][:spec] = {key: key.last.downcase, value: base[:fProp][:value]}
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
when /^DialogElement/
|
72
|
+
# Dialog.logger.debug "### 2 #{hash_fNameProp[:tFqn]} - #{hash_fNameProp[:tOID]}"
|
73
|
+
res[:elements][hash_fNameProp[:fOID]] ||= {}
|
74
|
+
res[:elements][hash_fNameProp[:fOID]][hash_fNameProp[:tOID]] = hash_fNameProp[:tFqn]
|
75
|
+
end
|
76
|
+
# Dialog.logger.debug "### 2 #{hash_fNameProp[:tFqn]} - #{res[:atoms][hash_fNameProp[:fOID]]}"
|
77
|
+
if res[:atoms][hash_fNameProp[:fOID]].is_a?(Hash)
|
78
|
+
res[:atoms][hash_fNameProp[:fOID]][hash_fNameProp[:tOID]][hash_fNameProp[:tFqn].to_sym][:tProp][row][col] = {tOID: hash_fNameProp[:tOID], tProp: hash_fNameProp[:tProp], modSend: modSend}
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
def repack_Element2ModSend(args, name, viewId)
|
17
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack] = {}
|
18
|
+
repack_Element2ModSend_fFqn(args, name, viewId, :fFqn)
|
19
|
+
repack_Element2ModSend_atoms(args, name, viewId, :atoms)
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def repack_Element2ModSend_fFqn(args, name, viewId, repackName)
|
24
|
+
res = {}
|
25
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
26
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
27
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
28
|
+
# if args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:DockedGroupings2AppFunctions][:repack][:tEID][hash_fNameProp[:fEID]]
|
29
|
+
# Dialog.logger.debug "### Element2ModSend_fFqn - #{hash_fNameProp[:fFqn]} - #{hash_fNameProp[:tFqn]} - #{hash_fNameProp[:tProp]}"
|
30
|
+
res[hash_fNameProp[:fFqn].to_sym] ||= {}
|
31
|
+
res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] ||= {}
|
32
|
+
res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] = hash_fNameProp[:tProp]
|
33
|
+
# end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def repack_Element2ModSend_atoms(args, name, viewId, repackName)
|
41
|
+
res = {atoms: {}}
|
42
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
43
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:lookup].each do |tName, hash_tNameProp|
|
44
|
+
hash_tNameProp.each do |fName, hash_fNameProp|
|
45
|
+
case hash_fNameProp[:tFqn]
|
46
|
+
when /DialogModSendInline_keyboardButton*/
|
47
|
+
next
|
48
|
+
end
|
49
|
+
res[:atoms][hash_fNameProp[:fOID]] ||= {}
|
50
|
+
res[:atoms][hash_fNameProp[:fOID]][hash_fNameProp[:tOID]] ||= {}
|
51
|
+
res[:atoms][hash_fNameProp[:fOID]][hash_fNameProp[:tOID]][hash_fNameProp[:tFqn].to_sym] = {:fFqn => hash_fNameProp[:fFqn], :tProp => hash_fNameProp[:tProp]}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = res
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
|
17
|
+
def repack_ElementChains(args, name, viewId)
|
18
|
+
repack_ElementChains_chain(args, name, viewId, :chain)
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def repack_ElementChains_chain(args, name, viewId, repackName)
|
23
|
+
step1Hash = {}
|
24
|
+
step1Array = []
|
25
|
+
step2Order = {}
|
26
|
+
root = ""
|
27
|
+
roots = []
|
28
|
+
|
29
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] ||= {}
|
30
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][:fOID].each do |fOID, hash_fOIDProp|
|
31
|
+
step1Hash[fOID.to_sym] = hash_fOIDProp[:tOID].to_sym
|
32
|
+
step1Array << fOID.to_sym unless step1Array.include?(fOID)
|
33
|
+
step1Array << hash_fOIDProp[:tOID].to_sym unless step1Array.include?(hash_fOIDProp[:OID])
|
34
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID].has_key?(fOID.to_sym)
|
35
|
+
roots << fOID
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
roots.each do |root|
|
41
|
+
baseRoot = root
|
42
|
+
step2Order[root] ||= {}
|
43
|
+
i=2
|
44
|
+
cycle = 1
|
45
|
+
step2Order[root][1] = root
|
46
|
+
maxCycles = step1Array.count
|
47
|
+
while cycle <= maxCycles
|
48
|
+
step1Hash.each do |fOID, tOID|
|
49
|
+
# Dialog.logger.debug "@@@1 i #{i}, step1Array.count #{step1Array.count}, if fOID #{fOID} == root #{root} => tOID #{tOID}"
|
50
|
+
if fOID == root
|
51
|
+
root = tOID.to_sym
|
52
|
+
step2Order[baseRoot][i] = tOID
|
53
|
+
# Dialog.logger.debug "@@@2 i #{i}, step1Array.count #{step1Array.count}, fOID #{fOID}, tOID #{tOID}"
|
54
|
+
step1Array.delete(fOID)
|
55
|
+
step1Array.delete(tOID)
|
56
|
+
i = i +1
|
57
|
+
end
|
58
|
+
cycle += 1
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
step3Final = {}
|
65
|
+
step2Order.each do |root,v|
|
66
|
+
step3Final[root] ||= {}
|
67
|
+
step2Order[root].each do |step, fOID|
|
68
|
+
step3Final[root][step] = {:oid => fOID.to_sym}
|
69
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID].has_key?(fOID)
|
70
|
+
step3Final[root][step][:fqn] = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID][fOID][:tFqn]
|
71
|
+
else
|
72
|
+
if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:fOID][fOID].is_a?(Hash)
|
73
|
+
step3Final[root][step][:fqn] = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:fOID][fOID][:tFqn]
|
74
|
+
else
|
75
|
+
step3Final[root][step][:fqn] = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:tOID][fOID][:tFqn]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
# Dialog.logger.debug "step #{step}, fqn #{step3Final[root][step]}"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
# Dialog.logger.debug "@@@ step3Final::#{step3Final}"
|
82
|
+
|
83
|
+
args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][name][:repack][repackName] = {:order => step3Final, :link => step1Hash}
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
######## ####### ######## ####### ######## ########
|
2
|
+
## / / / / License \ \ \ \
|
3
|
+
## Copyleft culture, Copyright (C) is prohibited here
|
4
|
+
## This work is licensed under a CC BY-SA 4.0
|
5
|
+
## Creative Commons Attribution-ShareAlike 4.0 License
|
6
|
+
## Refer to the http://creativecommons.org/licenses/by-sa/4.0/
|
7
|
+
######## ####### ######## ####### ######## ########
|
8
|
+
## / / / / Code Climate \ \ \ \
|
9
|
+
## Language = ruby
|
10
|
+
## Indent = space; 2 chars;
|
11
|
+
######## ####### ######## ####### ######## ########
|
12
|
+
module Dialog
|
13
|
+
module Dialect
|
14
|
+
class << self
|
15
|
+
|
16
|
+
def dialect_codegenRun_pre(args)
|
17
|
+
state = {stages: {}}
|
18
|
+
state[:stages][:codegenPerView] = {
|
19
|
+
b: :modSendOfArchi,
|
20
|
+
c: :rubyPreLabeling_,
|
21
|
+
d: :modOfElementsOfAppevent,
|
22
|
+
|
23
|
+
l: :modOfElementsOfBus,
|
24
|
+
m: :elementsInElementsArchi
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def dialect_codegenRun(args, type)
|
30
|
+
args[:tmp] = {stages: {}, x: {}}
|
31
|
+
args[:tmp][:stages][:codegenConstructor] = [
|
32
|
+
{name: :DockedGroupings2AppFunctions, order: '1', erb: 0},
|
33
|
+
{name: :Element2ModSend, order: '2', erb: 0},
|
34
|
+
{name: :ElementsInElements, order: '3', erb: 0},
|
35
|
+
]
|
36
|
+
|
37
|
+
args[:tmp][:stages][:functional] = [
|
38
|
+
{name: :Expect2Events, repack: 1, erb: 1, order: '1'},
|
39
|
+
{name: :Events2AppEvent, repack: 0, erb: 1, order: '2.1'},
|
40
|
+
{name: :Events2ModReceive, repack: 1, erb: 1, order: '2.2.1'},
|
41
|
+
{name: :ModReceive2AppEvent, repack: 1, erb: 1, order: '2.2.2'},
|
42
|
+
{name: :AppEvent2Elements, repack: 0, erb: 1, order: '4.1'},
|
43
|
+
{name: :Elements2AppEvent, repack: 0, erb: 0, order: '4.2'},
|
44
|
+
{name: :Appevent2EventBus, repack: 0, erb: 1, order: '3'},
|
45
|
+
{name: :ElementChains, repack: 1, erb: 1, order: '7'},
|
46
|
+
{name: :ModElementsSpecs, repack: 0, erb: 0, order: '6'},
|
47
|
+
{name: :Element2ModElements, repack: 1, erb: 1, order: '5.1'},
|
48
|
+
{name: :Element2ModSend, repack: 1, erb: 1, order: '5.2'},
|
49
|
+
|
50
|
+
|
51
|
+
]
|
52
|
+
|
53
|
+
args[:tmp][:stages][:data] = [
|
54
|
+
{name: :ModReceive2GetData, repack: 0, erb: 1, order: '1'},
|
55
|
+
{name: :GetData2Elements, repack: 0, erb: 1, order: '2'},
|
56
|
+
{name: :GenData2Dest, repack: 0, erb: 1, order: '3'},
|
57
|
+
]
|
58
|
+
|
59
|
+
args[:tmp][:stages][:codegenGlobal] = {
|
60
|
+
n: :rubySrcLabeling
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
dialect_repack(args)
|
65
|
+
dialect_erb(args, type)
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
def run(args, type)
|
70
|
+
dialect_codegenRun(args,type)
|
71
|
+
end
|
72
|
+
|
73
|
+
def lookupDebug(name, prop)
|
74
|
+
Dialog.logger.debug "### #{name} :: F:: '#{prop[:fName]}' fqn:#{prop[:fFqn]} o:#{prop[:fOID]} e:#{prop[:fEID]} p '#{prop[:fProp]}' :: T :: '#{prop[:tName]}' fqn:#{prop[:tFqn]} o:#{prop[:tOID]} e:#{prop[:tEID]} p '#{prop[:tProp]}'"
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|