From 8e4ef58a4b8ebfc69634ca353539e1df0fe06074 Mon Sep 17 00:00:00 2001 From: NAITOH Jun Date: Wed, 15 Jul 2026 18:32:13 +0900 Subject: [PATCH] Hide internal classes from documentation ## Why? REXML::FunctionsClass (and the REXML::Functions singleton), REXML::SourceFactory, REXML::Source, REXML::IOSource, REXML::Output and REXML::Parsers::XPathParser are for internal use only, so mark them with :nodoc: to exclude them from the generated documentation. ### See - https://docs.ruby-lang.org/ja/latest/class/REXML=3a=3aFunctions.html - https://docs.ruby-lang.org/ja/latest/class/REXML=3a=3aSource.html - https://docs.ruby-lang.org/ja/latest/class/REXML=3a=3aIOSource.html - https://docs.ruby-lang.org/ja/latest/class/REXML=3a=3aSourceFactory.html - https://docs.ruby-lang.org/ja/latest/class/REXML=3a=3aOutput.html - https://docs.ruby-lang.org/ja/latest/class/REXML=3a=3aParsers=3a=3aXPathParser.html --- lib/rexml/functions.rb | 4 ++-- lib/rexml/output.rb | 2 +- lib/rexml/parsers/xpathparser.rb | 2 +- lib/rexml/source.rb | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 1a0f85ec5..a526546da 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -7,7 +7,7 @@ module REXML # (2) all method calls from XML will have "-" replaced with "_". # Therefore, in XML, "local-name()" is identical (and actually becomes) # "local_name()" - class FunctionsClass + class FunctionsClass # :nodoc: @@available_functions = {} def initialize @@ -434,5 +434,5 @@ def send(name, *args) # Using this singleton instance may cause thread-safety issues # especially when accessing variables, context and namespace_context. # Consider instantiating your own FunctionsClass object. - Functions = FunctionsClass.new + Functions = FunctionsClass.new # :nodoc: end diff --git a/lib/rexml/output.rb b/lib/rexml/output.rb index 88a5fb378..c7948eb94 100644 --- a/lib/rexml/output.rb +++ b/lib/rexml/output.rb @@ -2,7 +2,7 @@ require_relative 'encoding' module REXML - class Output + class Output # :nodoc: include Encoding attr_reader :encoding diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index f8b7b7187..7cca09753 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -9,7 +9,7 @@ module Parsers # for this class. Believe me. You don't want to poke around in here. # There is strange, dark magic at work in this code. Beware. Go back! Go # back while you still can! - class XPathParser + class XPathParser # :nodoc: include XMLTokens LITERAL = /^'([^']*)'|^"([^"]*)"/u diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb index 8b8ba0da7..11ca5aad0 100644 --- a/lib/rexml/source.rb +++ b/lib/rexml/source.rb @@ -8,7 +8,7 @@ module REXML if StringScanner::Version < "1.0.0" - module StringScannerCheckScanString + module StringScannerCheckScanString # :nodoc: refine StringScanner do def check(pattern) pattern = /#{Regexp.escape(pattern)}/ if pattern.is_a?(String) @@ -35,7 +35,7 @@ def skip(pattern) end # Generates Source-s. USE THIS CLASS. - class SourceFactory + class SourceFactory # :nodoc: # Generates a Source object # @param arg Either a String, or an IO # @return a Source, or nil if a bad argument was given @@ -58,7 +58,7 @@ def SourceFactory::create_from(arg) # A Source can be searched for patterns, and wraps buffers and other # objects and provides consumption of text - class Source + class Source # :nodoc: all include Encoding # The line number of the last consumed text attr_reader :line @@ -217,7 +217,7 @@ def encoding_updated # A Source that wraps an IO. See the Source class for method # documentation - class IOSource < Source + class IOSource < Source # :nodoc: #attr_reader :block_size # block_size has been deprecated