xchan.rb 0.16.4 → 0.16.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f17c01d5c34d8de2176fa5241ca08bc985798d6a3d7d6b4fa355cd0f2cc6e739
4
- data.tar.gz: 0f1908263e8a272e32d2ec6e8026c21e836c1da92ee2ed12a0a9949e69ed1d46
3
+ metadata.gz: e5030f45f888a9c83fadde357be0c919cece744735af66016d80bcd5a9970dcc
4
+ data.tar.gz: b9de8383ad5af12a57586087c0c95b37d08ff07e7838b12471583c06ebec214b
5
5
  SHA512:
6
- metadata.gz: ac3779d634423270951d4c2d4818c021a856f066837f3b2015365d50af390cb5ccc2453475773f4ee0ed13ce1c19a30787e873ee43d84dc7d1ebd7f744e7a3f9
7
- data.tar.gz: d7fccca83af9d0d73302b17b50d7b03843ce1c7d599f711e1a7f5b9252d1a8e9f40f7919134ffb25fb88007ee2578b0a9e7049a51b29c3cb0440df66a5ea0d09
6
+ metadata.gz: 6716dcd591f6384a8665e2601fcc10d17f7ecb2842ed656ffc13de90d785bf5bd2e089fcc2ef5bba2a58ebde0b544014cc769cec6315413d0ac7c32d99724930
7
+ data.tar.gz: 578c4aedba9104f7eeec52d1780df6ac7e7caed3040f19da4e4f20b436031e60f79ce2e7300e5ce6abbd6d638406143b5bcb0a4335b4400ae27cba05743f0db2
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  *.gem
2
- .localgems/
3
2
  .bundle
4
3
  Gemfile.lock
5
4
  .yardoc/
data/README.md CHANGED
@@ -111,7 +111,7 @@ This example performs a write that will block when the send buffer becomes full:
111
111
  ```ruby
112
112
  require "xchan"
113
113
 
114
- ch = xchan(:marshal, socket: Socket::SOCK_STREAM)
114
+ ch = xchan(:marshal, sock_type: Socket::SOCK_STREAM)
115
115
  sndbuf = ch.getsockopt(:reader, Socket::SOL_SOCKET, Socket::SO_SNDBUF)
116
116
  while ch.bytes_sent <= sndbuf.int
117
117
  ch.send(1)
@@ -140,7 +140,7 @@ rescue Chan::WaitLockable
140
140
  retry
141
141
  end
142
142
 
143
- ch = xchan(:marshal, socket: Socket::SOCK_STREAM)
143
+ ch = xchan(:marshal, sock_type: Socket::SOCK_STREAM)
144
144
  sndbuf = ch.getsockopt(:writer, Socket::SOL_SOCKET, Socket::SO_SNDBUF)
145
145
  while ch.bytes_sent <= sndbuf.int
146
146
  send_nonblock(ch, 1)
@@ -166,7 +166,7 @@ a keyword argument:
166
166
 
167
167
  ```ruby
168
168
  require "xchan"
169
- ch = xchan(:marshal, socket: Socket::SOCK_STREAM)
169
+ ch = xchan(:marshal, sock_type: Socket::SOCK_STREAM)
170
170
  ```
171
171
 
172
172
  #### Options
@@ -222,19 +222,25 @@ ch = xchan(:marshal, tmpdir: Dir.home)
222
222
 
223
223
  ## Install
224
224
 
225
+ **Git**
226
+
225
227
  xchan.rb is distributed as a RubyGem through its git repositories. <br>
226
228
  [GitHub](https://github.com/0x1eef/xchan.rb),
227
229
  and
228
230
  [GitLab](https://gitlab.com/0x1eef/xchan.rb)
229
231
  are available as sources.
230
232
 
231
- **Gemfile**
232
-
233
- ```ruby
234
- gem "xchan.rb", github: "0x1eef/xchan.rb", tag: "v0.16.3"
235
- gem "lockf.rb", github: "0x1eef/lockf.rb", tag: "v0.10.6"
233
+ ``` ruby
234
+ # Gemfile
235
+ gem "xchan.rb", github: "0x1eef/xchan.rb", tag: "v0.16.5"
236
236
  ```
237
237
 
238
+ **Rubygems.org**
239
+
240
+ xchan.rb can also be installed via rubygems.org.
241
+
242
+ gem install xchan.rb
243
+
238
244
  ## <a id="license"> License </a>
239
245
 
240
246
  [BSD Zero Clause](https://choosealicense.com/licenses/0bsd/).
data/lib/xchan/mixin.rb CHANGED
@@ -11,7 +11,7 @@ module Chan::Mixin
11
11
  # ch.close
12
12
  #
13
13
  # @param serializer (see Chan::UNIXSocket#initialize)
14
- # @param socket (see Chan::UNIXSocket#initialize)
14
+ # @param sock_type (see Chan::UNIXSocket#initialize)
15
15
  # @param tmpdir (see Chan::UNIXSocket#initialize)
16
16
  # @return (see Chan::UNIXSocket#initialize)
17
17
  def xchan(serializer = :marshal, **kw_args)
@@ -18,7 +18,7 @@ class Chan::UNIXSocket
18
18
  # @param [Symbol, <#dump, #load>] serializer
19
19
  # A serializer.
20
20
  #
21
- # @param [Integer] socket
21
+ # @param [Integer] sock_type
22
22
  # A socket type (eg Socket::SOCK_STREAM).
23
23
  #
24
24
  # @param [String] tmpdir
@@ -26,9 +26,9 @@ class Chan::UNIXSocket
26
26
  #
27
27
  # @return [Chan::UNIXSocket]
28
28
  # Returns an instance of {Chan::UNIXSocket Chan::UNIXSocket}.
29
- def initialize(serializer, tmpdir: Dir.tmpdir, socket: Socket::SOCK_DGRAM)
29
+ def initialize(serializer, tmpdir: Dir.tmpdir, sock_type: Socket::SOCK_DGRAM)
30
30
  @serializer = Chan.serializers[serializer]&.call || serializer
31
- @r, @w = ::UNIXSocket.pair(socket)
31
+ @r, @w = ::UNIXSocket.pair(sock_type)
32
32
  @bytes = Chan::Bytes.new(tmpdir)
33
33
  @lock = LockFile.new Chan.temporary_file("xchan.lock", tmpdir:)
34
34
  end
data/lib/xchan/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chan
4
- VERSION = "0.16.4"
4
+ VERSION = "0.16.5"
5
5
  end
@@ -3,7 +3,7 @@
3
3
  require_relative "../setup"
4
4
  require "xchan"
5
5
 
6
- ch = xchan(:marshal, socket: Socket::SOCK_STREAM)
6
+ ch = xchan(:marshal, sock_type: Socket::SOCK_STREAM)
7
7
  sndbuf = ch.getsockopt(:reader, Socket::SOL_SOCKET, Socket::SO_SNDBUF)
8
8
  while ch.bytes_sent <= sndbuf.int
9
9
  ch.send(1)
@@ -14,7 +14,7 @@ rescue Chan::WaitLockable
14
14
  retry
15
15
  end
16
16
 
17
- ch = xchan(:marshal, socket: Socket::SOCK_STREAM)
17
+ ch = xchan(:marshal, sock_type: Socket::SOCK_STREAM)
18
18
  sndbuf = ch.getsockopt(:writer, Socket::SOL_SOCKET, Socket::SO_SNDBUF)
19
19
  while ch.bytes_sent <= sndbuf.int
20
20
  send_nonblock(ch, 1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xchan.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.4
4
+ version: 0.16.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'