nutella_framework 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/framework_components/logging_bot/logging_bot.rb +21 -8
- data/framework_components/logging_bot/utils.rb +4 -0
- data/nutella_framework.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 985ac203f45bd24c45a2dab80cadc5d35676c34d
|
4
|
+
data.tar.gz: 59a84923426a3c5220b3b40d23e11992ea25ebf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fca36e102b895e0dec892735adfef105656ca15de2a96fe75e0619dfad0024eb51ee12752f71441e76ad27c4496cdb477a52bab1506640a24de67cc84166fb8
|
7
|
+
data.tar.gz: d5df41d38bdb0027e810d04d98046de35aaf01aff200e6dea060742237ed1c3ebc6a1db11ee16d5b767804ee1621cea925e82b75a40a8c4780ff564bdea3e3ba
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
@@ -21,22 +21,35 @@ require_relative 'utils'
|
|
21
21
|
nutella.f.init(Nutella.config['broker'], 'example_framework_bot')
|
22
22
|
|
23
23
|
# Get a mongo persisted collection
|
24
|
-
|
24
|
+
logs = nutella.f.persist.get_mongo_collection_store 'logs'
|
25
|
+
dump = nutella.f.persist.get_mongo_collection_store 'dump'
|
25
26
|
|
26
27
|
|
27
28
|
# Listen for run-level log messages
|
28
29
|
nutella.f.net.subscribe_to_all_runs('logging', lambda do |payload, app_id, run_id, from|
|
29
|
-
|
30
|
-
|
30
|
+
logs.push assemble_log(payload, from)
|
31
|
+
end)
|
32
|
+
|
31
33
|
# Listen for app-level log messages
|
32
34
|
nutella.f.net.subscribe_to_all_apps('logging', lambda do |payload, app_id, from|
|
33
|
-
|
34
|
-
|
35
|
+
logs.push assemble_log(payload, from)
|
36
|
+
end)
|
37
|
+
|
35
38
|
# Listen for framework-level log messages
|
36
39
|
nutella.f.net.subscribe('logging', lambda do |payload, from|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
+
logs.push assemble_log(payload, from)
|
41
|
+
end)
|
42
|
+
|
43
|
+
|
44
|
+
# Listen for low-level messages that are archived in the 'dump' collection
|
45
|
+
bare_mqtt_client = SimpleMQTTClient.new Nutella.config['broker']
|
46
|
+
bare_mqtt_client.subscribe('/nutella/#', lambda do |message, channel|
|
47
|
+
begin
|
48
|
+
dump.push assemble_dump(JSON.parse(message), channel)
|
49
|
+
rescue
|
50
|
+
# Ignore non JSON
|
51
|
+
end
|
52
|
+
end)
|
40
53
|
|
41
54
|
# Listen and process messages as they come
|
42
55
|
nutella.f.net.listen
|
data/nutella_framework.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: nutella_framework 0.4.
|
5
|
+
# stub: nutella_framework 0.4.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "nutella_framework"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|