mumukit-nuntius 2.0.0 → 2.1.0
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b628114d5d75791ab061e91e54dd671775a51adb
|
4
|
+
data.tar.gz: e95e22d470c59814979b35f08d973fb1e7423bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57bf24d1e930f9eaa29896841a9b77ff3109dbbd8e1ae148831dff174b8a3ea06ed6317dd7e953fef981d0a66115e9845a52474033fd752fb85a91d0cbecb284
|
7
|
+
data.tar.gz: 4d19fff2f09fdc3f539474b74b484d3e8a0c662aeb9193521a5817f8b02cc500781d1dbb0752f54aa38127787cc2adc04e487971a8b51dfa114374fbb9e37bd6
|
data/lib/mumukit/nuntius.rb
CHANGED
@@ -3,10 +3,19 @@ require 'active_support/all'
|
|
3
3
|
require 'bunny'
|
4
4
|
require 'logger'
|
5
5
|
|
6
|
-
|
7
6
|
module Mumukit
|
8
7
|
module Nuntius
|
9
8
|
Logger = ::Logger.new('nuntius.log')
|
9
|
+
|
10
|
+
def self.configure
|
11
|
+
@config ||= OpenStruct.new
|
12
|
+
yield @config
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.config
|
16
|
+
@config
|
17
|
+
end
|
18
|
+
|
10
19
|
end
|
11
20
|
end
|
12
21
|
|
@@ -16,5 +25,4 @@ require 'mumukit/nuntius/channel'
|
|
16
25
|
require 'mumukit/nuntius/publisher'
|
17
26
|
require 'mumukit/nuntius/consumer'
|
18
27
|
require 'mumukit/nuntius/event_consumer'
|
19
|
-
require 'mumukit/nuntius/event_publisher'
|
20
|
-
|
28
|
+
require 'mumukit/nuntius/event_publisher'
|
@@ -4,7 +4,7 @@ module Mumukit::Nuntius::EventConsumer
|
|
4
4
|
|
5
5
|
def start(name)
|
6
6
|
Mumukit::Nuntius::Consumer.start "#{name}-events", 'events' do |_delivery_info, properties, body|
|
7
|
-
next if body['sender'] ==
|
7
|
+
next if body['sender'] == Mumukit::Nuntius.config.app_name
|
8
8
|
begin
|
9
9
|
choose_event(name, properties).execute!(body['data'], body['action'])
|
10
10
|
rescue NoMethodError => e
|
@@ -3,7 +3,7 @@ module Mumukit::Nuntius::EventPublisher
|
|
3
3
|
class << self
|
4
4
|
|
5
5
|
def publish(event, payload, action='')
|
6
|
-
payload.merge!(sender:
|
6
|
+
payload.merge!(sender: Mumukit::Nuntius.config.app_name)
|
7
7
|
Mumukit::Nuntius::Publisher.publish "events", { data: payload, action: action }, { type: event }
|
8
8
|
end
|
9
9
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-nuntius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agustin Pina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|