beaneater 1.1.0 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +14 -0
- data/lib/beaneater/connection.rb +6 -1
- data/lib/beaneater/job/collection.rb +1 -1
- data/lib/beaneater/tube/record.rb +1 -1
- data/lib/beaneater/version.rb +1 -1
- data/test/jobs_test.rb +6 -2
- data/test/test_helper.rb +1 -1
- data/test/tube_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffe398358517da9e09fd22e17ddd4421e7a0f2b7fa2ae816e8ad0a308466f2d8
|
4
|
+
data.tar.gz: 7f9d831b5318de310462d8d4405acc0dbedb82463d5b252dec9b63fbcb39677b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fd5812759fa6e28a830cecacdd7a22447ce94705b044d9c28062bb868a082ea3679a29b18e3c4f421a6abf90fb3ba28551a2715eb5e8b38782a6e842548dc08
|
7
|
+
data.tar.gz: 919952687b5f715aca936c4c40af28a0db741e6c7539dfdcb78c6e5834a855fb91800e5a2e5fc2cb0e201e6422b5522f7c944be787fa0ca7b145f6b3edf83091
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# CHANGELOG for Beaneater
|
2
2
|
|
3
|
+
## 1.1.3 (Oct 14 2022)
|
4
|
+
|
5
|
+
* Fixes issue introduced in 1.1.2 re YML parsing (@pond)
|
6
|
+
* Fix job lookup test so it passes again
|
7
|
+
|
8
|
+
## 1.1.2 (Oct 10 2022)
|
9
|
+
|
10
|
+
* Fixes beaneater when used with Ruby 3.1 and YAML 4 (@pond)
|
11
|
+
|
12
|
+
## 1.1.1 (April 27th 2021)
|
13
|
+
|
14
|
+
* Support Ruby 3 keyword arguments (@yahonda)
|
15
|
+
* Add CI for Ruby 3 (@yahonda)
|
16
|
+
|
3
17
|
## 1.1.0 (April 25th 2021)
|
4
18
|
|
5
19
|
* 'clear' behavior was failing unexpectedly, swallow issues during delete as well (@bfolkens)
|
data/lib/beaneater/connection.rb
CHANGED
@@ -150,7 +150,12 @@ class Beaneater
|
|
150
150
|
if ['OK','FOUND', 'RESERVED'].include?(status)
|
151
151
|
bytes_size = body_values[-1].to_i
|
152
152
|
raw_body = connection.read(bytes_size)
|
153
|
-
body = status == 'OK'
|
153
|
+
body = if status == 'OK'
|
154
|
+
psych_v4_valid_body = raw_body.gsub(/^(.*?): (.*)$/) { "#{$1}: #{$2.gsub(/[\:\-\~]/, '_')}" }
|
155
|
+
YAML.load(psych_v4_valid_body)
|
156
|
+
else
|
157
|
+
config.job_parser.call(raw_body)
|
158
|
+
end
|
154
159
|
crlf = connection.read(2) # \r\n
|
155
160
|
raise ExpectedCrlfError.new('EXPECTED_CRLF', cmd) if crlf != "\r\n"
|
156
161
|
end
|
data/lib/beaneater/version.rb
CHANGED
data/test/jobs_test.rb
CHANGED
@@ -28,8 +28,12 @@ describe Beaneater::Jobs do
|
|
28
28
|
assert_equal "foo find #{@time}", @jobs.find(@job.id).body
|
29
29
|
end
|
30
30
|
|
31
|
-
it "should return nil for invalid id" do
|
32
|
-
assert_nil @jobs.find(
|
31
|
+
it "should return nil for invalid negative id" do
|
32
|
+
assert_nil @jobs.find(10000)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should return nil for invalid negative id" do
|
36
|
+
assert_raises(Beaneater::BadFormatError) { @jobs.find(-1) }
|
33
37
|
end
|
34
38
|
end # find
|
35
39
|
|
data/test/test_helper.rb
CHANGED
data/test/tube_test.rb
CHANGED
@@ -89,9 +89,9 @@ describe Beaneater::Tube do
|
|
89
89
|
|
90
90
|
it "should support custom parser" do
|
91
91
|
Beaneater.configure.job_parser = lambda { |b| JSON.parse(b) }
|
92
|
-
json = '{"message":"hi"}'
|
92
|
+
json = '{"message": "hi: there! this: is a long message"}'
|
93
93
|
@tube.put(json)
|
94
|
-
assert_equal 'hi', @tube.peek(:ready).body['message']
|
94
|
+
assert_equal 'hi: there! this: is a long message', @tube.peek(:ready).body['message']
|
95
95
|
end
|
96
96
|
|
97
97
|
after do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaneater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nico Taing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|