supplement 2.4 → 2.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: d5f88b0474c869e526bfd16b7e5722c807def120fd4a77a7e18c8a553e39a649
4
- data.tar.gz: 9e4272c52c2f0147e4c85540d42d155fc2c1843c8513d4370e5de130b4baf2f7
3
+ metadata.gz: ce560e2f7352a6d0f2d273b3b66c8cb4c3781cf1ff54883d52a8ae78d0b1bea4
4
+ data.tar.gz: a58fc3dff8e03f90d995b548e30d7a45dbf1f1ba440b59ecd719b1d8cbb10cb3
5
5
  SHA512:
6
- metadata.gz: 57cc21c7b672bd54a34bb65766d80f33f16e053821078ec21467a110836d54b589efc708a3fefc9897320e7707816cb0864c089f5bd411056b3f81b413d1ca11
7
- data.tar.gz: 375e9c694c1c841994def2b00ce446dc3cd81509b707cc9169a580714b178da68f66cad9ee22ce9629665b0bc7456c8764a5c6be961fab94dea927e47c11c575
6
+ metadata.gz: '0382adec096f4dd2d54b2b71abb9d54dc2e008e6d742ba66f49348e3b0c0a41cf540f08024bf536af75aa8a18e75285ff444630198a6d6c49264e1e9b8aa4253'
7
+ data.tar.gz: 81e0844875bcabe889d10cb1bbb3c2baadc67c0de8af5db7a14c0ecb0094245e5a545ed6d2b0fe2ce06ead9599ab7b56b0adbb939ee036162e1e213dc8acec97
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = supplement 2.4 -- Useful Ruby enhancements
1
+ = supplement 2.5 -- Useful Ruby enhancements
2
2
 
3
3
  Some simple Ruby extensions.
4
4
 
@@ -10,16 +10,19 @@ Autorake.configure {
10
10
 
11
11
  extending_ruby
12
12
 
13
- if RUBY_VERSION < "1.9.2" then
14
- enable :array_select_bang
15
- if RUBY_VERSION < "1.9" then
16
- enable :string_ord
17
- enable :string_clear
18
- if RUBY_VERSION < "1.8.7" then
19
- enable :array_index_with_block
20
- enable :kernel_tap
21
- enable :string_start_with
22
- enable :thread_exclusive
13
+ if RUBY_VERSION < "2.5" then
14
+ enable :dir_children
15
+ if RUBY_VERSION < "1.9.2" then
16
+ enable :array_select_bang
17
+ if RUBY_VERSION < "1.9" then
18
+ enable :string_ord
19
+ enable :string_clear
20
+ if RUBY_VERSION < "1.8.7" then
21
+ enable :array_index_with_block
22
+ enable :kernel_tap
23
+ enable :string_start_with
24
+ enable :thread_exclusive
25
+ end
23
26
  end
24
27
  end
25
28
  end
@@ -40,7 +40,7 @@ rb_process_renice( int argc, VALUE *argv, VALUE obj)
40
40
  else
41
41
  pid = NUM2INT( p1), prio = NUM2INT( p2);
42
42
 
43
- rb_secure(2);
43
+ rb_secure(1);
44
44
  if (setpriority( PRIO_PROCESS, pid, prio) < 0)
45
45
  rb_sys_fail(0);
46
46
 
@@ -72,14 +72,15 @@ static ID id_index;
72
72
 
73
73
  /*
74
74
  * call-seq:
75
- * new_string -> str
75
+ * new_string -> str
76
+ * new_string { |str| ... } -> str
76
77
  *
77
78
  * Returns another string that may be modified without touching the original
78
79
  * object. This means +dup+ for a string and +to_s+ for any other object.
79
80
  *
80
81
  * If a block is given, that may modify a created string (built from a
81
82
  * non-string object). For a dup'ed string object the block will not be
82
- * called.
83
+ * called (See +String#new_string+).
83
84
  */
84
85
 
85
86
  VALUE
@@ -1229,7 +1230,7 @@ rb_file_s_umask( int argc, VALUE *argv)
1229
1230
  {
1230
1231
  int omask = 0;
1231
1232
 
1232
- rb_secure( 2);
1233
+ rb_secure( 1);
1233
1234
  switch (argc) {
1234
1235
  case 0:
1235
1236
  omask = umask( 0777);
@@ -1313,16 +1314,18 @@ rb_dir_s_mkdir_bang( int argc, VALUE *argv)
1313
1314
  }
1314
1315
 
1315
1316
 
1317
+ #ifdef FEATURE_DIR_CHILDREN
1318
+
1316
1319
  /*
1317
1320
  * call-seq:
1318
- * entries!() -> dir
1321
+ * children() -> ary
1319
1322
  *
1320
1323
  * Entries without <code>"."</code> and <code>".."</code>.
1321
1324
  *
1322
1325
  */
1323
1326
 
1324
1327
  VALUE
1325
- rb_dir_entries_bang( VALUE self)
1328
+ rb_dir_children( VALUE self)
1326
1329
  {
1327
1330
  VALUE e;
1328
1331
 
@@ -1332,6 +1335,8 @@ rb_dir_entries_bang( VALUE self)
1332
1335
  return e;
1333
1336
  }
1334
1337
 
1338
+ #endif
1339
+
1335
1340
 
1336
1341
 
1337
1342
  /*
@@ -1550,7 +1555,10 @@ void Init_supplement( void)
1550
1555
 
1551
1556
  rb_define_singleton_method( rb_cDir, "current", rb_dir_s_current, 0);
1552
1557
  rb_define_singleton_method( rb_cDir, "mkdir!", rb_dir_s_mkdir_bang, -1);
1553
- rb_define_method( rb_cDir, "entries!", rb_dir_entries_bang, 0);
1558
+ #ifdef FEATURE_DIR_CHILDREN
1559
+ rb_define_method( rb_cDir, "children", rb_dir_children, 0);
1560
+ #endif
1561
+ rb_define_alias( rb_cDir, "entries!", "children");
1554
1562
 
1555
1563
  rb_define_method( rb_cMatch, "begin", rb_match_begin, -1);
1556
1564
  rb_define_method( rb_cMatch, "end", rb_match_end, -1);
@@ -67,7 +67,7 @@ extern VALUE rb_file_size( VALUE);
67
67
  extern VALUE rb_file_s_umask( int, VALUE *);
68
68
  extern VALUE rb_dir_s_current( VALUE);
69
69
  extern VALUE rb_dir_s_mkdir_bang( int, VALUE *);
70
- extern VALUE rb_dir_entries_bang( VALUE);
70
+ extern VALUE rb_dir_children( VALUE);
71
71
 
72
72
  extern VALUE rb_match_begin( int, VALUE *, VALUE);
73
73
  extern VALUE rb_match_end( int, VALUE *, VALUE);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supplement
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.4'
4
+ version: '2.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-04 00:00:00.000000000 Z
11
+ date: 2019-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autorake
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  requirements:
80
80
  - Ruby and the autorake gem
81
- rubygems_version: 3.0.3
81
+ rubygems_version: 3.0.6
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Simple Ruby extensions