pbio 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +20 -0
- data/.github/workflows/test.yml +7 -28
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +34 -52
- data/README.md +1 -0
- data/go.mod +1 -5
- data/go.sum +6 -97
- data/lib/pbio/delimited.rb +1 -1
- data/pbio.gemspec +3 -3
- data/pbio_test.go +62 -50
- metadata +8 -10
- data/spec/lib/pbio/delimited_spec.rb +0 -33
- data/spec/spec_helper.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93b597d2a94ba12e5ad81af8ee146c65450ddf564795d552f8ea69721cf7d0ae
|
4
|
+
data.tar.gz: 25b97b5af88df9a03f7db5e83c20cae1c35d0cf588ccd2d6188f8ea424c47e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4101f14a1e44fb5da9745fa7c15e01c03da2c0e4e022c33b9aadc8f82b95201f9f6fad4d1c8ee33456b6c5e1b917c70174927830afaefd96ab55b5cc215d8fca
|
7
|
+
data.tar.gz: 827bb74213b65ac08c155d1a3f9ceed8647163210e23609bffdfa1f5dd1faf6d1990ccce87a84e426ed27121297be9a427f63831788af30ae4ea559f9c4feadc
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: Lint
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
pull_request:
|
7
|
+
branches:
|
8
|
+
- main
|
9
|
+
jobs:
|
10
|
+
golangci:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v3
|
14
|
+
- uses: actions/setup-go@v3
|
15
|
+
with:
|
16
|
+
go-version: 1.18.x
|
17
|
+
cache: true
|
18
|
+
- uses: golangci/golangci-lint-action@v3
|
19
|
+
with:
|
20
|
+
version: latest
|
data/.github/workflows/test.yml
CHANGED
@@ -11,42 +11,21 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
|
-
go-version: [1.
|
14
|
+
go-version: [1.17.x, 1.18.x]
|
15
15
|
steps:
|
16
|
-
-
|
17
|
-
|
18
|
-
with:
|
19
|
-
name: staticcheck
|
20
|
-
fromGitHubReleases: true
|
21
|
-
repo: dominikh/go-tools
|
22
|
-
version: latest
|
23
|
-
urlTemplate: "https://github.com/dominikh/go-tools/releases/download/2020.2.3/staticcheck_linux_amd64.tar.gz"
|
24
|
-
pathInArchive: staticcheck/staticcheck
|
25
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
26
|
-
- name: Checkout
|
27
|
-
uses: actions/checkout@v2
|
28
|
-
- name: Cache dependencies
|
29
|
-
uses: actions/cache@v2
|
30
|
-
with:
|
31
|
-
path: ~/go/pkg/mod
|
32
|
-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
33
|
-
restore-keys: |
|
34
|
-
${{ runner.os }}-go-
|
35
|
-
- name: Setup Go
|
36
|
-
uses: actions/setup-go@v2
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
- uses: actions/setup-go@v3
|
37
18
|
with:
|
38
19
|
go-version: ${{ matrix.go-version }}
|
39
|
-
|
40
|
-
|
41
|
-
- name: Run staticcheck
|
42
|
-
run: make staticcheck
|
20
|
+
cache: true
|
21
|
+
- run: make test
|
43
22
|
ruby:
|
44
23
|
runs-on: ubuntu-latest
|
45
24
|
strategy:
|
46
25
|
matrix:
|
47
|
-
ruby-version: ["2.
|
26
|
+
ruby-version: ["2.7", "3.0", "3.1"]
|
48
27
|
steps:
|
49
|
-
- uses: actions/checkout@
|
28
|
+
- uses: actions/checkout@v3
|
50
29
|
- uses: ruby/setup-ruby@v1
|
51
30
|
with:
|
52
31
|
ruby-version: ${{ matrix.ruby-version }}
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,80 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pbio (0.3.
|
4
|
+
pbio (0.3.2)
|
5
5
|
google-protobuf
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.1.3.1)
|
11
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
-
i18n (>= 1.6, < 2)
|
13
|
-
minitest (>= 5.1)
|
14
|
-
tzinfo (~> 2.0)
|
15
|
-
zeitwerk (~> 2.3)
|
16
10
|
ast (2.4.2)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
minitest (5.14.4)
|
23
|
-
parallel (1.20.1)
|
24
|
-
parser (3.0.1.1)
|
11
|
+
diff-lcs (1.5.0)
|
12
|
+
google-protobuf (3.21.7)
|
13
|
+
json (2.6.2)
|
14
|
+
parallel (1.22.1)
|
15
|
+
parser (3.1.2.1)
|
25
16
|
ast (~> 2.4.1)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
regexp_parser (2.1.1)
|
17
|
+
rainbow (3.1.1)
|
18
|
+
rake (13.0.6)
|
19
|
+
regexp_parser (2.6.0)
|
30
20
|
rexml (3.2.5)
|
31
|
-
rspec (3.
|
32
|
-
rspec-core (~> 3.
|
33
|
-
rspec-expectations (~> 3.
|
34
|
-
rspec-mocks (~> 3.
|
35
|
-
rspec-core (3.
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-expectations (3.
|
21
|
+
rspec (3.11.0)
|
22
|
+
rspec-core (~> 3.11.0)
|
23
|
+
rspec-expectations (~> 3.11.0)
|
24
|
+
rspec-mocks (~> 3.11.0)
|
25
|
+
rspec-core (3.11.0)
|
26
|
+
rspec-support (~> 3.11.0)
|
27
|
+
rspec-expectations (3.11.1)
|
38
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-mocks (3.
|
29
|
+
rspec-support (~> 3.11.0)
|
30
|
+
rspec-mocks (3.11.1)
|
41
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-support (3.
|
44
|
-
rubocop (1.
|
32
|
+
rspec-support (~> 3.11.0)
|
33
|
+
rspec-support (3.11.1)
|
34
|
+
rubocop (1.36.0)
|
35
|
+
json (~> 2.3)
|
45
36
|
parallel (~> 1.10)
|
46
|
-
parser (>= 3.
|
37
|
+
parser (>= 3.1.2.1)
|
47
38
|
rainbow (>= 2.2.2, < 4.0)
|
48
39
|
regexp_parser (>= 1.8, < 3.0)
|
49
|
-
rexml
|
50
|
-
rubocop-ast (>= 1.
|
40
|
+
rexml (>= 3.2.5, < 4.0)
|
41
|
+
rubocop-ast (>= 1.20.1, < 2.0)
|
51
42
|
ruby-progressbar (~> 1.7)
|
52
43
|
unicode-display_width (>= 1.4.0, < 3.0)
|
53
|
-
rubocop-ast (1.
|
54
|
-
parser (>= 3.
|
55
|
-
rubocop-bsm (0.
|
44
|
+
rubocop-ast (1.21.0)
|
45
|
+
parser (>= 3.1.1.0)
|
46
|
+
rubocop-bsm (0.6.0)
|
56
47
|
rubocop (~> 1.0)
|
57
48
|
rubocop-performance
|
58
|
-
rubocop-rails
|
59
49
|
rubocop-rake
|
60
50
|
rubocop-rspec
|
61
|
-
rubocop-performance (1.
|
51
|
+
rubocop-performance (1.15.0)
|
62
52
|
rubocop (>= 1.7.0, < 2.0)
|
63
53
|
rubocop-ast (>= 0.4.0)
|
64
|
-
rubocop-
|
65
|
-
activesupport (>= 4.2.0)
|
66
|
-
rack (>= 1.1)
|
67
|
-
rubocop (>= 0.90.0, < 2.0)
|
68
|
-
rubocop-rake (0.5.1)
|
69
|
-
rubocop
|
70
|
-
rubocop-rspec (2.3.0)
|
54
|
+
rubocop-rake (0.6.0)
|
71
55
|
rubocop (~> 1.0)
|
72
|
-
|
56
|
+
rubocop-rspec (2.13.2)
|
57
|
+
rubocop (~> 1.33)
|
73
58
|
ruby-progressbar (1.11.0)
|
74
|
-
|
75
|
-
concurrent-ruby (~> 1.0)
|
76
|
-
unicode-display_width (2.0.0)
|
77
|
-
zeitwerk (2.4.2)
|
59
|
+
unicode-display_width (2.3.0)
|
78
60
|
|
79
61
|
PLATFORMS
|
80
62
|
ruby
|
@@ -87,4 +69,4 @@ DEPENDENCIES
|
|
87
69
|
rubocop-bsm
|
88
70
|
|
89
71
|
BUNDLED WITH
|
90
|
-
2.
|
72
|
+
2.3.16
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# PB IO
|
2
2
|
|
3
|
+
[![Test](https://github.com/bsm/pbio/actions/workflows/test.yml/badge.svg)](https://github.com/bsm/pbio/actions/workflows/test.yml)
|
3
4
|
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
4
5
|
|
5
6
|
Protobuf IO is a Ruby equivalent of https://godoc.org/github.com/gogo/protobuf/io.
|
data/go.mod
CHANGED
data/go.sum
CHANGED
@@ -1,99 +1,8 @@
|
|
1
|
-
|
2
|
-
github.com/
|
3
|
-
github.com/
|
4
|
-
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
5
|
-
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
6
|
-
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
7
|
-
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
8
|
-
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
9
|
-
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
10
|
-
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
11
|
-
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
12
|
-
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
13
|
-
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
14
|
-
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
15
|
-
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
16
|
-
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
17
|
-
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
18
|
-
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
19
|
-
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
20
|
-
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
21
|
-
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
22
|
-
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
23
|
-
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
24
|
-
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
25
|
-
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
26
|
-
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
27
|
-
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
|
28
|
-
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
29
|
-
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
30
|
-
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
31
|
-
github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=
|
32
|
-
github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
33
|
-
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
34
|
-
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
35
|
-
github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs=
|
36
|
-
github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
37
|
-
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
38
|
-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
39
|
-
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
40
|
-
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
41
|
-
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
42
|
-
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
43
|
-
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
44
|
-
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
45
|
-
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
46
|
-
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
47
|
-
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
48
|
-
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
|
49
|
-
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
50
|
-
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
51
|
-
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
52
|
-
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
53
|
-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
54
|
-
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
55
|
-
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
56
|
-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
57
|
-
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
58
|
-
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
59
|
-
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
60
|
-
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
61
|
-
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
|
62
|
-
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
63
|
-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
64
|
-
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
65
|
-
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
66
|
-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
67
|
-
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
68
|
-
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
69
|
-
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
70
|
-
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
1
|
+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
2
|
+
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
3
|
+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
71
4
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
72
5
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
73
|
-
google.golang.org/
|
74
|
-
google.golang.org/
|
75
|
-
google.golang.org/
|
76
|
-
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
77
|
-
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
78
|
-
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
79
|
-
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
80
|
-
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
81
|
-
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
82
|
-
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
83
|
-
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
84
|
-
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
85
|
-
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
86
|
-
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
87
|
-
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
88
|
-
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
89
|
-
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
|
90
|
-
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
91
|
-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
92
|
-
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
93
|
-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
94
|
-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
95
|
-
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
96
|
-
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
97
|
-
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
98
|
-
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
99
|
-
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
6
|
+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
7
|
+
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
8
|
+
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
data/lib/pbio/delimited.rb
CHANGED
data/pbio.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'pbio'
|
3
|
-
s.version = '0.3.
|
3
|
+
s.version = '0.3.2'
|
4
4
|
s.authors = ['Dimitrij Denissenko']
|
5
5
|
s.email = ['dimitrij@blacksquaremedia.com']
|
6
6
|
s.summary = 'Protobuf Streaming'
|
@@ -9,9 +9,8 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.license = 'MIT'
|
10
10
|
|
11
11
|
s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^spec/}) }
|
12
|
-
s.test_files = `git ls-files -z -- spec/*`.split("\x0")
|
13
12
|
s.require_paths = ['lib']
|
14
|
-
s.required_ruby_version = '>= 2.
|
13
|
+
s.required_ruby_version = '>= 2.7'
|
15
14
|
|
16
15
|
s.add_dependency 'google-protobuf'
|
17
16
|
|
@@ -19,4 +18,5 @@ Gem::Specification.new do |s|
|
|
19
18
|
s.add_development_dependency 'rake'
|
20
19
|
s.add_development_dependency 'rspec'
|
21
20
|
s.add_development_dependency 'rubocop-bsm'
|
21
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
22
22
|
end
|
data/pbio_test.go
CHANGED
@@ -2,11 +2,13 @@ package pbio_test
|
|
2
2
|
|
3
3
|
import (
|
4
4
|
"bytes"
|
5
|
+
"encoding/json"
|
6
|
+
"errors"
|
7
|
+
"io"
|
8
|
+
"math"
|
5
9
|
"testing"
|
6
10
|
|
7
11
|
"github.com/bsm/pbio"
|
8
|
-
. "github.com/onsi/ginkgo"
|
9
|
-
. "github.com/onsi/gomega"
|
10
12
|
"google.golang.org/protobuf/types/known/structpb"
|
11
13
|
)
|
12
14
|
|
@@ -23,60 +25,70 @@ var message, _ = structpb.NewValue(map[string]interface{}{
|
|
23
25
|
},
|
24
26
|
})
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
func TestEncoder(t *testing.T) {
|
29
|
+
buf := new(bytes.Buffer)
|
30
|
+
enc := pbio.NewEncoder(buf)
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
if err := enc.Encode(message); err != nil {
|
33
|
+
t.Fatalf("expected no error, but got %v", err)
|
34
|
+
}
|
35
|
+
if exp, got, delta := 192, buf.Len(), 20; math.Abs(float64(exp)-float64(got)) > float64(delta) {
|
36
|
+
t.Fatalf("expected %d (±%d), got %d", exp, delta, got)
|
37
|
+
}
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
var _ = Describe("Decoder", func() {
|
44
|
-
var subject *pbio.Decoder
|
39
|
+
if err := enc.Encode(message); err != nil {
|
40
|
+
t.Fatalf("expected no error, but got %v", err)
|
41
|
+
}
|
42
|
+
if exp, got, delta := 384, buf.Len(), 20; math.Abs(float64(exp)-float64(got)) > float64(delta) {
|
43
|
+
t.Fatalf("expected %d (±%d), got %d", exp, delta, got)
|
44
|
+
}
|
45
|
+
}
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
func TestDecoder(t *testing.T) {
|
48
|
+
buf := new(bytes.Buffer)
|
49
|
+
enc := pbio.NewEncoder(buf)
|
50
|
+
for i := 0; i < 2; i++ {
|
51
|
+
if err := enc.Encode(message); err != nil {
|
52
|
+
t.Fatalf("expected no error, but got %v", err)
|
53
|
+
}
|
54
|
+
}
|
51
55
|
|
52
|
-
|
53
|
-
|
56
|
+
dec := pbio.NewDecoder(buf)
|
57
|
+
m1 := new(structpb.Value)
|
58
|
+
if err := dec.Decode(m1); err != nil {
|
59
|
+
t.Fatalf("expected no error, but got %v", err)
|
60
|
+
}
|
54
61
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
62
|
+
if data, err := m1.MarshalJSON(); err != nil {
|
63
|
+
t.Fatalf("expected no error, but got %v", err)
|
64
|
+
} else if exp, got := `{
|
65
|
+
"address": {
|
66
|
+
"city": "New York",
|
67
|
+
"postalCode": "10021-3100",
|
68
|
+
"state": "NY",
|
69
|
+
"streetAddress": "21 2nd Street"
|
70
|
+
},
|
71
|
+
"age": 27,
|
72
|
+
"firstName": "John",
|
73
|
+
"isAlive": true,
|
74
|
+
"lastName": "Smith"
|
75
|
+
}`, normJSON(data); exp != got {
|
76
|
+
t.Fatalf("expected:\n%v, but got:\n%v", exp, got)
|
77
|
+
}
|
70
78
|
|
71
|
-
|
72
|
-
|
79
|
+
m2 := new(structpb.Value)
|
80
|
+
if err := dec.Decode(m2); err != nil {
|
81
|
+
t.Fatalf("expected no error, but got %v", err)
|
82
|
+
}
|
73
83
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
}
|
84
|
+
m3 := new(structpb.Value)
|
85
|
+
if exp, got := io.EOF, dec.Decode(m3); !errors.Is(got, exp) {
|
86
|
+
t.Fatalf("expected %v, but got %v", exp, got)
|
87
|
+
}
|
88
|
+
}
|
78
89
|
|
79
|
-
func
|
80
|
-
|
81
|
-
|
90
|
+
func normJSON(data []byte) string {
|
91
|
+
b := new(bytes.Buffer)
|
92
|
+
_ = json.Indent(b, data, "", " ")
|
93
|
+
return b.String()
|
82
94
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pbio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -87,6 +87,7 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/lint.yml"
|
90
91
|
- ".github/workflows/test.yml"
|
91
92
|
- ".gitignore"
|
92
93
|
- ".rubocop.yml"
|
@@ -103,12 +104,11 @@ files:
|
|
103
104
|
- pbio.gemspec
|
104
105
|
- pbio.go
|
105
106
|
- pbio_test.go
|
106
|
-
- spec/lib/pbio/delimited_spec.rb
|
107
|
-
- spec/spec_helper.rb
|
108
107
|
homepage: https://github.com/bsm/pbio
|
109
108
|
licenses:
|
110
109
|
- MIT
|
111
|
-
metadata:
|
110
|
+
metadata:
|
111
|
+
rubygems_mfa_required: 'true'
|
112
112
|
post_install_message:
|
113
113
|
rdoc_options: []
|
114
114
|
require_paths:
|
@@ -117,17 +117,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
117
|
requirements:
|
118
118
|
- - ">="
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: '2.
|
120
|
+
version: '2.7'
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.3.3
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Protobuf Streaming
|
131
|
-
test_files:
|
132
|
-
- spec/lib/pbio/delimited_spec.rb
|
133
|
-
- spec/spec_helper.rb
|
131
|
+
test_files: []
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe PBIO::Delimited do
|
4
|
-
subject { described_class.new io }
|
5
|
-
|
6
|
-
let(:io) { StringIO.new }
|
7
|
-
let(:msg1) { PBIO::Spec::Message.new(name: 'Test A') }
|
8
|
-
let(:msg2) { PBIO::Spec::Message.new(name: 'Test B') }
|
9
|
-
let(:msg3) { PBIO::Spec::Message.new(name: 'x' * 32_000) }
|
10
|
-
|
11
|
-
it 'writes' do
|
12
|
-
expect(subject.write(msg1)).to eq(9)
|
13
|
-
expect(subject.write(msg2)).to eq(9)
|
14
|
-
expect(io.size).to eq(18)
|
15
|
-
expect(io.string.encoding).to eq(Encoding::BINARY)
|
16
|
-
|
17
|
-
expect(subject.write(msg3)).to eq(32_007)
|
18
|
-
expect(io.size).to eq(32_025)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'reads' do
|
22
|
-
expect(subject.write(msg1)).to eq(9)
|
23
|
-
expect(subject.write(msg2)).to eq(9)
|
24
|
-
io.rewind
|
25
|
-
|
26
|
-
expect(subject.read(PBIO::Spec::Message)).to eq(msg1)
|
27
|
-
expect(subject).not_to be_eof
|
28
|
-
expect(subject.read(PBIO::Spec::Message)).to eq(msg2)
|
29
|
-
expect(subject).to be_eof
|
30
|
-
expect(subject.read(PBIO::Spec::Message)).to be_nil
|
31
|
-
expect(subject).to be_eof
|
32
|
-
end
|
33
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'pbio'
|
2
|
-
require 'rspec'
|
3
|
-
require 'google/protobuf'
|
4
|
-
|
5
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
6
|
-
add_message 'pbio.spec.Message' do
|
7
|
-
optional :name, :string, 1
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
module PBIO
|
12
|
-
module Spec
|
13
|
-
Message = Google::Protobuf::DescriptorPool.generated_pool.lookup('pbio.spec.Message').msgclass
|
14
|
-
end
|
15
|
-
end
|