summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2026-05-07 18:54:02 +0900
committergit <svn-admin@ruby-lang.org>2026-05-08 06:43:40 +0000
commit36b2ed2b129556bd76ffd4cad0fe750c4bbb4388 (patch)
tree0564acbf94bfb14e391b0c013a5e3a900545e218
parent4fa0924fb4f62583b4b5d30ca6d9fab9cf11149a (diff)
[ruby/rubygems] Allow :all target for metadata-field overrides
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) <noreply@anthropic.com>
-rw-r--r--lib/bundler/dsl.rb4
-rw-r--r--spec/bundler/bundler/dsl_spec.rb17
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