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: 0b8d113d1a27b387deff368b6ef1d91a05a0ee29
4
- data.tar.gz: 625209addf53efac89c8e24bef4c6688dbc5eacd
3
+ metadata.gz: b628114d5d75791ab061e91e54dd671775a51adb
4
+ data.tar.gz: e95e22d470c59814979b35f08d973fb1e7423bd9
5
5
  SHA512:
6
- metadata.gz: 7fbe05af1c955833b7aac6c1346f8f154a8da47ed7e0da6b6bd878d74e17eea282dded0a93191ecf4a935bd8dea03c92e887397cc1fa8dcdc2b4fac0189b058e
7
- data.tar.gz: 13f2143dfe2eb83439fcd19b69f139b94e78857a15794a93e7788c10a9efc9fc5b45b2d9a81725279eb8dedbe4f4effcf9bea1e2d64efea84a8f3899138a8c56
6
+ metadata.gz: 57bf24d1e930f9eaa29896841a9b77ff3109dbbd8e1ae148831dff174b8a3ea06ed6317dd7e953fef981d0a66115e9845a52474033fd752fb85a91d0cbecb284
7
+ data.tar.gz: 4d19fff2f09fdc3f539474b74b484d3e8a0c662aeb9193521a5817f8b02cc500781d1dbb0752f54aa38127787cc2adc04e487971a8b51dfa114374fbb9e37bd6
@@ -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'] == ENV['MUMUKI_APPLICATION_NAME']
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: ENV['MUMUKI_APPLICATION_NAME'])
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
 
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Nuntius
3
- VERSION = '2.0.0'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
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.0.0
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-20 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler