net-protocol 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +14 -5
- data/Gemfile +1 -0
- data/Rakefile +0 -7
- data/lib/net/protocol.rb +6 -15
- data/net-protocol.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7931f6f4ad36cdf9dffca852a9e6c224bb229269da14ac94b6ea06e030ad58e3
|
4
|
+
data.tar.gz: acec2eea018af73a5d7c809230a91cf2017f7486cdf96d89960c529e3956da39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0524fe9693038d5da5bd8920ab921bacf8b641301c215986bbeca494bec701cfb6e313e6abd68db520e5c763c984818f47e0cf0da2d4f4ca2b9e25a497b49bd6
|
7
|
+
data.tar.gz: aa4c7acb2896d4c2e22f23e25d4f6219c0126b110de700e6282b976edc327247f67dcf064d4d31eb9dfc084bdbca21da8802f382b72cb25971fc486d34e22368
|
data/.github/workflows/test.yml
CHANGED
@@ -1,17 +1,26 @@
|
|
1
|
-
name:
|
1
|
+
name: test
|
2
2
|
|
3
3
|
on: [push, pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
|
6
|
+
ruby-verions:
|
7
|
+
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
|
8
|
+
with:
|
9
|
+
min_version: 2.6
|
10
|
+
|
11
|
+
test:
|
12
|
+
needs: ruby-verions
|
7
13
|
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
14
|
strategy:
|
9
15
|
matrix:
|
10
|
-
ruby:
|
11
|
-
os: [ ubuntu-latest, macos-latest ]
|
16
|
+
ruby: ${{ fromJson(needs.ruby-verions.outputs.versions) }}
|
17
|
+
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
18
|
+
exclude:
|
19
|
+
- { os: windows-latest, ruby: truffleruby-head }
|
20
|
+
- { os: windows-latest, ruby: truffleruby }
|
12
21
|
runs-on: ${{ matrix.os }}
|
13
22
|
steps:
|
14
|
-
- uses: actions/checkout@
|
23
|
+
- uses: actions/checkout@v4
|
15
24
|
- name: Set up Ruby
|
16
25
|
uses: ruby/setup-ruby@v1
|
17
26
|
with:
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -7,11 +7,4 @@ Rake::TestTask.new(:test) do |t|
|
|
7
7
|
t.test_files = FileList["test/**/test_*.rb"]
|
8
8
|
end
|
9
9
|
|
10
|
-
task :sync_tool do
|
11
|
-
require 'fileutils'
|
12
|
-
FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
|
13
|
-
FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
|
14
|
-
FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
|
15
|
-
end
|
16
|
-
|
17
10
|
task :default => :test
|
data/lib/net/protocol.rb
CHANGED
@@ -26,7 +26,7 @@ require 'io/wait'
|
|
26
26
|
module Net # :nodoc:
|
27
27
|
|
28
28
|
class Protocol #:nodoc: internal use only
|
29
|
-
VERSION = "0.2.
|
29
|
+
VERSION = "0.2.2"
|
30
30
|
|
31
31
|
private
|
32
32
|
def Protocol.protocol_param(name, val)
|
@@ -120,6 +120,7 @@ module Net # :nodoc:
|
|
120
120
|
@continue_timeout = continue_timeout
|
121
121
|
@debug_output = debug_output
|
122
122
|
@rbuf = ''.b
|
123
|
+
@rbuf_empty = true
|
123
124
|
@rbuf_offset = 0
|
124
125
|
end
|
125
126
|
|
@@ -156,7 +157,7 @@ module Net # :nodoc:
|
|
156
157
|
read_bytes = 0
|
157
158
|
begin
|
158
159
|
while read_bytes + rbuf_size < len
|
159
|
-
if s =
|
160
|
+
if s = rbuf_consume_all
|
160
161
|
read_bytes += s.bytesize
|
161
162
|
dest << s
|
162
163
|
end
|
@@ -177,7 +178,7 @@ module Net # :nodoc:
|
|
177
178
|
read_bytes = 0
|
178
179
|
begin
|
179
180
|
while true
|
180
|
-
if s =
|
181
|
+
if s = rbuf_consume_all
|
181
182
|
read_bytes += s.bytesize
|
182
183
|
dest << s
|
183
184
|
end
|
@@ -249,18 +250,8 @@ module Net # :nodoc:
|
|
249
250
|
@rbuf.bytesize - @rbuf_offset
|
250
251
|
end
|
251
252
|
|
252
|
-
|
253
|
-
|
254
|
-
# string once rbuf_fill has been called again
|
255
|
-
def rbuf_consume_all_shareable!
|
256
|
-
@rbuf_empty = true
|
257
|
-
buf = if @rbuf_offset == 0
|
258
|
-
@rbuf
|
259
|
-
else
|
260
|
-
@rbuf.byteslice(@rbuf_offset..-1)
|
261
|
-
end
|
262
|
-
@rbuf_offset = @rbuf.bytesize
|
263
|
-
buf
|
253
|
+
def rbuf_consume_all
|
254
|
+
rbuf_consume if rbuf_size > 0
|
264
255
|
end
|
265
256
|
|
266
257
|
def rbuf_consume(len = nil)
|
data/net-protocol.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
26
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
27
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
28
|
-
`git ls-files -z 2
|
28
|
+
`git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
29
|
end
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: timeout
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
67
|
+
rubygems_version: 3.5.0.dev
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: The abstract interface for net-* client.
|