Skip to content

Commit 6179cc0

Browse files
committed
[DOC] Fill undocumented documents
1 parent b4dfdb9 commit 6179cc0

File tree

12 files changed

+103
-3
lines changed

12 files changed

+103
-3
lines changed

encoding.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,7 @@ Init_unicode_version(void)
19881988
VALUE str = rb_usascii_str_new_static(onigenc_unicode_version_string,
19891989
strlen(onigenc_unicode_version_string));
19901990
OBJ_FREEZE(str);
1991+
/* The supported Unicode version. */
19911992
rb_define_const(rb_cEncoding, "UNICODE_VERSION", str);
19921993
}
19931994

error.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,6 +3499,18 @@ syserr_eqq(VALUE self, VALUE exc)
34993499
* incompatible with the target encoding.
35003500
*/
35013501

3502+
/*
3503+
* Document-class: NoMatchingPatternError
3504+
*
3505+
* Raised when matching pattern not found.
3506+
*/
3507+
3508+
/*
3509+
* Document-class: NoMatchingPatternKeyError
3510+
*
3511+
* Raised when matching key not found.
3512+
*/
3513+
35023514
/*
35033515
* Document-class: fatal
35043516
*

namespace.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,12 @@ rb_get_namespace_object(rb_namespace_t *ns)
411411

412412
static void setup_pushing_loading_namespace(rb_namespace_t *ns);
413413

414+
/*
415+
* call-seq:
416+
* Namespace.new -> new_namespace
417+
*
418+
* Returns a new Namespace object.
419+
*/
414420
static VALUE
415421
namespace_initialize(VALUE namespace)
416422
{
@@ -450,12 +456,26 @@ namespace_initialize(VALUE namespace)
450456
return namespace;
451457
}
452458

459+
/*
460+
* call-seq:
461+
* Namespace.enabled? -> true or false
462+
*
463+
* Returns +true+ if namespace is enabled.
464+
*/
453465
static VALUE
454466
rb_namespace_s_getenabled(VALUE namespace)
455467
{
456468
return RBOOL(rb_namespace_available());
457469
}
458470

471+
/*
472+
* call-seq:
473+
* Namespace.current -> namespace, nil or false
474+
*
475+
* Returns the current namespace.
476+
* Returns +nil+ if it is the built-in namespace.
477+
* Returns +false+ if namespace is not enabled.
478+
*/
459479
static VALUE
460480
rb_namespace_current(VALUE klass)
461481
{
@@ -469,6 +489,12 @@ rb_namespace_current(VALUE klass)
469489
return Qfalse;
470490
}
471491

492+
/*
493+
* call-seq:
494+
* Namespace.is_builtin?(klass) -> true or false
495+
*
496+
* Returns +true+ if +klass+ is only in a user namespace.
497+
*/
472498
static VALUE
473499
rb_namespace_s_is_builtin_p(VALUE namespace, VALUE klass)
474500
{
@@ -477,6 +503,12 @@ rb_namespace_s_is_builtin_p(VALUE namespace, VALUE klass)
477503
return Qfalse;
478504
}
479505

506+
/*
507+
* call-seq:
508+
* load_path -> array
509+
*
510+
* Returns namespace local load path.
511+
*/
480512
static VALUE
481513
rb_namespace_load_path(VALUE namespace)
482514
{
@@ -1048,6 +1080,13 @@ Init_enable_namespace(void)
10481080
}
10491081
}
10501082

1083+
/*
1084+
* Document-class: Namespace
1085+
*
1086+
* Namespace is designed to provide separated spaces in a Ruby
1087+
* process, to isolate applications and libraries.
1088+
* See {Namespace}[rdoc-ref:namespace.md].
1089+
*/
10511090
void
10521091
Init_Namespace(void)
10531092
{
@@ -1057,14 +1096,17 @@ Init_Namespace(void)
10571096
rb_cNamespace = rb_define_class("Namespace", rb_cModule);
10581097
rb_define_method(rb_cNamespace, "initialize", namespace_initialize, 0);
10591098

1099+
/* :nodoc: */
10601100
rb_cNamespaceEntry = rb_define_class_under(rb_cNamespace, "Entry", rb_cObject);
10611101
rb_define_alloc_func(rb_cNamespaceEntry, rb_namespace_entry_alloc);
10621102

1103+
/* :nodoc: */
10631104
rb_mNamespaceRefiner = rb_define_module_under(rb_cNamespace, "Refiner");
10641105
if (rb_namespace_available()) {
10651106
setup_builtin_refinement(rb_mNamespaceRefiner);
10661107
}
10671108

1109+
/* :nodoc: */
10681110
rb_mNamespaceLoader = rb_define_module_under(rb_cNamespace, "Loader");
10691111
namespace_define_loader_method("require");
10701112
namespace_define_loader_method("require_relative");

pathname_builtin.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
class Pathname
1414

15+
# The version string.
1516
VERSION = "0.4.0"
1617

1718
# :stopdoc:

prelude.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ def irb(...)
1515
end
1616

1717
module Kernel
18+
# :stopdoc:
1819
def pp(*objs)
1920
require 'pp'
2021
pp(*objs)
2122
end
2223

2324
# suppress redefinition warning
24-
alias pp pp # :nodoc:
25+
alias pp pp
2526

2627
private :pp
28+
# :startdoc:
2729
end
2830

2931
module Enumerable

proc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,12 @@ method_owner(VALUE obj)
20262026
return data->owner;
20272027
}
20282028

2029+
/*
2030+
* call-see:
2031+
* meth.namespace -> namespace or nil
2032+
*
2033+
* Returns the namespace where +meth+ is defined in.
2034+
*/
20292035
static VALUE
20302036
method_namespace(VALUE obj)
20312037
{

ractor.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,12 @@ ractor_moved_missing(int argc, VALUE *argv, VALUE self)
874874
rb_raise(rb_eRactorMovedError, "can not send any methods to a moved object");
875875
}
876876

877+
/*
878+
* Document-class: Ractor::Error
879+
*
880+
* The parent class of Ractor-related error classes.
881+
*/
882+
877883
/*
878884
* Document-class: Ractor::ClosedError
879885
*
@@ -911,6 +917,13 @@ ractor_moved_missing(int argc, VALUE *argv, VALUE self)
911917
* Continue successfully
912918
*/
913919

920+
/*
921+
* Document-class: Ractor::IsolationError
922+
*
923+
* Raised on attempt to make a Ractor-unshareable object
924+
* Ractor-shareable.
925+
*/
926+
914927
/*
915928
* Document-class: Ractor::RemoteError
916929
*
@@ -960,6 +973,12 @@ ractor_moved_missing(int argc, VALUE *argv, VALUE self)
960973
* # Ractor::MovedError (can not send any methods to a moved object)
961974
*/
962975

976+
/*
977+
* Document-class: Ractor::UnsafeError
978+
*
979+
* Raised when Ractor-unsafe C-methods is invoked by a non-main Ractor.
980+
*/
981+
963982
// Main docs are in ractor.rb, but without this clause there are weird artifacts
964983
// in their rendering.
965984
/*

ractor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ def unmonitor port
612612
__builtin_ractor_unmonitor(port)
613613
end
614614

615+
# \Port objects transmit messages between Ractors.
615616
class Port
616617
#
617618
# call-seq:

ractor_sync.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,19 @@ ractor_port_init(VALUE rpv, rb_ractor_t *r)
9191
return rpv;
9292
}
9393

94+
/*
95+
* call-seq:
96+
* Ractor::Port.new -> new_port
97+
*
98+
* Returns a new Ractor::Port object.
99+
*/
94100
static VALUE
95101
ractor_port_initialzie(VALUE self)
96102
{
97103
return ractor_port_init(self, GET_RACTOR());
98104
}
99105

106+
/* :nodoc: */
100107
static VALUE
101108
ractor_port_initialzie_copy(VALUE self, VALUE orig)
102109
{

re.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4855,6 +4855,7 @@ Init_Regexp(void)
48554855
rb_define_method(rb_cRegexp, "named_captures", rb_reg_named_captures, 0);
48564856
rb_define_method(rb_cRegexp, "timeout", rb_reg_timeout_get, 0);
48574857

4858+
/* Raised when regexp matching timed out. */
48584859
rb_eRegexpTimeoutError = rb_define_class_under(rb_cRegexp, "TimeoutError", rb_eRegexpError);
48594860
rb_define_singleton_method(rb_cRegexp, "timeout", rb_reg_s_timeout_get, 0);
48604861
rb_define_singleton_method(rb_cRegexp, "timeout=", rb_reg_s_timeout_set, 1);

0 commit comments

Comments
 (0)