From 4cd6661e1853930c8002174c4ccd14f927fcd33b Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 27 Nov 2025 20:12:24 +0000 Subject: [PATCH 1/4] Reorganize page documentations (#15154) Re-organize page docs --- array.c | 4 +- box.c | 4 +- common.mk | 6 +- doc/.document | 7 +- doc/_regexp.rdoc | 4 +- doc/{ => contributing}/bug_triaging.rdoc | 0 doc/contributing/building_ruby.md | 2 +- doc/{ => contributing}/dtrace_probes.rdoc | 0 doc/{ => contributing}/memory_view.md | 0 doc/{ => distribution}/distribution.md | 0 doc/{ => distribution}/windows.md | 0 doc/{yjit => jit}/yjit.md | 0 doc/{ => jit}/zjit.md | 0 doc/{_box.md => language/box.md} | 0 doc/{ => language}/bsearch.rdoc | 0 doc/{date => language}/calendars.rdoc | 2 +- doc/{ => language}/case_mapping.rdoc | 0 doc/{ => language}/character_selectors.rdoc | 0 doc/{ => language}/dig_methods.rdoc | 0 doc/{ => language}/encodings.rdoc | 0 doc/{ => language}/exceptions.md | 0 doc/{ => language}/fiber.md | 0 doc/{ => language}/format_specifications.rdoc | 26 +++--- doc/{ => language}/globals.md | 0 doc/{ => language}/hash_inclusion.rdoc | 0 doc/{ => language}/implicit_conversion.rdoc | 0 doc/{ => language}/marshal.rdoc | 0 doc/{ruby => language}/option_dump.md | 0 doc/{ruby => language}/options.md | 72 ++++++++-------- doc/{ => language}/packed_data.rdoc | 2 +- doc/{ => language}/ractor.md | 0 doc/{ => language}/regexp/methods.rdoc | 0 .../regexp/unicode_properties.rdoc | 0 doc/{ => language}/signals.rdoc | 0 doc/{ => language}/strftime_formatting.rdoc | 7 +- doc/{ => security}/command_injection.rdoc | 0 doc/{ => security}/security.rdoc | 0 doc/string/partition.rdoc | 4 +- doc/string/rpartition.rdoc | 4 +- doc/syntax/assignment.rdoc | 2 +- ext/date/date_core.c | 86 +++++++++---------- hash.c | 8 +- io.c | 22 ++--- load.c | 2 +- object.c | 2 +- pack.rb | 6 +- process.c | 6 +- range.c | 2 +- string.c | 2 +- test/ruby/test_box.rb | 2 +- yjit.rb | 4 +- 51 files changed, 145 insertions(+), 143 deletions(-) rename doc/{ => contributing}/bug_triaging.rdoc (100%) rename doc/{ => contributing}/dtrace_probes.rdoc (100%) rename doc/{ => contributing}/memory_view.md (100%) rename doc/{ => distribution}/distribution.md (100%) rename doc/{ => distribution}/windows.md (100%) rename doc/{yjit => jit}/yjit.md (100%) rename doc/{ => jit}/zjit.md (100%) rename doc/{_box.md => language/box.md} (100%) rename doc/{ => language}/bsearch.rdoc (100%) rename doc/{date => language}/calendars.rdoc (95%) rename doc/{ => language}/case_mapping.rdoc (100%) rename doc/{ => language}/character_selectors.rdoc (100%) rename doc/{ => language}/dig_methods.rdoc (100%) rename doc/{ => language}/encodings.rdoc (100%) rename doc/{ => language}/exceptions.md (100%) rename doc/{ => language}/fiber.md (100%) rename doc/{ => language}/format_specifications.rdoc (89%) rename doc/{ => language}/globals.md (100%) rename doc/{ => language}/hash_inclusion.rdoc (100%) rename doc/{ => language}/implicit_conversion.rdoc (100%) rename doc/{ => language}/marshal.rdoc (100%) rename doc/{ruby => language}/option_dump.md (100%) rename doc/{ruby => language}/options.md (85%) rename doc/{ => language}/packed_data.rdoc (99%) rename doc/{ => language}/ractor.md (100%) rename doc/{ => language}/regexp/methods.rdoc (100%) rename doc/{ => language}/regexp/unicode_properties.rdoc (100%) rename doc/{ => language}/signals.rdoc (100%) rename doc/{ => language}/strftime_formatting.rdoc (98%) rename doc/{ => security}/command_injection.rdoc (100%) rename doc/{ => security}/security.rdoc (100%) diff --git a/array.c b/array.c index b71123532d19cc..2ea6b55a7f69a3 100644 --- a/array.c +++ b/array.c @@ -3521,7 +3521,7 @@ static VALUE rb_ary_bsearch_index(VALUE ary); * Returns the element from +self+ found by a binary search, * or +nil+ if the search found no suitable element. * - * See {Binary Searching}[rdoc-ref:bsearch.rdoc]. + * See {Binary Searching}[rdoc-ref:language/bsearch.rdoc]. * * Related: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching]. */ @@ -3545,7 +3545,7 @@ rb_ary_bsearch(VALUE ary) * Returns the integer index of the element from +self+ found by a binary search, * or +nil+ if the search found no suitable element. * - * See {Binary Searching}[rdoc-ref:bsearch.rdoc]. + * See {Binary Searching}[rdoc-ref:language/bsearch.rdoc]. * * Related: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching]. */ diff --git a/box.c b/box.c index e2c8f25eda7375..42ee967c509c84 100644 --- a/box.c +++ b/box.c @@ -796,7 +796,7 @@ rb_initialize_main_box(void) if (!box_experimental_warned) { rb_category_warn(RB_WARN_CATEGORY_EXPERIMENTAL, "Ruby::Box is experimental, and the behavior may change in the future!\n" - "See doc/box.md for known issues, etc."); + "See doc/language/box.md for known issues, etc."); box_experimental_warned = 1; } @@ -1048,7 +1048,7 @@ rb_f_dump_classext(VALUE recv, VALUE klass) * Document-class: Ruby::Box * * :markup: markdown - * :include: doc/_box.md + * :include: doc/language/box.md */ void Init_Box(void) diff --git a/common.mk b/common.mk index e5f9c7c3711d7a..eb9b75ca7e3dd0 100644 --- a/common.mk +++ b/common.mk @@ -1822,11 +1822,11 @@ $(UNICODE_HDR_DIR)/name2ctype.h: $(UNICODE_SRC_DATA_DIR) $(UNICODE_SRC_EMOJI_DATA_DIR) > $@.new $(MV) $@.new $@ -srcs-doc: $(srcdir)/doc/regexp/unicode_properties.rdoc -$(srcdir)/doc/regexp/$(ALWAYS_UPDATE_UNICODE:yes=unicode_properties.rdoc): \ +srcs-doc: $(srcdir)/doc/language/regexp/unicode_properties.rdoc +$(srcdir)/doc/language/regexp/$(ALWAYS_UPDATE_UNICODE:yes=unicode_properties.rdoc): \ $(UNICODE_HDR_DIR)/name2ctype.h $(UNICODE_PROPERTY_FILES) -$(srcdir)/doc/regexp/unicode_properties.rdoc: +$(srcdir)/doc/language/regexp/unicode_properties.rdoc: $(Q) $(BOOTSTRAPRUBY) $(tooldir)/generic_erb.rb -c -o $@ \ $(srcdir)/template/unicode_properties.rdoc.tmpl \ $(UNICODE_SRC_DATA_DIR) $(UNICODE_HDR_DIR)/name2ctype.h || \ diff --git a/doc/.document b/doc/.document index 1feb6934ec358f..3a95c9617b4db5 100644 --- a/doc/.document +++ b/doc/.document @@ -2,11 +2,12 @@ [^_]*.rb [^_]*.rdoc contributing +distribution NEWS syntax optparse date rdoc -regexp -yjit -ruby +jit +security +language diff --git a/doc/_regexp.rdoc b/doc/_regexp.rdoc index 76ac3a859e5b15..301a3fe11b5ce7 100644 --- a/doc/_regexp.rdoc +++ b/doc/_regexp.rdoc @@ -39,7 +39,7 @@ A regexp may be used: most such methods accept an argument that may be either a string or the (much more powerful) regexp. - See {Regexp Methods}[rdoc-ref:regexp/methods.rdoc]. + See {Regexp Methods}[rdoc-ref:language/regexp/methods.rdoc]. == \Regexp Objects @@ -821,7 +821,7 @@ Or by using \P (uppercase +P+): /\P{Alpha}/.match('1') # => # /\P{Alpha}/.match('a') # => nil -See {Unicode Properties}[rdoc-ref:regexp/unicode_properties.rdoc] +See {Unicode Properties}[rdoc-ref:language/regexp/unicode_properties.rdoc] for regexps based on the numerous properties. Some commonly-used properties correspond to POSIX bracket expressions: diff --git a/doc/bug_triaging.rdoc b/doc/contributing/bug_triaging.rdoc similarity index 100% rename from doc/bug_triaging.rdoc rename to doc/contributing/bug_triaging.rdoc diff --git a/doc/contributing/building_ruby.md b/doc/contributing/building_ruby.md index 4c69515684afbc..286bd1f1161635 100644 --- a/doc/contributing/building_ruby.md +++ b/doc/contributing/building_ruby.md @@ -184,7 +184,7 @@ cause build failures. ## Building on Windows The documentation for building on Windows can be found in [the separated -file](../windows.md). +file](../distribution/windows.md). ## More details diff --git a/doc/dtrace_probes.rdoc b/doc/contributing/dtrace_probes.rdoc similarity index 100% rename from doc/dtrace_probes.rdoc rename to doc/contributing/dtrace_probes.rdoc diff --git a/doc/memory_view.md b/doc/contributing/memory_view.md similarity index 100% rename from doc/memory_view.md rename to doc/contributing/memory_view.md diff --git a/doc/distribution.md b/doc/distribution/distribution.md similarity index 100% rename from doc/distribution.md rename to doc/distribution/distribution.md diff --git a/doc/windows.md b/doc/distribution/windows.md similarity index 100% rename from doc/windows.md rename to doc/distribution/windows.md diff --git a/doc/yjit/yjit.md b/doc/jit/yjit.md similarity index 100% rename from doc/yjit/yjit.md rename to doc/jit/yjit.md diff --git a/doc/zjit.md b/doc/jit/zjit.md similarity index 100% rename from doc/zjit.md rename to doc/jit/zjit.md diff --git a/doc/_box.md b/doc/language/box.md similarity index 100% rename from doc/_box.md rename to doc/language/box.md diff --git a/doc/bsearch.rdoc b/doc/language/bsearch.rdoc similarity index 100% rename from doc/bsearch.rdoc rename to doc/language/bsearch.rdoc diff --git a/doc/date/calendars.rdoc b/doc/language/calendars.rdoc similarity index 95% rename from doc/date/calendars.rdoc rename to doc/language/calendars.rdoc index a2540f1c433b5a..eb9638f55231ca 100644 --- a/doc/date/calendars.rdoc +++ b/doc/language/calendars.rdoc @@ -31,7 +31,7 @@ See also {a concrete example here}[rdoc-ref:DateTime@When+should+you+use+DateTim === Argument +start+ Certain methods in class \Date handle differences in the -{Julian and Gregorian calendars}[rdoc-ref:@Julian+and+Gregorian+Calendars] +{Julian and Gregorian calendars}[rdoc-ref:language/calendars.rdoc@Julian+and+Gregorian+Calendars] by accepting an optional argument +start+, whose value may be: - Date::ITALY (the default): the created date is Julian diff --git a/doc/case_mapping.rdoc b/doc/language/case_mapping.rdoc similarity index 100% rename from doc/case_mapping.rdoc rename to doc/language/case_mapping.rdoc diff --git a/doc/character_selectors.rdoc b/doc/language/character_selectors.rdoc similarity index 100% rename from doc/character_selectors.rdoc rename to doc/language/character_selectors.rdoc diff --git a/doc/dig_methods.rdoc b/doc/language/dig_methods.rdoc similarity index 100% rename from doc/dig_methods.rdoc rename to doc/language/dig_methods.rdoc diff --git a/doc/encodings.rdoc b/doc/language/encodings.rdoc similarity index 100% rename from doc/encodings.rdoc rename to doc/language/encodings.rdoc diff --git a/doc/exceptions.md b/doc/language/exceptions.md similarity index 100% rename from doc/exceptions.md rename to doc/language/exceptions.md diff --git a/doc/fiber.md b/doc/language/fiber.md similarity index 100% rename from doc/fiber.md rename to doc/language/fiber.md diff --git a/doc/format_specifications.rdoc b/doc/language/format_specifications.rdoc similarity index 89% rename from doc/format_specifications.rdoc rename to doc/language/format_specifications.rdoc index a59f2103775ec8..61eaefec4af179 100644 --- a/doc/format_specifications.rdoc +++ b/doc/language/format_specifications.rdoc @@ -46,42 +46,42 @@ The links lead to the details and examples. === \Integer Type Specifiers - +b+ or +B+: Format +argument+ as a binary integer. - See {Specifiers b and B}[rdoc-ref:@Specifiers+b+and+B]. + See {Specifiers b and B}[rdoc-ref:language/format_specifications.rdoc@Specifiers+b+and+B]. - +d+, +i+, or +u+ (all are identical): Format +argument+ as a decimal integer. - See {Specifier d}[rdoc-ref:@Specifier+d]. + See {Specifier d}[rdoc-ref:language/format_specifications.rdoc@Specifier+d]. - +o+: Format +argument+ as an octal integer. - See {Specifier o}[rdoc-ref:@Specifier+o]. + See {Specifier o}[rdoc-ref:language/format_specifications.rdoc@Specifier+o]. - +x+ or +X+: Format +argument+ as a hexadecimal integer. - See {Specifiers x and X}[rdoc-ref:@Specifiers+x+and+X]. + See {Specifiers x and X}[rdoc-ref:language/format_specifications.rdoc@Specifiers+x+and+X]. === Floating-Point Type Specifiers - +a+ or +A+: Format +argument+ as hexadecimal floating-point number. - See {Specifiers a and A}[rdoc-ref:@Specifiers+a+and+A]. + See {Specifiers a and A}[rdoc-ref:language/format_specifications.rdoc@Specifiers+a+and+A]. - +e+ or +E+: Format +argument+ in scientific notation. - See {Specifiers e and E}[rdoc-ref:@Specifiers+e+and+E]. + See {Specifiers e and E}[rdoc-ref:language/format_specifications.rdoc@Specifiers+e+and+E]. - +f+: Format +argument+ as a decimal floating-point number. - See {Specifier f}[rdoc-ref:@Specifier+f]. + See {Specifier f}[rdoc-ref:language/format_specifications.rdoc@Specifier+f]. - +g+ or +G+: Format +argument+ in a "general" format. - See {Specifiers g and G}[rdoc-ref:@Specifiers+g+and+G]. + See {Specifiers g and G}[rdoc-ref:language/format_specifications.rdoc@Specifiers+g+and+G]. === Other Type Specifiers - +c+: Format +argument+ as a character. - See {Specifier c}[rdoc-ref:@Specifier+c]. + See {Specifier c}[rdoc-ref:language/format_specifications.rdoc@Specifier+c]. - +p+: Format +argument+ as a string via argument.inspect. - See {Specifier p}[rdoc-ref:@Specifier+p]. + See {Specifier p}[rdoc-ref:language/format_specifications.rdoc@Specifier+p]. - +s+: Format +argument+ as a string via argument.to_s. - See {Specifier s}[rdoc-ref:@Specifier+s]. + See {Specifier s}[rdoc-ref:language/format_specifications.rdoc@Specifier+s]. - %: Format +argument+ ('%') as a single percent character. - See {Specifier %}[rdoc-ref:@Specifier+-25]. + See {Specifier %}[rdoc-ref:language/format_specifications.rdoc@Specifier+-25]. == Flags The effect of a flag may vary greatly among type specifiers. These remarks are general in nature. -See {type-specific details}[rdoc-ref:@Type+Specifier+Details+and+Examples]. +See {type-specific details}[rdoc-ref:language/format_specifications.rdoc@Type+Specifier+Details+and+Examples]. Multiple flags may be given with single type specifier; order does not matter. diff --git a/doc/globals.md b/doc/language/globals.md similarity index 100% rename from doc/globals.md rename to doc/language/globals.md diff --git a/doc/hash_inclusion.rdoc b/doc/language/hash_inclusion.rdoc similarity index 100% rename from doc/hash_inclusion.rdoc rename to doc/language/hash_inclusion.rdoc diff --git a/doc/implicit_conversion.rdoc b/doc/language/implicit_conversion.rdoc similarity index 100% rename from doc/implicit_conversion.rdoc rename to doc/language/implicit_conversion.rdoc diff --git a/doc/marshal.rdoc b/doc/language/marshal.rdoc similarity index 100% rename from doc/marshal.rdoc rename to doc/language/marshal.rdoc diff --git a/doc/ruby/option_dump.md b/doc/language/option_dump.md similarity index 100% rename from doc/ruby/option_dump.md rename to doc/language/option_dump.md diff --git a/doc/ruby/options.md b/doc/language/options.md similarity index 85% rename from doc/ruby/options.md rename to doc/language/options.md index ee6b2054bc1e80..ededb67f8d8dbf 100644 --- a/doc/ruby/options.md +++ b/doc/language/options.md @@ -68,15 +68,15 @@ nil See also: -- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-a`: Split Input Lines into Fields @@ -98,15 +98,15 @@ and the default field separator is `$;`. See also: -- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-c`: Check Syntax @@ -228,15 +228,15 @@ The argument must immediately follow the option See also: -- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-h`: Print Short Help Message @@ -314,15 +314,15 @@ $ ruby -ln -e 'p $_' desiderata.txt See also: -- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-n`: Run Program in `gets` Loop @@ -348,15 +348,15 @@ be on good terms with all persons. See also: -- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-p`: `-n`, with Printing @@ -377,15 +377,15 @@ be on good terms with all persons. See also: -- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. ### `-r`: Require Library @@ -434,7 +434,7 @@ $ ruby -s t.rb -foo=baz -bar=bat ``` The option may not be used with -{option -e}[rdoc-ref:@e-3A+Execute+Given+Ruby+Code] +{option -e}[rdoc-ref:language/options.md@e-3A+Execute+Given+Ruby+Code] ### `-S`: Search Directories in `ENV['PATH']` @@ -583,7 +583,7 @@ ruby - Copyright (C) 1993-2024 Yukihiro Matsumoto ### `--debug`: Alias for `-d` Option `--debug` is an alias for -{option -d}[rdoc-ref:@d-3A+Set+-24DEBUG+to+true]. +{option -d}[rdoc-ref:language/options.md@d-3A+Set+-24DEBUG+to+true]. ### `--disable`: Disable Features @@ -617,9 +617,9 @@ option was given: - `--dump=help`: Same as {option \-\-help}[options_md.html#label--help-3A+Print+Help+Message]. - `--dump=syntax`: - Same as {option -c}[rdoc-ref:@c-3A+Check+Syntax]. + Same as {option -c}[rdoc-ref:language/options.md@c-3A+Check+Syntax]. - `--dump=usage`: - Same as {option -h}[rdoc-ref:@h-3A+Print+Short+Help+Message]. + Same as {option -h}[rdoc-ref:language/options.md@h-3A+Print+Short+Help+Message]. - `--dump=version`: Same as {option \-\-version}[options_md.html#label--version-3A+Print+Ruby+Version]. @@ -641,7 +641,7 @@ see {option --disable}[options_md.html#label--disable-3A+Disable+Features]. ### `--encoding`: Alias for `-E`. Option `--encoding` is an alias for -{option -E}[rdoc-ref:@E-3A+Set+Default+Encodings]. +{option -E}[rdoc-ref:language/options.md@E-3A+Set+Default+Encodings]. ### `--external-encoding`: Set Default External \Encoding @@ -682,7 +682,7 @@ CESU-8 ### `--jit` Option `--jit` is an alias for option `--yjit`, which enables YJIT; -see additional YJIT options in the [YJIT documentation](rdoc-ref:yjit/yjit.md). +see additional YJIT options in the [YJIT documentation](rdoc-ref:jit/yjit.md). ### `--verbose`: Set `$VERBOSE` diff --git a/doc/packed_data.rdoc b/doc/language/packed_data.rdoc similarity index 99% rename from doc/packed_data.rdoc rename to doc/language/packed_data.rdoc index 3a2c8a57a5f0ed..3a762c03829a74 100644 --- a/doc/packed_data.rdoc +++ b/doc/language/packed_data.rdoc @@ -159,7 +159,7 @@ Any directive may be followed by either of these modifiers: 'AB'.unpack('C3') # => [65, 66, nil] Note: Directives in %w[A a Z m] use +count+ differently; - see {String Directives}[rdoc-ref:@String+Directives]. + see {String Directives}[rdoc-ref:language/packed_data.rdoc@String+Directives]. If elements don't fit the provided directive, only least significant bits are encoded: diff --git a/doc/ractor.md b/doc/language/ractor.md similarity index 100% rename from doc/ractor.md rename to doc/language/ractor.md diff --git a/doc/regexp/methods.rdoc b/doc/language/regexp/methods.rdoc similarity index 100% rename from doc/regexp/methods.rdoc rename to doc/language/regexp/methods.rdoc diff --git a/doc/regexp/unicode_properties.rdoc b/doc/language/regexp/unicode_properties.rdoc similarity index 100% rename from doc/regexp/unicode_properties.rdoc rename to doc/language/regexp/unicode_properties.rdoc diff --git a/doc/signals.rdoc b/doc/language/signals.rdoc similarity index 100% rename from doc/signals.rdoc rename to doc/language/signals.rdoc diff --git a/doc/strftime_formatting.rdoc b/doc/language/strftime_formatting.rdoc similarity index 98% rename from doc/strftime_formatting.rdoc rename to doc/language/strftime_formatting.rdoc index bef343c3073a83..991a708fa4cb3c 100644 --- a/doc/strftime_formatting.rdoc +++ b/doc/language/strftime_formatting.rdoc @@ -136,7 +136,7 @@ the only required part is the conversion specifier, so we begin with that. t = Time.now # => 2022-06-29 07:10:20.3230914 -0500 t.strftime('%N') # => "323091400" # Default. - Use {width specifiers}[rdoc-ref:@Width+Specifiers] + Use {width specifiers}[rdoc-ref:language/strftime_formatting.rdoc@Width+Specifiers] to adjust units: t.strftime('%3N') # => "323" # Milliseconds. @@ -522,5 +522,6 @@ An ISO 8601 combined date and time representation may be any ISO 8601 date and any ISO 8601 time, separated by the letter +T+. -For the relevant +strftime+ formats, see {Dates}[rdoc-ref:@Dates] and -{Times}[rdoc-ref:@Times] above. +For the relevant +strftime+ formats, see +{Dates}[rdoc-ref:language/strftime_formatting.rdoc@Dates] +and {Times}[rdoc-ref:language/strftime_formatting.rdoc@Times] above. diff --git a/doc/command_injection.rdoc b/doc/security/command_injection.rdoc similarity index 100% rename from doc/command_injection.rdoc rename to doc/security/command_injection.rdoc diff --git a/doc/security.rdoc b/doc/security/security.rdoc similarity index 100% rename from doc/security.rdoc rename to doc/security/security.rdoc diff --git a/doc/string/partition.rdoc b/doc/string/partition.rdoc index ee445bd21f32ba..330e6b03987fcf 100644 --- a/doc/string/partition.rdoc +++ b/doc/string/partition.rdoc @@ -17,7 +17,7 @@ Note that in the examples below, a returned string 'hello' is a copy of +self+, not +self+. If +pattern+ is a Regexp, performs the equivalent of self.match(pattern) -(also setting {pattern-matching global variables}[rdoc-ref:globals.md@Pattern+Matching]): +(also setting {pattern-matching global variables}[rdoc-ref:language/globals.md@Pattern+Matching]): 'hello'.partition(/h/) # => ["", "h", "ello"] 'hello'.partition(/l/) # => ["he", "l", "lo"] @@ -30,7 +30,7 @@ If +pattern+ is a Regexp, performs the equivalent of self.match(pattern)self.index(pattern) -(and does _not_ set {pattern-matching global variables}[rdoc-ref:globals.md@Pattern+Matching]): +(and does _not_ set {pattern-matching global variables}[rdoc-ref:language/globals.md@Pattern+Matching]): 'hello'.partition('h') # => ["", "h", "ello"] 'hello'.partition('l') # => ["he", "l", "lo"] diff --git a/doc/string/rpartition.rdoc b/doc/string/rpartition.rdoc index 56eb9ddb95cab3..11b0571bfb2ba7 100644 --- a/doc/string/rpartition.rdoc +++ b/doc/string/rpartition.rdoc @@ -23,7 +23,7 @@ The pattern used is: Note that in the examples below, a returned string 'hello' is a copy of +self+, not +self+. If +pattern+ is a Regexp, searches for the last matching substring -(also setting {pattern-matching global variables}[rdoc-ref:globals.md@Pattern+Matching]): +(also setting {pattern-matching global variables}[rdoc-ref:language/globals.md@Pattern+Matching]): 'hello'.rpartition(/l/) # => ["hel", "l", "o"] 'hello'.rpartition(/ll/) # => ["he", "ll", "o"] @@ -36,7 +36,7 @@ If +pattern+ is a Regexp, searches for the last matching substring If +pattern+ is not a Regexp, converts it to a string (if it is not already one), then searches for the last matching substring -(and does _not_ set {pattern-matching global variables}[rdoc-ref:globals.md@Pattern+Matching]): +(and does _not_ set {pattern-matching global variables}[rdoc-ref:language/globals.md@Pattern+Matching]): 'hello'.rpartition('l') # => ["hel", "l", "o"] 'hello'.rpartition('ll') # => ["he", "ll", "o"] diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index 9d91bd92dc00df..3988f82e5fc74f 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -279,7 +279,7 @@ An uninitialized global variable has a value of +nil+. Ruby has some special globals that behave differently depending on context such as the regular expression match variables or that have a side-effect when -assigned to. See the {global variables documentation}[rdoc-ref:globals.md] +assigned to. See the {global variables documentation}[rdoc-ref:language/globals.md] for details. == Assignment Methods diff --git a/ext/date/date_core.c b/ext/date/date_core.c index e4021051731714..cf8ea3c0a44990 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -2498,7 +2498,7 @@ date_s__valid_jd_p(int argc, VALUE *argv, VALUE klass) * * Date.valid_jd?(2451944) # => true * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd. */ @@ -2592,7 +2592,7 @@ date_s__valid_civil_p(int argc, VALUE *argv, VALUE klass) * Date.valid_date?(2001, 2, 29) # => false * Date.valid_date?(2001, 2, -1) # => true * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd, Date.new. */ @@ -2680,7 +2680,7 @@ date_s__valid_ordinal_p(int argc, VALUE *argv, VALUE klass) * Date.valid_ordinal?(2001, 34) # => true * Date.valid_ordinal?(2001, 366) # => false * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd, Date.ordinal. */ @@ -2770,7 +2770,7 @@ date_s__valid_commercial_p(int argc, VALUE *argv, VALUE klass) * * See Date.commercial. * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd, Date.commercial. */ @@ -3350,7 +3350,7 @@ static VALUE d_lite_plus(VALUE, VALUE); * * Date.jd(Date::ITALY - 1).julian? # => true * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.new. */ @@ -3415,7 +3415,7 @@ date_s_jd(int argc, VALUE *argv, VALUE klass) * * Raises an exception if +yday+ is zero or out of range. * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd, Date.new. */ @@ -3492,7 +3492,7 @@ date_s_civil(int argc, VALUE *argv, VALUE klass) * where +n+ is the number of days in the month; * when the argument is negative, counts backward from the end of the month. * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd. */ @@ -3598,7 +3598,7 @@ date_initialize(int argc, VALUE *argv, VALUE self) * Date.commercial(2020, 1, 1).to_s # => "2019-12-30" Date.commercial(2020, 1, 7).to_s # => "2020-01-05" * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * Related: Date.jd, Date.new, Date.ordinal. */ @@ -3783,7 +3783,7 @@ static void set_sg(union DateData *, double); * * Date.today.to_s # => "2022-07-06" * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * */ static VALUE @@ -4383,7 +4383,7 @@ date_s__strptime_internal(int argc, VALUE *argv, VALUE klass, * Date._strptime('2001-02-03', '%Y-%m-%d') # => {:year=>2001, :mon=>2, :mday=>3} * * For other formats, see - * {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]. + * {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]. * (Unlike Date.strftime, does not support flags and width.) * * See also {strptime(3)}[https://man7.org/linux/man-pages/man3/strptime.3.html]. @@ -4412,10 +4412,10 @@ date_s__strptime(int argc, VALUE *argv, VALUE klass) * Date.strptime('sat3feb01', '%a%d%b%y') # => # * * For other formats, see - * {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]. + * {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]. * (Unlike Date.strftime, does not support flags and width.) * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * * See also {strptime(3)}[https://man7.org/linux/man-pages/man3/strptime.3.html]. * @@ -4504,7 +4504,7 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass) * This method recognizes many forms in +string+, * but it is not a validator. * For formats, see - * {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc@Specialized+Format+Strings] + * {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc@Specialized+Format+Strings] * * If +string+ does not specify a valid date, * the result is unpredictable; @@ -4539,7 +4539,7 @@ date_s__parse(int argc, VALUE *argv, VALUE klass) * This method recognizes many forms in +string+, * but it is not a validator. * For formats, see - * {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc@Specialized+Format+Strings] + * {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc@Specialized+Format+Strings] * If +string+ does not specify a valid date, * the result is unpredictable; * consider using Date._strptime instead. @@ -4559,7 +4559,7 @@ date_s__parse(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._parse (returns a hash). @@ -4603,7 +4603,7 @@ VALUE date__jisx0301(VALUE); * Date._iso8601(string, limit: 128) -> hash * * Returns a hash of values parsed from +string+, which should contain - * an {ISO 8601 formatted date}[rdoc-ref:strftime_formatting.rdoc@ISO+8601+Format+Specifications]: + * an {ISO 8601 formatted date}[rdoc-ref:language/strftime_formatting.rdoc@ISO+8601+Format+Specifications]: * * d = Date.new(2001, 2, 3) * s = d.iso8601 # => "2001-02-03" @@ -4630,7 +4630,7 @@ date_s__iso8601(int argc, VALUE *argv, VALUE klass) * * Returns a new \Date object with values parsed from +string+, * which should contain - * an {ISO 8601 formatted date}[rdoc-ref:strftime_formatting.rdoc@ISO+8601+Format+Specifications]: + * an {ISO 8601 formatted date}[rdoc-ref:language/strftime_formatting.rdoc@ISO+8601+Format+Specifications]: * * d = Date.new(2001, 2, 3) * s = d.iso8601 # => "2001-02-03" @@ -4638,7 +4638,7 @@ date_s__iso8601(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._iso8601 (returns a hash). @@ -4672,7 +4672,7 @@ date_s_iso8601(int argc, VALUE *argv, VALUE klass) * Date._rfc3339(string, limit: 128) -> hash * * Returns a hash of values parsed from +string+, which should be a valid - * {RFC 3339 format}[rdoc-ref:strftime_formatting.rdoc@RFC+3339+Format]: + * {RFC 3339 format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+3339+Format]: * * d = Date.new(2001, 2, 3) * s = d.rfc3339 # => "2001-02-03T00:00:00+00:00" @@ -4700,7 +4700,7 @@ date_s__rfc3339(int argc, VALUE *argv, VALUE klass) * * Returns a new \Date object with values parsed from +string+, * which should be a valid - * {RFC 3339 format}[rdoc-ref:strftime_formatting.rdoc@RFC+3339+Format]: + * {RFC 3339 format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+3339+Format]: * * d = Date.new(2001, 2, 3) * s = d.rfc3339 # => "2001-02-03T00:00:00+00:00" @@ -4708,7 +4708,7 @@ date_s__rfc3339(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._rfc3339 (returns a hash). @@ -4776,7 +4776,7 @@ date_s__xmlschema(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._xmlschema (returns a hash). @@ -4810,7 +4810,7 @@ date_s_xmlschema(int argc, VALUE *argv, VALUE klass) * Date._rfc2822(string, limit: 128) -> hash * * Returns a hash of values parsed from +string+, which should be a valid - * {RFC 2822 date format}[rdoc-ref:strftime_formatting.rdoc@RFC+2822+Format]: + * {RFC 2822 date format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+2822+Format]: * * d = Date.new(2001, 2, 3) * s = d.rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000" @@ -4838,7 +4838,7 @@ date_s__rfc2822(int argc, VALUE *argv, VALUE klass) * * Returns a new \Date object with values parsed from +string+, * which should be a valid - * {RFC 2822 date format}[rdoc-ref:strftime_formatting.rdoc@RFC+2822+Format]: + * {RFC 2822 date format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+2822+Format]: * * d = Date.new(2001, 2, 3) * s = d.rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000" @@ -4846,7 +4846,7 @@ date_s__rfc2822(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._rfc2822 (returns a hash). @@ -4880,7 +4880,7 @@ date_s_rfc2822(int argc, VALUE *argv, VALUE klass) * Date._httpdate(string, limit: 128) -> hash * * Returns a hash of values parsed from +string+, which should be a valid - * {HTTP date format}[rdoc-ref:strftime_formatting.rdoc@HTTP+Format]: + * {HTTP date format}[rdoc-ref:language/strftime_formatting.rdoc@HTTP+Format]: * * d = Date.new(2001, 2, 3) * s = d.httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT" @@ -4906,7 +4906,7 @@ date_s__httpdate(int argc, VALUE *argv, VALUE klass) * * Returns a new \Date object with values parsed from +string+, * which should be a valid - * {HTTP date format}[rdoc-ref:strftime_formatting.rdoc@HTTP+Format]: + * {HTTP date format}[rdoc-ref:language/strftime_formatting.rdoc@HTTP+Format]: * * d = Date.new(2001, 2, 3) s = d.httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT" @@ -4914,7 +4914,7 @@ date_s__httpdate(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._httpdate (returns a hash). @@ -4948,7 +4948,7 @@ date_s_httpdate(int argc, VALUE *argv, VALUE klass) * Date._jisx0301(string, limit: 128) -> hash * * Returns a hash of values parsed from +string+, which should be a valid - * {JIS X 0301 date format}[rdoc-ref:strftime_formatting.rdoc@JIS+X+0301+Format]: + * {JIS X 0301 date format}[rdoc-ref:language/strftime_formatting.rdoc@JIS+X+0301+Format]: * * d = Date.new(2001, 2, 3) * s = d.jisx0301 # => "H13.02.03" @@ -4974,7 +4974,7 @@ date_s__jisx0301(int argc, VALUE *argv, VALUE klass) * Date.jisx0301(string = '-4712-01-01', start = Date::ITALY, limit: 128) -> date * * Returns a new \Date object with values parsed from +string+, - * which should be a valid {JIS X 0301 format}[rdoc-ref:strftime_formatting.rdoc@JIS+X+0301+Format]: + * which should be a valid {JIS X 0301 format}[rdoc-ref:language/strftime_formatting.rdoc@JIS+X+0301+Format]: * * d = Date.new(2001, 2, 3) * s = d.jisx0301 # => "H13.02.03" @@ -4986,7 +4986,7 @@ date_s__jisx0301(int argc, VALUE *argv, VALUE klass) * * See: * - * - Argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * - Argument {limit}[rdoc-ref:Date@Argument+limit]. * * Related: Date._jisx0301 (returns a hash). @@ -5744,7 +5744,7 @@ d_lite_leap_p(VALUE self) * Date.new(2001, 2, 3, Date::GREGORIAN).start # => -Infinity * Date.new(2001, 2, 3, Date::JULIAN).start # => Infinity * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * */ static VALUE @@ -5819,7 +5819,7 @@ dup_obj_with_new_start(VALUE obj, double sg) * d1 = d0.new_start(Date::JULIAN) * d1.julian? # => true * - * See argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start]. + * See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start]. * */ static VALUE @@ -6967,7 +6967,7 @@ static VALUE strftimev(const char *, VALUE, * to_s -> string * * Returns a string representation of the date in +self+ - * in {ISO 8601 extended date format}[rdoc-ref:strftime_formatting.rdoc@ISO+8601+Format+Specifications] + * in {ISO 8601 extended date format}[rdoc-ref:language/strftime_formatting.rdoc@ISO+8601+Format+Specifications] * ('%Y-%m-%d'): * * Date.new(2001, 2, 3).to_s # => "2001-02-03" @@ -7248,7 +7248,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self, * Date.new(2001, 2, 3).strftime # => "2001-02-03" * * For other formats, see - * {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]. + * {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]. * */ static VALUE @@ -7280,7 +7280,7 @@ strftimev(const char *fmt, VALUE self, * asctime -> string * * Equivalent to #strftime with argument '%a %b %e %T %Y' - * (or its {shorthand form}[rdoc-ref:strftime_formatting.rdoc@Shorthand+Conversion+Specifiers] + * (or its {shorthand form}[rdoc-ref:language/strftime_formatting.rdoc@Shorthand+Conversion+Specifiers] * '%c'): * * Date.new(2001, 2, 3).asctime # => "Sat Feb 3 00:00:00 2001" @@ -7299,7 +7299,7 @@ d_lite_asctime(VALUE self) * iso8601 -> string * * Equivalent to #strftime with argument '%Y-%m-%d' - * (or its {shorthand form}[rdoc-ref:strftime_formatting.rdoc@Shorthand+Conversion+Specifiers] + * (or its {shorthand form}[rdoc-ref:language/strftime_formatting.rdoc@Shorthand+Conversion+Specifiers] * '%F'); * * Date.new(2001, 2, 3).iso8601 # => "2001-02-03" @@ -7316,7 +7316,7 @@ d_lite_iso8601(VALUE self) * rfc3339 -> string * * Equivalent to #strftime with argument '%FT%T%:z'; - * see {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]: + * see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]: * * Date.new(2001, 2, 3).rfc3339 # => "2001-02-03T00:00:00+00:00" * @@ -7332,7 +7332,7 @@ d_lite_rfc3339(VALUE self) * rfc2822 -> string * * Equivalent to #strftime with argument '%a, %-d %b %Y %T %z'; - * see {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]: + * see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]: * * Date.new(2001, 2, 3).rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000" * @@ -7348,7 +7348,7 @@ d_lite_rfc2822(VALUE self) * httpdate -> string * * Equivalent to #strftime with argument '%a, %d %b %Y %T GMT'; - * see {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]: + * see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]: * * Date.new(2001, 2, 3).httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT" * @@ -8717,7 +8717,7 @@ dt_lite_to_s(VALUE self) * DateTime.now.strftime # => "2022-07-01T11:03:19-05:00" * * For other formats, - * see {Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc]: + * see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]: * */ static VALUE @@ -9524,7 +9524,7 @@ Init_date_core(void) * * - You need both dates and times; \Date handles only dates. * - You need only Gregorian dates (and not Julian dates); - * see {Julian and Gregorian Calendars}[rdoc-ref:date/calendars.rdoc]. + * see {Julian and Gregorian Calendars}[rdoc-ref:language/calendars.rdoc]. * * A \Date object, once created, is immutable, and cannot be modified. * @@ -9571,7 +9571,7 @@ Init_date_core(void) * Date.strptime('fri31dec99', '%a%d%b%y') # => # * * See also the specialized methods in - * {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:strftime_formatting.rdoc@Specialized+Format+Strings] + * {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc@Specialized+Format+Strings] * * == Argument +limit+ * diff --git a/hash.c b/hash.c index a8be0bad75f675..0b98b68d169b44 100644 --- a/hash.c +++ b/hash.c @@ -4899,7 +4899,7 @@ hash_le(VALUE hash1, VALUE hash2) * h0 <= h1 # => true * h1 <= h0 # => false * - * See {Hash Inclusion}[rdoc-ref:hash_inclusion.rdoc]. + * See {Hash Inclusion}[rdoc-ref:language/hash_inclusion.rdoc]. * * Raises TypeError if +other_hash+ is not a hash and cannot be converted to a hash. * @@ -4928,7 +4928,7 @@ rb_hash_le(VALUE hash, VALUE other) * h < {foo: 0, bar: 1, baz: 2} # => false # Different key. * h < {foo: 0, bar: 1, baz: 2} # => false # Different value. * - * See {Hash Inclusion}[rdoc-ref:hash_inclusion.rdoc]. + * See {Hash Inclusion}[rdoc-ref:language/hash_inclusion.rdoc]. * * Raises TypeError if +other_hash+ is not a hash and cannot be converted to a hash. * @@ -4955,7 +4955,7 @@ rb_hash_lt(VALUE hash, VALUE other) * h0 >= h0 # => true * h1 >= h0 # => false * - * See {Hash Inclusion}[rdoc-ref:hash_inclusion.rdoc]. + * See {Hash Inclusion}[rdoc-ref:language/hash_inclusion.rdoc]. * * Raises TypeError if +other_hash+ is not a hash and cannot be converted to a hash. * @@ -4984,7 +4984,7 @@ rb_hash_ge(VALUE hash, VALUE other) * h > {foo: 0, bar: 1} # => false # Different key. * h > {foo: 0, bar: 1} # => false # Different value. * - * See {Hash Inclusion}[rdoc-ref:hash_inclusion.rdoc]. + * See {Hash Inclusion}[rdoc-ref:language/hash_inclusion.rdoc]. * * Raises TypeError if +other_hash+ is not a hash and cannot be converted to a hash. * diff --git a/io.c b/io.c index fdd6256ff854dd..a5a8139f2914c9 100644 --- a/io.c +++ b/io.c @@ -7820,7 +7820,7 @@ static VALUE popen_finish(VALUE port, VALUE klass); * whose $stdin and $stdout are connected to a new stream +io+. * * This method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * If no block is given, returns the new stream, * which depending on given +mode+ may be open for reading, writing, or both. @@ -8224,7 +8224,7 @@ rb_io_s_sysopen(int argc, VALUE *argv, VALUE _) * Creates an IO object connected to the given file. * * This method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * With no block given, file stream is returned: * @@ -8577,7 +8577,7 @@ rb_io_init_copy(VALUE dest, VALUE io) * Formats and writes +objects+ to the stream. * * For details on +format_string+, see - * {Format Specifications}[rdoc-ref:format_specifications.rdoc]. + * {Format Specifications}[rdoc-ref:language/format_specifications.rdoc]. * */ @@ -8598,7 +8598,7 @@ rb_io_printf(int argc, const VALUE *argv, VALUE out) * io.write(sprintf(format_string, *objects)) * * For details on +format_string+, see - * {Format Specifications}[rdoc-ref:format_specifications.rdoc]. + * {Format Specifications}[rdoc-ref:language/format_specifications.rdoc]. * * With the single argument +format_string+, formats +objects+ into the string, * then writes the formatted string to $stdout: @@ -10621,7 +10621,7 @@ argf_readlines(int argc, VALUE *argv, VALUE argf) * sets global variable $? to the process status. * * This method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * Examples: * @@ -12035,7 +12035,7 @@ io_s_foreach(VALUE v) * * When called from class \IO (but not subclasses of \IO), * this method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * The first argument must be a string that is the path to a file. * @@ -12138,7 +12138,7 @@ io_s_readlines(VALUE v) * * When called from class \IO (but not subclasses of \IO), * this method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * The first argument must be a string that is the path to a file. * @@ -12227,7 +12227,7 @@ seek_before_access(VALUE argp) * * When called from class \IO (but not subclasses of \IO), * this method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * The first argument must be a string that is the path to a file. * @@ -12298,7 +12298,7 @@ rb_io_s_read(int argc, VALUE *argv, VALUE io) * * When called from class \IO (but not subclasses of \IO), * this method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * */ @@ -12402,7 +12402,7 @@ io_s_write(int argc, VALUE *argv, VALUE klass, int binary) * * When called from class \IO (but not subclasses of \IO), * this method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * The first argument must be a string that is the path to a file. * @@ -12452,7 +12452,7 @@ rb_io_s_write(int argc, VALUE *argv, VALUE io) * * When called from class \IO (but not subclasses of \IO), * this method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * */ diff --git a/load.c b/load.c index 02b75ceb2bd4e3..c519efe2a13f8d 100644 --- a/load.c +++ b/load.c @@ -1234,7 +1234,7 @@ no_feature_p(const rb_box_t *box, const char *feature, const char *ext, int rb, return 0; } -// Documented in doc/globals.md +// Documented in doc/language/globals.md VALUE rb_resolve_feature_path(VALUE klass, VALUE fname) { diff --git a/object.c b/object.c index c8d59601925e59..097199479e241a 100644 --- a/object.c +++ b/object.c @@ -4094,7 +4094,7 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound) * into +format_string+. * * For details on +format_string+, see - * {Format Specifications}[rdoc-ref:format_specifications.rdoc]. + * {Format Specifications}[rdoc-ref:language/format_specifications.rdoc]. */ static VALUE diff --git a/pack.rb b/pack.rb index d57788b222a126..a8b9e74514fdf5 100644 --- a/pack.rb +++ b/pack.rb @@ -3,7 +3,7 @@ class Array # pack(template, buffer: nil) -> string # # Formats each element in +self+ into a binary string; returns that string. - # See {Packed Data}[rdoc-ref:packed_data.rdoc]. + # See {Packed Data}[rdoc-ref:language/packed_data.rdoc]. def pack(fmt, buffer: nil) Primitive.pack_pack(fmt, buffer) end @@ -15,7 +15,7 @@ class String # unpack(template, offset: 0) -> array # # Extracts data from +self+ to form new objects; - # see {Packed Data}[rdoc-ref:packed_data.rdoc]. + # see {Packed Data}[rdoc-ref:language/packed_data.rdoc]. # # With a block given, calls the block with each unpacked object. # @@ -31,7 +31,7 @@ def unpack(fmt, offset: 0) # unpack1(template, offset: 0) -> object # # Like String#unpack with no block, but unpacks and returns only the first extracted object. - # See {Packed Data}[rdoc-ref:packed_data.rdoc]. + # See {Packed Data}[rdoc-ref:language/packed_data.rdoc]. # # Related: see {Converting to Non-String}[rdoc-ref:String@Converting+to+Non--5CString]. def unpack1(fmt, offset: 0) diff --git a/process.c b/process.c index e2ca6612d2d674..19f3172cb82ec6 100644 --- a/process.c +++ b/process.c @@ -2957,7 +2957,7 @@ NORETURN(static VALUE f_exec(int c, const VALUE *a, VALUE _)); * - Invoking the executable at +exe_path+. * * This method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * The new process is created using the * {exec system call}[https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/execve.html]; @@ -4642,7 +4642,7 @@ rb_spawn(int argc, const VALUE *argv) * - Invoking the executable at +exe_path+. * * This method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * Returns: * @@ -4822,7 +4822,7 @@ rb_f_system(int argc, VALUE *argv, VALUE _) * - Invoking the executable at +exe_path+. * * This method has potential security vulnerabilities if called with untrusted input; - * see {Command Injection}[rdoc-ref:command_injection.rdoc]. + * see {Command Injection}[rdoc-ref:security/command_injection.rdoc]. * * Returns the process ID (pid) of the new process, * without waiting for it to complete. diff --git a/range.c b/range.c index f26efe57ba810d..f82d1a316ddd7d 100644 --- a/range.c +++ b/range.c @@ -784,7 +784,7 @@ bsearch_integer_range(VALUE beg, VALUE end, int excl) * * Returns an element from +self+ selected by a binary search. * - * See {Binary Searching}[rdoc-ref:bsearch.rdoc]. + * See {Binary Searching}[rdoc-ref:language/bsearch.rdoc]. * */ diff --git a/string.c b/string.c index b1db9cb528fdfe..2dec3a11e61246 100644 --- a/string.c +++ b/string.c @@ -2618,7 +2618,7 @@ rb_str_times(VALUE str, VALUE times) * * Returns the result of formatting +object+ into the format specifications * contained in +self+ - * (see {Format Specifications}[rdoc-ref:format_specifications.rdoc]): + * (see {Format Specifications}[rdoc-ref:language/format_specifications.rdoc]): * * '%05d' % 123 # => "00123" * diff --git a/test/ruby/test_box.rb b/test/ruby/test_box.rb index 7023ecab16aa0e..c52c7564ae682e 100644 --- a/test/ruby/test_box.rb +++ b/test/ruby/test_box.rb @@ -5,7 +5,7 @@ class TestBox < Test::Unit::TestCase EXPERIMENTAL_WARNINGS = [ "warning: Ruby::Box is experimental, and the behavior may change in the future!", - "See doc/box.md for known issues, etc." + "See doc/language/box.md for known issues, etc." ].join("\n") ENV_ENABLE_BOX = {'RUBY_BOX' => '1', 'TEST_DIR' => __dir__} diff --git a/yjit.rb b/yjit.rb index 859c335d229638..9e9a79fa731581 100644 --- a/yjit.rb +++ b/yjit.rb @@ -219,7 +219,7 @@ def self.disasm(iseq) # :nodoc: if !self.enabled? warn( "YJIT needs to be enabled to produce disasm output, e.g.\n" + - "ruby --yjit-call-threshold=1 my_script.rb (see doc/yjit/yjit.md)" + "ruby --yjit-call-threshold=1 my_script.rb (see doc/jit/yjit.md)" ) return nil end @@ -229,7 +229,7 @@ def self.disasm(iseq) # :nodoc: if !disasm_str warn( "YJIT disasm is only available when YJIT is built in dev mode, i.e.\n" + - "./configure --enable-yjit=dev (see doc/yjit/yjit.md)\n" + "./configure --enable-yjit=dev (see doc/jit/yjit.md)\n" ) return nil end From 5b1ed1ef2076b3a89ba28836eee6072cb16124dc Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 27 Nov 2025 23:31:32 +0000 Subject: [PATCH 2/4] [DOC] Remove unneeded filename from rdoc-ref links (#15339) --- doc/language/calendars.rdoc | 2 +- doc/language/format_specifications.rdoc | 26 ++++----- doc/language/options.md | 70 ++++++++++++------------- doc/language/strftime_formatting.rdoc | 6 +-- 4 files changed, 51 insertions(+), 53 deletions(-) diff --git a/doc/language/calendars.rdoc b/doc/language/calendars.rdoc index eb9638f55231ca..a2540f1c433b5a 100644 --- a/doc/language/calendars.rdoc +++ b/doc/language/calendars.rdoc @@ -31,7 +31,7 @@ See also {a concrete example here}[rdoc-ref:DateTime@When+should+you+use+DateTim === Argument +start+ Certain methods in class \Date handle differences in the -{Julian and Gregorian calendars}[rdoc-ref:language/calendars.rdoc@Julian+and+Gregorian+Calendars] +{Julian and Gregorian calendars}[rdoc-ref:@Julian+and+Gregorian+Calendars] by accepting an optional argument +start+, whose value may be: - Date::ITALY (the default): the created date is Julian diff --git a/doc/language/format_specifications.rdoc b/doc/language/format_specifications.rdoc index 61eaefec4af179..a59f2103775ec8 100644 --- a/doc/language/format_specifications.rdoc +++ b/doc/language/format_specifications.rdoc @@ -46,42 +46,42 @@ The links lead to the details and examples. === \Integer Type Specifiers - +b+ or +B+: Format +argument+ as a binary integer. - See {Specifiers b and B}[rdoc-ref:language/format_specifications.rdoc@Specifiers+b+and+B]. + See {Specifiers b and B}[rdoc-ref:@Specifiers+b+and+B]. - +d+, +i+, or +u+ (all are identical): Format +argument+ as a decimal integer. - See {Specifier d}[rdoc-ref:language/format_specifications.rdoc@Specifier+d]. + See {Specifier d}[rdoc-ref:@Specifier+d]. - +o+: Format +argument+ as an octal integer. - See {Specifier o}[rdoc-ref:language/format_specifications.rdoc@Specifier+o]. + See {Specifier o}[rdoc-ref:@Specifier+o]. - +x+ or +X+: Format +argument+ as a hexadecimal integer. - See {Specifiers x and X}[rdoc-ref:language/format_specifications.rdoc@Specifiers+x+and+X]. + See {Specifiers x and X}[rdoc-ref:@Specifiers+x+and+X]. === Floating-Point Type Specifiers - +a+ or +A+: Format +argument+ as hexadecimal floating-point number. - See {Specifiers a and A}[rdoc-ref:language/format_specifications.rdoc@Specifiers+a+and+A]. + See {Specifiers a and A}[rdoc-ref:@Specifiers+a+and+A]. - +e+ or +E+: Format +argument+ in scientific notation. - See {Specifiers e and E}[rdoc-ref:language/format_specifications.rdoc@Specifiers+e+and+E]. + See {Specifiers e and E}[rdoc-ref:@Specifiers+e+and+E]. - +f+: Format +argument+ as a decimal floating-point number. - See {Specifier f}[rdoc-ref:language/format_specifications.rdoc@Specifier+f]. + See {Specifier f}[rdoc-ref:@Specifier+f]. - +g+ or +G+: Format +argument+ in a "general" format. - See {Specifiers g and G}[rdoc-ref:language/format_specifications.rdoc@Specifiers+g+and+G]. + See {Specifiers g and G}[rdoc-ref:@Specifiers+g+and+G]. === Other Type Specifiers - +c+: Format +argument+ as a character. - See {Specifier c}[rdoc-ref:language/format_specifications.rdoc@Specifier+c]. + See {Specifier c}[rdoc-ref:@Specifier+c]. - +p+: Format +argument+ as a string via argument.inspect. - See {Specifier p}[rdoc-ref:language/format_specifications.rdoc@Specifier+p]. + See {Specifier p}[rdoc-ref:@Specifier+p]. - +s+: Format +argument+ as a string via argument.to_s. - See {Specifier s}[rdoc-ref:language/format_specifications.rdoc@Specifier+s]. + See {Specifier s}[rdoc-ref:@Specifier+s]. - %: Format +argument+ ('%') as a single percent character. - See {Specifier %}[rdoc-ref:language/format_specifications.rdoc@Specifier+-25]. + See {Specifier %}[rdoc-ref:@Specifier+-25]. == Flags The effect of a flag may vary greatly among type specifiers. These remarks are general in nature. -See {type-specific details}[rdoc-ref:language/format_specifications.rdoc@Type+Specifier+Details+and+Examples]. +See {type-specific details}[rdoc-ref:@Type+Specifier+Details+and+Examples]. Multiple flags may be given with single type specifier; order does not matter. diff --git a/doc/language/options.md b/doc/language/options.md index ededb67f8d8dbf..c805c7dd65c2c0 100644 --- a/doc/language/options.md +++ b/doc/language/options.md @@ -68,15 +68,15 @@ nil See also: -- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-a`: Split Input Lines into Fields @@ -98,15 +98,15 @@ and the default field separator is `$;`. See also: -- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-c`: Check Syntax @@ -228,15 +228,15 @@ The argument must immediately follow the option See also: -- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-h`: Print Short Help Message @@ -314,15 +314,15 @@ $ ruby -ln -e 'p $_' desiderata.txt See also: -- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. -- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-n`: Run Program in `gets` Loop @@ -348,15 +348,15 @@ be on good terms with all persons. See also: -- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -p}[rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing]: +- {Option -p}[rdoc-ref:@p-3A+-n-2C+with+Printing]: `-n`, with printing. ### `-p`: `-n`, with Printing @@ -377,15 +377,15 @@ be on good terms with all persons. See also: -- {Option -0}[rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: +- {Option -0}[rdoc-ref:@0-3A+Set+-24-2F+-28Input+Record+Separator-29]: Set `$/` (input record separator). -- {Option -a}[rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields]: +- {Option -a}[rdoc-ref:@a-3A+Split+Input+Lines+into+Fields]: Split input lines into fields. -- {Option -F}[rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator]: +- {Option -F}[rdoc-ref:@F-3A+Set+Input+Field+Separator]: Set input field separator. -- {Option -l}[rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: +- {Option -l}[rdoc-ref:@l-3A+Set+Output+Record+Separator-3B+Chop+Lines]: Set output record separator; chop lines. -- {Option -n}[rdoc-ref:language/options.md@n-3A+Run+Program+in+gets+Loop]: +- {Option -n}[rdoc-ref:@n-3A+Run+Program+in+gets+Loop]: Run program in `gets` loop. ### `-r`: Require Library @@ -434,7 +434,7 @@ $ ruby -s t.rb -foo=baz -bar=bat ``` The option may not be used with -{option -e}[rdoc-ref:language/options.md@e-3A+Execute+Given+Ruby+Code] +{option -e}[rdoc-ref:@e-3A+Execute+Given+Ruby+Code] ### `-S`: Search Directories in `ENV['PATH']` @@ -583,7 +583,7 @@ ruby - Copyright (C) 1993-2024 Yukihiro Matsumoto ### `--debug`: Alias for `-d` Option `--debug` is an alias for -{option -d}[rdoc-ref:language/options.md@d-3A+Set+-24DEBUG+to+true]. +{option -d}[rdoc-ref:@d-3A+Set+-24DEBUG+to+true]. ### `--disable`: Disable Features @@ -617,9 +617,9 @@ option was given: - `--dump=help`: Same as {option \-\-help}[options_md.html#label--help-3A+Print+Help+Message]. - `--dump=syntax`: - Same as {option -c}[rdoc-ref:language/options.md@c-3A+Check+Syntax]. + Same as {option -c}[rdoc-ref:@c-3A+Check+Syntax]. - `--dump=usage`: - Same as {option -h}[rdoc-ref:language/options.md@h-3A+Print+Short+Help+Message]. + Same as {option -h}[rdoc-ref:@h-3A+Print+Short+Help+Message]. - `--dump=version`: Same as {option \-\-version}[options_md.html#label--version-3A+Print+Ruby+Version]. @@ -641,7 +641,7 @@ see {option --disable}[options_md.html#label--disable-3A+Disable+Features]. ### `--encoding`: Alias for `-E`. Option `--encoding` is an alias for -{option -E}[rdoc-ref:language/options.md@E-3A+Set+Default+Encodings]. +{option -E}[rdoc-ref:@E-3A+Set+Default+Encodings]. ### `--external-encoding`: Set Default External \Encoding diff --git a/doc/language/strftime_formatting.rdoc b/doc/language/strftime_formatting.rdoc index 991a708fa4cb3c..2bfa6b975e3153 100644 --- a/doc/language/strftime_formatting.rdoc +++ b/doc/language/strftime_formatting.rdoc @@ -136,7 +136,7 @@ the only required part is the conversion specifier, so we begin with that. t = Time.now # => 2022-06-29 07:10:20.3230914 -0500 t.strftime('%N') # => "323091400" # Default. - Use {width specifiers}[rdoc-ref:language/strftime_formatting.rdoc@Width+Specifiers] + Use {width specifiers}[rdoc-ref:@Width+Specifiers] to adjust units: t.strftime('%3N') # => "323" # Milliseconds. @@ -522,6 +522,4 @@ An ISO 8601 combined date and time representation may be any ISO 8601 date and any ISO 8601 time, separated by the letter +T+. -For the relevant +strftime+ formats, see -{Dates}[rdoc-ref:language/strftime_formatting.rdoc@Dates] -and {Times}[rdoc-ref:language/strftime_formatting.rdoc@Times] above. +For the relevant +strftime+ formats, see {Dates}[rdoc-ref:@Dates] and {Times}[rdoc-ref:@Times] above. From 9929dc4440a76b57f362ad676a9b8b64c309a6d8 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 20 Nov 2025 02:42:42 -0800 Subject: [PATCH 3/4] Mask off unused VWA bits --- gc/default/default.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gc/default/default.c b/gc/default/default.c index 0858d94b89e79c..7f568aaccc1815 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -426,6 +426,7 @@ typedef int (*gc_compact_compare_func)(const void *l, const void *r, void *d); typedef struct rb_heap_struct { short slot_size; + bits_t slot_bits_mask; /* Basic statistics */ size_t total_allocated_pages; @@ -3570,9 +3571,12 @@ gc_sweep_page(rb_objspace_t *objspace, rb_heap_t *heap, struct gc_sweep_context GC_ASSERT(bitmap_plane_count == HEAP_PAGE_BITMAP_LIMIT - 1 || bitmap_plane_count == HEAP_PAGE_BITMAP_LIMIT); + bits_t slot_mask = heap->slot_bits_mask; + // Skip out of range slots at the head of the page bitset = ~bits[0]; bitset >>= NUM_IN_PAGE(p); + bitset &= slot_mask; if (bitset) { gc_sweep_plane(objspace, heap, p, bitset, ctx); } @@ -3580,6 +3584,7 @@ gc_sweep_page(rb_objspace_t *objspace, rb_heap_t *heap, struct gc_sweep_context for (int i = 1; i < bitmap_plane_count; i++) { bitset = ~bits[i]; + bitset &= slot_mask; if (bitset) { gc_sweep_plane(objspace, heap, p, bitset, ctx); } @@ -9435,6 +9440,17 @@ rb_gc_impl_objspace_init(void *objspace_ptr) heap->slot_size = (1 << i) * BASE_SLOT_SIZE; + // Bitmask with every (1 << i)th bit set, representing aligned slot positions + static const bits_t slot_bits_masks[] = { + ~(bits_t)0, // i=0: every 1st bit + (bits_t)0x5555555555555555ULL, // i=1: every 2nd bit + (bits_t)0x1111111111111111ULL, // i=2: every 4th bit + (bits_t)0x0101010101010101ULL, // i=3: every 8th bit + (bits_t)0x0001000100010001ULL, // i=4: every 16th bit + }; + GC_ASSERT(i < numberof(slot_bits_masks)); + heap->slot_bits_mask = slot_bits_masks[i]; + ccan_list_head_init(&heap->pages); } From 5e2e45fc242b79e844754691ad106c463ebb6251 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 27 Nov 2025 00:49:28 -0800 Subject: [PATCH 4/4] Fix for modgc --- gc/default/default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc/default/default.c b/gc/default/default.c index 7f568aaccc1815..530fc4df891acb 100644 --- a/gc/default/default.c +++ b/gc/default/default.c @@ -9448,7 +9448,7 @@ rb_gc_impl_objspace_init(void *objspace_ptr) (bits_t)0x0101010101010101ULL, // i=3: every 8th bit (bits_t)0x0001000100010001ULL, // i=4: every 16th bit }; - GC_ASSERT(i < numberof(slot_bits_masks)); + GC_ASSERT(i < sizeof(slot_bits_masks) / sizeof(slot_bits_masks[0])); heap->slot_bits_mask = slot_bits_masks[i]; ccan_list_head_init(&heap->pages);