[前][次][番号順一覧][スレッド一覧]

ruby-changes:71110

From: Peter <ko1@a...>
Date: Mon, 7 Feb 2022 23:52:28 +0900 (JST)
Subject: [ruby-changes:71110] a32e5e1b97 (master): [DOC] Use RDoc link style for links in the same class/module

https://git.ruby-lang.org/ruby.git/commit/?id=a32e5e1b97

From a32e5e1b970298590200c2a63e5d4bacce4355ac Mon Sep 17 00:00:00 2001
From: Peter Zhu <peter@p...>
Date: Sun, 6 Feb 2022 10:37:06 -0500
Subject: [DOC] Use RDoc link style for links in the same class/module

I used this regex:

(?<=\[)#(?:class|module)-([A-Za-z]+)-label-([A-Za-z0-9\-\+]+)

And performed a global find & replace for this:

rdoc-ref:$1@$2
---
 array.c   |  20 +++++-----
 enum.c    |  12 +++---
 file.c    |   8 ++--
 hash.c    |  98 ++++++++++++++++++++++++------------------------
 io.c      | 126 +++++++++++++++++++++++++++++++-------------------------------
 numeric.c |  22 +++++------
 object.c  |  30 +++++++--------
 range.c   |  10 ++---
 string.c  |  30 +++++++--------
 struct.c  |  14 +++----
 10 files changed, 185 insertions(+), 185 deletions(-)

diff --git a/array.c b/array.c
index 630dbf424c..55987f52b1 100644
--- a/array.c
+++ b/array.c
@@ -8086,16 +8086,16 @@ rb_ary_deconstruct(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L8086
  *
  *  Here, class \Array provides methods that are useful for:
  *
- *  - {Creating an Array}[#class-Array-label-Methods+for+Creating+an+Array]
- *  - {Querying}[#class-Array-label-Methods+for+Querying]
- *  - {Comparing}[#class-Array-label-Methods+for+Comparing]
- *  - {Fetching}[#class-Array-label-Methods+for+Fetching]
- *  - {Assigning}[#class-Array-label-Methods+for+Assigning]
- *  - {Deleting}[#class-Array-label-Methods+for+Deleting]
- *  - {Combining}[#class-Array-label-Methods+for+Combining]
- *  - {Iterating}[#class-Array-label-Methods+for+Iterating]
- *  - {Converting}[#class-Array-label-Methods+for+Converting]
- *  - {And more....}[#class-Array-label-Other+Methods]
+ *  - {Creating an Array}[rdoc-ref:Array@Methods+for+Creating+an+Array]
+ *  - {Querying}[rdoc-ref:Array@Methods+for+Querying]
+ *  - {Comparing}[rdoc-ref:Array@Methods+for+Comparing]
+ *  - {Fetching}[rdoc-ref:Array@Methods+for+Fetching]
+ *  - {Assigning}[rdoc-ref:Array@Methods+for+Assigning]
+ *  - {Deleting}[rdoc-ref:Array@Methods+for+Deleting]
+ *  - {Combining}[rdoc-ref:Array@Methods+for+Combining]
+ *  - {Iterating}[rdoc-ref:Array@Methods+for+Iterating]
+ *  - {Converting}[rdoc-ref:Array@Methods+for+Converting]
+ *  - {And more....}[rdoc-ref:Array@Other+Methods]
  *
  *  === Methods for Creating an Array
  *
diff --git a/enum.c b/enum.c
index 5912280840..519d8873f6 100644
--- a/enum.c
+++ b/enum.c
@@ -4650,12 +4650,12 @@ enum_compact(VALUE obj) https://github.com/ruby/ruby/blob/trunk/enum.c#L4650
  * == What's Here
  *
  * \Module \Enumerable provides methods that are useful to a collection class for:
- * - {Querying}[#module-Enumerable-label-Methods+for+Querying]
- * - {Fetching}[#module-Enumerable-label-Methods+for+Fetching]
- * - {Searching}[#module-Enumerable-label-Methods+for+Searching]
- * - {Sorting}[#module-Enumerable-label-Methods+for+Sorting]
- * - {Iterating}[#module-Enumerable-label-Methods+for+Iterating]
- * - {And more....}[#module-Enumerable-label-Other+Methods]
+ * - {Querying}[rdoc-ref:Enumerable@Methods+for+Querying]
+ * - {Fetching}[rdoc-ref:Enumerable@Methods+for+Fetching]
+ * - {Searching}[rdoc-ref:Enumerable@Methods+for+Searching]
+ * - {Sorting}[rdoc-ref:Enumerable@Methods+for+Sorting]
+ * - {Iterating}[rdoc-ref:Enumerable@Methods+for+Iterating]
+ * - {And more....}[rdoc-ref:Enumerable@Other+Methods]
  *
  * === Methods for Querying
  *
diff --git a/file.c b/file.c
index 1fb661d3ef..2cd011375a 100644
--- a/file.c
+++ b/file.c
@@ -6584,10 +6584,10 @@ const char ruby_null_device[] = https://github.com/ruby/ruby/blob/trunk/file.c#L6584
  *
  *  Here, class \File provides methods that are useful for:
  *
- *  - {Creating}[#class-File-label-Creating]
- *  - {Querying}[#class-File-label-Querying]
- *  - {Settings}[#class-File-label-Settings]
- *  - {Other}[#class-File-label-Other]
+ *  - {Creating}[rdoc-ref:File@Creating]
+ *  - {Querying}[rdoc-ref:File@Querying]
+ *  - {Settings}[rdoc-ref:File@Settings]
+ *  - {Other}[rdoc-ref:File@Other]
  *
  *  === Creating
  *
diff --git a/hash.c b/hash.c
index ece9adee06..08e08935d2 100644
--- a/hash.c
+++ b/hash.c
@@ -1775,7 +1775,7 @@ set_proc_default(VALUE hash, VALUE proc) https://github.com/ruby/ruby/blob/trunk/hash.c#L1775
  *  Returns a new empty \Hash object.
  *
  *  The initial default value and initial default proc for the new hash
- *  depend on which form above was used. See {Default Values}[#class-Hash-label-Default+Values].
+ *  depend on which form above was used. See {Default Values}[rdoc-ref:Hash@Default+Values].
  *
  *  If neither an argument nor a block given,
  *  initializes both the default value and the default proc to <tt>nil</tt>:
@@ -2008,7 +2008,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg) https://github.com/ruby/ruby/blob/trunk/hash.c#L2008
  *
  *  The hash table becomes invalid if the hash value of a key
  *  has changed after the entry was created.
- *  See {Modifying an Active Hash Key}[#class-Hash-label-Modifying+an+Active+Hash+Key].
+ *  See {Modifying an Active Hash Key}[rdoc-ref:Hash@Modifying+an+Active+Hash+Key].
  */
 
 VALUE
@@ -2092,7 +2092,7 @@ rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval) https://github.com/ruby/ruby/blob/trunk/hash.c#L2092
  *    h[:foo] # => 0
  *
  *  If +key+ is not found, returns a default value
- *  (see {Default Values}[#class-Hash-label-Default+Values]):
+ *  (see {Default Values}[rdoc-ref:Hash@Default+Values]):
  *    h = {foo: 0, bar: 1, baz: 2}
  *    h[:nosuch] # => nil
  */
@@ -2201,7 +2201,7 @@ rb_hash_fetch(VALUE hash, VALUE key) https://github.com/ruby/ruby/blob/trunk/hash.c#L2201
  *
  *  Returns the default value for the given +key+.
  *  The returned value will be determined either by the default proc or by the default value.
- *  See {Default Values}[#class-Hash-label-Default+Values].
+ *  See {Default Values}[rdoc-ref:Hash@Default+Values].
  *
  *  With no argument, returns the current default value:
  *    h = {}
@@ -2238,7 +2238,7 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L2238
  *    h.default = false # => false
  *    h.default # => false
  *
- *  See {Default Values}[#class-Hash-label-Default+Values].
+ *  See {Default Values}[rdoc-ref:Hash@Default+Values].
  */
 
 static VALUE
@@ -2254,7 +2254,7 @@ rb_hash_set_default(VALUE hash, VALUE ifnone) https://github.com/ruby/ruby/blob/trunk/hash.c#L2254
  *    hash.default_proc -> proc or nil
  *
  *  Returns the default proc for +self+
- *  (see {Default Values}[#class-Hash-label-Default+Values]):
+ *  (see {Default Values}[rdoc-ref:Hash@Default+Values]):
  *    h = {}
  *    h.default_proc # => nil
  *    h.default_proc = proc {|hash, key| "Default value for #{key}" }
@@ -2275,7 +2275,7 @@ rb_hash_default_proc(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L2275
  *    hash.default_proc = proc -> proc
  *
  *  Sets the default proc for +self+ to +proc+:
- *  (see {Default Values}[#class-Hash-label-Default+Values]):
+ *  (see {Default Values}[rdoc-ref:Hash@Default+Values]):
  *    h = {}
  *    h.default_proc # => nil
  *    h.default_proc = proc { |hash, key| "Default value for #{key}" }
@@ -2322,7 +2322,7 @@ key_i(VALUE key, VALUE value, VALUE arg) https://github.com/ruby/ruby/blob/trunk/hash.c#L2322
  *    hash.key(value) -> key or nil
  *
  *  Returns the key for the first-found entry with the given +value+
- *  (see {Entry Order}[#class-Hash-label-Entry+Order]):
+ *  (see {Entry Order}[rdoc-ref:Hash@Entry+Order]):
  *    h = {foo: 0, bar: 2, baz: 2}
  *    h.key(0) # => :foo
  *    h.key(2) # => :bar
@@ -2458,7 +2458,7 @@ shift_i_safe(VALUE key, VALUE value, VALUE arg) https://github.com/ruby/ruby/blob/trunk/hash.c#L2458
  *    hash.shift -> [key, value] or nil
  *
  *  Removes the first hash entry
- *  (see {Entry Order}[#class-Hash-label-Entry+Order]);
+ *  (see {Entry Order}[rdoc-ref:Hash@Entry+Order]);
  *  returns a 2-element \Array containing the removed key and value:
  *    h = {foo: 0, bar: 1, baz: 2}
  *    h.shift # => [:foo, 0]
@@ -2680,7 +2680,7 @@ rb_hash_except(int argc, VALUE *argv, VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L2680
  *    h = {foo: 0, bar: 1, baz: 2}
  *    h.values_at(:baz, :foo) # => [2, 0]
  *
- *  The {default values}[#class-Hash-label-Default+Values] are returned
+ *  The {default values}[rdoc-ref:Hash@Default+Values] are returned
  *  for any keys that are not found:
  *    h.values_at(:hello, :foo) # => [nil, 0]
  */
@@ -2902,7 +2902,7 @@ NOINSERT_UPDATE_CALLBACK(hash_aset_str) https://github.com/ruby/ruby/blob/trunk/hash.c#L2902
  *
  *  If the given +key+ exists, replaces its value with the given +value+;
  *  the ordering is not affected
- *  (see {Entry Order}[#class-Hash-label-Entry+Order]):
+ *  (see {Entry Order}[rdoc-ref:Hash@Entry+Order]):
  *    h = {foo: 0, bar: 1}
  *    h[:foo] = 2 # => 2
  *    h.store(:bar, 3) # => 3
@@ -2910,7 +2910,7 @@ NOINSERT_UPDATE_CALLBACK(hash_aset_str) https://github.com/ruby/ruby/blob/trunk/hash.c#L2910
  *
  *  If +key+ does not exist, adds the +key+ and +value+;
  *  the new entry is last in the order
- *  (see {Entry Order}[#class-Hash-label-Entry+Order]):
+ *  (see {Entry Order}[rdoc-ref:Hash@Entry+Order]):
  *    h = {foo: 0, bar: 1}
  *    h[:baz] = 2 # => 2
  *    h.store(:bat, 3) # => 3
@@ -3872,7 +3872,7 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L3872
  *    h1 # => {0=>:foo, 1=>:bar, 2=>:baz}
  *
  *  Overwrites any repeated new keys:
- *  (see {Entry Order}[#class-Hash-label-Entry+Order]):
+ *  (see {Entry Order}[rdoc-ref:Hash@Entry+Order]):
  *    h = {foo: 0, bar: 0, baz: 0}
  *    h.invert # => {0=>:baz}
  */
@@ -4202,7 +4202,7 @@ rassoc_i(VALUE key, VALUE val, VALUE arg) https://github.com/ruby/ruby/blob/trunk/hash.c#L4202
  *
  *  Returns a new 2-element \Array consisting of the key and value
  *  of the first-found entry whose value is <tt>==</tt> to value
- *  (see {Entry Order}[#class-Hash-labe (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]