rafka 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af039ada3c68e5b6a3478a84942b344bc9a229f0
4
- data.tar.gz: 6f0e9cc0c464b83e0661cd868f4c3d94f00217cb
3
+ metadata.gz: fc549dedd6c527810e287f92bb95f57e001addb4
4
+ data.tar.gz: c1a4cf7b486392968cf7982b35cccfe81e87536c
5
5
  SHA512:
6
- metadata.gz: '0817ecf06bf5fbd36852f19d98b317ecf56aa9cf3e052db3bd75e22174c609b3be2541f145dccbc6640e82ebb7247245b75d24561ddfd27e3a1d2c05f4f746a8'
7
- data.tar.gz: 40bff0316776a450b8e77b5c4cce5364d9fe93cd237cc7ae9c296e198470908616cdba392dbb5aa9dd093eaeeae3096017614f2037adf98bbdeff77a7406aa18
6
+ metadata.gz: e2d45712221fca6e7ff0f24a0990678cb93faf26bf7a78713180185fd21e53ae9f159a2a4998acd87c8b78c87fe09475f8c666d1f015e7396aa37f93e025306b
7
+ data.tar.gz: 0d27ecd0e1de49a8e91680f0d50440c686a71c46bd57e58d2cb4c35440c9dd6795767bded90323c33eefe0fcefaf5d492def24f1c9be3498319f56a4612d9a78
data/CHANGELOG.md CHANGED
@@ -4,12 +4,17 @@ Breaking changes are prefixed with a "[BREAKING]" label.
4
4
 
5
5
  ## master (unreleased)
6
6
 
7
+ ## 0.2.3 (2018-05-07)
8
+
9
+ ### Fixed
10
+
11
+ - `Consumer#consume` could yield a nil message to the block it received [[0ded948](https://github.com/skroutz/rafka-rb/commit/0ded94821b21d590a6cdf1314f85da56b48a9c40)]
7
12
 
8
13
  ## 0.2.2 (2018-05-04)
9
14
 
10
15
  ### Fixed
11
16
 
12
- - SETNAME was incorrectly called more than once in batch mode [[3416d7](https://github.com/skroutz/rafka-rb/commit/3416d7bbd9f9e36b4e4d7f87f1e51ba2f559caf2))
17
+ - SETNAME was incorrectly called more than once in batch mode [[3416d7](https://github.com/skroutz/rafka-rb/commit/3416d7bbd9f9e36b4e4d7f87f1e51ba2f559caf2)]
13
18
 
14
19
  ## 0.2.1 (2018-05-04)
15
20
 
@@ -76,12 +76,12 @@ module Rafka
76
76
  end
77
77
 
78
78
  raised = false
79
+ msg = consume_one(timeout)
80
+
81
+ return nil if !msg
79
82
 
80
83
  begin
81
- msg = consume_one(timeout)
82
84
  yield(msg) if block_given?
83
-
84
- return nil if !msg
85
85
  rescue => e
86
86
  raised = true
87
87
  raise e
data/lib/rafka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rafka
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.2.3".freeze
3
3
  end
@@ -42,4 +42,16 @@ class ConsumerTest < Minitest::Test
42
42
 
43
43
  assert_equal(consumer.send(:prepare_for_commit), {})
44
44
  end
45
+
46
+ def test_consume_block_no_message
47
+ cons = Rafka::Consumer.new(group: "foo", topic: "bar")
48
+
49
+ def cons.consume_one(t)
50
+ nil
51
+ end
52
+
53
+ cons.consume do |msg|
54
+ assert_kind_of Rafka::Message, msg
55
+ end
56
+ end
45
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agis Anastasopoulos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-04 00:00:00.000000000 Z
11
+ date: 2018-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis