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,39 @@
|
|
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 TDLib
|
14
|
+
class << self
|
15
|
+
|
16
|
+
def tdlibInit(name)
|
17
|
+
|
18
|
+
FileUtils.mkdir_p("#{Dialog.config.path.data}/tdlib/#{name}")
|
19
|
+
config = {
|
20
|
+
api_id: Dialog.config.api.id,
|
21
|
+
api_hash: Dialog.config.api.hash_s,
|
22
|
+
device_model: Dialog.config.naming.app,
|
23
|
+
database_directory: "#{Dialog.config.path.data}/tdlib/#{name}",
|
24
|
+
files_directory: "#{Dialog.config.path.data}/tdlib/#{name}",
|
25
|
+
}
|
26
|
+
|
27
|
+
TD.configure do |config|
|
28
|
+
config.lib_path = '/usr/lib64'
|
29
|
+
end
|
30
|
+
|
31
|
+
TD::Api.set_log_verbosity_level(Dialog.config.log.tdlib)
|
32
|
+
handler = TD::Client.new(**config)
|
33
|
+
|
34
|
+
return handler
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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
|
+
|
13
|
+
module Dialog
|
14
|
+
module BotApi
|
15
|
+
class << self
|
16
|
+
|
17
|
+
def apiActionGet(args)
|
18
|
+
args[:api][:op] = "get#{args[:api][:op]}"
|
19
|
+
a = apiAction(args)
|
20
|
+
return a
|
21
|
+
end
|
22
|
+
|
23
|
+
def apiActionSend(args)
|
24
|
+
args[:api][:op] = "send#{args[:api][:op]}"
|
25
|
+
a = apiAction(args)
|
26
|
+
return a
|
27
|
+
end
|
28
|
+
|
29
|
+
def apiAction(args)
|
30
|
+
args[:perf][:preApiAction] = Time.now
|
31
|
+
op = args[:api][:op]
|
32
|
+
Dialog.logger.debug "Operation #{op}: #{args[:smsg]}\n"
|
33
|
+
a = args[:bot].api.send("#{op}".to_sym, args[:smsg])
|
34
|
+
Dialog.logger.debug "API Answer - #{a}"
|
35
|
+
|
36
|
+
if a["ok"] == true
|
37
|
+
return a
|
38
|
+
else
|
39
|
+
Dialog.logger.info "ERROR in bot.api interaction #{"#{op}".to_sym}, msg: #{args[:smsg]}"
|
40
|
+
end
|
41
|
+
args[:smsg] = {}
|
42
|
+
args[:api] = {}
|
43
|
+
args[:x] = {}
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def socks5_connection
|
48
|
+
require 'telegram/bot/adapters/socks5'
|
49
|
+
|
50
|
+
host = "https://#{Dialog.config.proxy.host}:#{Dialog.config.proxy.port}"
|
51
|
+
proxy_opts = {
|
52
|
+
uri: URI.parse(host),
|
53
|
+
user: Dialog.config.proxy.login,
|
54
|
+
password: Dialog.config.proxy.pass,
|
55
|
+
socks: true
|
56
|
+
}
|
57
|
+
|
58
|
+
c = Faraday.new(url: Dialog.config.host.apiUri,
|
59
|
+
ssl: {verify:false},
|
60
|
+
request: { proxy: proxy_opts }) do |c|
|
61
|
+
c.request :multipart
|
62
|
+
c.request :url_encoded
|
63
|
+
Faraday::Adapter.register_middleware socks5: Telegram::Bot::Adapters::Socks5
|
64
|
+
c.adapter :socks5
|
65
|
+
end
|
66
|
+
return c
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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 BotApi
|
15
|
+
class << self
|
16
|
+
|
17
|
+
def runMetacommand__info(args)
|
18
|
+
|
19
|
+
if args[:mmsg][:reply] == nil
|
20
|
+
args[:smsg][:text] = "О чём именно вам дать информацию?\n Отметьте объект с помощью 'Reply' и отправьте ему сообщение '_info' или '_инфо'\n"
|
21
|
+
Bot::BotApi.new.apiActionSend(args)
|
22
|
+
else
|
23
|
+
text = "Информация об объекте:\n\n"
|
24
|
+
text = text + "Как-то раз (а именно, <b>#{DateTime.strptime(args[:mmsg][:reply][:mmsg][:date].to_s,'%s')}</b>) \n"
|
25
|
+
text = text + "пользователь <b>#{args[:mmsg][:reply][:mmsg][:username]}</b> с ID <b>#{args[:mmsg][:reply][:mmsg][:user_id]}</b> \n"
|
26
|
+
text = text + "отправил сообщение с ID \"<b>#{args[:mmsg][:reply][:mmsg][:message_id]}</b>\"\n"
|
27
|
+
text = text + "в чат контекста \"<b>#{args[:mmsg][:reply][:mmsg][:chat_context]}</b>\" под названием \"<b>#{args[:mmsg][:reply][:mmsg][:chat_title]}</b>\" с ID \"<b>#{args[:mmsg][:reply][:mmsg][:chat_id]}</b>\"\n"
|
28
|
+
text = text + "(на самом деле, это был forward сообщения пользователя <b>#{args[:mmsg][:reply][:mmsg][:forward][:from][:username]}</b> с ID <b>#{args[:mmsg][:reply][:mmsg][:forward][:from][:user_id]}</b> от <b>#{DateTime.strptime(args[:mmsg][:reply][:mmsg][:forward][:date].to_s,'%s')}</b>\n" if ! args[:mmsg][:reply][:mmsg][:forward].nil?
|
29
|
+
text = text + "Сообщение было отредактировано <b>#{DateTime.strptime(args[:mmsg][:reply][:mmsg][:edit][:date].to_s,'%s')}</b>\n" if ! args[:mmsg][:reply][:mmsg][:edit].nil?
|
30
|
+
text = text + "\nДополнительная информация:\n"
|
31
|
+
text = text + "Order(Порядок): \"<b>#{args[:mmsg][:reply][:mmsg][:_order]}</b>\"\n"
|
32
|
+
text = text + "Family(Семейство): \"<b>#{args[:mmsg][:reply][:mmsg][:_family]}</b>\"\n"
|
33
|
+
|
34
|
+
if args[:mmsg][:reply][:mmsg][:_order] == Bot::Naming::Class::Message::Order.Media
|
35
|
+
text = text + "ID файла: \"<b>#{args[:mmsg][:reply][:mmsg][:media][:file_id]}</b>\"\n"
|
36
|
+
text = text + "Название файла: \"<b>#{args[:mmsg][:reply][:mmsg][:media][:file_name]}</b>\"\n" if ! args[:mmsg][:reply][:mmsg][:media][:file_name].nil?
|
37
|
+
text = text + "MIME-тип: \"<b>#{args[:mmsg][:reply][:mmsg][:media][:mime_type]}</b>\"\n" if ! args[:mmsg][:reply][:mmsg][:media][:mime_type].nil?
|
38
|
+
text = text + "Размер файла: \"<b>#{args[:mmsg][:reply][:mmsg][:media][:file_size]} байта</b>\"\n"
|
39
|
+
text = text + "Описание к #{args[:mmsg][:reply][:mmsg][:_family]} : \"<b>#{args[:mmsg][:reply][:mmsg][:media][:caption]}</b>\n" if ! args[:mmsg][:reply][:mmsg][:media][:caption] == nil
|
40
|
+
end
|
41
|
+
args[:smsg][:text] = text
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
#
|
50
|
+
|
@@ -0,0 +1,41 @@
|
|
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 Wrappers
|
15
|
+
class << self
|
16
|
+
|
17
|
+
def apiGetFilePath(file_id)
|
18
|
+
c = Dialog::BotApi.socks5_connection
|
19
|
+
url="/bot#{Dialog.config.secure.token}/getFile?file_id=#{file_id}"
|
20
|
+
response = c.get url
|
21
|
+
response_json = JSON.parse response.body
|
22
|
+
file_path=response_json["result"]["file_path"]
|
23
|
+
return file_path
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
def downloadFile(args)
|
28
|
+
file = args[:mmsg][:fqndata][:f][:file]
|
29
|
+
FileUtils.mkdir_p("#{Dialog.config.path.render}/_tmpfiles/")
|
30
|
+
c = Dialog::BotApi.socks5_connection
|
31
|
+
url_file="/file/bot#{Dialog.config.secure.token}/#{file[:path]}"
|
32
|
+
response = c.get url_file
|
33
|
+
file.has_key?(:name) ? name = file[:name] : name = file[:path].split('/')[1]
|
34
|
+
File.open("#{Dialog.config.path.render}/_tmpfiles/#{name}", 'wb') { |fp| fp.write(response.body) }
|
35
|
+
return name
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,24 @@
|
|
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 Lang
|
14
|
+
class << self
|
15
|
+
|
16
|
+
def initial
|
17
|
+
I18n.load_path = Dir["#{Dialog.config.path.run}/lang/*.yml"]
|
18
|
+
I18n.default_locale = :ru
|
19
|
+
I18n.backend.load_translations
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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
|
+
|
15
|
+
def self.logger
|
16
|
+
@logger ||= Log.new(Dialog.config.log.base)
|
17
|
+
end
|
18
|
+
|
19
|
+
class Log
|
20
|
+
|
21
|
+
def initialize(debug_level)
|
22
|
+
@logger ||= Logger.new(STDERR)
|
23
|
+
@logger.datetime_format = "sec: %S.%6N"
|
24
|
+
@logger.formatter = proc do |severity, datetime, progname, msg|
|
25
|
+
"#{msg}\n"
|
26
|
+
end
|
27
|
+
|
28
|
+
@logger.info 'Logger started'
|
29
|
+
@debug_level = debug_level
|
30
|
+
end
|
31
|
+
|
32
|
+
def catch(message)
|
33
|
+
@logger.debug "\033[33m#{message}\033[0m" if [:debug].include? @debug_level.to_sym
|
34
|
+
end
|
35
|
+
|
36
|
+
def debug(message)
|
37
|
+
@logger.debug "\033[32m#{message}\033[0m" if [:debug].include? @debug_level.to_sym
|
38
|
+
end
|
39
|
+
|
40
|
+
def info(message)
|
41
|
+
@logger.info "\033[36m#{message}\033[0m" if [:info, :debug].include? @debug_level.to_sym
|
42
|
+
end
|
43
|
+
|
44
|
+
def warn(message)
|
45
|
+
@logger.warn "\033[35m#{message}\033[0m" if [:warn, :info, :debug].include? @debug_level.to_sym
|
46
|
+
end
|
47
|
+
|
48
|
+
def error(message)
|
49
|
+
@logger.error "\033[31m#{message}\033[0m" if [:error, :warn, :info, :debug].include? @debug_level.to_sym
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,25 @@
|
|
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
|
+
class Hash
|
13
|
+
def diff(other)
|
14
|
+
(self.keys + other.keys).uniq.inject({}) do |memo, key|
|
15
|
+
unless self[key] == other[key]
|
16
|
+
if self[key].kind_of?(Hash) && other[key].kind_of?(Hash)
|
17
|
+
memo[key] = self[key].diff(other[key])
|
18
|
+
else
|
19
|
+
memo[key] = [self[key], other[key]]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
memo
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/version.rb
ADDED
data/logo.png
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,305 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dialog_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eugene Istomin
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dialect_lookup
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.0.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.0.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: dialog_bot_ruby
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: tdlib-ruby
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: i18n
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: redis
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: concurrent
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: oj
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: erb
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: open3
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :runtime
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: sidekiq-cron
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
type: :runtime
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: sidekiq-rate-limiter
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :runtime
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "~>"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
description: Communication prototyping platform
|
174
|
+
email:
|
175
|
+
- info@innosense.org
|
176
|
+
executables: []
|
177
|
+
extensions: []
|
178
|
+
extra_rdoc_files: []
|
179
|
+
files:
|
180
|
+
- ".gitignore"
|
181
|
+
- Gemfile
|
182
|
+
- _dev/get_full_botapi.rb
|
183
|
+
- _dev/inlinekb_pubsub.rb
|
184
|
+
- _dev/main.rb
|
185
|
+
- _dev/restriction.rb
|
186
|
+
- _dev/ru.yml
|
187
|
+
- _dev/sidekiq.rb
|
188
|
+
- _dev/tdlib.rb
|
189
|
+
- dialog.sh
|
190
|
+
- dialog_ruby.gemspec
|
191
|
+
- lib/architecture.md
|
192
|
+
- lib/configuration.rb
|
193
|
+
- lib/dialogStart.rb
|
194
|
+
- lib/dialog_ruby.rb
|
195
|
+
- lib/exec.sh
|
196
|
+
- lib/exec_conf/cli_config
|
197
|
+
- lib/exec_conf/dialog__sync.service
|
198
|
+
- lib/exec_conf/dialog__sync.timer
|
199
|
+
- lib/exec_conf/dialog_bot@.path
|
200
|
+
- lib/exec_conf/dialog_bot@.service
|
201
|
+
- lib/exec_conf/dialog_bot_dev@.path
|
202
|
+
- lib/exec_conf/dialog_bot_dev_pre@.service
|
203
|
+
- lib/exec_conf/dialog_bot_pre@.service
|
204
|
+
- lib/exec_conf/dialog_redis@.service
|
205
|
+
- lib/exec_conf/post-merge
|
206
|
+
- lib/exec_conf/redis_global.conf
|
207
|
+
- lib/exec_conf/redis_local.conf
|
208
|
+
- lib/lang/global_ru.yml
|
209
|
+
- lib/lib/dialect/canvas/canvas.rb
|
210
|
+
- lib/lib/dialect/canvas/element/convert/SearchBaloo.rb
|
211
|
+
- lib/lib/dialect/canvas/element/data/search.rb
|
212
|
+
- lib/lib/dialect/canvas/element/send/Inline_query_result.rb
|
213
|
+
- lib/lib/dialect/canvas/element/send/bot_message.rb
|
214
|
+
- lib/lib/dialect/canvas/element/send/keyboards.rb
|
215
|
+
- lib/lib/dialect/canvas/element/send/recognize.rb
|
216
|
+
- lib/lib/dialect/canvas/element/send/restrict.rb
|
217
|
+
- lib/lib/dialect/canvas/element/send/tdlib_chat.rb
|
218
|
+
- lib/lib/dialect/canvas/element/send/tdlib_message.rb
|
219
|
+
- lib/lib/dialect/canvas/mod/send/_Inline_query_result.rb
|
220
|
+
- lib/lib/dialect/canvas/mod/send/_keyboards.rb
|
221
|
+
- lib/lib/dialect/canvas/mod/send/func.rb
|
222
|
+
- lib/lib/dialect/canvas/mod/send/general/_heads.rb
|
223
|
+
- lib/lib/dialect/canvas/mod/send/general/chat.rb
|
224
|
+
- lib/lib/dialect/canvas/mod/send/general/common.rb
|
225
|
+
- lib/lib/dialect/canvas/mod/send/general/message.rb
|
226
|
+
- lib/lib/dialect/canvas/mod/send/general/user.rb
|
227
|
+
- lib/lib/dialect/canvas/mod/send/inline_query_result/common.rb
|
228
|
+
- lib/lib/dialect/codegen/codegen.rb
|
229
|
+
- lib/lib/dialect/codegen/erb/data/1.ModReceive2GetData.erb
|
230
|
+
- lib/lib/dialect/codegen/erb/data/2.GetData2Elements.erb
|
231
|
+
- lib/lib/dialect/codegen/erb/data/3.GenData2Dest.erb
|
232
|
+
- lib/lib/dialect/codegen/erb/functional/1.Expect2Events.erb
|
233
|
+
- lib/lib/dialect/codegen/erb/functional/2.1.Events2AppEvent.erb
|
234
|
+
- lib/lib/dialect/codegen/erb/functional/2.2.1.Events2ModReceive.erb
|
235
|
+
- lib/lib/dialect/codegen/erb/functional/2.2.2.ModReceive2AppEvent.erb
|
236
|
+
- lib/lib/dialect/codegen/erb/functional/3.Appevent2EventBus.erb
|
237
|
+
- lib/lib/dialect/codegen/erb/functional/4.1.AppEvent2Elements.erb
|
238
|
+
- lib/lib/dialect/codegen/erb/functional/5.1.Element2ModElements.erb
|
239
|
+
- lib/lib/dialect/codegen/erb/functional/5.2.Element2ModSend.erb
|
240
|
+
- lib/lib/dialect/codegen/erb/functional/7.ElementChains.erb
|
241
|
+
- lib/lib/dialect/codegen/repack/constructor/DockedGroupings2AppFunctions.rb
|
242
|
+
- lib/lib/dialect/codegen/repack/constructor/Element2ModSend.rb
|
243
|
+
- lib/lib/dialect/codegen/repack/constructor/ElementsInElements.rb
|
244
|
+
- lib/lib/dialect/codegen/repack/functional/1.Expect2Events.rb
|
245
|
+
- lib/lib/dialect/codegen/repack/functional/2.2.1.Events2ModReceive.rb
|
246
|
+
- lib/lib/dialect/codegen/repack/functional/2.2.2.ModReceive2AppEvent.rb
|
247
|
+
- lib/lib/dialect/codegen/repack/functional/5.1.Element2ModElements.rb
|
248
|
+
- lib/lib/dialect/codegen/repack/functional/5.2.Element2ModSend.rb
|
249
|
+
- lib/lib/dialect/codegen/repack/functional/7.ElementChains.rb
|
250
|
+
- lib/lib/dialect/codegen/run.rb
|
251
|
+
- lib/lib/metamess/_run.rb
|
252
|
+
- lib/lib/metamess/content/content_o-command_f.rb
|
253
|
+
- lib/lib/metamess/content/content_o-media_f.rb
|
254
|
+
- lib/lib/metamess/content/content_o-simple_f.rb
|
255
|
+
- lib/lib/metamess/content/content_o.rb
|
256
|
+
- lib/lib/metamess/event/notify_o-chatmember_f.rb
|
257
|
+
- lib/lib/metamess/event/notify_o-chattitle_f.rb
|
258
|
+
- lib/lib/metamess/event/notify_o-create_f.rb
|
259
|
+
- lib/lib/metamess/event/notify_o-migrate_f.rb
|
260
|
+
- lib/lib/metamess/event/notify_o-pinned_f.rb
|
261
|
+
- lib/lib/metamess/event/notify_o.rb
|
262
|
+
- lib/lib/metamess/event_c.rb
|
263
|
+
- lib/lib/metamess/func.rb
|
264
|
+
- lib/lib/metamess/service/service_o-callback_f.rb
|
265
|
+
- lib/lib/metamess/service/service_o-inline_f.rb
|
266
|
+
- lib/lib/metamess/service/service_o.rb
|
267
|
+
- lib/lib/naming.rb
|
268
|
+
- lib/lib/storage/redis/redisPubSub.rb
|
269
|
+
- lib/lib/storage/redis/rediscached.rb
|
270
|
+
- lib/lib/tdlib/auth.rb
|
271
|
+
- lib/lib/tdlib/func.rb
|
272
|
+
- lib/lib/tdlib/init.rb
|
273
|
+
- lib/lib/telegram/botapi.rb
|
274
|
+
- lib/lib/telegram/infra_info.rb
|
275
|
+
- lib/lib/telegram/wrappers.rb
|
276
|
+
- lib/lib/tooling/lang.rb
|
277
|
+
- lib/lib/tooling/log.rb
|
278
|
+
- lib/lib/tooling/ruby.rb
|
279
|
+
- lib/version.rb
|
280
|
+
- logo.png
|
281
|
+
homepage: https://gitlab.com/Innosense/MVP/dialog_ruby
|
282
|
+
licenses:
|
283
|
+
- CC-BY-SA-4.0
|
284
|
+
metadata: {}
|
285
|
+
post_install_message:
|
286
|
+
rdoc_options: []
|
287
|
+
require_paths:
|
288
|
+
- lib
|
289
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
290
|
+
requirements:
|
291
|
+
- - ">="
|
292
|
+
- !ruby/object:Gem::Version
|
293
|
+
version: '0'
|
294
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
295
|
+
requirements:
|
296
|
+
- - ">="
|
297
|
+
- !ruby/object:Gem::Version
|
298
|
+
version: '0'
|
299
|
+
requirements: []
|
300
|
+
rubyforge_project:
|
301
|
+
rubygems_version: 2.7.3
|
302
|
+
signing_key:
|
303
|
+
specification_version: 4
|
304
|
+
summary: Communication prototyping platform
|
305
|
+
test_files: []
|