bi-frost 0.4.0 → 0.4.1

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: f8b9ebfc0c96cc0f16a2bd99f5c4ac62bf2af316
4
- data.tar.gz: f766bfcb594119c63145c848f114973b631bef4d
3
+ metadata.gz: e3473e63e0afb70a565b476a6ff3b8e65ef87f96
4
+ data.tar.gz: df2842a9f4838f55156ea570c0c5a476326ec4bd
5
5
  SHA512:
6
- metadata.gz: 61e070940b3a4cb3f7e5bcd0b44b55ec379b07487ce145a92c765551fc326ab7af97c33faf95c7bdb33a13130ca5ccffbec5c1153fe5d1bb3383e8725937c937
7
- data.tar.gz: 66067c6787062a0e72e7bb0f6bb5da4c45202a8e6aee9dd2b0b5d0bc037c8ad89ea1bf01b10c1b90a0f7459c2d2da7f69840a4d6faeee1c5024201569493b53e
6
+ metadata.gz: 0dfb17e4d710b6e52e70d13ef610878cb3086e2e007cf4549e72f53c381ff5f0e94109275d500a0ceefe60d4703e00cdb0e5a6ce52794a6c06887321a2816b6e
7
+ data.tar.gz: db30185a5cab2f29980fc8d59575207bd81df1887d66847013396b323c787e2088d3710597da7c6c20012ce337df5b2881688d96036eaaa9c8351eecf43d4e4b
@@ -7,8 +7,8 @@ module Bifrost
7
7
  class Message < Entity
8
8
  attr_reader :meta, :body, :status, :message_id
9
9
 
10
- alias_method :resource_id, :message_id
11
- alias_method :id, :message_id
10
+ alias resource_id message_id
11
+ alias id message_id
12
12
 
13
13
  # A message must have a valid subject and body. The service
14
14
  # bus is initialised in the Entity class
@@ -9,7 +9,7 @@ module Bifrost
9
9
 
10
10
  # The patch version of Bifrost, updated only for bug fixes from the last
11
11
  # feature release.
12
- PATCH_VERSION = 0
12
+ PATCH_VERSION = 1
13
13
 
14
14
  # The full version as a string.
15
15
  VERSION = "#{MAJOR_VERSION}.#{MINOR_VERSION}.#{PATCH_VERSION}".freeze
@@ -57,15 +57,14 @@ module Bifrost
57
57
 
58
58
  # Actual processing of the message
59
59
  def read_message
60
- byebug
61
60
  raw_message = @bus.interface.receive_subscription_message(topic, subscriber, timeout: ENV['TIMEOUT'] || 10)
62
61
  if raw_message
63
62
  info("Worker #{self} picked up message #{raw_message}") if Bifrost.debug?
64
63
  message = Bifrost::Message.new(raw_message)
65
64
  callback.call(message)
66
65
  @bus.interface.delete_subscription_message(raw_message)
67
- else
68
- info("Worker #{self} no message...") if Bifrost.debug?
66
+ elsif Bifrost.debug?
67
+ info("Worker #{self} no message...")
69
68
  end
70
69
  end
71
70
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'bifrost'
3
3
 
4
4
  describe Bifrost::Message do
5
- subject(:message) { Bifrost::Message.new({ content: 'some data' }, { app_name: 'bifrost' }) }
5
+ subject(:message) { Bifrost::Message.new({ content: 'some data' }, app_name: 'bifrost') }
6
6
 
7
7
  it { is_expected.to respond_to(:meta) }
8
8
  it { is_expected.to respond_to(:status) }
@@ -32,7 +32,7 @@ describe Bifrost::Message do
32
32
  topic = Bifrost::Topic.new('valid-topic')
33
33
  topic.save
34
34
  topic.add_subscriber(Bifrost::Subscriber.new('new_subscriber'))
35
- msg = Bifrost::Message.new(1, { app_name: 'bifrost' })
35
+ msg = Bifrost::Message.new(1, app_name: 'bifrost')
36
36
  expect(msg.publish(topic)).to be_truthy
37
37
  end
38
38
 
@@ -41,7 +41,6 @@ describe Bifrost::Topic do
41
41
  end
42
42
 
43
43
  context 'for an undefined topic' do
44
-
45
44
  describe 'save' do
46
45
  it 'should persist the topic and return a binary value' do
47
46
  new_topic = Bifrost::Topic.new('new_topic_name')
@@ -31,7 +31,7 @@ describe Bifrost::Worker do
31
31
  topic.save
32
32
  subscriber = Bifrost::Subscriber.new('subscriber')
33
33
  topic.add_subscriber(subscriber)
34
- msg = Bifrost::Message.new([item1: { data: 2 }, item2: { more_data: 3 }], { app_name: 'bifrost' })
34
+ msg = Bifrost::Message.new([item1: { data: 2 }, item2: { more_data: 3 }], app_name: 'bifrost')
35
35
  msg.publish(topic)
36
36
  expect(msg.status).to eq(:delivered)
37
37
  expect(msg.message_id).not_to be_nil
data/spec/spec_helper.rb CHANGED
@@ -14,7 +14,6 @@ SimpleCov.start do
14
14
  end
15
15
 
16
16
  RSpec.configure do |config|
17
-
18
17
  # All specs use this pre-defined namespace in Azure
19
18
  Azure.sb_namespace = ENV['AZURE_BUS_NAMESPACE']
20
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bi-frost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shirren Premaratne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-22 00:00:00.000000000 Z
11
+ date: 2016-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure