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
15 changes: 1 addition & 14 deletions .github/actions/setup/directories/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,9 @@ runs:
working-directory: ${{ inputs.srcdir }}
run: |
ruby tool/missing-baseruby.bat --verbose
touch config.status .rbconfig.time
for mk in Makefile GNUmakefile; do
sed -f tool/prereq.status template/$mk.in > $mk
done
make up
bash tool/gen-sources.bash up
echo RUBY_DUMP_AST=true >> "$GITHUB_ENV"

# Cleanup, runs even on failure
- if: always() && inputs.makeup
shell: bash
working-directory: ${{ inputs.srcdir }}
run: |
rm -f config.status .rbconfig.time \
Makefile GNUmakefile uncommon.mk enc.mk noarch-fake.rb
rm -f prism/.time prism/util/.time

- if: steps.which.outputs.sudo
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,11 @@ $(BUILTIN_BINARY:no=builtin)_binary.rbbin:

$(BUILTIN_RB_INCS): $(tooldir)/mk_builtin_loader.rb $(DUMP_AST_TARGET)

dump_ast$(BUILD_EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS)
dump_ast$(BUILD_EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) revision.h
$(ECHO) compiling $@
$(Q) $(CC) $(CFLAGS) $(OUTFLAG)$@ $(INCFLAGS) $(tooldir)/dump_ast.c $(LIBPRISM_OBJS)

build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb prism-srcs prism-incs
build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb prism-srcs prism-incs revision.h
+$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb \
"-INCFLAGS=$(INCFLAGS)" "-make=$(MAKE)" "-objext=$(OBJEXT)" \
build-tool $(tooldir)/dump_ast.c dump_ast.$(OBJEXT) $(LIBPRISM_OBJS)
Expand Down
81 changes: 28 additions & 53 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -5954,7 +5954,7 @@ env_each_pair(VALUE ehash)
*
* Similar to ENV.delete_if, but returns +nil+ if no changes were made.
*
* Yields each environment variable name and its value as a 2-element Array,
* Calls the block with each environment variable name and value,
* deleting each environment variable for which the block returns a truthy value,
* and returning ENV (if any deletions) or +nil+ (if not):
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
Expand Down Expand Up @@ -5995,23 +5995,18 @@ env_reject_bang(VALUE ehash)

/*
* call-seq:
* ENV.delete_if { |name, value| block } -> ENV
* ENV.delete_if {|name, value| ... } -> ENV
* ENV.delete_if -> an_enumerator
*
* Yields each environment variable name and its value as a 2-element Array,
* Calls the block with each environment variable name and value,
* deleting each environment variable for which the block returns a truthy value,
* and returning ENV (regardless of whether any deletions):
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* ENV.delete_if { |name, value| name.start_with?('b') } # => ENV
* ENV # => {"foo"=>"0"}
* ENV.delete_if { |name, value| name.start_with?('b') } # => ENV
*
* Returns an Enumerator if no block given:
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* e = ENV.delete_if # => #<Enumerator: {"bar"=>"1", "baz"=>"2", "foo"=>"0"}:delete_if!>
* e.each { |name, value| name.start_with?('b') } # => ENV
* ENV # => {"foo"=>"0"}
* e.each { |name, value| name.start_with?('b') } # => ENV
* With no block given, returns a new Enumerator.
*/
static VALUE
env_delete_if(VALUE ehash)
Expand Down Expand Up @@ -6053,22 +6048,18 @@ env_values_at(int argc, VALUE *argv, VALUE _)

/*
* call-seq:
* ENV.select { |name, value| block } -> hash of name/value pairs
* ENV.select {|name, value| ... } -> hash of name/value pairs
* ENV.select -> an_enumerator
* ENV.filter { |name, value| block } -> hash of name/value pairs
* ENV.filter {|name, value| ... } -> hash of name/value pairs
* ENV.filter -> an_enumerator
*
* Yields each environment variable name and its value as a 2-element Array,
* Calls the block with each environment variable name and value,
* returning a Hash of the names and values for which the block returns a truthy value:
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* ENV.select { |name, value| name.start_with?('b') } # => {"bar"=>"1", "baz"=>"2"}
* ENV.filter { |name, value| name.start_with?('b') } # => {"bar"=>"1", "baz"=>"2"}
*
* Returns an Enumerator if no block given:
* e = ENV.select # => #<Enumerator: {"bar"=>"1", "baz"=>"2", "foo"=>"0"}:select>
* e.each { |name, value | name.start_with?('b') } # => {"bar"=>"1", "baz"=>"2"}
* e = ENV.filter # => #<Enumerator: {"bar"=>"1", "baz"=>"2", "foo"=>"0"}:filter>
* e.each { |name, value | name.start_with?('b') } # => {"bar"=>"1", "baz"=>"2"}
* With no block given, returns a new Enumerator.
*/
static VALUE
env_select(VALUE ehash)
Expand Down Expand Up @@ -6096,12 +6087,12 @@ env_select(VALUE ehash)

/*
* call-seq:
* ENV.select! { |name, value| block } -> ENV or nil
* ENV.select! {|name, value| ... } -> ENV or nil
* ENV.select! -> an_enumerator
* ENV.filter! { |name, value| block } -> ENV or nil
* ENV.filter! {|name, value| ... } -> ENV or nil
* ENV.filter! -> an_enumerator
*
* Yields each environment variable name and its value as a 2-element Array,
* Calls the block with each environment variable name and value,
* deleting each entry for which the block returns +false+ or +nil+,
* and returning ENV if any deletions made, or +nil+ otherwise:
*
Expand All @@ -6115,19 +6106,7 @@ env_select(VALUE ehash)
* ENV # => {"bar"=>"1", "baz"=>"2"}
* ENV.filter! { |name, value| true } # => nil
*
* Returns an Enumerator if no block given:
*
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* e = ENV.select! # => #<Enumerator: {"bar"=>"1", "baz"=>"2"}:select!>
* e.each { |name, value| name.start_with?('b') } # => ENV
* ENV # => {"bar"=>"1", "baz"=>"2"}
* e.each { |name, value| true } # => nil
*
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* e = ENV.filter! # => #<Enumerator: {"bar"=>"1", "baz"=>"2"}:filter!>
* e.each { |name, value| name.start_with?('b') } # => ENV
* ENV # => {"bar"=>"1", "baz"=>"2"}
* e.each { |name, value| true } # => nil
* With no block given, returns a new Enumerator.
*/
static VALUE
env_select_bang(VALUE ehash)
Expand Down Expand Up @@ -6155,21 +6134,17 @@ env_select_bang(VALUE ehash)

/*
* call-seq:
* ENV.keep_if { |name, value| block } -> ENV
* ENV.keep_if {|name, value| ... } -> ENV
* ENV.keep_if -> an_enumerator
*
* Yields each environment variable name and its value as a 2-element Array,
* Calls the block with each environment variable name and value,
* deleting each environment variable for which the block returns +false+ or +nil+,
* and returning ENV:
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* ENV.keep_if { |name, value| name.start_with?('b') } # => ENV
* ENV # => {"bar"=>"1", "baz"=>"2"}
*
* Returns an Enumerator if no block given:
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* e = ENV.keep_if # => #<Enumerator: {"bar"=>"1", "baz"=>"2", "foo"=>"0"}:keep_if>
* e.each { |name, value| name.start_with?('b') } # => ENV
* ENV # => {"bar"=>"1", "baz"=>"2"}
* With no block given, returns a new Enumerator.
*/
static VALUE
env_keep_if(VALUE ehash)
Expand Down Expand Up @@ -6685,19 +6660,19 @@ env_except(int argc, VALUE *argv, VALUE _)
}

/*
* call-seq:
* ENV.reject { |name, value| block } -> hash of name/value pairs
* ENV.reject -> an_enumerator
* call-seq:
* ENV.reject {|name, value| ... } -> hash
* ENV.reject -> new_enumerator
*
* Yields each environment variable name and its value as a 2-element Array.
* Returns a Hash whose items are determined by the block.
* When the block returns a truthy value, the name/value pair is added to the return Hash;
* otherwise the pair is ignored:
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* ENV.reject { |name, value| name.start_with?('b') } # => {"foo"=>"0"}
* Returns an Enumerator if no block given:
* e = ENV.reject
* e.each { |name, value| name.start_with?('b') } # => {"foo"=>"0"}
* Calls the block with each environment variable name and value.
* Returns a Hash whose items are determined by the block.
* When the block returns a truthy value, the name/value pair is ignored;
* otherwise the pair is added to the return Hash:
*
* ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
* ENV.reject { |name, value| name.start_with?('b') } # => {"foo"=>"0"}
*
* Returns a new Enumerator if no block is given.
*/
static VALUE
env_reject(VALUE _)
Expand Down Expand Up @@ -7653,7 +7628,7 @@ Init_Hash(void)
* - ::delete_if: Deletes entries selected by the block.
* - ::keep_if: Deletes entries not selected by the block.
* - ::reject!: Similar to #delete_if, but returns +nil+ if no change was made.
* - ::select!, ::filter!: Deletes entries selected by the block.
* - ::select!, ::filter!: Deletes entries not selected by the block.
* - ::shift: Removes and returns the first entry.
*
* ==== Methods for Iterating
Expand Down
2 changes: 1 addition & 1 deletion io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3572,7 +3572,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int no_exception, int nonblock)
*
* - Contains +maxlen+ bytes from the stream, if available.
* - Otherwise contains all available bytes, if any available.
* - Otherwise is an empty string.
* - Is an empty string if +maxlen+ is zero.
*
* With the single non-negative integer argument +maxlen+ given,
* returns a new string:
Expand Down
4 changes: 2 additions & 2 deletions numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -2164,8 +2164,8 @@ flo_floor(int argc, VALUE *argv, VALUE num)
* returns an Integer based on a computed granularity:
*
* - The granularity is `10 ** ndigits.abs`.
* - The returned value is the largest multiple of the granularity
* that is less than or equal to `self`.
* - The returned value is the smallest multiple of the granularity
* that is greater than or equal to `self`.
*
* Examples with positive `self`:
*
Expand Down
8 changes: 4 additions & 4 deletions pathname_builtin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1392,9 +1392,9 @@ def chmod(mode) File.chmod(mode, @path) end
# :markup: markdown
#
# call-seq:
# Pathname.lchmod(mode) -> 1
# lchmod(mode) -> 1
#
# Not supported on some platforms (raises Errno:: ENOTSUP).
# Not supported on some platforms (raises Errno::ENOTSUP).
#
# When supported: like Pathname::chmod, but does not follow symbolic links,
# and therefore changes the mode of the entry specified by `self`:
Expand Down Expand Up @@ -1514,7 +1514,7 @@ def lchown(owner, group) File.lchown(owner, group, @path) end
# :markup: markdown
#
# call-seq:
# File.fnmatch(pattern, flags = 0) -> true or false
# fnmatch(pattern, flags = 0) -> true or false
#
# Returns whether string `pattern` matches against the string path in `self`,
# under the control of the given `flags`;
Expand Down Expand Up @@ -2473,7 +2473,7 @@ class Pathname
# each based on a selected filesystem entry.
#
# With a block given, calls the block with pathnames,
# each based on a selected filesytem entry.
# each based on a selected filesystem entry.
#
def Pathname.glob(*args, **kwargs) # :yield: pathname
if block_given?
Expand Down
3 changes: 0 additions & 3 deletions process.c
Original file line number Diff line number Diff line change
Expand Up @@ -4688,8 +4688,6 @@ rb_spawn(int argc, const VALUE *argv)
*
* See {Execution Shell}[rdoc-ref:Process@Execution+Shell] for details about the shell.
*
* Raises an exception if the new process could not execute.
*
* <b>Argument +exe_path+</b>
*
* Argument +exe_path+ is one of the following:
Expand Down Expand Up @@ -4731,7 +4729,6 @@ rb_spawn(int argc, const VALUE *argv)
* C*
* hello world
*
* Raises an exception if the new process could not execute.
*/

static VALUE
Expand Down
2 changes: 1 addition & 1 deletion range.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ range_step_size(VALUE range, VALUE args, VALUE eobj)
* Iterates over the elements of range in steps of +s+. The iteration is performed
* by <tt>+</tt> operator:
*
* (0..6).step(2) { puts _1 } #=> 1..5
* (0..6).step(2) { puts _1 }
* # Prints: 0, 2, 4, 6
*
* # Iterate between two dates in step of 1 day (24 hours)
Expand Down
4 changes: 2 additions & 2 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -4561,14 +4561,14 @@ rb_reg_s_union(VALUE self, VALUE args0)
* Regexp.union(*patterns) -> regexp
* Regexp.union(array_of_patterns) -> regexp
*
* Returns a new regexp that is the union of the given patterns:
* Returns a regexp that is the union of the given patterns:
*
* r = Regexp.union(%w[cat dog]) # => /cat|dog/
* r.match('cat') # => #<MatchData "cat">
* r.match('dog') # => #<MatchData "dog">
* r.match('cog') # => nil
*
* For each pattern that is a string, <tt>Regexp.new(pattern)</tt> is used:
* Each string pattern is escaped so that it is matched literally:
*
* Regexp.union('penzance') # => /penzance/
* Regexp.union('a+b*c') # => /a\+b\*c/
Expand Down
11 changes: 5 additions & 6 deletions time.c
Original file line number Diff line number Diff line change
Expand Up @@ -4163,20 +4163,19 @@ time_zonelocal(VALUE time, VALUE off)

/*
* call-seq:
* localtime -> self or new_time
* localtime(zone) -> new_time
* localtime -> self
* localtime(zone) -> self
*
* With no argument given:
*
* - Returns +self+ if +self+ is a local time.
* - Otherwise returns a new +Time+ in the user's local timezone:
* - Returns +self+ if +self+ is already a local time.
* - Otherwise returns +self+, converted to the user's local timezone:
*
* t = Time.utc(2000, 1, 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
* t.localtime # => 2000-01-01 14:15:01 -0600
*
* With argument +zone+ given,
* returns the new +Time+ object created by converting
* +self+ to the given time zone:
* returns +self+, converted to the given time zone:
*
* t = Time.utc(2000, 1, 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
* t.localtime("-09:00") # => 2000-01-01 11:15:01 -0900
Expand Down
Loading