[pull] master from ruby:master#773
Merged
pull[bot] merged 15 commits intoturkdevops:masterfrom Feb 12, 2026
Merged
Conversation
Only add the source lib directory to $LOAD_PATH when running with miniruby, which needs it for the standard library (erb, fileutils, etc.). When running with baseruby (detected via CROSS_COMPILING defined by fake.rb), its own stdlib is already available and adding the source lib causes warnings with -w due to loading both baseruby's cgi/escape.so and the source cgi/escape.rb via erb.
Ruby codes lives in lib/prism but c code is just in prism. This fixes docs on https://docs.ruby-lang.org/en/master/Prism.html Currently it doesn't list any methods that are defined in the C extension
When we hit EOF and still have lex modes left, it means some content was unterminated. Heredocs specifically have logic that needs to happen when the body finished lexing. If we don't reset the mode back to how it was before, it will not continue lexing at the correct place. ruby/prism@8f35e8ef25
Prism inserts these to make bookkeeping easier. Ripper does not do so. ruby/prism@0a3b560218
[Feature #21800]
There are numerous ruby tools that need to recursively scan
the project directory, such as Zeitwerk, rubocop, etc.
All of them end up listing childs of a directory then for each child
emit a `stat` call to check if it's a directory or not.
This is common enough for a pattern that on most operating
systems, `struct dirent` include a `dtype` member that allows to
check the file type without issuing a any extra system calls.
By yielding that type, we can make these routines twice as fast.
```
$ hyperfine './miniruby --disable-all --yjit ../test.rb' 'OPT=1 ./miniruby --disable-all --yjit ../test.rb'
Benchmark 1: ./miniruby --disable-all --yjit ../test.rb
Time (mean ± σ): 1.428 s ± 0.062 s [User: 0.342 s, System: 1.070 s]
Range (min … max): 1.396 s … 1.601 s 10 runs
Benchmark 2: OPT=1 ./miniruby --disable-all --yjit ../test.rb
Time (mean ± σ): 673.8 ms ± 5.8 ms [User: 146.0 ms, System: 527.3 ms]
Range (min … max): 659.7 ms … 679.6 ms 10 runs
Summary
OPT=1 ./miniruby --disable-all --yjit ../test.rb ran
2.12 ± 0.09 times faster than ./miniruby --disable-all --yjit ../test.rb
```
```ruby
if ENV['OPT']
def count_ruby_files
count = 0
queue = [File.expand_path(__dir__)]
while dir = queue.pop
Dir.scan(dir) do |name, type|
next if name.start_with?(".")
case type
when :directory
queue << File.join(dir, name)
when :file
count += 1 if name.end_with?(".rb")
end
end
end
count
end
else
def count_ruby_files
count = 0
queue = [File.expand_path(__dir__)]
while dir = queue.pop
Dir.each_child(dir) do |name|
next if name.start_with?(".")
abspath = File.join(dir, name)
if File.directory?(abspath)
queue << abspath
else
count += 1 if name.end_with?(".rb")
end
end
end
count
end
end
10.times do
count_ruby_files
end
```
test/json/json_parser_test.rb:141: warning: Integer out of Float range lib/json/common.rb:353: warning: Float ruby/json@123456789012... out of range ruby/json@e7245b714a
Add opt-in support for a global .gem file cache at ~/.cache/gem/gems (respects XDG_CACHE_HOME). This allows sharing cached gems across all Ruby installations and between RubyGems and Bundler. Enable via: - Environment: RUBYGEMS_GLOBAL_GEM_CACHE=true - gemrc: global_gem_cache: true - Bundler: bundle config set global_gem_cache true When enabled, RubyGems checks the global cache before downloading and copies downloaded gems to the cache. Bundler's existing global_gem_cache setting now uses the same unified cache location. ruby/rubygems@417e10d6a1
…wnload Instead of checking global cache separately and copying after download, integrate global_gem_cache as the first option in cache_dir selection. This removes ~20 lines while achieving the same behavior. Suggested by Aaron Patterson. ruby/rubygems@48ce0ecc32
…byGems Guard against missing Gem.global_gem_cache_path method when Bundler is used with an older RubyGems version that doesn't have the global cache feature. Falls back to the previous Bundler.user_cache location. Suggested by skipkayhil. ruby/rubygems@a4bb3a20f8
The global gem cache is now at ~/.cache/gem/gems/ (XDG standard) instead of ~/.bundle/cache/gems/ to align with the shared RubyGems/Bundler cache implementation. ruby/rubygems@8f845a72e7
When running Bundler tests against system RubyGems (which doesn't have Gem.global_gem_cache_path), the test needs to use the fallback cache location (~/.bundle/cache/gems/) that Bundler uses in that case. ruby/rubygems@a6fc1d862b
These memoized instance variables were not being cleared, causing test isolation issues when HOME environment variable changes. ruby/rubygems@a8b3e0bca0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )