pbio 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 36b95e1705d04faed8b26ed62a4a4ed9622881e78f4bb31a3ec6195cf1aaf3fd
4
- data.tar.gz: 432b73cb7fd0349619bb98c5b3710af137d87da79bebc6716b8dce1a3402fa1c
3
+ metadata.gz: 77f8f874faf28491854d7dc995406e40addaa679c49353a234ed5e4bff1d209e
4
+ data.tar.gz: af842f93b1e1d578ee52e089b35776597191090db3e4412f86dfe7850f34f1ed
5
5
  SHA512:
6
- metadata.gz: 47468bad7600fbddcb8ede71a05ec6a0107b0d2e08f00b8a471fa02c8db8ce0b807be6b1d9023dbbebdd33641b67e008af9105084f7da61e3dc6ead83360a21c
7
- data.tar.gz: 8f3cc0d72c3ee110a0a30232817c387487e64ce69d7429fbf67c8a32225b836ea7f1e9602b80196d9eb3d1314fc726d4197c33c566b84deded7f6930fd98b188
6
+ metadata.gz: 0e20fcbb824481fbf59a33a07880f7e1428d115517f6c12373d6a0bbf883ff200b9e33d082bc934de2afb35e06ee4a7c99acf215fe7b4df7e48b9c2f1eebd330
7
+ data.tar.gz: ac269f15235e35a5c1ed487b5b2d846dde96bb7182616b9f05ab266c9a3fedc14c20bf04cb6ee00b6164835ad176ef4e364e9dc3c04cf9b25b382f0672dd7fd1
@@ -0,0 +1,18 @@
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
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+ - name: Run lint
16
+ uses: golangci/golangci-lint-action@v2
17
+ with:
18
+ version: latest
@@ -11,18 +11,8 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- go-version: [1.15.x, 1.16.x]
14
+ go-version: [1.16.x, 1.17.x]
15
15
  steps:
16
- - name: Fetch staticcheck
17
- uses: engineerd/configurator@v0.0.6
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
16
  - name: Checkout
27
17
  uses: actions/checkout@v2
28
18
  - name: Cache dependencies
@@ -38,13 +28,11 @@ jobs:
38
28
  go-version: ${{ matrix.go-version }}
39
29
  - name: Run tests
40
30
  run: make test
41
- - name: Run staticcheck
42
- run: make staticcheck
43
31
  ruby:
44
32
  runs-on: ubuntu-latest
45
33
  strategy:
46
34
  matrix:
47
- ruby-version: ["2.5", "2.6", "2.7", "3.0"]
35
+ ruby-version: ["2.7", "3.0", "3.1"]
48
36
  steps:
49
37
  - uses: actions/checkout@v2
50
38
  - uses: ruby/setup-ruby@v1
data/.rubocop.yml CHANGED
@@ -6,4 +6,4 @@ inherit_mode:
6
6
  - Exclude
7
7
 
8
8
  AllCops:
9
- TargetRubyVersion: 2.5
9
+ TargetRubyVersion: 2.7
data/Gemfile.lock CHANGED
@@ -1,32 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pbio (0.3.0)
4
+ pbio (0.3.1)
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
- concurrent-ruby (1.1.8)
18
- diff-lcs (1.4.4)
19
- google-protobuf (3.15.8)
20
- i18n (1.8.10)
21
- concurrent-ruby (~> 1.0)
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.19.2)
13
+ parallel (1.21.0)
14
+ parser (3.1.0.0)
25
15
  ast (~> 2.4.1)
26
- rack (2.2.3)
27
16
  rainbow (3.0.0)
28
- rake (13.0.3)
29
- regexp_parser (2.1.1)
17
+ rake (13.0.6)
18
+ regexp_parser (2.2.0)
30
19
  rexml (3.2.5)
31
20
  rspec (3.10.0)
32
21
  rspec-core (~> 3.10.0)
@@ -40,41 +29,32 @@ GEM
40
29
  rspec-mocks (3.10.2)
41
30
  diff-lcs (>= 1.2.0, < 2.0)
42
31
  rspec-support (~> 3.10.0)
43
- rspec-support (3.10.2)
44
- rubocop (1.13.0)
32
+ rspec-support (3.10.3)
33
+ rubocop (1.24.1)
45
34
  parallel (~> 1.10)
46
35
  parser (>= 3.0.0.0)
47
36
  rainbow (>= 2.2.2, < 4.0)
48
37
  regexp_parser (>= 1.8, < 3.0)
49
38
  rexml
50
- rubocop-ast (>= 1.2.0, < 2.0)
39
+ rubocop-ast (>= 1.15.1, < 2.0)
51
40
  ruby-progressbar (~> 1.7)
52
41
  unicode-display_width (>= 1.4.0, < 3.0)
53
- rubocop-ast (1.5.0)
42
+ rubocop-ast (1.15.1)
54
43
  parser (>= 3.0.1.1)
55
- rubocop-bsm (0.5.9)
44
+ rubocop-bsm (0.6.0)
56
45
  rubocop (~> 1.0)
57
46
  rubocop-performance
58
- rubocop-rails
59
47
  rubocop-rake
60
48
  rubocop-rspec
61
- rubocop-performance (1.11.1)
49
+ rubocop-performance (1.13.1)
62
50
  rubocop (>= 1.7.0, < 2.0)
63
51
  rubocop-ast (>= 0.4.0)
64
- rubocop-rails (2.9.1)
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)
52
+ rubocop-rake (0.6.0)
71
53
  rubocop (~> 1.0)
72
- rubocop-ast (>= 1.1.0)
54
+ rubocop-rspec (2.7.0)
55
+ rubocop (~> 1.19)
73
56
  ruby-progressbar (1.11.0)
74
- tzinfo (2.0.4)
75
- concurrent-ruby (~> 1.0)
76
- unicode-display_width (2.0.0)
77
- zeitwerk (2.4.2)
57
+ unicode-display_width (2.1.0)
78
58
 
79
59
  PLATFORMS
80
60
  ruby
@@ -87,4 +67,4 @@ DEPENDENCIES
87
67
  rubocop-bsm
88
68
 
89
69
  BUNDLED WITH
90
- 2.1.4
70
+ 2.2.27
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
@@ -2,8 +2,4 @@ module github.com/bsm/pbio
2
2
 
3
3
  go 1.15
4
4
 
5
- require (
6
- github.com/onsi/ginkgo v1.14.1
7
- github.com/onsi/gomega v1.10.2
8
- google.golang.org/protobuf v1.25.0
9
- )
5
+ require google.golang.org/protobuf v1.27.1
data/go.sum CHANGED
@@ -1,99 +1,8 @@
1
- cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
2
- github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
3
- github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
74
- google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
75
- google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
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.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
8
+ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
@@ -7,7 +7,7 @@ module PBIO
7
7
  def self.encode_uvarint(num)
8
8
  bytes = []
9
9
  while num >= 0x80
10
- b = num & 0xFF | 0x80
10
+ b = (num & 0xFF) | 0x80
11
11
  bytes << b
12
12
  num >>= 7
13
13
  end
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.0'
3
+ s.version = '0.3.1'
4
4
  s.authors = ['Dimitrij Denissenko']
5
5
  s.email = ['dimitrij@blacksquaremedia.com']
6
6
  s.summary = 'Protobuf Streaming'
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^spec/}) }
12
12
  s.test_files = `git ls-files -z -- spec/*`.split("\x0")
13
13
  s.require_paths = ['lib']
14
- s.required_ruby_version = '>= 2.5'
14
+ s.required_ruby_version = '>= 2.7'
15
15
 
16
16
  s.add_dependency 'google-protobuf'
17
17
 
@@ -19,4 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_development_dependency 'rake'
20
20
  s.add_development_dependency 'rspec'
21
21
  s.add_development_dependency 'rubocop-bsm'
22
+ s.metadata['rubygems_mfa_required'] = 'true'
22
23
  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
- var _ = Describe("Encoder", func() {
27
- var subject *pbio.Encoder
28
- var buf *bytes.Buffer
28
+ func TestEncoder(t *testing.T) {
29
+ buf := new(bytes.Buffer)
30
+ enc := pbio.NewEncoder(buf)
29
31
 
30
- BeforeEach(func() {
31
- buf = new(bytes.Buffer)
32
- subject = pbio.NewEncoder(buf)
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
- It("should encode", func() {
36
- Expect(subject.Encode(message)).To(Succeed())
37
- Expect(buf.Len()).To(BeNumerically("~", 192, 20))
38
- Expect(subject.Encode(message)).To(Succeed())
39
- Expect(buf.Len()).To(BeNumerically("~", 384, 20))
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
- BeforeEach(func() {
47
- buf := new(bytes.Buffer)
48
- enc := pbio.NewEncoder(buf)
49
- Expect(enc.Encode(message)).To(Succeed())
50
- Expect(enc.Encode(message)).To(Succeed())
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
- subject = pbio.NewDecoder(buf)
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
- It("should decode", func() {
56
- m1 := new(structpb.Value)
57
- Expect(subject.Decode(m1)).To(Succeed())
58
- Expect(m1.MarshalJSON()).To(MatchJSON(`{
59
- "firstName":"John",
60
- "lastName":"Smith",
61
- "isAlive":true,
62
- "age":27,
63
- "address":{
64
- "city":"New York",
65
- "postalCode":"10021-3100",
66
- "state":"NY",
67
- "streetAddress":"21 2nd Street"
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
- m2 := new(structpb.Value)
72
- Expect(subject.Decode(m2)).To(Succeed())
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
- m3 := new(structpb.Value)
75
- Expect(subject.Decode(m3)).To(MatchError(`EOF`))
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 TestSuite(t *testing.T) {
80
- RegisterFailHandler(Fail)
81
- RunSpecs(t, "pbio")
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.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2022-01-10 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"
@@ -108,7 +109,8 @@ files:
108
109
  homepage: https://github.com/bsm/pbio
109
110
  licenses:
110
111
  - MIT
111
- metadata: {}
112
+ metadata:
113
+ rubygems_mfa_required: 'true'
112
114
  post_install_message:
113
115
  rdoc_options: []
114
116
  require_paths:
@@ -117,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
119
  requirements:
118
120
  - - ">="
119
121
  - !ruby/object:Gem::Version
120
- version: '2.5'
122
+ version: '2.7'
121
123
  required_rubygems_version: !ruby/object:Gem::Requirement
122
124
  requirements:
123
125
  - - ">="
124
126
  - !ruby/object:Gem::Version
125
127
  version: '0'
126
128
  requirements: []
127
- rubygems_version: 3.1.4
129
+ rubygems_version: 3.2.15
128
130
  signing_key:
129
131
  specification_version: 4
130
132
  summary: Protobuf Streaming