net-protocol 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/lib/net/protocol.rb +6 -7
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92337fd3b9dd8606934c4268df73d181c6e01415cbb46d351fa3aea9efa916f7
4
- data.tar.gz: 844f8cc3ea230ffbd36bfa8a659d8e41623123f1b9de1eba5c5844986d6093a9
3
+ metadata.gz: d8e88ea7a722bbf9b9d0f2fa612bfde5c5208878e180f5a26516b1df9b034f17
4
+ data.tar.gz: 9062b0fea9900d450c8b2384ba2bdc3a56296b3e77a8cf32a5eae11ce5af782f
5
5
  SHA512:
6
- metadata.gz: 0a4fd46f1b109a518d98d3da922a5fdbc0a62ca425e0a4e80df355a3c3ad63473c93a07068ffe92f8a4d233930344ffa353e599b6993a568ccc5cfb2b8365249
7
- data.tar.gz: 9f3be01d495d0077b40ded12a6f3dfc9eb2f65fed8e883447340c3ac2208c8e715f1fdc0e9aabd193143bee5cd7a01ceeffe4f5f39d8b8f09346b51414ed4f92
6
+ metadata.gz: 8206f5d99416bbd72b390819fe5193dddde16b6b0d4f5bfa7fa99fc6d99ed79f1c5e2dab0da13009d27087d483d13e92d48a92ca4db853f1f531a0f884afdad9
7
+ data.tar.gz: b9881f6507c2f67f24bc60034397644745e090194a5443093a9f655008bd4db8281e6a49bf76aea135b12bb534bc230866aef80c784a67e72cd024567dcfdee3
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  task :sync_tool do
11
11
  require 'fileutils'
12
- FileUtils.cp "../ruby/tool/lib/test/unit/core_assertions.rb", "./test/lib"
12
+ FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
13
13
  FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
14
14
  FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
15
15
  end
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.1.1"
29
+ VERSION = "0.1.2"
30
30
 
31
31
  private
32
32
  def Protocol.protocol_param(name, val)
@@ -383,7 +383,7 @@ module Net # :nodoc:
383
383
  len = writing {
384
384
  using_each_crlf_line {
385
385
  begin
386
- block.call(WriteAdapter.new(self, :write_message_0))
386
+ block.call(WriteAdapter.new(self.method(:write_message_0)))
387
387
  rescue LocalJumpError
388
388
  # allow `break' from writer block
389
389
  end
@@ -447,17 +447,16 @@ module Net # :nodoc:
447
447
  # The writer adapter class
448
448
  #
449
449
  class WriteAdapter
450
- def initialize(socket, method)
451
- @socket = socket
452
- @method_id = method
450
+ def initialize(writer)
451
+ @writer = writer
453
452
  end
454
453
 
455
454
  def inspect
456
- "#<#{self.class} socket=#{@socket.inspect}>"
455
+ "#<#{self.class} writer=#{@writer.inspect}>"
457
456
  end
458
457
 
459
458
  def write(str)
460
- @socket.__send__(@method_id, str)
459
+ @writer.call(str)
461
460
  end
462
461
 
463
462
  alias print write
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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-31 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timeout