kybus-bot 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6027eb3dbf33a839ee3b209eda5c8175a75372a3b03021cf171d07794f9ba1b2
|
4
|
+
data.tar.gz: 1271955a903acbbebecec80eca93302f144bd97ec70b93ad6c2d6171381942a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bee0655c5cc486692a84b0e63cace81b3c0028cd10c88699d486d0e05714acb866f9afc68708b66e1bc3a5c5d94aebc43a04ceb875c99331d7d600faea02d39c
|
7
|
+
data.tar.gz: db7c59187ff02ca0931382d4ad49a9483047dff4ac6c55217aa68ffbcc6c6a9caa5ef4d5416b773e0a51c280e019d6865f359cb70f5689b9b127c6401190e0e7
|
data/lib/kybus/bot/base.rb
CHANGED
@@ -26,6 +26,8 @@ module Kybus
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class Base
|
29
|
+
include Kybus::Logger
|
30
|
+
|
29
31
|
def initialize(bot, configs)
|
30
32
|
@configs = configs
|
31
33
|
@bot = bot
|
@@ -44,6 +46,15 @@ module Kybus
|
|
44
46
|
|
45
47
|
invoke(command, arguments, job_definition, dsl)
|
46
48
|
end
|
49
|
+
|
50
|
+
def handle_job(command, args)
|
51
|
+
job_definition = @command_definition[command]
|
52
|
+
@bot.dsl.instance_eval do
|
53
|
+
@args = args
|
54
|
+
instance_eval(&job_definition.block)
|
55
|
+
end
|
56
|
+
log_info('Job Executed', command:, args:)
|
57
|
+
end
|
47
58
|
end
|
48
59
|
end
|
49
60
|
end
|
@@ -14,7 +14,7 @@ module Kybus
|
|
14
14
|
super
|
15
15
|
@client = LambdaSQSForker.resource(:sqs)
|
16
16
|
@queue = configs['queue']
|
17
|
-
@queue_url = @client.get_queue_url(queue_name: @queue)
|
17
|
+
@queue_url = @client.get_queue_url(queue_name: @queue).queue_url
|
18
18
|
end
|
19
19
|
|
20
20
|
def invoke(command, args, _job_definition, dsl)
|
@@ -28,6 +28,11 @@ module Kybus
|
|
28
28
|
state: dsl.state.to_h
|
29
29
|
}
|
30
30
|
end
|
31
|
+
|
32
|
+
def handle_job(command, args)
|
33
|
+
log_info('Got job from SQS', command:)
|
34
|
+
super
|
35
|
+
end
|
31
36
|
end
|
32
37
|
|
33
38
|
register_forker('sqs', LambdaSQSForker)
|
@@ -4,13 +4,10 @@ module Kybus
|
|
4
4
|
module Bot
|
5
5
|
module Forkers
|
6
6
|
class ThreadForker < Base
|
7
|
-
def invoke(command, args,
|
7
|
+
def invoke(command, args, _job_definition, _dsl)
|
8
8
|
Thread.new do
|
9
|
-
|
10
|
-
|
11
|
-
log_info('Forking job', command:)
|
12
|
-
instance_eval(&job_definition.block)
|
13
|
-
end
|
9
|
+
log_info('Forking job', command:)
|
10
|
+
handle_job(command, args)
|
14
11
|
end
|
15
12
|
end
|
16
13
|
end
|
data/lib/kybus/bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kybus-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilberto Vargas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kybus-core
|