summaryrefslogtreecommitdiff
path: root/spec
AgeCommit message (Collapse)Author
2026-03-09[ruby/rubygems] Update bundler inline spec expectationsHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/825d4eba3c Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06Improve comparison error message.Ernie Miller
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"
2026-03-04[ruby/rubygems] Fix plugin new version not registering:Edouard CHIN
- ### 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
2026-03-04[ruby/rubygems] Add a new Bundler config to control how many specs are fetched:Edouard CHIN
- ### 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
2026-03-03Update to ruby/spec@af627d6Andrew Konchin
2026-03-03Update to ruby/mspec@a2587d9Andrew Konchin
2026-03-03[Feature #21781] Add `ENV.fetch_values`Earlopain
Specs/Implementation inspired by methods on hash/env that already exist.
2026-03-03[ruby/rubygems] Show release date with bundle outdatedHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/300cc0c223
2026-03-02Use .bundle only if all deps presentHiroshi SHIBATA
2026-03-02Use .bundle gem paths for test deps with ruby/ruby repository.Hiroshi SHIBATA
2026-02-28[ruby/rubygems] Skip Windows group warning for realworld specsHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/98a355dcfb
2026-02-24Use .bundle gems dependencies directlyHiroshi SHIBATA
2026-02-20Removed unnecessary setup for make bundled_gems_spec-runHiroshi SHIBATA
2026-02-18Skip failing example in spec/bundler/install/global_cache_spec.rb when ↵Hiroshi SHIBATA
running in ruby core
2026-02-18[ruby/rubygems] Fix Bundler crashing when it tries to install plugin:Edouard CHIN
- ### 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
2026-02-15Start handling `&nil` in method parametersUfuk Kayserilioglu
Similar to `:nokey` for `**nil` declaring methods/procs, a method/proc with a `&nil` declaration will return a `:noblock` entry in the parameters array.
2026-02-15[Feature #19979] Method definition with `&nil`Nobuyoshi Nakada
Allow methods to declare that they don't accept a block via `&nil`.
2026-02-13spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."4.1"' ↵Hiroshi SHIBATA
spec/ruby/library/net-ftp/**/*.rb
2026-02-13[ruby/rubygems] Improve testing configIan Ker-Seymer
https://github.com/ruby/rubygems/commit/92e28403c3
2026-02-13[ruby/rubygems] [rust gem] Make cargo test work by defaultIan Ker-Seymer
https://github.com/ruby/rubygems/commit/9420974db7
2026-02-13[ruby/rubygems] bin/rubocop -a --only Style/HashSyntaxHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/00db7f4522
2026-02-13[ruby/rubygems] fix(bundler): only preload git sources for requested groupsAbdelkader Boudih
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
2026-02-13[ruby/rubygems] Relax gem name validation to warn on capital lettersHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/26dab848c5
2026-02-13[ruby/rubygems] Raise error when gem contains capital lettersOKURA Masafumi
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
2026-02-13[ruby/rubygems] Add test for bundle help greet commandcopilot-swe-agent[bot]
https://github.com/ruby/rubygems/commit/602b0cecb8 Co-authored-by: hsbt <12301+hsbt@users.noreply.github.com>
2026-02-13[ruby/rubygems] Add support for help flag in plugin commandsHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/b8d45956d0
2026-02-12[Feature #21796] unpack variant `^` that returns the final offset (#15647)Nobuyoshi Nakada
[Feature #21796] unpack variant `^` that returns the current offset
2026-02-13Introduce suport for `autoload_relative`. (#16148)Samuel Williams
2026-02-12[Feature #21785] Add LEB128 again (#16123)Aaron Patterson
* Revert "Revert pack/unpack support for LEB128" This reverts commit 77c3a9e447ec477be39e00072e1ce3348d0f4533. * Update specs for LEB128
2026-02-12Make Monitor a core classJean Boussier
[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 ```
2026-02-12[ruby/rubygems] Fix global_cache_spec to work with system RubyGemsAnthony Panozzo
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
2026-02-12[ruby/rubygems] Update global cache test to use XDG cache pathAnthony Panozzo
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
2026-02-12Dir.scan: return or yield children along with their typeJean Boussier
[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 ```
2026-02-10Use a ruby_bug guard since this bug fix will likely be backportedBenoit Daloze
* And it should be tested on current versions of other Ruby implementations.
2026-02-10Add ruby specs for UnboundMethod#== with included/extended modules [Bug #21873]Mike Dalessio
https://bugs.ruby-lang.org/issues/21873
2026-02-10[Feature #21872] Search script from $PATH only if no separatorNobuyoshi Nakada
2026-02-09[ruby/rubygems] Do not create unnecessary directoriesNobuyoshi Nakada
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
2026-02-09[ruby/rubygems] Revert "Cleaned up bundler .gem and .gemspec files in ensure ↵Nobuyoshi Nakada
block." This reverts commit https://github.com/ruby/rubygems/commit/dce4ef87bb70. https://github.com/ruby/rubygems/commit/3b62e468c3
2026-02-07Refactor type error to be more consistentJean Boussier
[Bug #21864] Co-Authored-By: Benoit Daloze <eregontp@gmail.com>
2026-02-06[ruby/rubygems] Cleaned up bundler .gem and .gemspec files in ensure block.Hiroshi SHIBATA
https://github.com/ruby/rubygems/commit/dce4ef87bb
2026-02-06Set Gem::BUNDLED_GEMS::LIBDIR from Spec::Path realpath with symlink at macOSHiroshi SHIBATA
2026-02-05Bypass the conversion of drive letter in `with_destdir`Nobuyoshi Nakada
2026-02-05Ensure the jobserver is usableNobuyoshi Nakada
If invalid, clear jobserver options from the environment variables.
2026-02-04[ruby/rubygems] Fix gzip cache corruption when recovering from HTTP 416 ↵Giovanni Tirloni
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
2026-02-04[ruby/rubygems] Add test case for git sources with transitive dependenciescopilot-swe-agent[bot]
https://github.com/ruby/rubygems/commit/00c8bb7bc5 Co-authored-by: hsbt <12301+hsbt@users.noreply.github.com>
2026-02-04[ruby/rubygems] Added failing exampleHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/73735b503c
2026-02-04Expand realpath to symlink when running with macOSHiroshi SHIBATA
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2026-02-04[ruby/rubygems] Lock diff-lcs < 2.0Hiroshi SHIBATA
https://github.com/ruby/rubygems/commit/23aecf4a86
2026-01-30[ruby/rubygems] Handle symlink TMPDIR with macOSHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/cf08f1ec4c
2026-01-30[ruby/rubygems] Revert "[ruby/rubygems] Revert "Merge pull request #8989 ↵Hiroshi SHIBATA
from nobu/test-tmpdir"" This reverts commit https://github.com/ruby/rubygems/commit/6e00da098aba. https://github.com/ruby/rubygems/commit/c6abdae812