dialog_ruby 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/Gemfile +0 -0
  4. data/_dev/get_full_botapi.rb +59 -0
  5. data/_dev/inlinekb_pubsub.rb +69 -0
  6. data/_dev/main.rb +127 -0
  7. data/_dev/restriction.rb +32 -0
  8. data/_dev/ru.yml +79 -0
  9. data/_dev/sidekiq.rb +28 -0
  10. data/_dev/tdlib.rb +154 -0
  11. data/dialog.sh +51 -0
  12. data/dialog_ruby.gemspec +41 -0
  13. data/lib/architecture.md +22 -0
  14. data/lib/configuration.rb +117 -0
  15. data/lib/dialogStart.rb +189 -0
  16. data/lib/dialog_ruby.rb +59 -0
  17. data/lib/exec.sh +61 -0
  18. data/lib/exec_conf/cli_config +7 -0
  19. data/lib/exec_conf/dialog__sync.service +14 -0
  20. data/lib/exec_conf/dialog__sync.timer +11 -0
  21. data/lib/exec_conf/dialog_bot@.path +6 -0
  22. data/lib/exec_conf/dialog_bot@.service +18 -0
  23. data/lib/exec_conf/dialog_bot_dev@.path +6 -0
  24. data/lib/exec_conf/dialog_bot_dev_pre@.service +16 -0
  25. data/lib/exec_conf/dialog_bot_pre@.service +16 -0
  26. data/lib/exec_conf/dialog_redis@.service +14 -0
  27. data/lib/exec_conf/post-merge +5 -0
  28. data/lib/exec_conf/redis_global.conf +49 -0
  29. data/lib/exec_conf/redis_local.conf +4 -0
  30. data/lib/lang/global_ru.yml +29 -0
  31. data/lib/lib/dialect/canvas/canvas.rb +35 -0
  32. data/lib/lib/dialect/canvas/element/convert/SearchBaloo.rb +45 -0
  33. data/lib/lib/dialect/canvas/element/data/search.rb +34 -0
  34. data/lib/lib/dialect/canvas/element/send/Inline_query_result.rb +32 -0
  35. data/lib/lib/dialect/canvas/element/send/bot_message.rb +38 -0
  36. data/lib/lib/dialect/canvas/element/send/keyboards.rb +59 -0
  37. data/lib/lib/dialect/canvas/element/send/recognize.rb +51 -0
  38. data/lib/lib/dialect/canvas/element/send/restrict.rb +42 -0
  39. data/lib/lib/dialect/canvas/element/send/tdlib_chat.rb +33 -0
  40. data/lib/lib/dialect/canvas/element/send/tdlib_message.rb +38 -0
  41. data/lib/lib/dialect/canvas/mod/send/_Inline_query_result.rb +38 -0
  42. data/lib/lib/dialect/canvas/mod/send/_keyboards.rb +40 -0
  43. data/lib/lib/dialect/canvas/mod/send/func.rb +98 -0
  44. data/lib/lib/dialect/canvas/mod/send/general/_heads.rb +27 -0
  45. data/lib/lib/dialect/canvas/mod/send/general/chat.rb +38 -0
  46. data/lib/lib/dialect/canvas/mod/send/general/common.rb +32 -0
  47. data/lib/lib/dialect/canvas/mod/send/general/message.rb +37 -0
  48. data/lib/lib/dialect/canvas/mod/send/general/user.rb +36 -0
  49. data/lib/lib/dialect/canvas/mod/send/inline_query_result/common.rb +36 -0
  50. data/lib/lib/dialect/codegen/codegen.rb +74 -0
  51. data/lib/lib/dialect/codegen/erb/data/1.ModReceive2GetData.erb +27 -0
  52. data/lib/lib/dialect/codegen/erb/data/2.GetData2Elements.erb +27 -0
  53. data/lib/lib/dialect/codegen/erb/data/3.GenData2Dest.erb +34 -0
  54. data/lib/lib/dialect/codegen/erb/functional/1.Expect2Events.erb +37 -0
  55. data/lib/lib/dialect/codegen/erb/functional/2.1.Events2AppEvent.erb +26 -0
  56. data/lib/lib/dialect/codegen/erb/functional/2.2.1.Events2ModReceive.erb +73 -0
  57. data/lib/lib/dialect/codegen/erb/functional/2.2.2.ModReceive2AppEvent.erb +59 -0
  58. data/lib/lib/dialect/codegen/erb/functional/3.Appevent2EventBus.erb +35 -0
  59. data/lib/lib/dialect/codegen/erb/functional/4.1.AppEvent2Elements.erb +72 -0
  60. data/lib/lib/dialect/codegen/erb/functional/5.1.Element2ModElements.erb +70 -0
  61. data/lib/lib/dialect/codegen/erb/functional/5.2.Element2ModSend.erb +69 -0
  62. data/lib/lib/dialect/codegen/erb/functional/7.ElementChains.erb +91 -0
  63. data/lib/lib/dialect/codegen/repack/constructor/DockedGroupings2AppFunctions.rb +36 -0
  64. data/lib/lib/dialect/codegen/repack/constructor/Element2ModSend.rb +49 -0
  65. data/lib/lib/dialect/codegen/repack/constructor/ElementsInElements.rb +34 -0
  66. data/lib/lib/dialect/codegen/repack/functional/1.Expect2Events.rb +35 -0
  67. data/lib/lib/dialect/codegen/repack/functional/2.2.1.Events2ModReceive.rb +71 -0
  68. data/lib/lib/dialect/codegen/repack/functional/2.2.2.ModReceive2AppEvent.rb +45 -0
  69. data/lib/lib/dialect/codegen/repack/functional/5.1.Element2ModElements.rb +90 -0
  70. data/lib/lib/dialect/codegen/repack/functional/5.2.Element2ModSend.rb +60 -0
  71. data/lib/lib/dialect/codegen/repack/functional/7.ElementChains.rb +88 -0
  72. data/lib/lib/dialect/codegen/run.rb +79 -0
  73. data/lib/lib/metamess/_run.rb +162 -0
  74. data/lib/lib/metamess/content/content_o-command_f.rb +100 -0
  75. data/lib/lib/metamess/content/content_o-media_f.rb +149 -0
  76. data/lib/lib/metamess/content/content_o-simple_f.rb +35 -0
  77. data/lib/lib/metamess/content/content_o.rb +245 -0
  78. data/lib/lib/metamess/event/notify_o-chatmember_f.rb +124 -0
  79. data/lib/lib/metamess/event/notify_o-chattitle_f.rb +34 -0
  80. data/lib/lib/metamess/event/notify_o-create_f.rb +42 -0
  81. data/lib/lib/metamess/event/notify_o-migrate_f.rb +34 -0
  82. data/lib/lib/metamess/event/notify_o-pinned_f.rb +34 -0
  83. data/lib/lib/metamess/event/notify_o.rb +28 -0
  84. data/lib/lib/metamess/event_c.rb +26 -0
  85. data/lib/lib/metamess/func.rb +220 -0
  86. data/lib/lib/metamess/service/service_o-callback_f.rb +33 -0
  87. data/lib/lib/metamess/service/service_o-inline_f.rb +55 -0
  88. data/lib/lib/metamess/service/service_o.rb +26 -0
  89. data/lib/lib/naming.rb +130 -0
  90. data/lib/lib/storage/redis/redisPubSub.rb +51 -0
  91. data/lib/lib/storage/redis/rediscached.rb +97 -0
  92. data/lib/lib/tdlib/auth.rb +141 -0
  93. data/lib/lib/tdlib/func.rb +34 -0
  94. data/lib/lib/tdlib/init.rb +39 -0
  95. data/lib/lib/telegram/botapi.rb +71 -0
  96. data/lib/lib/telegram/infra_info.rb +50 -0
  97. data/lib/lib/telegram/wrappers.rb +41 -0
  98. data/lib/lib/tooling/lang.rb +24 -0
  99. data/lib/lib/tooling/log.rb +54 -0
  100. data/lib/lib/tooling/ruby.rb +25 -0
  101. data/lib/version.rb +3 -0
  102. data/logo.png +0 -0
  103. metadata +305 -0
@@ -0,0 +1,59 @@
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 Generated
14
+ class << self
15
+
16
+ <% args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModReceive2AppEvent][:repack][:parentOID2EID].each do |fOID, fOIDProps|
17
+ defName = "dialog__ModReceive2AppEvent__#{fOID}"%>
18
+
19
+ ## TODO rewrite to case
20
+ def <%= defName %>(args)
21
+ Dialog.logger.debug "### ENTER : <%= defName %>"
22
+ Dialog.logger.debug "### LABELS HAVE : #{args[:x][:labels]}"
23
+
24
+ if args[:x][:labels].is_a?(Hash)
25
+ case args[:x]
26
+ <% fOID = {}
27
+ fOIDProps.each do |fEID, hash_tOID|
28
+ fOIDCondition = ''
29
+ fOIDConditionNum = 0
30
+ fOIDName = ''
31
+ hash_tOID.each do |tOID, prop|
32
+ fOIDCondition == '' ? prefix = '' : prefix = "and"
33
+ fOIDCondition = fOIDCondition + " #{prefix} h[:labels].has_key?(:oid_#{tOID}) "
34
+ fOIDName = prop[:fName]
35
+ fOIDConditionNum += 1
36
+ end
37
+ unless fOIDName == ''
38
+ fOID[fOIDConditionNum] ||= {}
39
+ fOID[fOIDConditionNum][fEID] = fOIDCondition
40
+ end
41
+ end %>
42
+
43
+ <% fOID = fOID.sort.reverse
44
+ fOID.each do |fOIDConditionNum, fEID_hash|
45
+ fEID_hash.each do |fEID, fOIDCondition| %>
46
+ when -> (h) { <%=fOIDCondition %> }
47
+ dialog__Appevent2EventBus__<%= fEID %>(args)
48
+ return
49
+ <% end
50
+ end %>
51
+
52
+ end
53
+ end
54
+ end
55
+ <% end %>
56
+
57
+ end
58
+ end
59
+ 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 Generated
14
+ class << self
15
+
16
+ <% args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Appevent2EventBus][:repack][:tEID].each do |tEID, tOIDProps|%>
17
+ def dialog__Appevent2EventBus__<%= tEID %>(args)
18
+ #just a bus emulation
19
+ # F: <%= tOIDProps[:fName] %> ->> T: <%= tOIDProps[:tName] %>
20
+ <% case tOIDProps[:tFqn]
21
+ when 'DialogArchiAppeventOrder'
22
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:fOID][tOIDProps[:tOID].to_sym].is_a?(Hash)%>
23
+ dialog__AppEvent2Elements__<%= args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:fOID][tOIDProps[:tOID].to_sym][:tOID] %>(args)
24
+ <% else %>
25
+ #no path
26
+ <% end
27
+ when 'DialogArchiAppeventPass'%>
28
+ true
29
+ <% end %>
30
+ end
31
+ <% end %>
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,72 @@
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 Generated
14
+ class << self
15
+
16
+ <% hash_Text = {}
17
+ hash_tFqn = {}
18
+ args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID].each do |tOID, prop|
19
+ defName = "dialog__AppEvent2Elements__#{prop[:tOID]}"%>
20
+ ## '<%= prop[:fName] %>' -> '<%= prop[:tName] %>' + may be more
21
+ def <%= defName %>(args)
22
+ Dialog.logger.debug "### ENTER : <%= defName %>"
23
+ <% hash_Text[prop[:tOID]]= "#{prop[:tDoc]}"
24
+ hash_tFqn[prop[:tFqn]] = 1%>
25
+
26
+ <% if args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:Element2ModSend][:repack][:fFqn2tFqn].has_key?(prop[:tFqn].to_sym)%>
27
+ args[:x][:exec][:<%=prop[:tFqn] %>] = <%= args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:Element2ModSend][:repack][:fFqn2tFqn][prop[:tFqn].to_sym] %>
28
+ args[:x][:exec][:<%=prop[:tFqn] %>][:text] = elementText_<%= prop[:tOID] %>
29
+ <% else %>
30
+ args[:x][:exec][:<%=prop[:tFqn] %>] = {}
31
+ args[:x][:send][:<%=prop[:tFqn] %>] = {}
32
+ <% end %>
33
+ Dialog::ModSend.call_CompileElementFromAtoms(args, <%= prop %>, "<%= viewId %>")
34
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Element2ModElements].is_a?(Hash) %>
35
+ dialog__Element2ModElements__<%= prop[:tOID] %>(args)
36
+ <% end %>
37
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Element2ModSend].is_a?(Hash) %>
38
+ dialog__Element2ModSend__<%= prop[:tOID] %>(args)
39
+ <% end %>
40
+ <% unless prop[:tFqn] == 'DialogElementSendMessageSimple' %>
41
+ Dialog::ElementSend.send_<%=prop[:tFqn] %>(args)
42
+ <% end %>
43
+
44
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains].is_a?(Hash)
45
+ # Dialog.logger.debug "%%%%%%%% #{args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:chain][:order][prop[:tOID]]}"
46
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:chain][:order][prop[:tOID].to_sym]
47
+ run = 'chain'
48
+ else
49
+ run = 'simple'
50
+ end
51
+ else
52
+ run = 'simple'
53
+ end %>
54
+
55
+ #mode = <%=run%>
56
+ <% unless run == 'simple'%>
57
+ dialog__ElementChains__<%= prop[:tOID] %>(args)
58
+ <% end %>
59
+ end
60
+ <% end %>
61
+
62
+ <% hash_Text.each do |tOID, text| %>
63
+ def elementText_<%= tOID %>
64
+ <<-HEREDOC
65
+ <%= text %>
66
+ HEREDOC
67
+ end
68
+ <% end %>
69
+
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,70 @@
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 Generated
14
+ class << self
15
+
16
+ <% def codeGen_ElementChains2ModElements(args, run, viewId)
17
+ a = []
18
+ run.each do |tOID, hash_tOID|
19
+
20
+ base = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Element2ModElements][:repack][:atoms]
21
+
22
+ if base[:keyboards].has_key?(tOID.to_s)
23
+ base[:keyboards].each do |tOID, hash_tOID|
24
+ a << "# #{tOID}"
25
+ a << "def dialog__Element2ModElements__#{tOID}(args)"
26
+ hash_tOID.each do |fFqn, tFqn_hash|
27
+ tFqn_hash.each do |tFqn, keyboardRaw|
28
+ a << "args[:x][:exec][:#{fFqn}][:#{tFqn}] = #{keyboardRaw}"
29
+ end
30
+ end
31
+ a << "end"
32
+ end
33
+
34
+ elsif base[:atoms].has_key?(tOID.to_s)
35
+
36
+ base[:atoms].each do |joinName, hash_tOID|
37
+ # a << "# #{joinName}"
38
+ # a << "def dialog__Element2ModElements__#{joinName}(args)"
39
+ # hash_tOID.each do |tOID, fOID|
40
+ # a << "# fOID - #{tOID}"
41
+ # fOID.each do |tFqn, props|
42
+ # a << "# tFqn - #{tFqn}"
43
+ # a << "Dialog::ModSend.call_CompileElementFromAtoms(args, {fFqn: '#{props[:fFqn]}', tFqn: '#{tFqn}', tProp: #{props[:tProp]}, add: true}, '#{viewId}')"
44
+ # end
45
+ # end
46
+ # a << "end"
47
+ end
48
+ else
49
+ a << "def dialog__Element2ModElements__#{tOID}(args)"
50
+ a << "end"
51
+ end
52
+ end
53
+ return a
54
+ end %>
55
+
56
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements].is_a?(Hash)
57
+ run = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID]
58
+ result = codeGen_ElementChains2ModElements(args, run, viewId) %>
59
+ <%= result.join("\n\n") %>
60
+ <% end%>
61
+
62
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains].is_a?(Hash)
63
+ run = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:tOID]
64
+ result = codeGen_ElementChains2ModElements(args, run, viewId) %>
65
+ <%= result.join("\n\n") %>
66
+ <% end%>
67
+
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,69 @@
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 Generated
14
+ class << self
15
+
16
+ <% def codeGen_ElementChains(args, run, viewId)
17
+ a = []
18
+ run.each do |tOID, hash_tOID|
19
+
20
+ base = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Element2ModSend][:repack][:atoms]
21
+ if base.has_key?(:keyboards)
22
+ if base[:keyboards].has_key?(tOID.to_s)
23
+ base[:keyboards].each do |tOID, hash_tOID|
24
+ a << "# #{tOID}"
25
+ a << "def dialog__Element2ModElements__#{tOID}(args)"
26
+ hash_tOID.each do |fFqn, tFqn_hash|
27
+ tFqn_hash.each do |tFqn, keyboardRaw|
28
+ a << "args[:x][:exec][:#{fFqn}][:#{tFqn}] = #{keyboardRaw}"
29
+ end
30
+ end
31
+ a << "end"
32
+ end
33
+ end
34
+
35
+ elsif base[:atoms].has_key?(tOID.to_s)
36
+
37
+ base[:atoms].each do |joinName, hash_tOID|
38
+ a << "def dialog__Element2ModSend__#{joinName}(args)"
39
+ hash_tOID.each do |tOID, fOID|
40
+ fOID.each do |tFqn, props|
41
+ a << "Dialog::ModSend.call_CompileElementFromAtoms(args, {fFqn: '#{props[:fFqn]}', tFqn: '#{tFqn}', tProp: #{props[:tProp]}, add: true}, '#{viewId}')"
42
+ end
43
+ end
44
+ a << "end"
45
+ # end
46
+ end
47
+ else
48
+ a << "def dialog__Element2ModSend__#{tOID}(args)"
49
+ a << "end"
50
+ end
51
+ end
52
+ return a
53
+ end %>
54
+
55
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements].is_a?(Hash)
56
+ run = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID]
57
+ result = codeGen_ElementChains(args, run, viewId) %>
58
+ <%= result.join("\n\n") %>
59
+ <% end%>
60
+
61
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains].is_a?(Hash)
62
+ run = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:tOID]
63
+ result = codeGen_ElementChains(args, run, viewId) %>
64
+ <%= result.join("\n\n") %>
65
+ <% end%>
66
+
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,91 @@
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 Generated
14
+ class << self
15
+
16
+ <% def codeGen_ElementChains2Chains(args, run, viewId, mode)
17
+ a = []
18
+ hash_Text = {}
19
+ hash_tFqn = {}
20
+ run.each do |xOID, propX|
21
+ if mode == 'tOID'
22
+ chainsRun = true if propX[:tClass] == 'ApplicationFunction'
23
+ else
24
+ chainsRun = true
25
+ end
26
+
27
+ codeGen_ElementChains2ChainsRun(args, viewId, propX, a, hash_Text, hash_tFqn, mode) if chainsRun == true
28
+ end
29
+ hash_Text.each do |tOID, text|
30
+ a << "def elementText_#{tOID}"
31
+ a << " <<-HEREDOC "
32
+ a << " #{text}"
33
+ a << 'HEREDOC'
34
+ a << 'end'
35
+ end
36
+ return a
37
+ end
38
+ %>
39
+
40
+ <% def codeGen_ElementChains2ChainsRun(args, viewId, propX, a, hash_Text, hash_tFqn, mode)
41
+ defName = "dialog__ElementChains__#{propX[:fOID]}"
42
+ a << "## mode:#{mode}, '#{propX[:fName]}' -> '#{propX[:tName]}' + may be more"
43
+ a << "def #{defName}(args)"
44
+ a << " Dialog.logger.debug \"### ENTER : #{defName}\""
45
+ hash_Text[propX[:tOID]]= "#{propX[:tDoc]}"
46
+ hash_tFqn[propX[:tFqn]] = 1
47
+
48
+ if args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:Element2ModSend][:repack][:fFqn2tFqn].has_key?(propX[:tFqn].to_sym)
49
+ a << " args[:x][:exec][:#{propX[:tFqn]}] = #{args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:Element2ModSend][:repack][:fFqn2tFqn][propX[:tFqn].to_sym]}"
50
+ a << " args[:x][:exec][:#{propX[:tFqn]}][:text] = elementText_#{propX[:tOID]}"
51
+ else
52
+ a << " args[:x][:exec][:#{propX[:tFqn]}] = {}"
53
+ a << " args[:x][:send][:#{propX[:tFqn]}] = {}"
54
+ end
55
+
56
+ a << " Dialog::ModSend.call_CompileElementFromAtoms(args, #{propX}, '#{viewId}')"
57
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Element2ModElements].is_a?(Hash)
58
+ a << " dialog__Element2ModElements__#{propX[:tOID]}(args)"
59
+ end
60
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Element2ModSend].is_a?(Hash)
61
+ a << " dialog__Element2ModSend__#{propX[:tOID]}(args)"
62
+ end
63
+ unless propX[:tFqn] == 'DialogElementSendMessageSimple'
64
+ a << " Dialog::ElementSend.send_#{propX[:tFqn]}(args)"
65
+ end
66
+
67
+ args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:chain][:order].each do |k, v|
68
+ if k == propX[:fOID].to_sym
69
+ # #{k, #{v
70
+ a << " dialog__ElementChains__#{propX[:tOID]}(args)"
71
+ end
72
+ end
73
+ a << "end\n\n"
74
+ end
75
+ %>
76
+
77
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains].is_a?(Hash)
78
+ run = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:fOID]
79
+ result = codeGen_ElementChains2Chains(args, run, viewId, 'fOID') %>
80
+ <%= result.join("\n\n") %>
81
+ <% end%>
82
+
83
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains].is_a?(Hash)
84
+ run = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ElementChains][:repack][:tOID]
85
+ result = codeGen_ElementChains2Chains(args, run, viewId, 'tOID') %>
86
+ <%= result.join("\n\n") %>
87
+ <% end%>
88
+
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,36 @@
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_DockedGroupings2AppFunctions(args, name, viewId)
17
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack] ||= {}
18
+ repack_constructors_DockedGroupings2AppFunctions_tEID(args, name, viewId, :tEID)
19
+
20
+ end
21
+
22
+
23
+ def repack_constructors_DockedGroupings2AppFunctions_tEID(args, name, viewId, repackName)
24
+ res = {}
25
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][repackName] ||= {}
26
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:lookup].each do |tName, hash_tNameProp|
27
+ hash_tNameProp.each do |fName, hash_fNameProp|
28
+ res[hash_fNameProp[:tEID]] = hash_fNameProp
29
+ end
30
+ end
31
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][repackName] = res
32
+ end
33
+
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,49 @@
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_constructors_Element2ModSend(args, name, viewId)
18
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack] ||= {}
19
+ repack_constructors_Element2ModSend_fFqn2tFqn(args, name, viewId, :fFqn2tFqn)
20
+ repack_constructors_Element2ModSend_EInE_nores(args, name, viewId, :EInE_nores)
21
+ end
22
+
23
+
24
+ def repack_constructors_Element2ModSend_fFqn2tFqn(args, name, viewId, repackName)
25
+ res = {}
26
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][repackName] ||= {}
27
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:lookup].each do |tName, hash_tNameProp|
28
+ hash_tNameProp.each do |fName, hash_fNameProp|
29
+ res[hash_fNameProp[:fFqn].to_sym] ||= {}
30
+ res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] ||= {}
31
+ res[hash_fNameProp[:fFqn].to_sym][hash_fNameProp[:tFqn].to_sym] = hash_fNameProp[:tProp]
32
+ end
33
+ end
34
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][repackName] = res
35
+ end
36
+
37
+
38
+ def repack_constructors_Element2ModSend_EInE_nores(args, name, viewId, repackName)
39
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][:ElementsInElements][:lookup].each do |tName, hash_tNameProp|
40
+ hash_tNameProp.each do |fName, hash_fNameProp|
41
+
42
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][:fFqn2tFqn][hash_fNameProp[:fFqn].to_sym].merge!(args[:dialect][:constructors][Dialog.config.naming.app.to_sym][name][:repack][:fFqn2tFqn][hash_fNameProp[:tFqn].to_sym])
43
+ end
44
+ end
45
+ end
46
+
47
+ end
48
+ end
49
+ end