farmstead 0.0.77 → 0.0.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/farmstead/pipeline/load.rb +13 -1
- data/lib/farmstead/version.rb +1 -1
- 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: c714a55694953352e059ff37f418f1346d5c1060
|
4
|
+
data.tar.gz: 3244b536dbfd931074fc8b60d33d3a4ec9cdce08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5604ee77300fe7bf5648b22f7765c6b15363a2600816a348661097af237d3c054facb59754663d008dbe84b8091c44d3435cb7ae4ca81b1871508d0c06b0c7c7
|
7
|
+
data.tar.gz: 7e73f8aaa56d2da1b43e086ae6c828fa8b7e67cf26f0764b0d22f9eaa5912ed9aa1b68cdb58b0305ff029f68e7eb7e66da606fab9011676244bf8a0c928aca1f
|
data/Gemfile.lock
CHANGED
@@ -11,6 +11,18 @@ module Farmstead
|
|
11
11
|
module Load
|
12
12
|
class Service < Farmstead::Service
|
13
13
|
def run
|
14
|
+
puts "Received: #{message.value}"
|
15
|
+
# Run the load method of the module referenced by the message
|
16
|
+
message = '{"module_name":"StopandShop","result":"Home - stop and shop"}'
|
17
|
+
obj = JSON.parse(message)
|
18
|
+
project_name = ENV["name"].capitalize
|
19
|
+
module_name = obj["module_name"]
|
20
|
+
my_module = Object.const_get "#{project_name}::#{module_name}"
|
21
|
+
puts obj["result"]
|
22
|
+
my_module::load(obj["result"])
|
23
|
+
end
|
24
|
+
|
25
|
+
def runs
|
14
26
|
@consumer.subscribe("Road")
|
15
27
|
trap('TERM') { @consumer.stop }
|
16
28
|
@consumer.each_message do |message|
|
@@ -21,7 +33,7 @@ module Farmstead
|
|
21
33
|
module_name = obj["module_name"]
|
22
34
|
my_module = Object.const_get "#{project_name}::#{module_name}"
|
23
35
|
puts obj["result"]
|
24
|
-
|
36
|
+
my_module::load(obj["result"])
|
25
37
|
@consumer.mark_message_as_processed(message)
|
26
38
|
end
|
27
39
|
end
|
data/lib/farmstead/version.rb
CHANGED