From 36b2ed2b129556bd76ffd4cad0fe750c4bbb4388 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 7 May 2026 18:54:02 +0900 Subject: [ruby/rubygems] Allow :all target for metadata-field overrides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the temporary "not yet supported" guard so a Gemfile may write `override :all, required_ruby_version: :ignore_upper` and similar forms. The version: ban for :all stays — version requirements are inherently per-gem. https://github.com/ruby/rubygems/commit/af09f0360a Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/bundler/dsl.rb | 4 ---- spec/bundler/bundler/dsl_spec.rb | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 92abd07a84..46389b6c68 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -195,10 +195,6 @@ module Bundler raise ArgumentError, "`override :all, version:` is not allowed; version requirements are per-gem" end - if target == :all && operations.any? - raise ArgumentError, "`override :all` is not yet supported" - end - operations.each do |field, operation| validate_override_field!(field) validate_override_operation!(operation) diff --git a/spec/bundler/bundler/dsl_spec.rb b/spec/bundler/bundler/dsl_spec.rb index 6df665e3d9..a04528a57f 100644 --- a/spec/bundler/bundler/dsl_spec.rb +++ b/spec/bundler/bundler/dsl_spec.rb @@ -444,10 +444,19 @@ RSpec.describe Bundler::Dsl do expect(override.operation).to be_nil end - it "raises ArgumentError for `override :all, required_ruby_version:` until :all is implemented" do - expect do - subject.override(:all, required_ruby_version: :ignore_upper) - end.to raise_error(ArgumentError, /`override :all` is not yet supported/) + it "stores an Override targeting :all with a metadata field" do + subject.override(:all, required_ruby_version: :ignore_upper) + override = subject.overrides.first + expect(override.target).to eq(:all) + expect(override.field).to eq(:required_ruby_version) + expect(override.operation).to eq(:ignore_upper) + end + + it "stores an Override targeting :all with required_rubygems_version" do + subject.override(:all, required_rubygems_version: nil) + override = subject.overrides.first + expect(override.target).to eq(:all) + expect(override.field).to eq(:required_rubygems_version) end it "raises ArgumentError for a non-string, non-symbol, non-nil operation" do -- cgit v1.2.3