Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/check_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ jobs:
- name: Generate docs
id: docs
run: |
ruby -W0 --disable-gems tool/rdoc-srcdir -q --op html .
$RDOC -C -x ^ext -x ^lib .
$RDOC --op html .
echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT
env:
RDOC: ruby -W0 --disable-gems tool/rdoc-srcdir -q
# Generate only when document commit/PR
if: >-
${{false
Expand Down
1 change: 0 additions & 1 deletion .rdoc_options
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ rdoc_include:
- doc

exclude:
- \Alib/irb
- \.gemspec\z

autolink_excluded_words:
Expand Down
4 changes: 2 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ html: PHONY main srcs-doc

rdoc-coverage: PHONY main srcs-doc
@echo Generating RDoc coverage report
$(Q) $(RDOC) --quiet -C $(RDOCFLAGS) "$(srcdir)"
$(Q) $(RDOC) --quiet -C $(RDOCFLAGS) .

undocumented: PHONY main srcs-doc
$(Q) $(RDOC) --quiet -C $(RDOCFLAGS) "$(srcdir)" | \
$(Q) $(RDOC) --quiet -C $(RDOCFLAGS) . | \
sed -n \
-e '/^ *# in file /{' -e 's///;N;s/\n/: /p' -e '}' \
-e 's/^ *\(.*[^ ]\) *# in file \(.*\)/\2: \1/p' | sort
Expand Down
1 change: 1 addition & 0 deletions encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
12 changes: 12 additions & 0 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
12 changes: 7 additions & 5 deletions lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2047,19 +2047,21 @@ def candidate(word)
def load(filename = nil, **keywords)
unless filename
basename = File.basename($0, '.*')
return true if load(File.expand_path(basename, '~/.options'), **keywords) rescue nil
return true if load(File.expand_path("~/.options/#{basename}"), **keywords) rescue nil
basename << ".options"
return [
# XDG
ENV['XDG_CONFIG_HOME'],
'~/.config',
['~/.config', true],
*ENV['XDG_CONFIG_DIRS']&.split(File::PATH_SEPARATOR),

# Haiku
'~/config/settings',
].any? {|dir|
['~/config/settings', true],
].any? {|dir, expand|
next if !dir or dir.empty?
load(File.expand_path(basename, dir), **keywords) rescue nil
filename = File.join(dir, basename)
filename = File.expand_path(filename) if expand
load(filename, **keywords) rescue nil
}
end
begin
Expand Down
42 changes: 42 additions & 0 deletions namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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");
Expand Down
5 changes: 3 additions & 2 deletions pathname_builtin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class Pathname

# The version string.
VERSION = "0.4.0"

# :stopdoc:
Expand All @@ -36,9 +37,9 @@ class Pathname
end

if File.dirname('A:') == 'A:.' # DOSish drive letter
ABSOLUTE_PATH = /\A(?:[A-Za-z]:|#{SEPARATOR_PAT})/o
ABSOLUTE_PATH = /\A(?:[A-Za-z]:|#{SEPARATOR_PAT})/
else
ABSOLUTE_PATH = /\A#{SEPARATOR_PAT}/o
ABSOLUTE_PATH = /\A#{SEPARATOR_PAT}/
end
private_constant :ABSOLUTE_PATH

Expand Down
4 changes: 3 additions & 1 deletion prelude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ def irb(...)
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
Expand Down
6 changes: 6 additions & 0 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
19 changes: 19 additions & 0 deletions ractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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.
/*
Expand Down
1 change: 1 addition & 0 deletions ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ def unmonitor port
__builtin_ractor_unmonitor(port)
end

# \Port objects transmit messages between Ractors.
class Port
#
# call-seq:
Expand Down
7 changes: 7 additions & 0 deletions ractor_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions set.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
Loading