io-console 0.9.3 → 0.9.4

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: ebd03c00dd26da504baad420ab97511db9bdce9f417d11ae1c22b0d66b900d25
4
- data.tar.gz: 53d6e1b303c060a5680e1c27b92d20cc5ed218789dc4526cb1f05f89ba006eeb
3
+ metadata.gz: 982d948cdd16ab0999b230f5bcd0518e9e45306b4520ca2279d070cd19c545aa
4
+ data.tar.gz: 5b7e540146b2f6ff031a094d8c4b127eae8d16031d9fd14bee1f98b14bd4e531
5
5
  SHA512:
6
- metadata.gz: 5d822e1e4153d1fc233dc844dcd664df75ca34d892fc909c6266dfcd57b082f9d4d766f39a2b447892f2ab9bd7adaf72b830bd197c2bec37bd34de21cb385180
7
- data.tar.gz: 2d1a01b63c7076d5c28bbf60824fb2a0528f252db3186946000223e95425e19efd4a0e78153496a0f58f9948e16cd1aeea8b1a28644e7a10dc1eb81aa98745c5
6
+ metadata.gz: 3ad6916e763a997cb36429a8c5968ece5e24932698560a3e12b1502ddc98478361915ea3b8f673a558c7a1d06355a1ca5ecfd7b5c8b505be73ca1d63c658278a
7
+ data.tar.gz: 07ad02584ba78446e4f959e5fd76fe1b8e1ec48e465c77a4ae14b6538a43567adbc03b2c105115eec84789d56b83b6649fca6b17f9087023fcc11cfdb6f57742
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  static const char *const
7
- IO_CONSOLE_VERSION = "0.9.3";
7
+ IO_CONSOLE_VERSION = "0.9.4";
8
8
 
9
9
  #include "ruby.h"
10
10
  #include "ruby/io.h"
@@ -2314,6 +2314,9 @@ console_ttyname(VALUE io)
2314
2314
  return rb_usascii_str_new_lit("con");
2315
2315
  # elif defined HAVE_TTYNAME_R
2316
2316
  {
2317
+ # ifdef TTYNAME_R_RETURNS_CHAR_P
2318
+ # define ttyname_r(fd, name, size) (ttyname_r(fd, name, size) == NULL ? errno : 0)
2319
+ # endif
2317
2320
  char termname[1024], *tn = termname;
2318
2321
  size_t size = sizeof(termname);
2319
2322
  int e;
@@ -50,7 +50,18 @@ when true
50
50
  end
51
51
  have_func("rb_category_warn")
52
52
  have_const("RB_WARN_CATEGORY_DEPRECATED")
53
- win32 or have_func("ttyname_r") or have_func("ttyname")
53
+ unless win32
54
+ if have_func("ttyname_r")
55
+ ret = checking_for("type of ttyname_r()", "%s") {try_link(<<~C) ? "int" : "char *"}
56
+ #{cpp_include %<unistd.h>}
57
+ int t(void) {char name[1024]; return ttyname_r(0, name, sizeof(name)) % 1024;}
58
+ #{MAIN_DOES_NOTHING('t')}
59
+ C
60
+ $defs << "-DTTYNAME_R_RETURNS_#{ret.tr_cpp}"
61
+ else
62
+ have_func("ttyname")
63
+ end
64
+ end
54
65
  have_func("rb_prepend_module") # not exported by TruffleRuby
55
66
  vk_tool = find_executable("gperf")
56
67
  create_makefile("io/console") {|conf|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-14 00:00:00.000000000 Z
10
+ date: 2026-09-17 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: add console capabilities to IO instances.
13
13
  email: nobu@ruby-lang.org