dialog_ruby 0.1.1

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.
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,32 @@
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
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+
18
+ def set_DialogModSendGeneralCommonReply_to_message_id(args, fFqn, tFqn, props, viewId)
19
+
20
+ case args[:x][:exec][fFqn][tFqn][:value]
21
+ when '{same}'
22
+ reply_to = args[:mmsg][:fqndata][:o][:msg][:id]
23
+ else
24
+ reply_to = args[:x][:exec][fFqn][tFqn][:value]
25
+ end
26
+ setter(args, fFqn, 'reply_to_message_id', reply_to)
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ #
@@ -0,0 +1,37 @@
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
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+
18
+ def set_DialogModSendGeneralMessageText(args, fFqn, tFqn, props, viewId)
19
+ if args[:x][:exec][fFqn][tFqn][:value].nil?
20
+ text = 'Text placeholder by low-level code'
21
+ else
22
+ # case args[:x][:exec][fFqn][tFqn][:value]
23
+ # when '{funcdoc}'
24
+ text = args[:x][:exec][fFqn][:text]
25
+ # else
26
+ # text = args[:x][:exec][fFqn][tFqn][:value]
27
+ # end
28
+ end
29
+ setter(args, fFqn, 'text', text)
30
+ end
31
+
32
+ ##
33
+
34
+ end
35
+ end
36
+ end
37
+ #
@@ -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
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+
18
+ def set_DialogModSendGeneralUserId(args, fFqn, tFqn, props, viewId)
19
+
20
+ id = args[:x][:exec][fFqn][tFqn][:value]
21
+ case args[:x][:exec][fFqn][tFqn][:value]
22
+ when '{same}'
23
+ chat_id = args[:mmsg][:fqndata][:o][:from][:id]
24
+ when /^[:fqndata]*/
25
+ id = "args[:mmsg]#{id}"
26
+ chat_id = binding.eval("#{id}")
27
+ else
28
+ chat_id = args[:x][:exec][fFqn][tFqn][:value]
29
+ end
30
+ setter(args, fFqn, 'user_id', chat_id)
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ #
@@ -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 Inlines 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
+
13
+ module Dialog
14
+ module ModSend
15
+ class << self
16
+
17
+ def set_DialogModSendInline_query_resultCommon(args, fFqn, tFqn, props, viewId)
18
+ run = "set_#{tFqn}"
19
+ args[:api] = { op: 'answerInlineQuery'}
20
+ #args[:smsg][:inline_query_id] = ??
21
+ send("set_#{tFqn}".to_sym, args, fFqn, tFqn, props, viewId)
22
+ end
23
+
24
+ def set_DialogModSendInline_query_resultCommonId(args, fFqn, tFqn, props, viewId)
25
+ case args[:x][:exec][fFqn][tFqn][:value]
26
+ when '{same}'
27
+ inline_query_id = args[:mmsg][:fqndata][:g][:inline][:id]
28
+ end
29
+ setter(args, fFqn, 'inline_query_id', inline_query_id)
30
+
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ #
@@ -0,0 +1,74 @@
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 makeARepack(args, stage)
17
+ args[:tmp][:stages][stage].each do |runProps|
18
+ if runProps[:repack] == 1
19
+ data = args[:dialect][:perView][Dialog.config.naming.app.to_sym]
20
+ if data.is_a?(Hash)
21
+ data.each do |viewId, viewProps|
22
+ send("repack_#{runProps[:name]}".to_sym, args, runProps[:name], viewId) if data[viewId][runProps[:name]].is_a?(Hash)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ def dialect_repack(args)
30
+
31
+ args[:tmp][:stages][:codegenConstructor].each do |runProps|
32
+ args[:dialect][:constructors][Dialog.config.naming.app.to_sym].each do |viewId, viewProps|
33
+ send("repack_constructors_#{runProps[:name]}".to_sym, args, runProps[:name], viewId)
34
+ end
35
+ end
36
+
37
+ makeARepack(args, :functional)
38
+ makeARepack(args, :data)
39
+
40
+ end
41
+
42
+
43
+
44
+ def makeAErb(args, type, stage)
45
+ FileUtils.mkdir_p("#{Dialog.config.path.render}/code_#{type}/")
46
+
47
+ args[:tmp][:stages][stage].each do |runProps|
48
+ nameSym = runProps[:name].to_sym
49
+ data = args[:dialect][:perView][Dialog.config.naming.app.to_sym]
50
+ if data.is_a?(Hash)
51
+ data.each do |viewId, viewProps|
52
+ if runProps[:erb] == 1 && data[viewId][runProps[:name]].is_a?(Hash)
53
+ Dialog.logger.debug "### erb - #{runProps}"
54
+ fullName = "#{runProps[:order]}_#{runProps[:name]}_#{viewId}"
55
+ fullNameSym = fullName.to_sym
56
+
57
+ tmpl = ERB.new(File.read("#{Dialog.config.path.run}/lib/dialect/codegen/erb/#{stage}/#{runProps[:order]}.#{runProps[:name]}.erb")).result(binding)
58
+ runProps.has_key?(:erb_order) ? rname = "#{runProps[:erb_order]}_#{fullName}" : rname = fullName
59
+ File.open("#{Dialog.config.path.render}/code_#{type}/#{stage}__#{rname}.rb", 'w') do |f| f.write tmpl; end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+
67
+ def dialect_erb(args, type)
68
+ makeAErb(args, type, :functional)
69
+ makeAErb(args, type, :data)
70
+ end
71
+
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,27 @@
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][:ModReceive2GetData][:repack][:tOID].each do |event, nextStep|%>
17
+ def dialog__ModReceive2GetData__<%= event %>(args)
18
+ Dialog.logger.debug "### ENTER ModReceive2GetData__<%= event %>"
19
+
20
+ dialog__GetData2Elements__<%= nextStep[:fOID] %>(args)
21
+
22
+ end
23
+ <% end %>
24
+
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
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][:GetData2Elements][:repack][:fOID].each do |event, nextStep|%>
17
+ def dialog__GetData2Elements__<%= event %>(args)
18
+ Dialog.logger.debug "### ENTER GetData2Elements__<%= event %>"
19
+ args[:x][:dataReqType] = "<%= nextStep[:fName]%>"
20
+ Dialog::ElementData::exec_<%= nextStep[:tFqn] %>(args)
21
+ dialog__GenData2Dest__<%= nextStep[:tOID] %>(args)
22
+ end
23
+ <% end %>
24
+
25
+ end
26
+ end
27
+ end
@@ -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 Generated
14
+ class << self
15
+
16
+ <% args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Results2GenData][:repack][:fOID].each do |fOID, nextStep|%>
17
+ def dialog__GenData2Dest__<%= fOID %>(args)
18
+
19
+ <% dataDst = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:GenData2Dest][:repack][:tOID][nextStep[:tOID].to_sym][:fOID]
20
+ element = args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:AppEvent2Elements][:repack][:tOID][dataDst.to_sym]
21
+ fFqnSplitted = nextStep[:fFqn].to_s.split /(?=[A-Z])/
22
+ tFqnSplitted = element[:tFqn].to_s.split /(?=[A-Z])/
23
+
24
+ fFqnSplitted = "#{fFqnSplitted[3]}#{fFqnSplitted[4]}"
25
+ tFqnSplitted = "#{tFqnSplitted[3]}#{tFqnSplitted[4]}"%>
26
+ Dialog.logger.debug "### ENTER GenData2Dest__<%= fOID %>"
27
+ Dialog::ElementData::<%=fFqnSplitted%>.convert_<%= tFqnSplitted %>(args)
28
+
29
+ end
30
+ <% end %>
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,37 @@
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
+
17
+ <% args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Expect2Events][:repack][:tFqn].each do |event, nextStep|%>
18
+ def get_<%= event %>(args)
19
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2AppEvent].is_a?(Hash)
20
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2AppEvent][:repack][:fOID].has_key?(nextStep[:tOID].to_sym) %>
21
+ dialog__Events2Appevent__<%= args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2AppEvent][:repack][:fOID][nextStep[:tOID].to_sym][:fOID]%>(args)
22
+ <% end
23
+ end%>
24
+
25
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive].is_a?(Hash)
26
+
27
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive][:repack][:fEID2tFqn].has_key?(nextStep[:tEID]) %>
28
+ dialog__Events2ModReceive__<%= args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive][:repack][:fEID][nextStep[:tEID].to_sym][:fOID]%>(args) unless args[:x] == 'done'
29
+ <% end
30
+ end%>
31
+
32
+ end
33
+ <% end %>
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,26 @@
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][:Events2AppEvent][:repack][:fOID].each do |event, eventProps| %>
17
+ def dialog__Events2Appevent__<%= event %>(args)
18
+ # F: <%= eventProps[:fName] %> ->> T: <%= eventProps[:tName] %>
19
+
20
+ dialog__Appevent2EventBus__<%= eventProps[:tEID] %>(args)
21
+ end
22
+ <% end %>
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,73 @@
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
+
17
+ <% args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive][:repack][:fEID2tFqn].each do |fEID, hash_tFqn|
18
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Expect2Events][:repack][:tEID_root].has_key?(fEID)
19
+ getfOID = "#{args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Events2ModReceive][:repack][:fEID][fEID.to_sym][:fOID]}"
20
+ data = {} %>
21
+ def dialog__Events2ModReceive__<%=getfOID%>(args)
22
+
23
+ Dialog.logger.debug "### ENTER : <%= getfOID %>"
24
+
25
+ <% hash_tFqn.each do |tFqn, hash_Scope| %>
26
+
27
+ <% hash_Scope.each do |scope, hash_tOID| %>
28
+
29
+ if /<%= scope%>/.match?('<%= args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:Expect2Events][:repack][:tEID_root][fEID][:root]%>')
30
+ <% hash_tOID.each do |tOID, prop|
31
+
32
+ prop[:tProp][:op] == "=~" ? valuePrefix = "/" : valuePrefix = "\""
33
+ prop[:tProp][:value].to_s === prop[:tProp][:value].to_i.to_s ? value = prop[:tProp][:value] : value = "#{valuePrefix}#{prop[:tProp][:value]}#{valuePrefix}" %>
34
+ ## <%= prop[:tName]%>
35
+ ## <%= prop[:fFqn]%> ->> <%= tFqn%>
36
+ if args[:mmsg][:fqndata]<%= prop[:tProp][:key]%> <%= prop[:tProp][:op]%> <%= value %>
37
+ args[:x][:labels] = {} if args[:x][:labels] == 'next'
38
+ args[:x][:labels][:oid_<%= prop[:tOID]%>] = true
39
+ Dialog.logger.debug "### ADD LABEL: <%= prop[:tProp][:key]%> = #{args[:mmsg][:fqndata]<%= prop[:tProp][:key]%>} <%= prop[:tProp][:op]%> %Q[#{<%= value %>}]"
40
+ <% if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModReceive2GetData].is_a?(Hash)
41
+ if args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModReceive2GetData][:repack][:tOID][tOID.to_sym].is_a?(Hash)
42
+ case args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModReceive2GetData][:repack][:tOID][tOID.to_sym][:fFqn]
43
+ when "#{Dialog.config.naming.app}ArchiGetdataField" %>
44
+ args[:x][:dataReq] = args[:mmsg][:fqndata]<%= prop[:tProp][:key]%>
45
+ <% when "#{Dialog.config.naming.app}ArchiGetdataFixed" %>
46
+ args[:x][:dataReq] = "<%= args[:dialect][:perView][Dialog.config.naming.app.to_sym][viewId][:ModReceive2GetData][:repack][:tOID][tOID.to_sym][:fProp][:data] %>"
47
+ <% end %>
48
+ dialog__ModReceive2GetData__<%=prop[:tOID]%>(args)
49
+ <% end
50
+ end%>
51
+
52
+ end
53
+ <% end %>
54
+ if args[:x][:labels].empty?
55
+ args[:x][:labels] = 'next'
56
+ Dialog.logger.debug "### NO LABEL: TRY NEXT"
57
+ return true
58
+ end
59
+
60
+ else
61
+ Dialog.logger.error "### OUT OF SCOPE ###"
62
+ end
63
+
64
+ <% end %>
65
+ <% end %>
66
+ dialog__ModReceive2AppEvent__<%=getfOID%>(args)
67
+ end
68
+ <% end
69
+ end %>
70
+
71
+ end
72
+ end
73
+ end