pbio 0.2.0 → 0.3.1
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 +18 -0
- data/.github/workflows/test.yml +42 -0
- data/.gitignore +3 -1
- data/.rubocop.yml +7 -4
- data/Gemfile.lock +45 -31
- data/LICENSE +1 -1
- data/Makefile +6 -0
- data/README.md +1 -0
- data/go.mod +5 -0
- data/go.sum +8 -0
- data/lib/pbio/delimited.rb +6 -1
- data/pbio.gemspec +4 -4
- data/pbio.go +74 -0
- data/pbio_test.go +94 -0
- data/spec/lib/pbio/delimited_spec.rb +6 -5
- metadata +14 -22
- data/.rubocop-https---gitlab-com-bsm-misc-raw-master-rubocop-default-yml +0 -78
- data/.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77f8f874faf28491854d7dc995406e40addaa679c49353a234ed5e4bff1d209e
|
4
|
+
data.tar.gz: af842f93b1e1d578ee52e089b35776597191090db3e4412f86dfe7850f34f1ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -0,0 +1,42 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
pull_request:
|
7
|
+
branches:
|
8
|
+
- main
|
9
|
+
jobs:
|
10
|
+
go:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
go-version: [1.16.x, 1.17.x]
|
15
|
+
steps:
|
16
|
+
- name: Checkout
|
17
|
+
uses: actions/checkout@v2
|
18
|
+
- name: Cache dependencies
|
19
|
+
uses: actions/cache@v2
|
20
|
+
with:
|
21
|
+
path: ~/go/pkg/mod
|
22
|
+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
23
|
+
restore-keys: |
|
24
|
+
${{ runner.os }}-go-
|
25
|
+
- name: Setup Go
|
26
|
+
uses: actions/setup-go@v2
|
27
|
+
with:
|
28
|
+
go-version: ${{ matrix.go-version }}
|
29
|
+
- name: Run tests
|
30
|
+
run: make test
|
31
|
+
ruby:
|
32
|
+
runs-on: ubuntu-latest
|
33
|
+
strategy:
|
34
|
+
matrix:
|
35
|
+
ruby-version: ["2.7", "3.0", "3.1"]
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v2
|
38
|
+
- uses: ruby/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: ${{ matrix.ruby-version }}
|
41
|
+
bundler-cache: true
|
42
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,45 +1,60 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pbio (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
|
-
ast (2.4.
|
11
|
-
diff-lcs (1.
|
12
|
-
google-protobuf (3.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
ast (~> 2.4.0)
|
10
|
+
ast (2.4.2)
|
11
|
+
diff-lcs (1.5.0)
|
12
|
+
google-protobuf (3.19.2)
|
13
|
+
parallel (1.21.0)
|
14
|
+
parser (3.1.0.0)
|
15
|
+
ast (~> 2.4.1)
|
17
16
|
rainbow (3.0.0)
|
18
|
-
rake (13.0.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
rspec-
|
23
|
-
|
24
|
-
rspec-
|
25
|
-
rspec-
|
17
|
+
rake (13.0.6)
|
18
|
+
regexp_parser (2.2.0)
|
19
|
+
rexml (3.2.5)
|
20
|
+
rspec (3.10.0)
|
21
|
+
rspec-core (~> 3.10.0)
|
22
|
+
rspec-expectations (~> 3.10.0)
|
23
|
+
rspec-mocks (~> 3.10.0)
|
24
|
+
rspec-core (3.10.1)
|
25
|
+
rspec-support (~> 3.10.0)
|
26
|
+
rspec-expectations (3.10.1)
|
26
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
-
rspec-support (~> 3.
|
28
|
-
rspec-mocks (3.
|
28
|
+
rspec-support (~> 3.10.0)
|
29
|
+
rspec-mocks (3.10.2)
|
29
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-support (3.
|
32
|
-
rubocop (
|
33
|
-
jaro_winkler (~> 1.5.1)
|
31
|
+
rspec-support (~> 3.10.0)
|
32
|
+
rspec-support (3.10.3)
|
33
|
+
rubocop (1.24.1)
|
34
34
|
parallel (~> 1.10)
|
35
|
-
parser (>=
|
35
|
+
parser (>= 3.0.0.0)
|
36
36
|
rainbow (>= 2.2.2, < 4.0)
|
37
|
+
regexp_parser (>= 1.8, < 3.0)
|
38
|
+
rexml
|
39
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
37
40
|
ruby-progressbar (~> 1.7)
|
38
|
-
unicode-display_width (>= 1.4.0, <
|
39
|
-
rubocop-
|
40
|
-
|
41
|
-
|
42
|
-
|
41
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
42
|
+
rubocop-ast (1.15.1)
|
43
|
+
parser (>= 3.0.1.1)
|
44
|
+
rubocop-bsm (0.6.0)
|
45
|
+
rubocop (~> 1.0)
|
46
|
+
rubocop-performance
|
47
|
+
rubocop-rake
|
48
|
+
rubocop-rspec
|
49
|
+
rubocop-performance (1.13.1)
|
50
|
+
rubocop (>= 1.7.0, < 2.0)
|
51
|
+
rubocop-ast (>= 0.4.0)
|
52
|
+
rubocop-rake (0.6.0)
|
53
|
+
rubocop (~> 1.0)
|
54
|
+
rubocop-rspec (2.7.0)
|
55
|
+
rubocop (~> 1.19)
|
56
|
+
ruby-progressbar (1.11.0)
|
57
|
+
unicode-display_width (2.1.0)
|
43
58
|
|
44
59
|
PLATFORMS
|
45
60
|
ruby
|
@@ -49,8 +64,7 @@ DEPENDENCIES
|
|
49
64
|
pbio!
|
50
65
|
rake
|
51
66
|
rspec
|
52
|
-
rubocop
|
53
|
-
rubocop-performance
|
67
|
+
rubocop-bsm
|
54
68
|
|
55
69
|
BUNDLED WITH
|
56
|
-
|
70
|
+
2.2.27
|
data/LICENSE
CHANGED
data/Makefile
ADDED
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
ADDED
data/go.sum
ADDED
@@ -0,0 +1,8 @@
|
|
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=
|
4
|
+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
5
|
+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
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=
|
data/lib/pbio/delimited.rb
CHANGED
@@ -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
|
@@ -36,6 +36,11 @@ module PBIO
|
|
36
36
|
# @param [IO] io object
|
37
37
|
def initialize(io)
|
38
38
|
@io = io
|
39
|
+
if @io.respond_to?(:binmode)
|
40
|
+
@io.binmode
|
41
|
+
elsif @io.respond_to?(:set_encoding)
|
42
|
+
@io.set_encoding(Encoding::BINARY)
|
43
|
+
end
|
39
44
|
end
|
40
45
|
|
41
46
|
# Writes a message to the IO stream.
|
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
|
+
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,13 +11,13 @@ 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.
|
14
|
+
s.required_ruby_version = '>= 2.7'
|
15
15
|
|
16
16
|
s.add_dependency 'google-protobuf'
|
17
17
|
|
18
18
|
s.add_development_dependency 'bundler'
|
19
19
|
s.add_development_dependency 'rake'
|
20
20
|
s.add_development_dependency 'rspec'
|
21
|
-
s.add_development_dependency 'rubocop'
|
22
|
-
s.
|
21
|
+
s.add_development_dependency 'rubocop-bsm'
|
22
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
23
23
|
end
|
data/pbio.go
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
package pbio
|
2
|
+
|
3
|
+
import (
|
4
|
+
"bufio"
|
5
|
+
"encoding/binary"
|
6
|
+
"io"
|
7
|
+
|
8
|
+
"google.golang.org/protobuf/proto"
|
9
|
+
)
|
10
|
+
|
11
|
+
// Encoder encodes protobuf messages and writes to the underlying writer.
|
12
|
+
type Encoder struct {
|
13
|
+
w io.Writer
|
14
|
+
buf []byte
|
15
|
+
}
|
16
|
+
|
17
|
+
// NewEncoder inits a new encoder.
|
18
|
+
func NewEncoder(w io.Writer) *Encoder {
|
19
|
+
return &Encoder{
|
20
|
+
w: w,
|
21
|
+
buf: make([]byte, binary.MaxVarintLen64),
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
// Encode encodes a message.
|
26
|
+
func (e *Encoder) Encode(msg proto.Message) error {
|
27
|
+
opt := proto.MarshalOptions{}
|
28
|
+
sz := opt.Size(msg)
|
29
|
+
e.buf = e.buf[:binary.PutUvarint(e.buf, uint64(sz))]
|
30
|
+
|
31
|
+
data, err := opt.MarshalAppend(e.buf, msg)
|
32
|
+
if err != nil {
|
33
|
+
return err
|
34
|
+
}
|
35
|
+
e.buf = data
|
36
|
+
|
37
|
+
_, err = e.w.Write(data)
|
38
|
+
return err
|
39
|
+
}
|
40
|
+
|
41
|
+
// --------------------------------------------------------------------
|
42
|
+
|
43
|
+
// Decoder decodes protobuf messages from an underlying reader.
|
44
|
+
type Decoder struct {
|
45
|
+
r *bufio.Reader
|
46
|
+
buf []byte
|
47
|
+
}
|
48
|
+
|
49
|
+
// NewDecoder inits a new Decoder.
|
50
|
+
func NewDecoder(r io.Reader) *Decoder {
|
51
|
+
return &Decoder{
|
52
|
+
r: bufio.NewReader(r),
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
// Decode decodes a message.
|
57
|
+
func (d *Decoder) Decode(msg proto.Message) error {
|
58
|
+
sz, err := binary.ReadUvarint(d.r)
|
59
|
+
if err != nil {
|
60
|
+
return err
|
61
|
+
}
|
62
|
+
|
63
|
+
if n := int(sz); cap(d.buf) < n {
|
64
|
+
d.buf = make([]byte, n)
|
65
|
+
} else {
|
66
|
+
d.buf = d.buf[:n]
|
67
|
+
}
|
68
|
+
if _, err := io.ReadFull(d.r, d.buf); err != nil {
|
69
|
+
return err
|
70
|
+
}
|
71
|
+
|
72
|
+
opt := proto.UnmarshalOptions{}
|
73
|
+
return opt.Unmarshal(d.buf, msg)
|
74
|
+
}
|
data/pbio_test.go
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
package pbio_test
|
2
|
+
|
3
|
+
import (
|
4
|
+
"bytes"
|
5
|
+
"encoding/json"
|
6
|
+
"errors"
|
7
|
+
"io"
|
8
|
+
"math"
|
9
|
+
"testing"
|
10
|
+
|
11
|
+
"github.com/bsm/pbio"
|
12
|
+
"google.golang.org/protobuf/types/known/structpb"
|
13
|
+
)
|
14
|
+
|
15
|
+
var message, _ = structpb.NewValue(map[string]interface{}{
|
16
|
+
"firstName": "John",
|
17
|
+
"lastName": "Smith",
|
18
|
+
"isAlive": true,
|
19
|
+
"age": 27,
|
20
|
+
"address": map[string]interface{}{
|
21
|
+
"streetAddress": "21 2nd Street",
|
22
|
+
"city": "New York",
|
23
|
+
"state": "NY",
|
24
|
+
"postalCode": "10021-3100",
|
25
|
+
},
|
26
|
+
})
|
27
|
+
|
28
|
+
func TestEncoder(t *testing.T) {
|
29
|
+
buf := new(bytes.Buffer)
|
30
|
+
enc := pbio.NewEncoder(buf)
|
31
|
+
|
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
|
+
}
|
38
|
+
|
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
|
+
}
|
46
|
+
|
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
|
+
}
|
55
|
+
|
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
|
+
}
|
61
|
+
|
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
|
+
}
|
78
|
+
|
79
|
+
m2 := new(structpb.Value)
|
80
|
+
if err := dec.Decode(m2); err != nil {
|
81
|
+
t.Fatalf("expected no error, but got %v", err)
|
82
|
+
}
|
83
|
+
|
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
|
+
}
|
89
|
+
|
90
|
+
func normJSON(data []byte) string {
|
91
|
+
b := new(bytes.Buffer)
|
92
|
+
_ = json.Indent(b, data, "", " ")
|
93
|
+
return b.String()
|
94
|
+
}
|
@@ -1,29 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe PBIO::Delimited do
|
4
|
+
subject { described_class.new io }
|
5
|
+
|
4
6
|
let(:io) { StringIO.new }
|
5
7
|
let(:msg1) { PBIO::Spec::Message.new(name: 'Test A') }
|
6
8
|
let(:msg2) { PBIO::Spec::Message.new(name: 'Test B') }
|
7
9
|
let(:msg3) { PBIO::Spec::Message.new(name: 'x' * 32_000) }
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
it 'should write' do
|
11
|
+
it 'writes' do
|
12
12
|
expect(subject.write(msg1)).to eq(9)
|
13
13
|
expect(subject.write(msg2)).to eq(9)
|
14
14
|
expect(io.size).to eq(18)
|
15
|
+
expect(io.string.encoding).to eq(Encoding::BINARY)
|
15
16
|
|
16
17
|
expect(subject.write(msg3)).to eq(32_007)
|
17
18
|
expect(io.size).to eq(32_025)
|
18
19
|
end
|
19
20
|
|
20
|
-
it '
|
21
|
+
it 'reads' do
|
21
22
|
expect(subject.write(msg1)).to eq(9)
|
22
23
|
expect(subject.write(msg2)).to eq(9)
|
23
24
|
io.rewind
|
24
25
|
|
25
26
|
expect(subject.read(PBIO::Spec::Message)).to eq(msg1)
|
26
|
-
expect(subject).
|
27
|
+
expect(subject).not_to be_eof
|
27
28
|
expect(subject.read(PBIO::Spec::Message)).to eq(msg2)
|
28
29
|
expect(subject).to be_eof
|
29
30
|
expect(subject.read(PBIO::Spec::Message)).to be_nil
|
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.
|
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:
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -67,21 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop-performance
|
70
|
+
name: rubocop-bsm
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
@@ -101,24 +87,30 @@ executables: []
|
|
101
87
|
extensions: []
|
102
88
|
extra_rdoc_files: []
|
103
89
|
files:
|
90
|
+
- ".github/workflows/lint.yml"
|
91
|
+
- ".github/workflows/test.yml"
|
104
92
|
- ".gitignore"
|
105
|
-
- ".rubocop-https---gitlab-com-bsm-misc-raw-master-rubocop-default-yml"
|
106
93
|
- ".rubocop.yml"
|
107
|
-
- ".travis.yml"
|
108
94
|
- Gemfile
|
109
95
|
- Gemfile.lock
|
110
96
|
- LICENSE
|
97
|
+
- Makefile
|
111
98
|
- README.md
|
112
99
|
- Rakefile
|
100
|
+
- go.mod
|
101
|
+
- go.sum
|
113
102
|
- lib/pbio.rb
|
114
103
|
- lib/pbio/delimited.rb
|
115
104
|
- pbio.gemspec
|
105
|
+
- pbio.go
|
106
|
+
- pbio_test.go
|
116
107
|
- spec/lib/pbio/delimited_spec.rb
|
117
108
|
- spec/spec_helper.rb
|
118
109
|
homepage: https://github.com/bsm/pbio
|
119
110
|
licenses:
|
120
111
|
- MIT
|
121
|
-
metadata:
|
112
|
+
metadata:
|
113
|
+
rubygems_mfa_required: 'true'
|
122
114
|
post_install_message:
|
123
115
|
rdoc_options: []
|
124
116
|
require_paths:
|
@@ -127,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
119
|
requirements:
|
128
120
|
- - ">="
|
129
121
|
- !ruby/object:Gem::Version
|
130
|
-
version: 2.
|
122
|
+
version: '2.7'
|
131
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
124
|
requirements:
|
133
125
|
- - ">="
|
134
126
|
- !ruby/object:Gem::Version
|
135
127
|
version: '0'
|
136
128
|
requirements: []
|
137
|
-
rubygems_version: 3.
|
129
|
+
rubygems_version: 3.2.15
|
138
130
|
signing_key:
|
139
131
|
specification_version: 4
|
140
132
|
summary: Protobuf Streaming
|
@@ -1,78 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
Exclude:
|
3
|
-
- "db/schema.rb"
|
4
|
-
- "vendor/**/*"
|
5
|
-
- "**/*_pb.rb"
|
6
|
-
|
7
|
-
Metrics/AbcSize:
|
8
|
-
Enabled: false
|
9
|
-
Metrics/BlockLength:
|
10
|
-
Exclude:
|
11
|
-
- "**/*.rake"
|
12
|
-
- "db/**/*.rb"
|
13
|
-
- "**/spec/**/*.rb"
|
14
|
-
- "**/*.gemspec"
|
15
|
-
Metrics/ClassLength:
|
16
|
-
Max: 1500
|
17
|
-
Metrics/CyclomaticComplexity:
|
18
|
-
Max: 20
|
19
|
-
Metrics/LineLength:
|
20
|
-
Max: 160
|
21
|
-
Metrics/MethodLength:
|
22
|
-
Max: 20
|
23
|
-
Exclude:
|
24
|
-
- "db/**/*.rb"
|
25
|
-
Metrics/ModuleLength:
|
26
|
-
Exclude:
|
27
|
-
- "**/*_spec.rb"
|
28
|
-
Metrics/PerceivedComplexity:
|
29
|
-
Max: 20
|
30
|
-
|
31
|
-
Layout/AlignArguments:
|
32
|
-
EnforcedStyle: with_fixed_indentation
|
33
|
-
Layout/AlignHash:
|
34
|
-
EnforcedHashRocketStyle: table
|
35
|
-
Layout/AlignParameters:
|
36
|
-
EnforcedStyle: with_fixed_indentation
|
37
|
-
Layout/EmptyLinesAroundBlockBody:
|
38
|
-
Exclude:
|
39
|
-
- "db/**/*.rb"
|
40
|
-
- "**/*.rake"
|
41
|
-
- "**/*_spec.rb"
|
42
|
-
Layout/EmptyLinesAroundClassBody:
|
43
|
-
Enabled: false
|
44
|
-
Layout/IndentFirstArrayElement:
|
45
|
-
EnforcedStyle: consistent
|
46
|
-
Layout/MultilineOperationIndentation:
|
47
|
-
Enabled: false
|
48
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
49
|
-
EnforcedStyle: no_space
|
50
|
-
Layout/SpaceInsideBlockBraces:
|
51
|
-
SpaceBeforeBlockParameters: false
|
52
|
-
|
53
|
-
Lint/AmbiguousBlockAssociation:
|
54
|
-
Exclude:
|
55
|
-
- "spec/**/*_spec.rb"
|
56
|
-
|
57
|
-
Style/ClassAndModuleChildren:
|
58
|
-
Enabled: false
|
59
|
-
Style/Documentation:
|
60
|
-
Enabled: false
|
61
|
-
Style/FrozenStringLiteralComment:
|
62
|
-
Enabled: false
|
63
|
-
Style/HashSyntax:
|
64
|
-
EnforcedStyle: ruby19_no_mixed_keys
|
65
|
-
Style/MultilineIfModifier:
|
66
|
-
Enabled: false
|
67
|
-
Style/NumericLiterals:
|
68
|
-
Enabled: false
|
69
|
-
Style/Semicolon:
|
70
|
-
AllowAsExpressionSeparator: true
|
71
|
-
Style/SingleLineBlockParams:
|
72
|
-
Enabled: false
|
73
|
-
Style/TrailingCommaInArguments:
|
74
|
-
EnforcedStyleForMultiline: consistent_comma
|
75
|
-
Style/TrailingCommaInArrayLiteral:
|
76
|
-
EnforcedStyleForMultiline: consistent_comma
|
77
|
-
Style/TrailingCommaInHashLiteral:
|
78
|
-
EnforcedStyleForMultiline: consistent_comma
|
data/.travis.yml
DELETED