etc 1.4.4 → 1.4.6
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/{LICENSE.txt → BSDL} +3 -3
- data/COPYING +56 -0
- data/ChangeLog +4 -4
- data/README.md +1 -0
- data/ext/etc/etc.c +35 -21
- data/ext/etc/extconf.rb +25 -23
- data/test/etc/test_etc.rb +66 -9
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 189d06e9fa0ddac3e7a4adfc9e57ae032463bc677b9e3890ccd4747bd143e5ed
|
4
|
+
data.tar.gz: cd3d52688c5aa5db9b5cdbaa9d68bb7d958c028aff7aa60a790b03dfc4342b85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 147fa5a4bda2946963fc1b3ee96b0dc71c5f5daf3087cb9f072a732431d39ba4cf7ceae1e02d84d1eeeab2b475219b2fbdafa9786c19a71f4954d987d28f9473
|
7
|
+
data.tar.gz: 47a4f90a79f6223b1870c26d037d240a5bb2a41c565c1606f26dba533c1efb4e3b590b42571bb4c8f197c5ae87c0b6f05048111c4f7e011b8385e74f53750e7f
|
data/{LICENSE.txt → BSDL}
RENAMED
@@ -4,10 +4,10 @@ Redistribution and use in source and binary forms, with or without
|
|
4
4
|
modification, are permitted provided that the following conditions
|
5
5
|
are met:
|
6
6
|
1. Redistributions of source code must retain the above copyright
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
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.
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
11
|
|
12
12
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
13
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
data/COPYING
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b. use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c. give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d. make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a. distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c. give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d. make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
data/ChangeLog
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
-*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
commit
|
3
|
+
commit c9c9b9d15e798d94c3ce148859f8b88c541bc567
|
4
4
|
Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
5
|
-
AuthorDate:
|
5
|
+
AuthorDate: 2025-07-15 16:24:07 +0900
|
6
6
|
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
7
|
-
CommitDate:
|
7
|
+
CommitDate: 2025-07-15 16:24:09 +0900
|
8
8
|
|
9
|
-
Bump up v1.4.
|
9
|
+
Bump up v1.4.6
|
data/README.md
CHANGED
@@ -5,6 +5,7 @@ The Etc module provides access to information typically stored in files in the /
|
|
5
5
|
The information accessible consists of the information found in the `/etc/passwd` and `/etc/group` files, plus information about he system's temporary directory (/tmp) and configuration directory (/etc).
|
6
6
|
|
7
7
|
The Etc module provides a more reliable way to access information about the logged in user than environment variables such as +$USER+.
|
8
|
+
Read the [API RDoc](https://docs.ruby-lang.org/en/master/Etc.html).
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
data/ext/etc/etc.c
CHANGED
@@ -56,7 +56,9 @@ static VALUE sGroup;
|
|
56
56
|
#endif
|
57
57
|
RUBY_EXTERN char *getlogin(void);
|
58
58
|
|
59
|
-
#define RUBY_ETC_VERSION "1.4.
|
59
|
+
#define RUBY_ETC_VERSION "1.4.6"
|
60
|
+
|
61
|
+
#define SYMBOL_LIT(str) ID2SYM(rb_intern_const(str ""))
|
60
62
|
|
61
63
|
#ifdef HAVE_RB_DEPRECATE_CONSTANT
|
62
64
|
void rb_deprecate_constant(VALUE mod, const char *name);
|
@@ -697,7 +699,7 @@ rbconfig(void)
|
|
697
699
|
{
|
698
700
|
VALUE config;
|
699
701
|
rb_require("rbconfig");
|
700
|
-
config = rb_const_get(rb_path2class("RbConfig"),
|
702
|
+
config = rb_const_get(rb_path2class("RbConfig"), rb_intern_const("CONFIG"));
|
701
703
|
Check_Type(config, T_HASH);
|
702
704
|
return config;
|
703
705
|
}
|
@@ -823,12 +825,12 @@ etc_uname(VALUE obj)
|
|
823
825
|
sysname = "Windows";
|
824
826
|
break;
|
825
827
|
}
|
826
|
-
rb_hash_aset(result,
|
828
|
+
rb_hash_aset(result, SYMBOL_LIT("sysname"), rb_str_new_cstr(sysname));
|
827
829
|
release = rb_sprintf("%lu.%lu.%lu", v.dwMajorVersion, v.dwMinorVersion, v.dwBuildNumber);
|
828
|
-
rb_hash_aset(result,
|
830
|
+
rb_hash_aset(result, SYMBOL_LIT("release"), release);
|
829
831
|
version = rb_sprintf("%s Version %"PRIsVALUE": %"PRIsVALUE, sysname, release,
|
830
832
|
rb_w32_conv_from_wchar(v.szCSDVersion, rb_utf8_encoding()));
|
831
|
-
rb_hash_aset(result,
|
833
|
+
rb_hash_aset(result, SYMBOL_LIT("version"), version);
|
832
834
|
|
833
835
|
# if defined _MSC_VER && _MSC_VER < 1300
|
834
836
|
# define GET_COMPUTER_NAME(ptr, plen) GetComputerNameW(ptr, plen)
|
@@ -842,7 +844,7 @@ etc_uname(VALUE obj)
|
|
842
844
|
}
|
843
845
|
ALLOCV_END(vbuf);
|
844
846
|
if (NIL_P(nodename)) nodename = rb_str_new(0, 0);
|
845
|
-
rb_hash_aset(result,
|
847
|
+
rb_hash_aset(result, SYMBOL_LIT("nodename"), nodename);
|
846
848
|
|
847
849
|
# ifndef PROCESSOR_ARCHITECTURE_AMD64
|
848
850
|
# define PROCESSOR_ARCHITECTURE_AMD64 9
|
@@ -866,7 +868,7 @@ etc_uname(VALUE obj)
|
|
866
868
|
break;
|
867
869
|
}
|
868
870
|
|
869
|
-
rb_hash_aset(result,
|
871
|
+
rb_hash_aset(result, SYMBOL_LIT("machine"), rb_str_new_cstr(mach));
|
870
872
|
#else
|
871
873
|
struct utsname u;
|
872
874
|
int ret;
|
@@ -877,11 +879,11 @@ etc_uname(VALUE obj)
|
|
877
879
|
rb_sys_fail("uname");
|
878
880
|
|
879
881
|
result = rb_hash_new();
|
880
|
-
rb_hash_aset(result,
|
881
|
-
rb_hash_aset(result,
|
882
|
-
rb_hash_aset(result,
|
883
|
-
rb_hash_aset(result,
|
884
|
-
rb_hash_aset(result,
|
882
|
+
rb_hash_aset(result, SYMBOL_LIT("sysname"), rb_str_new_cstr(u.sysname));
|
883
|
+
rb_hash_aset(result, SYMBOL_LIT("nodename"), rb_str_new_cstr(u.nodename));
|
884
|
+
rb_hash_aset(result, SYMBOL_LIT("release"), rb_str_new_cstr(u.release));
|
885
|
+
rb_hash_aset(result, SYMBOL_LIT("version"), rb_str_new_cstr(u.version));
|
886
|
+
rb_hash_aset(result, SYMBOL_LIT("machine"), rb_str_new_cstr(u.machine));
|
885
887
|
#endif
|
886
888
|
|
887
889
|
return result;
|
@@ -1161,14 +1163,26 @@ Init_etc(void)
|
|
1161
1163
|
{
|
1162
1164
|
VALUE mEtc;
|
1163
1165
|
|
1164
|
-
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
1165
|
-
RB_EXT_RACTOR_SAFE(true);
|
1166
|
-
#endif
|
1167
1166
|
mEtc = rb_define_module("Etc");
|
1168
1167
|
/* The version */
|
1169
1168
|
rb_define_const(mEtc, "VERSION", rb_str_new_cstr(RUBY_ETC_VERSION));
|
1170
1169
|
init_constants(mEtc);
|
1171
1170
|
|
1171
|
+
/* Ractor-safe methods */
|
1172
|
+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
1173
|
+
RB_EXT_RACTOR_SAFE(true);
|
1174
|
+
#endif
|
1175
|
+
rb_define_module_function(mEtc, "systmpdir", etc_systmpdir, 0);
|
1176
|
+
rb_define_module_function(mEtc, "uname", etc_uname, 0);
|
1177
|
+
rb_define_module_function(mEtc, "sysconf", etc_sysconf, 1);
|
1178
|
+
rb_define_module_function(mEtc, "confstr", etc_confstr, 1);
|
1179
|
+
rb_define_method(rb_cIO, "pathconf", io_pathconf, 1);
|
1180
|
+
rb_define_module_function(mEtc, "nprocessors", etc_nprocessors, 0);
|
1181
|
+
|
1182
|
+
/* Non-Ractor-safe methods, see https://bugs.ruby-lang.org/issues/21115 */
|
1183
|
+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
1184
|
+
RB_EXT_RACTOR_SAFE(false);
|
1185
|
+
#endif
|
1172
1186
|
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
|
1173
1187
|
|
1174
1188
|
rb_define_module_function(mEtc, "getpwuid", etc_getpwuid, -1);
|
@@ -1184,13 +1198,9 @@ Init_etc(void)
|
|
1184
1198
|
rb_define_module_function(mEtc, "setgrent", etc_setgrent, 0);
|
1185
1199
|
rb_define_module_function(mEtc, "endgrent", etc_endgrent, 0);
|
1186
1200
|
rb_define_module_function(mEtc, "getgrent", etc_getgrent, 0);
|
1201
|
+
|
1202
|
+
/* Uses RbConfig::CONFIG so does not work in a Ractor */
|
1187
1203
|
rb_define_module_function(mEtc, "sysconfdir", etc_sysconfdir, 0);
|
1188
|
-
rb_define_module_function(mEtc, "systmpdir", etc_systmpdir, 0);
|
1189
|
-
rb_define_module_function(mEtc, "uname", etc_uname, 0);
|
1190
|
-
rb_define_module_function(mEtc, "sysconf", etc_sysconf, 1);
|
1191
|
-
rb_define_module_function(mEtc, "confstr", etc_confstr, 1);
|
1192
|
-
rb_define_method(rb_cIO, "pathconf", io_pathconf, 1);
|
1193
|
-
rb_define_module_function(mEtc, "nprocessors", etc_nprocessors, 0);
|
1194
1204
|
|
1195
1205
|
sPasswd = rb_struct_define_under(mEtc, "Passwd",
|
1196
1206
|
"name",
|
@@ -1301,4 +1311,8 @@ Init_etc(void)
|
|
1301
1311
|
rb_extend_object(sGroup, rb_mEnumerable);
|
1302
1312
|
rb_define_singleton_method(sGroup, "each", etc_each_group, 0);
|
1303
1313
|
#endif
|
1314
|
+
|
1315
|
+
#if defined(HAVE_GETPWENT) || defined(HAVE_GETGRENT)
|
1316
|
+
(void)safe_setup_str;
|
1317
|
+
#endif
|
1304
1318
|
}
|
data/ext/etc/extconf.rb
CHANGED
@@ -10,8 +10,30 @@ headers = []
|
|
10
10
|
have_library("sun", "getpwnam") # NIS (== YP) interface for IRIX 4
|
11
11
|
have_func("uname((struct utsname *)NULL)", headers)
|
12
12
|
have_func("getlogin")
|
13
|
-
have_func("getpwent")
|
14
|
-
|
13
|
+
if have_func("getpwent")
|
14
|
+
have_struct_member('struct passwd', 'pw_gecos', 'pwd.h')
|
15
|
+
have_struct_member('struct passwd', 'pw_change', 'pwd.h')
|
16
|
+
have_struct_member('struct passwd', 'pw_quota', 'pwd.h')
|
17
|
+
if have_struct_member('struct passwd', 'pw_age', 'pwd.h')
|
18
|
+
case what_type?('struct passwd', 'pw_age', 'pwd.h')
|
19
|
+
when "string"
|
20
|
+
f = "safe_setup_str"
|
21
|
+
when "long long"
|
22
|
+
f = "LL2NUM"
|
23
|
+
else
|
24
|
+
f = "INT2NUM"
|
25
|
+
end
|
26
|
+
$defs.push("-DPW_AGE2VAL="+f)
|
27
|
+
end
|
28
|
+
have_struct_member('struct passwd', 'pw_class', 'pwd.h')
|
29
|
+
have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM
|
30
|
+
have_struct_member('struct passwd', 'pw_expire', 'pwd.h')
|
31
|
+
have_struct_member('struct passwd', 'pw_passwd', 'pwd.h')
|
32
|
+
end
|
33
|
+
if have_func("getgrent")
|
34
|
+
have_struct_member('struct group', 'gr_passwd', 'grp.h')
|
35
|
+
end
|
36
|
+
|
15
37
|
if (sysconfdir = RbConfig::CONFIG["sysconfdir"] and
|
16
38
|
!RbConfig.expand(sysconfdir.dup, "prefix"=>"", "DESTDIR"=>"").empty?)
|
17
39
|
$defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
|
@@ -21,26 +43,6 @@ have_func("sysconf")
|
|
21
43
|
have_func("confstr")
|
22
44
|
have_func("fpathconf")
|
23
45
|
|
24
|
-
have_struct_member('struct passwd', 'pw_gecos', 'pwd.h')
|
25
|
-
have_struct_member('struct passwd', 'pw_change', 'pwd.h')
|
26
|
-
have_struct_member('struct passwd', 'pw_quota', 'pwd.h')
|
27
|
-
if have_struct_member('struct passwd', 'pw_age', 'pwd.h')
|
28
|
-
case what_type?('struct passwd', 'pw_age', 'pwd.h')
|
29
|
-
when "string"
|
30
|
-
f = "safe_setup_str"
|
31
|
-
when "long long"
|
32
|
-
f = "LL2NUM"
|
33
|
-
else
|
34
|
-
f = "INT2NUM"
|
35
|
-
end
|
36
|
-
$defs.push("-DPW_AGE2VAL="+f)
|
37
|
-
end
|
38
|
-
have_struct_member('struct passwd', 'pw_class', 'pwd.h')
|
39
|
-
have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM
|
40
|
-
have_struct_member('struct passwd', 'pw_expire', 'pwd.h')
|
41
|
-
have_struct_member('struct passwd', 'pw_passwd', 'pwd.h')
|
42
|
-
have_struct_member('struct group', 'gr_passwd', 'grp.h')
|
43
|
-
|
44
46
|
# for https://github.com/ruby/etc
|
45
47
|
srcdir = File.expand_path("..", __FILE__)
|
46
48
|
constdefs = "#{srcdir}/constdefs.h"
|
@@ -58,7 +60,7 @@ end
|
|
58
60
|
# TODO: remove when dropping 2.7 support, as exported since 3.0
|
59
61
|
have_func('rb_deprecate_constant(Qnil, "None")')
|
60
62
|
|
61
|
-
have_func("rb_io_descriptor")
|
63
|
+
have_func("rb_io_descriptor", "ruby/io.h")
|
62
64
|
|
63
65
|
$distcleanfiles << "constdefs.h"
|
64
66
|
|
data/test/etc/test_etc.rb
CHANGED
@@ -21,7 +21,7 @@ class TestEtc < Test::Unit::TestCase
|
|
21
21
|
assert_instance_of(String, s.shell)
|
22
22
|
assert_kind_of(Integer, s.change) if s.respond_to?(:change)
|
23
23
|
assert_kind_of(Integer, s.quota) if s.respond_to?(:quota)
|
24
|
-
assert(s.age.is_a?(Integer) || s.age.is_a?(String)) if s.respond_to?(:age)
|
24
|
+
assert(s.age.is_a?(Integer) || s.age.is_a?(String), s.age) if s.respond_to?(:age)
|
25
25
|
assert_instance_of(String, s.uclass) if s.respond_to?(:uclass)
|
26
26
|
assert_instance_of(String, s.comment) if s.respond_to?(:comment)
|
27
27
|
assert_kind_of(Integer, s.expire) if s.respond_to?(:expire)
|
@@ -160,7 +160,7 @@ class TestEtc < Test::Unit::TestCase
|
|
160
160
|
end
|
161
161
|
IO.pipe {|r, w|
|
162
162
|
val = w.pathconf(Etc::PC_PIPE_BUF)
|
163
|
-
|
163
|
+
assert_kind_of(Integer, val) if val
|
164
164
|
}
|
165
165
|
end if defined?(Etc::PC_PIPE_BUF)
|
166
166
|
|
@@ -173,28 +173,85 @@ class TestEtc < Test::Unit::TestCase
|
|
173
173
|
assert_operator(File, :absolute_path?, Etc.sysconfdir)
|
174
174
|
end if File.method_defined?(:absolute_path?)
|
175
175
|
|
176
|
-
|
176
|
+
# All Ractor-safe methods should be tested here
|
177
|
+
def test_ractor_parallel
|
178
|
+
omit "This test is flaky and intermittently failing now on ModGC workflow" if ENV['GITHUB_WORKFLOW'] == 'ModGC'
|
179
|
+
|
180
|
+
assert_ractor(<<~RUBY, require: 'etc', timeout: 60)
|
181
|
+
10.times.map do
|
182
|
+
Ractor.new do
|
183
|
+
100.times do
|
184
|
+
raise unless String === Etc.systmpdir
|
185
|
+
raise unless Hash === Etc.uname
|
186
|
+
if defined?(Etc::SC_CLK_TCK)
|
187
|
+
raise unless Integer === Etc.sysconf(Etc::SC_CLK_TCK)
|
188
|
+
end
|
189
|
+
if defined?(Etc::CS_PATH)
|
190
|
+
raise unless String === Etc.confstr(Etc::CS_PATH)
|
191
|
+
end
|
192
|
+
if defined?(Etc::PC_PIPE_BUF)
|
193
|
+
IO.pipe { |r, w|
|
194
|
+
val = w.pathconf(Etc::PC_PIPE_BUF)
|
195
|
+
raise unless val.nil? || val.kind_of?(Integer)
|
196
|
+
}
|
197
|
+
end
|
198
|
+
raise unless Integer === Etc.nprocessors
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end.each(&:join)
|
202
|
+
RUBY
|
203
|
+
end
|
204
|
+
|
205
|
+
def test_ractor_unsafe
|
206
|
+
assert_ractor(<<~RUBY, require: 'etc')
|
207
|
+
r = Ractor.new do
|
208
|
+
begin
|
209
|
+
Etc.passwd
|
210
|
+
rescue => e
|
211
|
+
e.class
|
212
|
+
end
|
213
|
+
end.value
|
214
|
+
assert_equal Ractor::UnsafeError, r
|
215
|
+
RUBY
|
216
|
+
end
|
217
|
+
|
218
|
+
def test_ractor_passwd
|
219
|
+
omit("https://bugs.ruby-lang.org/issues/21115")
|
177
220
|
return unless Etc.passwd # => skip test if no platform support
|
178
221
|
Etc.endpwent
|
179
222
|
|
180
223
|
assert_ractor(<<~RUBY, require: 'etc')
|
181
|
-
ractor = Ractor.new do
|
224
|
+
ractor = Ractor.new port = Ractor::Port.new do |port|
|
182
225
|
Etc.passwd do |s|
|
183
|
-
|
184
|
-
|
226
|
+
port << :sync
|
227
|
+
port << s.name
|
185
228
|
break :done
|
186
229
|
end
|
187
230
|
end
|
188
|
-
|
231
|
+
port.receive # => :sync
|
189
232
|
assert_raise RuntimeError, /parallel/ do
|
190
233
|
Etc.passwd {}
|
191
234
|
end
|
192
|
-
name =
|
193
|
-
ractor.
|
235
|
+
name = port.receive # => first name
|
236
|
+
ractor.join # => :done
|
194
237
|
name2 = Etc.passwd do |s|
|
195
238
|
break s.name
|
196
239
|
end
|
197
240
|
assert_equal(name2, name)
|
198
241
|
RUBY
|
199
242
|
end
|
243
|
+
|
244
|
+
def test_ractor_getgrgid
|
245
|
+
omit("https://bugs.ruby-lang.org/issues/21115")
|
246
|
+
|
247
|
+
assert_ractor(<<~RUBY, require: 'etc')
|
248
|
+
20.times.map do
|
249
|
+
Ractor.new do
|
250
|
+
1000.times do
|
251
|
+
raise unless Etc.getgrgid(Process.gid).gid == Process.gid
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end.each(&:join)
|
255
|
+
RUBY
|
256
|
+
end
|
200
257
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-07-15 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Provides access to information typically stored in UNIX /etc directory.
|
14
13
|
email:
|
@@ -17,8 +16,9 @@ executables: []
|
|
17
16
|
extensions:
|
18
17
|
- ext/etc/extconf.rb
|
19
18
|
extra_rdoc_files:
|
19
|
+
- BSDL
|
20
|
+
- COPYING
|
20
21
|
- ChangeLog
|
21
|
-
- LICENSE.txt
|
22
22
|
- README.md
|
23
23
|
- ext/etc/constdefs.h
|
24
24
|
- ext/etc/etc.c
|
@@ -26,8 +26,9 @@ extra_rdoc_files:
|
|
26
26
|
- ext/etc/mkconstants.rb
|
27
27
|
- test/etc/test_etc.rb
|
28
28
|
files:
|
29
|
+
- BSDL
|
30
|
+
- COPYING
|
29
31
|
- ChangeLog
|
30
|
-
- LICENSE.txt
|
31
32
|
- README.md
|
32
33
|
- ext/etc/constdefs.h
|
33
34
|
- ext/etc/etc.c
|
@@ -39,7 +40,6 @@ licenses:
|
|
39
40
|
- Ruby
|
40
41
|
- BSD-2-Clause
|
41
42
|
metadata: {}
|
42
|
-
post_install_message:
|
43
43
|
rdoc_options:
|
44
44
|
- "--main"
|
45
45
|
- README.md
|
@@ -56,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
60
|
-
signing_key:
|
59
|
+
rubygems_version: 3.6.7
|
61
60
|
specification_version: 4
|
62
61
|
summary: Provides access to information typically stored in UNIX /etc directory.
|
63
62
|
test_files: []
|