diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-12 13:24:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-12 13:24:53 +0900 |
commit | b57ecc3eb88db40517f43ed44c007e2ddf5a8b2f (patch) | |
tree | f8dbe5f02e2c7f4a77c02ff92e0f59d7fbe000b6 /tool | |
parent | 3539da64fc42d6eb76f1d4c3ccd219c3259ecd8b (diff) | |
download | ruby-b57ecc3eb88db40517f43ed44c007e2ddf5a8b2f.tar.gz |
sync_default_gems: Replace the URIs to be redirected
The reference generated by using RDoc without the proper `--page-dir`
option (or `.rdoc_options`) file may contain `/doc/`. Since these
URIs are redirected by the server now, replace such URIs with the
corresponding rdoc-refs too.
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/sync_default_gems.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 8b7fae2db3..d585f5f14a 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -86,7 +86,7 @@ end def replace_rdoc_ref(file) src = File.binread(file) - src.gsub!(%r[\[\Khttps://docs\.ruby-lang\.org/en/master/(([A-Z]\w+(?:/[A-Z]\w+)*)|\w+_rdoc)\.html(\#\S+)?(?=\])]) do + src.gsub!(%r[\[\Khttps://docs\.ruby-lang\.org/en/master(?:/doc)?/(([A-Z]\w+(?:/[A-Z]\w+)*)|\w+_rdoc)\.html(\#\S+)?(?=\])]) do name, mod, label = $1, $2, $3 mod &&= mod.gsub('/', '::') if label && (m = label.match(/\A\#(?:method-([ci])|(?:(?:class|module)-#{mod}-)?label)-([-+\w]+)\z/)) |