bbk-app 1.1.2.294476 → 1.1.3.334031

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
  SHA256:
3
- metadata.gz: 48d4c5f17dd7b744178733bf2834f5452bdc6db5d01be68384114e20dff96aa3
4
- data.tar.gz: ac052d0e46715d46a2f092dc5bbd8b8c520ba4b14873bce5c863f9fa8188b66e
3
+ metadata.gz: c2cf194e273e7b90cb1b547aba33d10561b172ec445882c79121d7ced7136c0e
4
+ data.tar.gz: 1539c01f72926b962f0ca84e0a726ea6e2bf1a78d6cb7674755ffdf02cadb27d
5
5
  SHA512:
6
- metadata.gz: 7cd54852700029c10c8e6ca029f371af7f5c3819e63088bb17aa958e6fe48dfc3983d102d3d3bb5ff01595fe189c6c90cf7d592c7072e155a04d2d2ac2cab13b
7
- data.tar.gz: ab80b4799e63cb2510faac6998f50368385c22ff8c072833a7a02128f4ff0d923132b5c60f3c26a877d4de1c77584f70b52d15e83a00971134b0cd035bcbb416
6
+ metadata.gz: 4a46fc8f905a492b112d7975c11243296d267b5c6d03b90914fdd01ae3e9bc9d78612210e64ab554f9b5a0b8ba65ee9180c4862c40ae0cc34614763436255c37
7
+ data.tar.gz: 4d8e0b8283c57392fd8cecf862f9d0961d787522aeea2af22d13d20e4744bf1bd4a3a2280f3430bbf9409a1860da1027e33a364c233435bb6944fbdfc90877b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-app (1.1.2.294476)
4
+ bbk-app (1.1.3.334031)
5
5
  activesupport (>= 6.0)
6
6
  bbk-utils (> 1.0.1)
7
7
  oj
@@ -33,7 +33,7 @@ GEM
33
33
  bbk-utils (1.0.1.147183)
34
34
  activesupport (>= 6.0)
35
35
  russian
36
- bigdecimal (3.1.9)
36
+ bigdecimal (3.3.1)
37
37
  bunny (2.19.0)
38
38
  amq-protocol (~> 2.3, >= 2.3.1)
39
39
  sorted_set (~> 1, >= 1.0.2)
@@ -69,10 +69,10 @@ GEM
69
69
  addressable (~> 2.7)
70
70
  mini_portile2 (2.8.8)
71
71
  minitest (5.15.0)
72
- oj (3.16.10)
72
+ oj (3.16.11)
73
73
  bigdecimal (>= 3.0)
74
74
  ostruct (>= 0.2)
75
- ostruct (0.6.1)
75
+ ostruct (0.6.3)
76
76
  parallel (1.21.0)
77
77
  parser (3.0.3.2)
78
78
  ast (~> 2.4.1)
@@ -40,7 +40,11 @@ module BBK
40
40
  @nacked = true
41
41
  nil
42
42
  end
43
-
43
+
44
+ def metadata
45
+ @metadata = payload.fetch(:metadata, {})
46
+ end
47
+
44
48
  def message_id
45
49
  raise NotImplementedError.new("#{self.class.name} does not implement #{__method__} method")
46
50
  end
@@ -28,7 +28,7 @@ module BBK
28
28
  rule = kwargs
29
29
  kwargs = {}
30
30
  end
31
- raise "rule is not a Hash: #{args.inspect}" unless rule.is_a?(Hash)
31
+ raise "rule is not a Hash: #{args.inspect}" unless rule.is_a?(Hash) || rule.is_a?(Array)
32
32
  else
33
33
  raise "type and rule or method :rule missing: #{args.inspect}"
34
34
  end
@@ -17,7 +17,8 @@ RSpec.shared_examples 'BBK::App::Dispatcher::Message' do
17
17
  }
18
18
  end
19
19
 
20
- let(:body) { JSON.generate(Hash[Random.rand(2..6).times.map { [SecureRandom.hex, SecureRandom.hex] }]) }
20
+ let(:metadata) { {m: 1} }
21
+ let(:body) { JSON.generate(Hash[Random.rand(2..6).times.map { [SecureRandom.hex, SecureRandom.hex] }].merge(metadata:)) }
21
22
  let(:payload) { JSON.parse(body) }
22
23
 
23
24
  describe 'Interface' do
@@ -26,6 +27,7 @@ RSpec.shared_examples 'BBK::App::Dispatcher::Message' do
26
27
  it { is_expected.to respond_to(:headers).with(0).argument }
27
28
  it { is_expected.to respond_to(:body).with(0).argument }
28
29
  it { is_expected.to respond_to(:payload).with(0).argument }
30
+ it { is_expected.to respond_to(:metadata).with(0).argument }
29
31
 
30
32
  it { is_expected.to respond_to(:ack).with_unlimited_arguments.with_keywords(:answer).with_any_keywords }
31
33
  it { is_expected.to respond_to(:nack).with_unlimited_arguments.with_keywords(:error).with_any_keywords }
@@ -46,6 +48,7 @@ RSpec.shared_examples 'BBK::App::Dispatcher::Message' do
46
48
  it { is_expected.to have_attributes(headers: include(headers)) }
47
49
  it { is_expected.to have_attributes(body: body) }
48
50
  it { is_expected.to have_attributes(payload: payload) }
51
+ it { is_expected.to have_attributes(metadata: metadata) }
49
52
 
50
53
  context 'with invalid body' do
51
54
  let(:body) { ']invalid_trash' }
@@ -1,7 +1,7 @@
1
1
  module BBK
2
2
  module App
3
3
 
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.3'
5
5
 
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbk-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2.294476
4
+ version: 1.1.3.334031
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoilenko Yuri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-18 00:00:00.000000000 Z
11
+ date: 2025-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport