bps-kafka 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bps/publisher/kafka.rb +1 -1
- data/spec/bps/kafka_spec.rb +12 -11
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 332d68ff69826c69b3a32c7d343e7760f6eab8441a2264667138351e189b5a08
|
4
|
+
data.tar.gz: b5f753df0a51c938e2fdf0930d9f233b13fb268c2e1960809f2ffda3fda94fc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a524f30fc1066a99be4e33ac4ada7e4c3ca39c8a705d695589ebfea89d4162b9f0b0e5792150d087b6b28a7fe7de546f13402d62c599acdc27a130295e8f2b9
|
7
|
+
data.tar.gz: f6aded50c6d824e192ce981c36568793714c07b9b19bbb5f9347e424ba22abd1151e7ef927eb6713dc945cfd0d512efdef86b04f204772e56b48f863e52cca4d
|
data/lib/bps/publisher/kafka.rb
CHANGED
data/spec/bps/kafka_spec.rb
CHANGED
@@ -2,33 +2,34 @@ require 'spec_helper'
|
|
2
2
|
require 'bps/kafka'
|
3
3
|
|
4
4
|
RSpec.describe 'Kafka', kafka: true do
|
5
|
-
context '
|
6
|
-
let(:client) {
|
5
|
+
context 'with addr resolving' do
|
6
|
+
let(:client) { instance_double(::Kafka::Client, producer: nil) }
|
7
|
+
|
7
8
|
before { allow(::Kafka).to receive(:new).and_return(client) }
|
8
9
|
|
9
|
-
it '
|
10
|
+
it 'resolves simple URLs' do
|
10
11
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
|
11
|
-
|
12
|
+
allow(::Kafka).to receive(:new).with(['test.host:9092'], {}).and_return(client)
|
12
13
|
else
|
13
|
-
|
14
|
+
allow(::Kafka).to receive(:new).with(['test.host:9092']).and_return(client)
|
14
15
|
end
|
15
16
|
BPS::Publisher.resolve(URI.parse('kafka+sync://test.host:9092'))
|
16
17
|
end
|
17
18
|
|
18
|
-
it '
|
19
|
+
it 'resolves URLs with multiple hosts' do
|
19
20
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
|
20
|
-
|
21
|
+
allow(::Kafka).to receive(:new).with(['foo.host:9092', 'bar.host:9092'], {}).and_return(client)
|
21
22
|
else
|
22
|
-
|
23
|
+
allow(::Kafka).to receive(:new).with(['foo.host:9092', 'bar.host:9092']).and_return(client)
|
23
24
|
end
|
24
25
|
BPS::Publisher.resolve(URI.parse('kafka+sync://foo.host,bar.host:9092'))
|
25
26
|
end
|
26
27
|
|
27
|
-
it '
|
28
|
+
it 'resolves URLs with multiple hosts/ports' do
|
28
29
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
|
29
|
-
|
30
|
+
allow(::Kafka).to receive(:new).with(['foo.host:9093', 'bar.host:9092'], {}).and_return(client)
|
30
31
|
else
|
31
|
-
|
32
|
+
allow(::Kafka).to receive(:new).with(['foo.host:9093', 'bar.host:9092']).and_return(client)
|
32
33
|
end
|
33
34
|
BPS::Publisher.resolve(URI.parse('kafka+sync://foo.host%3A9093,bar.host'))
|
34
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bps-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Black Square Media
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bps
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-kafka
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.1.
|
72
|
+
rubygems_version: 3.1.4
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Kafka adapter for bps
|