Skip to content

Commit af09f03

Browse files
hsbtclaude
andcommitted
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. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ec3a549 commit af09f03

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

bundler/lib/bundler/dsl.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ def override(target, **operations)
195195
raise ArgumentError, "`override :all, version:` is not allowed; version requirements are per-gem"
196196
end
197197

198-
if target == :all && operations.any?
199-
raise ArgumentError, "`override :all` is not yet supported"
200-
end
201-
202198
operations.each do |field, operation|
203199
validate_override_field!(field)
204200
validate_override_operation!(operation)

spec/bundler/dsl_spec.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,19 @@
444444
expect(override.operation).to be_nil
445445
end
446446

447-
it "raises ArgumentError for `override :all, required_ruby_version:` until :all is implemented" do
448-
expect do
449-
subject.override(:all, required_ruby_version: :ignore_upper)
450-
end.to raise_error(ArgumentError, /`override :all` is not yet supported/)
447+
it "stores an Override targeting :all with a metadata field" do
448+
subject.override(:all, required_ruby_version: :ignore_upper)
449+
override = subject.overrides.first
450+
expect(override.target).to eq(:all)
451+
expect(override.field).to eq(:required_ruby_version)
452+
expect(override.operation).to eq(:ignore_upper)
453+
end
454+
455+
it "stores an Override targeting :all with required_rubygems_version" do
456+
subject.override(:all, required_rubygems_version: nil)
457+
override = subject.overrides.first
458+
expect(override.target).to eq(:all)
459+
expect(override.field).to eq(:required_rubygems_version)
451460
end
452461

453462
it "raises ArgumentError for a non-string, non-symbol, non-nil operation" do

0 commit comments

Comments
 (0)