io-wait 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab2e90fe2ac7d5df2d629e3ccd501b8c01570fadd3eeee5d42709e55deb26ec6
4
- data.tar.gz: 12663accc0c74fb25368e47a87fbc7a5b4f06ccd7435ee1ab4528e51b4dca843
3
+ metadata.gz: '09f49ee95b2ba86480e8e9433aeb0f05890e1573b04a9967f76a705da944c11b'
4
+ data.tar.gz: 48db6154ed263ecdb3a3ace629d629c18c18637e8577cec6d784310b38e33050
5
5
  SHA512:
6
- metadata.gz: 1bc887d4119a7c39978294b99d6bc2affbc0124236ec4062fe439ffbfa64db295ec4de180a1db16ad2c481927a72f046def66e34dae9cca49157ccd25a8b82e4
7
- data.tar.gz: 1b237ca1a3f74ff1208059f49061df665ff4a78f8da89d9b7ffbb9a57cd9205ffbb848fb583704fafad66954df7f2481d9a145e1d68591c31d11ab8fff1b2dbe
6
+ metadata.gz: 72db9c0fea93027e7c8489ad5ecc7533c99f494743939ca2a1aaac3cac3847847538e07346ae53ca9026fb20aaa801ca0d35a5e8c491047f96b1e6cea0996e92
7
+ data.tar.gz: b70fc31c4c86f82e026be29904dbb819cb45deb2b6cff8d4cde4266f039c3b3b2c64e3b6c99be9df3034f1a9b8766d87078c1e2dba379aa542e914766712f564
data/.document ADDED
@@ -0,0 +1,6 @@
1
+ COPYING
2
+ ChangeLog
3
+ README.md
4
+ _doc/
5
+ ext/
6
+ logs/ChangeLog-*
data/.rdoc_options ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ main_page: README.md
data/_doc/io.rb ADDED
@@ -0,0 +1,3 @@
1
+ # See {IO}[https://docs.ruby-lang.org/en/master/IO.html]
2
+ class IO
3
+ end
data/ext/io/wait/depend CHANGED
@@ -2,7 +2,7 @@
2
2
  wait.o: $(RUBY_EXTCONF_H)
3
3
  wait.o: $(arch_hdrdir)/ruby/config.h
4
4
  wait.o: $(hdrdir)/ruby.h
5
- # wait.o: $(hdrdir)/ruby/assert.h # not in 2.6
5
+ wait.o: $(hdrdir)/ruby/assert.h
6
6
  wait.o: $(hdrdir)/ruby/backward.h
7
7
  wait.o: $(hdrdir)/ruby/defines.h
8
8
  wait.o: $(hdrdir)/ruby/encoding.h
@@ -1,25 +1,21 @@
1
1
  # frozen_string_literal: false
2
2
  require 'mkmf'
3
3
 
4
- if RUBY_VERSION < "2.6"
5
- File.write("Makefile", dummy_makefile($srcdir).join(""))
4
+ target = "io/wait"
5
+ have_func("rb_io_wait", "ruby/io.h")
6
+ have_func("rb_io_descriptor", "ruby/io.h")
7
+ unless macro_defined?("DOSISH", "#include <ruby.h>")
8
+ have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
9
+ fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
10
+ have_macro("FIONREAD", [h, ioctl_h].compact)
11
+ end
12
+ if fionread
13
+ $defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
14
+ create_makefile(target)
15
+ end
6
16
  else
7
- target = "io/wait"
8
- have_func("rb_io_wait")
9
- have_func("rb_io_descriptor")
10
- unless macro_defined?("DOSISH", "#include <ruby.h>")
11
- have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
12
- fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
13
- have_macro("FIONREAD", [h, ioctl_h].compact)
14
- end
15
- if fionread
16
- $defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
17
- create_makefile(target)
18
- end
19
- else
20
- if have_func("rb_w32_ioctlsocket", "ruby.h")
21
- have_func("rb_w32_is_socket", "ruby.h")
22
- create_makefile(target)
23
- end
17
+ if have_func("rb_w32_ioctlsocket", "ruby.h")
18
+ have_func("rb_w32_is_socket", "ruby.h")
19
+ create_makefile(target)
24
20
  end
25
21
  end
data/ext/io/wait/wait.c CHANGED
@@ -312,7 +312,7 @@ io_event_from_value(VALUE value)
312
312
  /*
313
313
  * call-seq:
314
314
  * io.wait(events, timeout) -> event mask, false or nil
315
- * io.wait(timeout = nil, mode = :read) -> self, true, or false
315
+ * io.wait(*event_symbols[, timeout]) -> self, true, or false
316
316
  *
317
317
  * Waits until the IO becomes ready for the specified events and returns the
318
318
  * subset of events that become ready, or a falsy value when times out.
@@ -320,10 +320,14 @@ io_event_from_value(VALUE value)
320
320
  * The events can be a bit mask of +IO::READABLE+, +IO::WRITABLE+ or
321
321
  * +IO::PRIORITY+.
322
322
  *
323
- * Returns a truthy value immediately when buffered data is available.
323
+ * Returns an event mask (truthy value) immediately when buffered data is
324
+ * available.
324
325
  *
325
- * Optional parameter +mode+ is one of +:read+, +:write+, or
326
- * +:read_write+.
326
+ * The second form: if one or more event symbols (+:read+, +:write+, or
327
+ * +:read_write+) are passed, the event mask is the bit OR of the bitmask
328
+ * corresponding to those symbols. In this form, +timeout+ is optional, the
329
+ * order of the arguments is arbitrary, and returns +io+ if any of the
330
+ * events is ready.
327
331
  *
328
332
  * You must require 'io/wait' to use this method.
329
333
  */
@@ -360,10 +364,6 @@ io_wait(int argc, VALUE *argv, VALUE io)
360
364
  rb_io_event_t events = 0;
361
365
  int i, return_io = 0;
362
366
 
363
- /* The documented signature for this method is actually incorrect.
364
- * A single timeout is allowed in any position, and multiple symbols can be given.
365
- * Whether this is intentional or not, I don't know, and as such I consider this to
366
- * be a legacy/slow path. */
367
367
  if (argc != 2 || (RB_SYMBOL_P(argv[0]) || RB_SYMBOL_P(argv[1]))) {
368
368
  /* We'd prefer to return the actual mask, but this form would return the io itself: */
369
369
  return_io = 1;
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-wait
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  - Charles Oliver Nutter
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2023-12-13 00:00:00.000000000 Z
11
+ date: 2025-07-15 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Waits until IO is readable or writable without blocking.
15
14
  email:
@@ -20,9 +19,12 @@ extensions:
20
19
  - ext/io/wait/extconf.rb
21
20
  extra_rdoc_files: []
22
21
  files:
22
+ - ".document"
23
+ - ".rdoc_options"
23
24
  - COPYING
24
25
  - Gemfile
25
26
  - README.md
27
+ - _doc/io.rb
26
28
  - ext/io/wait/depend
27
29
  - ext/io/wait/extconf.rb
28
30
  - ext/io/wait/wait.c
@@ -33,7 +35,6 @@ licenses:
33
35
  metadata:
34
36
  homepage_uri: https://github.com/ruby/io-wait
35
37
  source_code_uri: https://github.com/ruby/io-wait
36
- post_install_message:
37
38
  rdoc_options: []
38
39
  require_paths:
39
40
  - lib
@@ -41,15 +42,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
41
42
  requirements:
42
43
  - - ">="
43
44
  - !ruby/object:Gem::Version
44
- version: '0'
45
+ version: '3.0'
45
46
  required_rubygems_version: !ruby/object:Gem::Requirement
46
47
  requirements:
47
48
  - - ">="
48
49
  - !ruby/object:Gem::Version
49
50
  version: '0'
50
51
  requirements: []
51
- rubygems_version: 3.5.0.dev
52
- signing_key:
52
+ rubygems_version: 3.6.7
53
53
  specification_version: 4
54
54
  summary: Waits until IO is readable or writable without blocking.
55
55
  test_files: []