| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/rubygems/commit/825d4eba3c
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
In certain cases, things like Array#sort can result in a confusing error
message. For instance where a and b are characters in a string,
`"string"`:
```ruby
array.sort { |a, b| string.index(a) <=> string.index(b) }
```
If one of the index calls returns nil, we will get "comparison of String
with String failed", which is somewhat unhelpful, since it's easy to be
confused, given that what is really being compared is a Fixnum or
NilClass (the cause of the error). Yes, as far as Array#sort is
concerned, the two characters are the things being sorted, but it's
useful to call attention to the return value of the comparison in this
case.
This patch adds a "reason" argument to rb_cmperr, which will provide an
error message of "comparison of String with String failed: comparator
returned nil" in the case above, or, in the case of:
```ruby
1.upto('10').to_a
```
it will provide the message: "comparison of Fixnum with String failed:
coercion was not possible"
|
|
- ### Problem
When a plugin in the Gemfile is updated to a new version, it will
be downloaded but will not be registered. The old version of the
plugin will be loaded when Bundler is invoked.
### Context
The problem is in the `Index#installed?` method that only checks for
the plugin name in the index. If it finds one, it skips the
registration.
### Solution
Check whether the registed plugin load paths matche the new plugin
one. If not, register the new plugin which will override the
previous one in the index.
https://github.com/ruby/rubygems/commit/ac65001055
|
|
- ### Problem
In #9071, I increased the API_REQUEST_SIZE constants to fetch 100
specifications at once instead of 50.
Worth to remember that this codepath is exclusively used for servers
that don't implement the compact index API and where Bundler has to
fallback on the `/v1/dependencies` endpoint.
Fetching 100 gems at once seems not supported by some gem servers.
See https://github.com/ruby/rubygems/issues/9345
### Solution
I'd like to provide a new Bundler configuration
`BUNDLE_API_REQUEST_SIZE` to let users of those servers control how
many dependencies should be fetched at once.
### Alternatives
The other alternative is to revert #9071 and always fetch 50 specs.
I tried the number 100 on a single rubygem registry (cloudsmith),
and I don't have data point to know whether this value is supported
by most registries.
https://github.com/ruby/rubygems/commit/1a3bace42e
|
|
|
|
|
|
Specs/Implementation inspired by methods on hash/env that already exist.
|
|
https://github.com/ruby/rubygems/commit/300cc0c223
|
|
|
|
|
|
https://github.com/ruby/rubygems/commit/98a355dcfb
|
|
|
|
|
|
running in ruby core
|
|
- ### Problem
Bundler crashes when a Gemfile contains a plugin and you
try to run `bundle install` while setting the BUNDLE_WITHOUT=default
value.
### Context
Setting the BUNDLE_WITHOUT=default is something that some deployment
tooling does like [shipit](https://github.com/Shopify/shipit-engine/blob/a24b9d8b1b777e22f05311705be7938a4823eee6/app/models/shipit/deploy_spec/bundler_discovery.rb#L6)
The intent being to only install gems that are required to deploy
the app (for instance ones that are inside a `group :deploy` block).
### Solution
Bundler assume that all plugins inside the Gemfile will get
installed, but don't take in consideration that a BUNDLE_WITHOUT
may have affected this.
So before registering a plugin, make sure it's actually in
the `specs` object (meaning it was installed on disk).
https://github.com/ruby/rubygems/commit/b416a026ca
|
|
Similar to `:nokey` for `**nil` declaring methods/procs, a method/proc with a `&nil` declaration will return a `:noblock` entry in the parameters array.
|
|
Allow methods to declare that they don't accept a block via `&nil`.
|
|
spec/ruby/library/net-ftp/**/*.rb
|
|
https://github.com/ruby/rubygems/commit/92e28403c3
|
|
https://github.com/ruby/rubygems/commit/9420974db7
|
|
https://github.com/ruby/rubygems/commit/00db7f4522
|
|
Skip fetching git sources for excluded groups (--without). This is
important for production builds where development git dependencies
may be private repos without access, or should not be included in
Docker images.
https://github.com/ruby/rubygems/commit/d034ee10bb
|
|
https://github.com/ruby/rubygems/commit/26dab848c5
|
|
The problem is described in https://github.com/rubygems/rubygems/issues/5431
The guide ( https://guides.rubygems.org/name-your-gem/ ) says
> DON’T USE UPPERCASE LETTERS
so `bundle gem` command should respect it.
https://github.com/ruby/rubygems/commit/ea1b1e2209
|
|
https://github.com/ruby/rubygems/commit/602b0cecb8
Co-authored-by: hsbt <12301+hsbt@users.noreply.github.com>
|
|
https://github.com/ruby/rubygems/commit/b8d45956d0
|
|
[Feature #21796] unpack variant `^` that returns the current offset
|
|
|
|
* Revert "Revert pack/unpack support for LEB128"
This reverts commit 77c3a9e447ec477be39e00072e1ce3348d0f4533.
* Update specs for LEB128
|
|
[Feature #21788]
It allows monitor to access internal routines and remove some overhead.
Before:
```
ruby 4.0.0dev (2025-12-13T04:52:13Z master 71dd272506) +YJIT +PRISM [arm64-darwin25]
Warming up --------------------------------------
Mutex 2.111M i/100ms
Monitor 1.736M i/100ms
Calculating -------------------------------------
Mutex 25.050M (± 0.4%) i/s (39.92 ns/i) - 126.631M in 5.055208s
Monitor 19.809M (± 0.1%) i/s (50.48 ns/i) - 100.672M in 5.082015s
```
After:
```
ruby 4.0.0dev (2025-12-13T06:49:18Z core-monitor 6fabf389fd) +YJIT +PRISM [arm64-darwin25]
Warming up --------------------------------------
Mutex 2.144M i/100ms
Monitor 1.859M i/100ms
Calculating -------------------------------------
Mutex 24.771M (± 0.4%) i/s (40.37 ns/i) - 124.342M in 5.019716s
Monitor 23.722M (± 0.4%) i/s (42.15 ns/i) - 118.998M in 5.016361s
```
Bench:
```ruby
require 'bundler/inline'
gemfile do
gem "benchmark-ips"
end
mutex = Mutex.new
require "monitor"
monitor = Monitor.new
Benchmark.ips do |x|
x.report("Mutex") { mutex.synchronize { } }
x.report("Monitor") { monitor.synchronize { } }
end
```
|
|
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.
https://github.com/ruby/rubygems/commit/a6fc1d862b
|
|
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.
https://github.com/ruby/rubygems/commit/8f845a72e7
|
|
[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
```
|
|
* And it should be tested on current versions of other Ruby implementations.
|
|
https://bugs.ruby-lang.org/issues/21873
|
|
|
|
The method `Spec::Path#vendored_gems` creates the directory containing
the path. It makes no sense to create a directory with the same name
as its basename in the current working directory.
https://github.com/ruby/rubygems/commit/725f4ff2f4
|
|
block."
This reverts commit https://github.com/ruby/rubygems/commit/dce4ef87bb70.
https://github.com/ruby/rubygems/commit/3b62e468c3
|
|
[Bug #21864]
Co-Authored-By: Benoit Daloze <eregontp@gmail.com>
|
|
https://github.com/ruby/rubygems/commit/dce4ef87bb
|
|
|
|
|
|
If invalid, clear jobserver options from the environment variables.
|
|
responses
When a Range request returns 416 (Range Not Satisfiable), the recovery
path manually added an "Accept-Encoding: gzip" header before retrying.
This bypasses Ruby's automatic gzip decompression mechanism.
Ruby's Net::HTTP only sets decode_content=true (enabling automatic
decompression) when Accept-Encoding is NOT present in the request
headers. By manually setting this header, the decode_content flag
remained false, causing gzip-compressed response bodies to be written
directly to the compact index cache without decompression.
This resulted in "ArgumentError: invalid byte sequence in UTF-8" errors
when the corrupted cache was later read and parsed as text.
The fix removes the explicit Accept-Encoding header, allowing Ruby's
Net::HTTP to handle gzip compression transparently (as it does for all
other requests). Ruby will still add Accept-Encoding: gzip automatically
AND properly set decode_content=true for automatic decompression.
Fixes https://github.com/ruby/rubygems/pull/9271
https://github.com/ruby/rubygems/commit/b48b090e38
|
|
https://github.com/ruby/rubygems/commit/00c8bb7bc5
Co-authored-by: hsbt <12301+hsbt@users.noreply.github.com>
|
|
https://github.com/ruby/rubygems/commit/73735b503c
|
|
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
https://github.com/ruby/rubygems/commit/23aecf4a86
|
|
https://github.com/ruby/rubygems/commit/cf08f1ec4c
|
|
from nobu/test-tmpdir""
This reverts commit https://github.com/ruby/rubygems/commit/6e00da098aba.
https://github.com/ruby/rubygems/commit/c6abdae812
|