diff --git a/encoding.c b/encoding.c index 3be39d8e09..7bca8d1b2b 100644 --- a/encoding.c +++ b/encoding.c @@ -1988,6 +1988,7 @@ Init_unicode_version(void) VALUE str = rb_usascii_str_new_static(onigenc_unicode_version_string, strlen(onigenc_unicode_version_string)); OBJ_FREEZE(str); + /* The supported Unicode version. */ rb_define_const(rb_cEncoding, "UNICODE_VERSION", str); } diff --git a/error.c b/error.c index d3aeec54d8..e14ecd2393 100644 --- a/error.c +++ b/error.c @@ -3499,6 +3499,18 @@ syserr_eqq(VALUE self, VALUE exc) * incompatible with the target encoding. */ +/* + * Document-class: NoMatchingPatternError + * + * Raised when matching pattern not found. + */ + +/* + * Document-class: NoMatchingPatternKeyError + * + * Raised when matching key not found. + */ + /* * Document-class: fatal * diff --git a/namespace.c b/namespace.c index e667590890..55b7580c72 100644 --- a/namespace.c +++ b/namespace.c @@ -411,6 +411,12 @@ rb_get_namespace_object(rb_namespace_t *ns) static void setup_pushing_loading_namespace(rb_namespace_t *ns); +/* + * call-seq: + * Namespace.new -> new_namespace + * + * Returns a new Namespace object. + */ static VALUE namespace_initialize(VALUE namespace) { @@ -450,12 +456,26 @@ namespace_initialize(VALUE namespace) return namespace; } +/* + * call-seq: + * Namespace.enabled? -> true or false + * + * Returns +true+ if namespace is enabled. + */ static VALUE rb_namespace_s_getenabled(VALUE namespace) { return RBOOL(rb_namespace_available()); } +/* + * call-seq: + * Namespace.current -> namespace, nil or false + * + * Returns the current namespace. + * Returns +nil+ if it is the built-in namespace. + * Returns +false+ if namespace is not enabled. + */ static VALUE rb_namespace_current(VALUE klass) { @@ -469,6 +489,12 @@ rb_namespace_current(VALUE klass) return Qfalse; } +/* + * call-seq: + * Namespace.is_builtin?(klass) -> true or false + * + * Returns +true+ if +klass+ is only in a user namespace. + */ static VALUE rb_namespace_s_is_builtin_p(VALUE namespace, VALUE klass) { @@ -477,6 +503,12 @@ rb_namespace_s_is_builtin_p(VALUE namespace, VALUE klass) return Qfalse; } +/* + * call-seq: + * load_path -> array + * + * Returns namespace local load path. + */ static VALUE rb_namespace_load_path(VALUE namespace) { @@ -1048,6 +1080,13 @@ Init_enable_namespace(void) } } +/* + * Document-class: Namespace + * + * Namespace is designed to provide separated spaces in a Ruby + * process, to isolate applications and libraries. + * See {Namespace}[rdoc-ref:namespace.md]. + */ void Init_Namespace(void) { @@ -1057,14 +1096,17 @@ Init_Namespace(void) rb_cNamespace = rb_define_class("Namespace", rb_cModule); rb_define_method(rb_cNamespace, "initialize", namespace_initialize, 0); + /* :nodoc: */ rb_cNamespaceEntry = rb_define_class_under(rb_cNamespace, "Entry", rb_cObject); rb_define_alloc_func(rb_cNamespaceEntry, rb_namespace_entry_alloc); + /* :nodoc: */ rb_mNamespaceRefiner = rb_define_module_under(rb_cNamespace, "Refiner"); if (rb_namespace_available()) { setup_builtin_refinement(rb_mNamespaceRefiner); } + /* :nodoc: */ rb_mNamespaceLoader = rb_define_module_under(rb_cNamespace, "Loader"); namespace_define_loader_method("require"); namespace_define_loader_method("require_relative"); diff --git a/pathname_builtin.rb b/pathname_builtin.rb index fac0b46d9a..95bd8d0e3a 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -12,6 +12,7 @@ class Pathname + # The version string. VERSION = "0.4.0" # :stopdoc: diff --git a/prelude.rb b/prelude.rb index f49cada637..36da381804 100644 --- a/prelude.rb +++ b/prelude.rb @@ -15,15 +15,17 @@ class Binding end module Kernel + # :stopdoc: def pp(*objs) require 'pp' pp(*objs) end # suppress redefinition warning - alias pp pp # :nodoc: + alias pp pp private :pp + # :startdoc: end module Enumerable diff --git a/proc.c b/proc.c index 8543110476..68f63040b7 100644 --- a/proc.c +++ b/proc.c @@ -2026,6 +2026,12 @@ method_owner(VALUE obj) return data->owner; } +/* + * call-see: + * meth.namespace -> namespace or nil + * + * Returns the namespace where +meth+ is defined in. + */ static VALUE method_namespace(VALUE obj) { diff --git a/ractor.c b/ractor.c index 721234a98b..a46eb00685 100644 --- a/ractor.c +++ b/ractor.c @@ -874,6 +874,12 @@ ractor_moved_missing(int argc, VALUE *argv, VALUE self) rb_raise(rb_eRactorMovedError, "can not send any methods to a moved object"); } +/* + * Document-class: Ractor::Error + * + * The parent class of Ractor-related error classes. + */ + /* * Document-class: Ractor::ClosedError * @@ -911,6 +917,13 @@ ractor_moved_missing(int argc, VALUE *argv, VALUE self) * Continue successfully */ +/* + * Document-class: Ractor::IsolationError + * + * Raised on attempt to make a Ractor-unshareable object + * Ractor-shareable. + */ + /* * Document-class: Ractor::RemoteError * @@ -960,6 +973,12 @@ ractor_moved_missing(int argc, VALUE *argv, VALUE self) * # Ractor::MovedError (can not send any methods to a moved object) */ +/* + * Document-class: Ractor::UnsafeError + * + * Raised when Ractor-unsafe C-methods is invoked by a non-main Ractor. + */ + // Main docs are in ractor.rb, but without this clause there are weird artifacts // in their rendering. /* diff --git a/ractor.rb b/ractor.rb index ee6135b81e..5827f6672b 100644 --- a/ractor.rb +++ b/ractor.rb @@ -612,6 +612,7 @@ class Ractor __builtin_ractor_unmonitor(port) end + # \Port objects transmit messages between Ractors. class Port # # call-seq: diff --git a/ractor_sync.c b/ractor_sync.c index 8437516bfb..a3ed38295b 100644 --- a/ractor_sync.c +++ b/ractor_sync.c @@ -91,12 +91,19 @@ ractor_port_init(VALUE rpv, rb_ractor_t *r) return rpv; } +/* + * call-seq: + * Ractor::Port.new -> new_port + * + * Returns a new Ractor::Port object. + */ static VALUE ractor_port_initialzie(VALUE self) { return ractor_port_init(self, GET_RACTOR()); } +/* :nodoc: */ static VALUE ractor_port_initialzie_copy(VALUE self, VALUE orig) { diff --git a/re.c b/re.c index b47538d594..9348622eea 100644 --- a/re.c +++ b/re.c @@ -4855,6 +4855,7 @@ Init_Regexp(void) rb_define_method(rb_cRegexp, "named_captures", rb_reg_named_captures, 0); rb_define_method(rb_cRegexp, "timeout", rb_reg_timeout_get, 0); + /* Raised when regexp matching timed out. */ rb_eRegexpTimeoutError = rb_define_class_under(rb_cRegexp, "TimeoutError", rb_eRegexpError); rb_define_singleton_method(rb_cRegexp, "timeout", rb_reg_s_timeout_get, 0); rb_define_singleton_method(rb_cRegexp, "timeout=", rb_reg_s_timeout_set, 1); diff --git a/scheduler.c b/scheduler.c index 83b9681cc3..ddb205da88 100644 --- a/scheduler.c +++ b/scheduler.c @@ -798,7 +798,7 @@ rb_fiber_scheduler_io_read(VALUE scheduler, VALUE io, VALUE buffer, size_t lengt } /* - * Document-method: Fiber::Scheduler#io_read + * Document-method: Fiber::Scheduler#io_pread * call-seq: io_pread(io, buffer, from, length, offset) -> read length or -errno * * Invoked by IO#pread or IO::Buffer#pread to read +length+ bytes from +io+ @@ -837,7 +837,7 @@ rb_fiber_scheduler_io_pread(VALUE scheduler, VALUE io, rb_off_t from, VALUE buff } /* - * Document-method: Scheduler#io_write + * Document-method: Fiber::Scheduler#io_write * call-seq: io_write(io, buffer, length, offset) -> written length or -errno * * Invoked by IO#write or IO::Buffer#write to write +length+ bytes to +io+ from diff --git a/set.c b/set.c index 61f1fd8bc4..f83fb0880c 100644 --- a/set.c +++ b/set.c @@ -406,6 +406,13 @@ set_s_alloc(VALUE klass) return set_alloc_with_size(klass, 0); } +/* + * call-seq: + * Set[*objects] -> new_set + * + * Returns a new Set object populated with the given objects, + * See Set::new. + */ static VALUE set_s_create(int argc, VALUE *argv, VALUE klass) { @@ -522,6 +529,7 @@ set_i_initialize(int argc, VALUE *argv, VALUE set) return set; } +/* :nodoc: */ static VALUE set_i_initialize_copy(VALUE set, VALUE other) {