etc 1.4.2 → 1.4.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 +4 -4
- data/ChangeLog +4 -17
- data/ext/etc/constdefs.h +187 -0
- data/ext/etc/etc.c +97 -41
- data/ext/etc/extconf.rb +12 -2
- data/ext/etc/mkconstants.rb +22 -10
- data/test/etc/test_etc.rb +4 -0
- metadata +6 -22
- data/logs/ChangeLog-1.0.0 +0 -65
- data/logs/ChangeLog-1.0.1 +0 -71
- data/logs/ChangeLog-1.1.0 +0 -143
- data/logs/ChangeLog-1.2.0 +0 -124
- data/logs/ChangeLog-1.3.0 +0 -83
- data/logs/ChangeLog-1.3.1 +0 -145
- data/logs/ChangeLog-1.4.0 +0 -73
- data/logs/ChangeLog-1.4.1 +0 -97
data/ext/etc/etc.c
CHANGED
@@ -54,9 +54,9 @@ static VALUE sGroup;
|
|
54
54
|
# include <stdlib.h>
|
55
55
|
# endif
|
56
56
|
#endif
|
57
|
-
char *getlogin();
|
57
|
+
RUBY_EXTERN char *getlogin(void);
|
58
58
|
|
59
|
-
#define RUBY_ETC_VERSION "1.4.
|
59
|
+
#define RUBY_ETC_VERSION "1.4.4"
|
60
60
|
|
61
61
|
#ifdef HAVE_RB_DEPRECATE_CONSTANT
|
62
62
|
void rb_deprecate_constant(VALUE mod, const char *name);
|
@@ -66,6 +66,17 @@ void rb_deprecate_constant(VALUE mod, const char *name);
|
|
66
66
|
|
67
67
|
#include "constdefs.h"
|
68
68
|
|
69
|
+
#ifndef HAVE_RB_IO_DESCRIPTOR
|
70
|
+
static int
|
71
|
+
io_descriptor_fallback(VALUE io)
|
72
|
+
{
|
73
|
+
rb_io_t *fptr;
|
74
|
+
GetOpenFile(io, fptr);
|
75
|
+
return fptr->fd;
|
76
|
+
}
|
77
|
+
#define rb_io_descriptor io_descriptor_fallback
|
78
|
+
#endif
|
79
|
+
|
69
80
|
#ifdef HAVE_RUBY_ATOMIC_H
|
70
81
|
# include "ruby/atomic.h"
|
71
82
|
#else
|
@@ -192,7 +203,7 @@ setup_passwd(struct passwd *pwd)
|
|
192
203
|
#endif
|
193
204
|
|
194
205
|
/* call-seq:
|
195
|
-
* getpwuid(uid) -> Passwd
|
206
|
+
* getpwuid(uid) -> Etc::Passwd
|
196
207
|
*
|
197
208
|
* Returns the <tt>/etc/passwd</tt> information for the user with the given
|
198
209
|
* integer +uid+.
|
@@ -204,7 +215,7 @@ setup_passwd(struct passwd *pwd)
|
|
204
215
|
*
|
205
216
|
* See the unix manpage for <code>getpwuid(3)</code> for more detail.
|
206
217
|
*
|
207
|
-
*
|
218
|
+
* *Example:*
|
208
219
|
*
|
209
220
|
* Etc.getpwuid(0)
|
210
221
|
* #=> #<struct Etc::Passwd name="root", passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
|
@@ -232,7 +243,7 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
|
|
232
243
|
}
|
233
244
|
|
234
245
|
/* call-seq:
|
235
|
-
* getpwnam(name) -> Passwd
|
246
|
+
* getpwnam(name) -> Etc::Passwd
|
236
247
|
*
|
237
248
|
* Returns the <tt>/etc/passwd</tt> information for the user with specified
|
238
249
|
* login +name+.
|
@@ -241,7 +252,7 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
|
|
241
252
|
*
|
242
253
|
* See the unix manpage for <code>getpwnam(3)</code> for more detail.
|
243
254
|
*
|
244
|
-
*
|
255
|
+
* *Example:*
|
245
256
|
*
|
246
257
|
* Etc.getpwnam('root')
|
247
258
|
* #=> #<struct Etc::Passwd name="root", passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
|
@@ -296,8 +307,8 @@ each_passwd(void)
|
|
296
307
|
#endif
|
297
308
|
|
298
309
|
/* call-seq:
|
299
|
-
*
|
300
|
-
*
|
310
|
+
* passwd { |struct| block }
|
311
|
+
* passwd -> Etc::Passwd
|
301
312
|
*
|
302
313
|
* Provides a convenient Ruby iterator which executes a block for each entry
|
303
314
|
* in the <tt>/etc/passwd</tt> file.
|
@@ -306,7 +317,7 @@ each_passwd(void)
|
|
306
317
|
*
|
307
318
|
* See ::getpwent above for details.
|
308
319
|
*
|
309
|
-
* Example
|
320
|
+
* *Example:*
|
310
321
|
*
|
311
322
|
* require 'etc'
|
312
323
|
*
|
@@ -332,7 +343,7 @@ etc_passwd(VALUE obj)
|
|
332
343
|
}
|
333
344
|
|
334
345
|
/* call-seq:
|
335
|
-
* Etc::Passwd.each { |struct| block } -> Passwd
|
346
|
+
* Etc::Passwd.each { |struct| block } -> Etc::Passwd
|
336
347
|
* Etc::Passwd.each -> Enumerator
|
337
348
|
*
|
338
349
|
* Iterates for each entry in the <tt>/etc/passwd</tt> file if a block is
|
@@ -344,7 +355,7 @@ etc_passwd(VALUE obj)
|
|
344
355
|
*
|
345
356
|
* See Etc.getpwent above for details.
|
346
357
|
*
|
347
|
-
* Example
|
358
|
+
* *Example:*
|
348
359
|
*
|
349
360
|
* require 'etc'
|
350
361
|
*
|
@@ -366,7 +377,10 @@ etc_each_passwd(VALUE obj)
|
|
366
377
|
return obj;
|
367
378
|
}
|
368
379
|
|
369
|
-
/*
|
380
|
+
/* call-seq:
|
381
|
+
* setpwent
|
382
|
+
*
|
383
|
+
* Resets the process of reading the <tt>/etc/passwd</tt> file, so that the
|
370
384
|
* next call to ::getpwent will return the first entry again.
|
371
385
|
*/
|
372
386
|
static VALUE
|
@@ -378,7 +392,10 @@ etc_setpwent(VALUE obj)
|
|
378
392
|
return Qnil;
|
379
393
|
}
|
380
394
|
|
381
|
-
/*
|
395
|
+
/* call-seq:
|
396
|
+
* endpwent
|
397
|
+
*
|
398
|
+
* Ends the process of scanning through the <tt>/etc/passwd</tt> file begun
|
382
399
|
* with ::getpwent, and closes the file.
|
383
400
|
*/
|
384
401
|
static VALUE
|
@@ -390,7 +407,10 @@ etc_endpwent(VALUE obj)
|
|
390
407
|
return Qnil;
|
391
408
|
}
|
392
409
|
|
393
|
-
/*
|
410
|
+
/* call-seq:
|
411
|
+
* getpwent -> Etc::Passwd
|
412
|
+
*
|
413
|
+
* Returns an entry from the <tt>/etc/passwd</tt> file.
|
394
414
|
*
|
395
415
|
* The first time it is called it opens the file and returns the first entry;
|
396
416
|
* each successive call returns the next entry, or +nil+ if the end of the file
|
@@ -438,7 +458,7 @@ setup_group(struct group *grp)
|
|
438
458
|
#endif
|
439
459
|
|
440
460
|
/* call-seq:
|
441
|
-
* getgrgid(group_id) -> Group
|
461
|
+
* getgrgid(group_id) -> Etc::Group
|
442
462
|
*
|
443
463
|
* Returns information about the group with specified integer +group_id+,
|
444
464
|
* as found in <tt>/etc/group</tt>.
|
@@ -447,7 +467,7 @@ setup_group(struct group *grp)
|
|
447
467
|
*
|
448
468
|
* See the unix manpage for <code>getgrgid(3)</code> for more detail.
|
449
469
|
*
|
450
|
-
*
|
470
|
+
* *Example:*
|
451
471
|
*
|
452
472
|
* Etc.getgrgid(100)
|
453
473
|
* #=> #<struct Etc::Group name="users", passwd="x", gid=100, mem=["meta", "root"]>
|
@@ -476,7 +496,7 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj)
|
|
476
496
|
}
|
477
497
|
|
478
498
|
/* call-seq:
|
479
|
-
* getgrnam(name) -> Group
|
499
|
+
* getgrnam(name) -> Etc::Group
|
480
500
|
*
|
481
501
|
* Returns information about the group with specified +name+, as found in
|
482
502
|
* <tt>/etc/group</tt>.
|
@@ -485,7 +505,7 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj)
|
|
485
505
|
*
|
486
506
|
* See the unix manpage for <code>getgrnam(3)</code> for more detail.
|
487
507
|
*
|
488
|
-
*
|
508
|
+
* *Example:*
|
489
509
|
*
|
490
510
|
* Etc.getgrnam('users')
|
491
511
|
* #=> #<struct Etc::Group name="users", passwd="x", gid=100, mem=["meta", "root"]>
|
@@ -518,7 +538,6 @@ group_ensure(VALUE _)
|
|
518
538
|
return Qnil;
|
519
539
|
}
|
520
540
|
|
521
|
-
|
522
541
|
static VALUE
|
523
542
|
group_iterate(VALUE _)
|
524
543
|
{
|
@@ -541,14 +560,18 @@ each_group(void)
|
|
541
560
|
}
|
542
561
|
#endif
|
543
562
|
|
544
|
-
/*
|
563
|
+
/* call-seq:
|
564
|
+
* group { |struct| block }
|
565
|
+
* group -> Etc::Group
|
566
|
+
*
|
567
|
+
* Provides a convenient Ruby iterator which executes a block for each entry
|
545
568
|
* in the <tt>/etc/group</tt> file.
|
546
569
|
*
|
547
570
|
* The code block is passed an Group struct.
|
548
571
|
*
|
549
572
|
* See ::getgrent above for details.
|
550
573
|
*
|
551
|
-
* Example
|
574
|
+
* *Example:*
|
552
575
|
*
|
553
576
|
* require 'etc'
|
554
577
|
*
|
@@ -575,7 +598,7 @@ etc_group(VALUE obj)
|
|
575
598
|
|
576
599
|
#ifdef HAVE_GETGRENT
|
577
600
|
/* call-seq:
|
578
|
-
* Etc::Group.each { |group| block } ->
|
601
|
+
* Etc::Group.each { |group| block } -> Etc::Group
|
579
602
|
* Etc::Group.each -> Enumerator
|
580
603
|
*
|
581
604
|
* Iterates for each entry in the <tt>/etc/group</tt> file if a block is
|
@@ -585,7 +608,7 @@ etc_group(VALUE obj)
|
|
585
608
|
*
|
586
609
|
* The code block is passed a Group struct.
|
587
610
|
*
|
588
|
-
* Example
|
611
|
+
* *Example:*
|
589
612
|
*
|
590
613
|
* require 'etc'
|
591
614
|
*
|
@@ -606,7 +629,10 @@ etc_each_group(VALUE obj)
|
|
606
629
|
}
|
607
630
|
#endif
|
608
631
|
|
609
|
-
/*
|
632
|
+
/* call-seq:
|
633
|
+
* setgrent
|
634
|
+
*
|
635
|
+
* Resets the process of reading the <tt>/etc/group</tt> file, so that the
|
610
636
|
* next call to ::getgrent will return the first entry again.
|
611
637
|
*/
|
612
638
|
static VALUE
|
@@ -618,7 +644,10 @@ etc_setgrent(VALUE obj)
|
|
618
644
|
return Qnil;
|
619
645
|
}
|
620
646
|
|
621
|
-
/*
|
647
|
+
/* call-seq:
|
648
|
+
* endgrent
|
649
|
+
*
|
650
|
+
* Ends the process of scanning through the <tt>/etc/group</tt> file begun
|
622
651
|
* by ::getgrent, and closes the file.
|
623
652
|
*/
|
624
653
|
static VALUE
|
@@ -630,7 +659,10 @@ etc_endgrent(VALUE obj)
|
|
630
659
|
return Qnil;
|
631
660
|
}
|
632
661
|
|
633
|
-
/*
|
662
|
+
/* call-seq:
|
663
|
+
* getgrent -> Etc::Group
|
664
|
+
*
|
665
|
+
* Returns an entry from the <tt>/etc/group</tt> file.
|
634
666
|
*
|
635
667
|
* The first time it is called it opens the file and returns the first entry;
|
636
668
|
* each successive call returns the next entry, or +nil+ if the end of the file
|
@@ -659,9 +691,21 @@ etc_getgrent(VALUE obj)
|
|
659
691
|
VALUE rb_w32_special_folder(int type);
|
660
692
|
UINT rb_w32_system_tmpdir(WCHAR *path, UINT len);
|
661
693
|
VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
|
694
|
+
#elif defined(LOAD_RELATIVE)
|
695
|
+
static inline VALUE
|
696
|
+
rbconfig(void)
|
697
|
+
{
|
698
|
+
VALUE config;
|
699
|
+
rb_require("rbconfig");
|
700
|
+
config = rb_const_get(rb_path2class("RbConfig"), rb_intern("CONFIG"));
|
701
|
+
Check_Type(config, T_HASH);
|
702
|
+
return config;
|
703
|
+
}
|
662
704
|
#endif
|
663
705
|
|
664
|
-
/*
|
706
|
+
/* call-seq:
|
707
|
+
* sysconfdir -> String
|
708
|
+
*
|
665
709
|
* Returns system configuration directory.
|
666
710
|
*
|
667
711
|
* This is typically <code>"/etc"</code>, but is modified by the prefix used
|
@@ -676,12 +720,16 @@ etc_sysconfdir(VALUE obj)
|
|
676
720
|
{
|
677
721
|
#ifdef _WIN32
|
678
722
|
return rb_w32_special_folder(CSIDL_COMMON_APPDATA);
|
723
|
+
#elif defined(LOAD_RELATIVE)
|
724
|
+
return rb_hash_aref(rbconfig(), rb_str_new_lit("sysconfdir"));
|
679
725
|
#else
|
680
726
|
return rb_filesystem_str_new_cstr(SYSCONFDIR);
|
681
727
|
#endif
|
682
728
|
}
|
683
729
|
|
684
|
-
/*
|
730
|
+
/* call-seq:
|
731
|
+
* systmpdir -> String
|
732
|
+
*
|
685
733
|
* Returns system temporary directory; typically "/tmp".
|
686
734
|
*/
|
687
735
|
static VALUE
|
@@ -725,13 +773,15 @@ etc_systmpdir(VALUE _)
|
|
725
773
|
}
|
726
774
|
|
727
775
|
#ifdef HAVE_UNAME
|
728
|
-
/*
|
776
|
+
/* call-seq:
|
777
|
+
* uname -> hash
|
778
|
+
*
|
729
779
|
* Returns the system information obtained by uname system call.
|
730
780
|
*
|
731
781
|
* The return value is a hash which has 5 keys at least:
|
732
782
|
* :sysname, :nodename, :release, :version, :machine
|
733
783
|
*
|
734
|
-
* Example
|
784
|
+
* *Example:*
|
735
785
|
*
|
736
786
|
* require 'etc'
|
737
787
|
* require 'pp'
|
@@ -841,7 +891,9 @@ etc_uname(VALUE obj)
|
|
841
891
|
#endif
|
842
892
|
|
843
893
|
#ifdef HAVE_SYSCONF
|
844
|
-
/*
|
894
|
+
/* call-seq:
|
895
|
+
* sysconf(name) -> Integer
|
896
|
+
*
|
845
897
|
* Returns system configuration variable using sysconf().
|
846
898
|
*
|
847
899
|
* _name_ should be a constant under <code>Etc</code> which begins with <code>SC_</code>.
|
@@ -875,7 +927,9 @@ etc_sysconf(VALUE obj, VALUE arg)
|
|
875
927
|
#endif
|
876
928
|
|
877
929
|
#ifdef HAVE_CONFSTR
|
878
|
-
/*
|
930
|
+
/* call-seq:
|
931
|
+
* confstr(name) -> String
|
932
|
+
*
|
879
933
|
* Returns system configuration variable using confstr().
|
880
934
|
*
|
881
935
|
* _name_ should be a constant under <code>Etc</code> which begins with <code>CS_</code>.
|
@@ -922,7 +976,9 @@ etc_confstr(VALUE obj, VALUE arg)
|
|
922
976
|
#endif
|
923
977
|
|
924
978
|
#ifdef HAVE_FPATHCONF
|
925
|
-
/*
|
979
|
+
/* call-seq:
|
980
|
+
* pathconf(name) -> Integer
|
981
|
+
*
|
926
982
|
* Returns pathname configuration variable using fpathconf().
|
927
983
|
*
|
928
984
|
* _name_ should be a constant under <code>Etc</code> which begins with <code>PC_</code>.
|
@@ -941,14 +997,11 @@ io_pathconf(VALUE io, VALUE arg)
|
|
941
997
|
{
|
942
998
|
int name;
|
943
999
|
long ret;
|
944
|
-
rb_io_t *fptr;
|
945
1000
|
|
946
1001
|
name = NUM2INT(arg);
|
947
1002
|
|
948
|
-
GetOpenFile(io, fptr);
|
949
|
-
|
950
1003
|
errno = 0;
|
951
|
-
ret = fpathconf(
|
1004
|
+
ret = fpathconf(rb_io_descriptor(io), name);
|
952
1005
|
if (ret == -1) {
|
953
1006
|
if (errno == 0) /* no limit */
|
954
1007
|
return Qnil;
|
@@ -1017,7 +1070,9 @@ etc_nprocessors_affin(void)
|
|
1017
1070
|
}
|
1018
1071
|
#endif
|
1019
1072
|
|
1020
|
-
/*
|
1073
|
+
/* call-seq:
|
1074
|
+
* nprocessors -> Integer
|
1075
|
+
*
|
1021
1076
|
* Returns the number of online processors.
|
1022
1077
|
*
|
1023
1078
|
* The result is intended as the number of processes to
|
@@ -1027,7 +1082,7 @@ etc_nprocessors_affin(void)
|
|
1027
1082
|
* - sched_getaffinity(): Linux
|
1028
1083
|
* - sysconf(_SC_NPROCESSORS_ONLN): GNU/Linux, NetBSD, FreeBSD, OpenBSD, DragonFly BSD, OpenIndiana, Mac OS X, AIX
|
1029
1084
|
*
|
1030
|
-
* Example
|
1085
|
+
* *Example:*
|
1031
1086
|
*
|
1032
1087
|
* require 'etc'
|
1033
1088
|
* p Etc.nprocessors #=> 4
|
@@ -1036,7 +1091,7 @@ etc_nprocessors_affin(void)
|
|
1036
1091
|
* process is bound to specific cpus. This is intended for getting better
|
1037
1092
|
* parallel processing.
|
1038
1093
|
*
|
1039
|
-
* Example
|
1094
|
+
* *Example:* (Linux)
|
1040
1095
|
*
|
1041
1096
|
* linux$ taskset 0x3 ./ruby -retc -e "p Etc.nprocessors" #=> 2
|
1042
1097
|
*
|
@@ -1086,7 +1141,7 @@ etc_nprocessors(VALUE obj)
|
|
1086
1141
|
* The Etc module provides a more reliable way to access information about
|
1087
1142
|
* the logged in user than environment variables such as +$USER+.
|
1088
1143
|
*
|
1089
|
-
*
|
1144
|
+
* *Example:*
|
1090
1145
|
*
|
1091
1146
|
* require 'etc'
|
1092
1147
|
*
|
@@ -1110,6 +1165,7 @@ Init_etc(void)
|
|
1110
1165
|
RB_EXT_RACTOR_SAFE(true);
|
1111
1166
|
#endif
|
1112
1167
|
mEtc = rb_define_module("Etc");
|
1168
|
+
/* The version */
|
1113
1169
|
rb_define_const(mEtc, "VERSION", rb_str_new_cstr(RUBY_ETC_VERSION));
|
1114
1170
|
init_constants(mEtc);
|
1115
1171
|
|
data/ext/etc/extconf.rb
CHANGED
@@ -43,13 +43,23 @@ have_struct_member('struct group', 'gr_passwd', 'grp.h')
|
|
43
43
|
|
44
44
|
# for https://github.com/ruby/etc
|
45
45
|
srcdir = File.expand_path("..", __FILE__)
|
46
|
-
|
47
|
-
|
46
|
+
constdefs = "#{srcdir}/constdefs.h"
|
47
|
+
if !File.exist?(constdefs)
|
48
|
+
ruby = RbConfig.ruby
|
49
|
+
if File.file?(ruby)
|
50
|
+
ruby = [ruby]
|
51
|
+
else
|
52
|
+
require "shellwords"
|
53
|
+
ruby = Shellwords.split(ruby)
|
54
|
+
end
|
55
|
+
system(*ruby, "#{srcdir}/mkconstants.rb", "-o", constdefs)
|
48
56
|
end
|
49
57
|
|
50
58
|
# TODO: remove when dropping 2.7 support, as exported since 3.0
|
51
59
|
have_func('rb_deprecate_constant(Qnil, "None")')
|
52
60
|
|
61
|
+
have_func("rb_io_descriptor")
|
62
|
+
|
53
63
|
$distcleanfiles << "constdefs.h"
|
54
64
|
|
55
65
|
create_makefile("etc")
|
data/ext/etc/mkconstants.rb
CHANGED
@@ -35,6 +35,12 @@ opt.def_option('-H FILE', 'specify output header file') {|filename|
|
|
35
35
|
|
36
36
|
opt.parse!
|
37
37
|
|
38
|
+
CONST_PREFIXES = {
|
39
|
+
'SC' => 'for Etc.sysconf; See <tt>man sysconf</tt>',
|
40
|
+
'CS' => 'for Etc.confstr; See <tt>man constr</tt>',
|
41
|
+
'PC' => 'for IO#pathconf; See <tt>man fpathconf</tt>',
|
42
|
+
}
|
43
|
+
|
38
44
|
h = {}
|
39
45
|
COMMENTS = {}
|
40
46
|
|
@@ -49,6 +55,13 @@ DATA.each_line {|s|
|
|
49
55
|
next
|
50
56
|
end
|
51
57
|
h[name] = default_value
|
58
|
+
if additional = CONST_PREFIXES[name[/\A_([A-Z]+)_/, 1]]
|
59
|
+
if comment&.match(/\w\z/)
|
60
|
+
comment << " " << additional
|
61
|
+
else
|
62
|
+
(comment ||= String.new) << " " << additional.sub(/\A\w/) {$&.upcase}
|
63
|
+
end
|
64
|
+
end
|
52
65
|
COMMENTS[name] = comment if comment
|
53
66
|
}
|
54
67
|
DEFS = h.to_a
|
@@ -66,15 +79,11 @@ def each_name(pat)
|
|
66
79
|
}
|
67
80
|
end
|
68
81
|
|
69
|
-
erb_new = lambda do |src,
|
70
|
-
|
71
|
-
ERB.new(src, trim_mode: trim)
|
72
|
-
else
|
73
|
-
ERB.new(src, safe, trim)
|
74
|
-
end
|
82
|
+
erb_new = lambda do |src, trim|
|
83
|
+
ERB.new(src, trim_mode: trim)
|
75
84
|
end
|
76
85
|
|
77
|
-
erb_new.call(<<'EOS',
|
86
|
+
erb_new.call(<<'EOS', '%').def_method(Object, "gen_const_decls")
|
78
87
|
% each_const {|name, default_value|
|
79
88
|
#if !defined(<%=name%>)
|
80
89
|
# if defined(HAVE_CONST_<%=name.upcase%>)
|
@@ -88,7 +97,7 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
|
|
88
97
|
% }
|
89
98
|
EOS
|
90
99
|
|
91
|
-
erb_new.call(<<'EOS',
|
100
|
+
erb_new.call(<<'EOS', '%').def_method(Object, "gen_const_defs")
|
92
101
|
% each_const {|name, default_value|
|
93
102
|
#if defined(<%=name%>)
|
94
103
|
% if comment = COMMENTS[name]
|
@@ -99,13 +108,13 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
|
|
99
108
|
% }
|
100
109
|
EOS
|
101
110
|
|
102
|
-
header_result = erb_new.call(<<'EOS',
|
111
|
+
header_result = erb_new.call(<<'EOS', '%').result(binding)
|
103
112
|
/* autogenerated file */
|
104
113
|
|
105
114
|
<%= gen_const_decls %>
|
106
115
|
EOS
|
107
116
|
|
108
|
-
result = erb_new.call(<<'EOS',
|
117
|
+
result = erb_new.call(<<'EOS', '%').result(binding)
|
109
118
|
/* autogenerated file */
|
110
119
|
|
111
120
|
#ifdef HAVE_LONG_LONG
|
@@ -123,6 +132,9 @@ result = erb_new.call(<<'EOS', nil, '%').result(binding)
|
|
123
132
|
static void
|
124
133
|
init_constants(VALUE mod)
|
125
134
|
{
|
135
|
+
#if 0
|
136
|
+
mod = rb_define_module("Etc");
|
137
|
+
#endif
|
126
138
|
<%= gen_const_defs %>
|
127
139
|
}
|
128
140
|
EOS
|
data/test/etc/test_etc.rb
CHANGED
@@ -169,6 +169,10 @@ class TestEtc < Test::Unit::TestCase
|
|
169
169
|
assert_operator(1, :<=, n)
|
170
170
|
end
|
171
171
|
|
172
|
+
def test_sysconfdir
|
173
|
+
assert_operator(File, :absolute_path?, Etc.sysconfdir)
|
174
|
+
end if File.method_defined?(:absolute_path?)
|
175
|
+
|
172
176
|
def test_ractor
|
173
177
|
return unless Etc.passwd # => skip test if no platform support
|
174
178
|
Etc.endpwent
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides access to information typically stored in UNIX /etc directory.
|
14
14
|
email:
|
@@ -24,14 +24,6 @@ extra_rdoc_files:
|
|
24
24
|
- ext/etc/etc.c
|
25
25
|
- ext/etc/extconf.rb
|
26
26
|
- ext/etc/mkconstants.rb
|
27
|
-
- logs/ChangeLog-1.0.0
|
28
|
-
- logs/ChangeLog-1.0.1
|
29
|
-
- logs/ChangeLog-1.1.0
|
30
|
-
- logs/ChangeLog-1.2.0
|
31
|
-
- logs/ChangeLog-1.3.0
|
32
|
-
- logs/ChangeLog-1.3.1
|
33
|
-
- logs/ChangeLog-1.4.0
|
34
|
-
- logs/ChangeLog-1.4.1
|
35
27
|
- test/etc/test_etc.rb
|
36
28
|
files:
|
37
29
|
- ChangeLog
|
@@ -41,21 +33,13 @@ files:
|
|
41
33
|
- ext/etc/etc.c
|
42
34
|
- ext/etc/extconf.rb
|
43
35
|
- ext/etc/mkconstants.rb
|
44
|
-
- logs/ChangeLog-1.0.0
|
45
|
-
- logs/ChangeLog-1.0.1
|
46
|
-
- logs/ChangeLog-1.1.0
|
47
|
-
- logs/ChangeLog-1.2.0
|
48
|
-
- logs/ChangeLog-1.3.0
|
49
|
-
- logs/ChangeLog-1.3.1
|
50
|
-
- logs/ChangeLog-1.4.0
|
51
|
-
- logs/ChangeLog-1.4.1
|
52
36
|
- test/etc/test_etc.rb
|
53
37
|
homepage: https://github.com/ruby/etc
|
54
38
|
licenses:
|
55
39
|
- Ruby
|
56
40
|
- BSD-2-Clause
|
57
41
|
metadata: {}
|
58
|
-
post_install_message:
|
42
|
+
post_install_message:
|
59
43
|
rdoc_options:
|
60
44
|
- "--main"
|
61
45
|
- README.md
|
@@ -72,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
56
|
- !ruby/object:Gem::Version
|
73
57
|
version: '0'
|
74
58
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
59
|
+
rubygems_version: 3.5.11
|
60
|
+
signing_key:
|
77
61
|
specification_version: 4
|
78
62
|
summary: Provides access to information typically stored in UNIX /etc directory.
|
79
63
|
test_files: []
|
data/logs/ChangeLog-1.0.0
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
-*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
commit 3402a9366fba4d2bf2f4ea20df16c95121876bc4
|
4
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
5
|
-
AuthorDate: 2017-12-13 14:31:00 +0900
|
6
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
7
|
-
CommitDate: 2017-12-13 14:31:00 +0900
|
8
|
-
|
9
|
-
Bump release date
|
10
|
-
|
11
|
-
commit be7fadb654340282ff71a500a47f88a0b4c47a1d
|
12
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
13
|
-
AuthorDate: 2017-12-13 14:30:42 +0900
|
14
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
15
|
-
CommitDate: 2017-12-13 14:30:42 +0900
|
16
|
-
|
17
|
-
Added badge of Travis
|
18
|
-
|
19
|
-
commit 97aca32b82f6cd8c309ae515e36d86c4d4822e4c
|
20
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
21
|
-
AuthorDate: 2017-12-13 14:23:26 +0900
|
22
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
23
|
-
CommitDate: 2017-12-13 14:23:26 +0900
|
24
|
-
|
25
|
-
prepare to release 1.0.0
|
26
|
-
|
27
|
-
commit 744646073bcd4e7c5b65ae5921cf4c1d5697e35e
|
28
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
29
|
-
AuthorDate: 2017-11-28 12:17:10 +0900
|
30
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
31
|
-
CommitDate: 2017-11-28 12:20:44 +0900
|
32
|
-
|
33
|
-
Pick commits from ruby core repository.
|
34
|
-
|
35
|
-
* https://github.com/ruby/ruby/commit/0f7fed9253
|
36
|
-
* https://github.com/ruby/ruby/commit/8fc8587e05
|
37
|
-
* https://github.com/ruby/ruby/commit/1333c0f0df
|
38
|
-
* https://github.com/ruby/ruby/commit/e4ff51b05a
|
39
|
-
* https://github.com/ruby/ruby/commit/1852b4a866
|
40
|
-
* https://github.com/ruby/ruby/commit/b5b2bd86f1
|
41
|
-
* https://github.com/ruby/ruby/commit/253fd5fe6b
|
42
|
-
|
43
|
-
commit 0e8f8547412d33a35752ef4272d78fc18cf3a5ed
|
44
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
45
|
-
AuthorDate: 2017-10-20 16:51:22 +0900
|
46
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
47
|
-
CommitDate: 2017-10-20 16:51:22 +0900
|
48
|
-
|
49
|
-
Update README with rdoc of Etc module
|
50
|
-
|
51
|
-
commit 86a04b45feed2bc88d44399e127ed675d5d0f41c
|
52
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
53
|
-
AuthorDate: 2017-09-13 14:32:17 +0900
|
54
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
55
|
-
CommitDate: 2017-09-13 14:32:17 +0900
|
56
|
-
|
57
|
-
make frozen
|
58
|
-
|
59
|
-
commit 91ce5d0039fe10d86b35a3c114fabb9a7ae86344
|
60
|
-
Author: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
61
|
-
AuthorDate: 2017-07-18 14:38:26 +0900
|
62
|
-
Commit: SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
63
|
-
CommitDate: 2017-07-18 14:38:26 +0900
|
64
|
-
|
65
|
-
fixed wrong license name
|