net-protocol 0.1.0 → 0.1.3
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/dependabot.yml +6 -0
- data/.github/workflows/test.yml +4 -7
- data/LICENSE.txt +22 -0
- data/Rakefile +7 -0
- data/lib/net/protocol.rb +7 -6
- data/net-protocol.gemspec +16 -12
- metadata +30 -14
- data/Gemfile.lock +0 -23
- data/lib/net/protocol/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 426f967c28318d12339c67a1c40db52f25167a546e5760947c2f4653d946aa08
|
4
|
+
data.tar.gz: 1a536d8d45be996ec1bbf72443adb8aa9aaf9951c7f70366539c836af7836dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be52fa68351db428b2e0fadfb65965bae7c5e4b7dffda269cf9d9086d7f5ac91cb9c4a399788f6c7ed515be85ecb9c01e0feee94737b60a758c44438372d85b
|
7
|
+
data.tar.gz: e282e7f623600edbe1590a390cec89f6a93f0a26226d9567decad7c0f0a890d9971fc6223b8f5698894edf493c586b2b055f67af0ea14471f7c0f5a894e04b46
|
data/.github/workflows/test.yml
CHANGED
@@ -7,18 +7,15 @@ jobs:
|
|
7
7
|
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
ruby: [
|
10
|
+
ruby: [ head, '3.1', '3.0', '2.7', '2.6' ]
|
11
11
|
os: [ ubuntu-latest, macos-latest ]
|
12
12
|
runs-on: ${{ matrix.os }}
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v3
|
15
15
|
- name: Set up Ruby
|
16
16
|
uses: ruby/setup-ruby@v1
|
17
17
|
with:
|
18
18
|
ruby-version: ${{ matrix.ruby }}
|
19
|
-
|
20
|
-
run: |
|
21
|
-
gem install bundler --no-document
|
22
|
-
bundle install
|
19
|
+
bundler-cache: true # 'bundle install' and cache gems
|
23
20
|
- name: Run test
|
24
|
-
run: rake test
|
21
|
+
run: bundle exec rake test
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions
|
5
|
+
are met:
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
22
|
+
SUCH DAMAGE.
|
data/Rakefile
CHANGED
@@ -7,4 +7,11 @@ 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
|
+
|
10
17
|
task :default => :test
|
data/lib/net/protocol.rb
CHANGED
@@ -26,6 +26,8 @@ require 'io/wait'
|
|
26
26
|
module Net # :nodoc:
|
27
27
|
|
28
28
|
class Protocol #:nodoc: internal use only
|
29
|
+
VERSION = "0.1.3"
|
30
|
+
|
29
31
|
private
|
30
32
|
def Protocol.protocol_param(name, val)
|
31
33
|
module_eval(<<-End, __FILE__, __LINE__ + 1)
|
@@ -381,7 +383,7 @@ module Net # :nodoc:
|
|
381
383
|
len = writing {
|
382
384
|
using_each_crlf_line {
|
383
385
|
begin
|
384
|
-
block.call(WriteAdapter.new(self
|
386
|
+
block.call(WriteAdapter.new(self.method(:write_message_0)))
|
385
387
|
rescue LocalJumpError
|
386
388
|
# allow `break' from writer block
|
387
389
|
end
|
@@ -445,17 +447,16 @@ module Net # :nodoc:
|
|
445
447
|
# The writer adapter class
|
446
448
|
#
|
447
449
|
class WriteAdapter
|
448
|
-
def initialize(
|
449
|
-
@
|
450
|
-
@method_id = method
|
450
|
+
def initialize(writer)
|
451
|
+
@writer = writer
|
451
452
|
end
|
452
453
|
|
453
454
|
def inspect
|
454
|
-
"#<#{self.class}
|
455
|
+
"#<#{self.class} writer=#{@writer.inspect}>"
|
455
456
|
end
|
456
457
|
|
457
458
|
def write(str)
|
458
|
-
@
|
459
|
+
@writer.call(str)
|
459
460
|
end
|
460
461
|
|
461
462
|
alias print write
|
data/net-protocol.gemspec
CHANGED
@@ -1,19 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
name = File.basename(__FILE__, ".gemspec")
|
4
|
+
version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir|
|
5
|
+
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
|
6
|
+
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
|
7
|
+
end rescue nil
|
5
8
|
end
|
6
9
|
|
7
10
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
9
|
-
spec.version =
|
11
|
+
spec.name = name
|
12
|
+
spec.version = version
|
10
13
|
spec.authors = ["Yukihiro Matsumoto"]
|
11
14
|
spec.email = ["matz@ruby-lang.org"]
|
12
15
|
|
13
|
-
spec.summary = %q{The
|
14
|
-
spec.description = %q{The
|
16
|
+
spec.summary = %q{The abstract interface for net-* client.}
|
17
|
+
spec.description = %q{The abstract interface for net-* client.}
|
15
18
|
spec.homepage = "https://github.com/ruby/net-protocol"
|
16
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
20
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
17
21
|
|
18
22
|
spec.metadata["homepage_uri"] = spec.homepage
|
19
23
|
spec.metadata["source_code_uri"] = spec.homepage
|
@@ -21,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
21
25
|
# Specify which files should be added to the gem when it is released.
|
22
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
27
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
24
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
+
`git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
29
|
end
|
26
|
-
spec.bindir = "exe"
|
27
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
30
|
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
spec.add_dependency "timeout"
|
29
33
|
end
|
metadata
CHANGED
@@ -1,39 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: timeout
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: The abstract interface for net-* client.
|
14
28
|
email:
|
15
29
|
- matz@ruby-lang.org
|
16
30
|
executables: []
|
17
31
|
extensions: []
|
18
32
|
extra_rdoc_files: []
|
19
33
|
files:
|
34
|
+
- ".github/dependabot.yml"
|
20
35
|
- ".github/workflows/test.yml"
|
21
36
|
- ".gitignore"
|
22
37
|
- Gemfile
|
23
|
-
-
|
38
|
+
- LICENSE.txt
|
24
39
|
- README.md
|
25
40
|
- Rakefile
|
26
41
|
- bin/console
|
27
42
|
- bin/setup
|
28
43
|
- lib/net/protocol.rb
|
29
|
-
- lib/net/protocol/version.rb
|
30
44
|
- net-protocol.gemspec
|
31
45
|
homepage: https://github.com/ruby/net-protocol
|
32
|
-
licenses:
|
46
|
+
licenses:
|
47
|
+
- Ruby
|
48
|
+
- BSD-2-Clause
|
33
49
|
metadata:
|
34
50
|
homepage_uri: https://github.com/ruby/net-protocol
|
35
51
|
source_code_uri: https://github.com/ruby/net-protocol
|
36
|
-
post_install_message:
|
52
|
+
post_install_message:
|
37
53
|
rdoc_options: []
|
38
54
|
require_paths:
|
39
55
|
- lib
|
@@ -41,15 +57,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
57
|
requirements:
|
42
58
|
- - ">="
|
43
59
|
- !ruby/object:Gem::Version
|
44
|
-
version: 2.
|
60
|
+
version: 2.6.0
|
45
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
62
|
requirements:
|
47
63
|
- - ">="
|
48
64
|
- !ruby/object:Gem::Version
|
49
65
|
version: '0'
|
50
66
|
requirements: []
|
51
|
-
rubygems_version: 3.
|
52
|
-
signing_key:
|
67
|
+
rubygems_version: 3.4.0.dev
|
68
|
+
signing_key:
|
53
69
|
specification_version: 4
|
54
|
-
summary: The
|
70
|
+
summary: The abstract interface for net-* client.
|
55
71
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
net-protocol (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
power_assert (1.1.5)
|
10
|
-
rake (12.3.3)
|
11
|
-
test-unit (3.3.5)
|
12
|
-
power_assert
|
13
|
-
|
14
|
-
PLATFORMS
|
15
|
-
ruby
|
16
|
-
|
17
|
-
DEPENDENCIES
|
18
|
-
net-protocol!
|
19
|
-
rake
|
20
|
-
test-unit
|
21
|
-
|
22
|
-
BUNDLED WITH
|
23
|
-
2.1.4
|