ruby-brs 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ext/extconf.rb +6 -0
- data/lib/brs/stream/abstract.rb +1 -1
- data/lib/brs/stream/raw/compressor.rb +2 -0
- data/lib/brs/stream/reader.rb +7 -7
- data/lib/brs/stream/reader_helpers.rb +2 -0
- data/lib/brs/stream/writer_helpers.rb +2 -5
- data/lib/brs/version.rb +1 -1
- metadata +48 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 774954dc3bd3496501331c3799402c19bb6cd683fb0852420228677c8cc9bee5
|
4
|
+
data.tar.gz: 162bbb4c99689035c3c2a245ba0c242886c1f75eab278ce1082984110896366e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2560264e86f2ff77dd810261d94576d9999682c5f9f70334d2e85d28dfc7e576bd1e996872020b65e3588d3334e019d3a6c056960ddcd0cbe98c406fc2794c6c
|
7
|
+
data.tar.gz: fef04f25c06b4cdac5b187feced270ca021361c4c112db269d7509dea636fdf53d492d10566b137889dea543433ed332ec1e8d643163233f0db8657c03342dc5
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Ruby bindings for brotli library
|
2
2
|
|
3
|
-
| Travis | AppVeyor | Cirrus | Circle |
|
4
|
-
| :---: | :---: | :---: | :---: |
|
5
|
-
| [![Travis test status](https://travis-ci.com/andrew-aladev/ruby-brs.svg?branch=master)](https://travis-ci.com/andrew-aladev/ruby-brs) | [![AppVeyor test status](https://ci.appveyor.com/api/projects/status/github/andrew-aladev/ruby-brs?branch=master&svg=true)](https://ci.appveyor.com/project/andrew-aladev/ruby-brs/branch/master) | [![Cirrus test status](https://api.cirrus-ci.com/github/andrew-aladev/ruby-brs.svg?branch=master)](https://cirrus-ci.com/github/andrew-aladev/ruby-brs) | [![Circle test status](https://circleci.com/gh/andrew-aladev/ruby-brs/tree/master.svg?style=shield)](https://circleci.com/gh/andrew-aladev/ruby-brs/tree/master) |
|
3
|
+
| Travis | AppVeyor | Cirrus | Circle | Codecov |
|
4
|
+
| :---: | :---: | :---: | :---: | :---: |
|
5
|
+
| [![Travis test status](https://travis-ci.com/andrew-aladev/ruby-brs.svg?branch=master)](https://travis-ci.com/andrew-aladev/ruby-brs) | [![AppVeyor test status](https://ci.appveyor.com/api/projects/status/github/andrew-aladev/ruby-brs?branch=master&svg=true)](https://ci.appveyor.com/project/andrew-aladev/ruby-brs/branch/master) | [![Cirrus test status](https://api.cirrus-ci.com/github/andrew-aladev/ruby-brs.svg?branch=master)](https://cirrus-ci.com/github/andrew-aladev/ruby-brs) | [![Circle test status](https://circleci.com/gh/andrew-aladev/ruby-brs/tree/master.svg?style=shield)](https://circleci.com/gh/andrew-aladev/ruby-brs/tree/master) | [![Codecov](https://codecov.io/gh/andrew-aladev/ruby-brs/branch/master/graph/badge.svg)](https://codecov.io/gh/andrew-aladev/ruby-brs) |
|
6
6
|
|
7
7
|
See [brotli library](https://github.com/google/brotli).
|
8
8
|
|
data/ext/extconf.rb
CHANGED
@@ -61,7 +61,13 @@ $srcs = %w[
|
|
61
61
|
.map { |name| "src/#{extension_name}/#{name}.c" }
|
62
62
|
.freeze
|
63
63
|
|
64
|
+
if ENV["CI"] || ENV["COVERAGE"]
|
65
|
+
$CFLAGS << " --coverage"
|
66
|
+
$LDFLAGS << " --coverage"
|
67
|
+
end
|
68
|
+
|
64
69
|
$CFLAGS << " -Wno-declaration-after-statement"
|
70
|
+
|
65
71
|
$VPATH << "$(srcdir)/#{extension_name}:$(srcdir)/#{extension_name}/stream"
|
66
72
|
# rubocop:enable Style/GlobalVars
|
67
73
|
|
data/lib/brs/stream/abstract.rb
CHANGED
@@ -51,7 +51,7 @@ module BRS
|
|
51
51
|
protected def reset_io_advise
|
52
52
|
# Both compressor and decompressor need sequential io access.
|
53
53
|
@io.advise :sequential
|
54
|
-
rescue ::Errno::ESPIPE # rubocop:disable Lint/
|
54
|
+
rescue ::Errno::ESPIPE # rubocop:disable Lint/SuppressedException
|
55
55
|
# ok
|
56
56
|
end
|
57
57
|
|
data/lib/brs/stream/reader.rb
CHANGED
@@ -53,12 +53,12 @@ module BRS
|
|
53
53
|
unless bytes_to_read.nil?
|
54
54
|
return nil if eof?
|
55
55
|
|
56
|
-
|
56
|
+
read_more_to_buffer until @buffer.bytesize >= bytes_to_read || @io.eof?
|
57
57
|
|
58
58
|
return read_bytes_from_buffer bytes_to_read, out_buffer
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
read_more_to_buffer until @io.eof?
|
62
62
|
|
63
63
|
result = @buffer
|
64
64
|
reset_buffer
|
@@ -71,7 +71,7 @@ module BRS
|
|
71
71
|
result
|
72
72
|
end
|
73
73
|
|
74
|
-
protected def
|
74
|
+
protected def read_more_to_buffer
|
75
75
|
io_data = @io.read @source_buffer_length
|
76
76
|
append_io_data_to_buffer io_data
|
77
77
|
end
|
@@ -79,12 +79,12 @@ module BRS
|
|
79
79
|
def readpartial(bytes_to_read = nil, out_buffer = nil)
|
80
80
|
raise ::EOFError if eof?
|
81
81
|
|
82
|
-
|
82
|
+
readpartial_to_buffer until @buffer.bytesize >= bytes_to_read || @io.eof?
|
83
83
|
|
84
84
|
read_bytes_from_buffer bytes_to_read, out_buffer
|
85
85
|
end
|
86
86
|
|
87
|
-
protected def
|
87
|
+
protected def readpartial_to_buffer
|
88
88
|
io_data = @io.readpartial @source_buffer_length
|
89
89
|
append_io_data_to_buffer io_data
|
90
90
|
end
|
@@ -108,12 +108,12 @@ module BRS
|
|
108
108
|
def read_nonblock(bytes_to_read, out_buffer = nil, *options)
|
109
109
|
raise ::EOFError if eof?
|
110
110
|
|
111
|
-
|
111
|
+
read_more_to_buffer_nonblock(*options) until @buffer.bytesize >= bytes_to_read || @io.eof?
|
112
112
|
|
113
113
|
read_bytes_from_buffer bytes_to_read, out_buffer
|
114
114
|
end
|
115
115
|
|
116
|
-
protected def
|
116
|
+
protected def read_more_to_buffer_nonblock(*options)
|
117
117
|
io_data = @io.read_nonblock @source_buffer_length, *options
|
118
118
|
append_io_data_to_buffer io_data
|
119
119
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# Ruby bindings for brotli library.
|
2
2
|
# Copyright (c) 2019 AUTHORS, MIT License.
|
3
3
|
|
4
|
+
require "English"
|
5
|
+
|
4
6
|
require_relative "../error"
|
5
7
|
require_relative "../validation"
|
6
8
|
|
@@ -12,11 +14,6 @@ module BRS
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def print(*objects)
|
15
|
-
if objects.empty?
|
16
|
-
write $LAST_READ_LINE unless $LAST_READ_LINE.nil?
|
17
|
-
return nil
|
18
|
-
end
|
19
|
-
|
20
17
|
objects.each do |object|
|
21
18
|
write object
|
22
19
|
write $OUTPUT_FIELD_SEPARATOR unless $OUTPUT_FIELD_SEPARATOR.nil?
|
data/lib/brs/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-brs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Aladjev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: codecov
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: minitar
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +66,34 @@ dependencies:
|
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '1.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
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'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: rake-compiler
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
|
-
- - "
|
87
|
+
- - ">="
|
60
88
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
89
|
+
version: '0'
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- - "
|
94
|
+
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rubocop
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +136,20 @@ dependencies:
|
|
108
136
|
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
138
|
version: '2.3'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
111
153
|
description:
|
112
154
|
email: aladjev.andrew@gmail.com
|
113
155
|
executables: []
|