bundler 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b538a3abc5f8651616cf8883d701149ee50457172c532fe11e3c5f0849dca2d
4
- data.tar.gz: 610279b2dd9c3601d1c9cbf64ccd9a536f3ab5f7871a135014156352932b032e
3
+ metadata.gz: a7aeb28bb0c73f4b19b37264af4bbf1765cf15c03d8eb511a37f2c3c6d2d0e75
4
+ data.tar.gz: 6a93c4c78414e37f92bc3cac9f8a35c525fa9e3aa1ffa6eda977c51e5a03c63a
5
5
  SHA512:
6
- metadata.gz: 12b40ef7ba38861f20330914c5f6473f7bf6396a6cba0bcae2eef51d4e5c48fbfa1ab8f7a3071ca999f4e1d56a424b42b486f12704fe409fc0e4f2362e1f6552
7
- data.tar.gz: 8e2fa626c039857ab573a7213732d3a40e7de05d813bc3b197b1466d17fa5d835bb2141e7a74a445ba2fc4f6d48cba2a959373681cdc0bc47fa4dcaa184e3c8d
6
+ metadata.gz: f8315a073ff7179b32c03f45b99a12bf896b703be06ad0f4c331b5ea68d6adf92b86d66bf11e43ca7a69e37121d1b652a01e3428c6136d1e86c144c16e510ed9
7
+ data.tar.gz: 27b056ebf450d422990e70ea3ce08aefd5ff0c8bbaf8764f18dece19da24cbe033599a3d3c60067a829fd4080ff43520a3ffe6b6d78149c668244a493c6899ed
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.4 (2026-01-15)
4
+
5
+ ### Enhancements:
6
+
7
+ - Validate more options for add sub-command [#5905](https://github.com/ruby/rubygems/pull/5905)
8
+ - Support Ruby 4.1 [#9219](https://github.com/ruby/rubygems/pull/9219)
9
+
10
+ ### Bug fixes:
11
+
12
+ - Fix dependency source bug in bundler [#9213](https://github.com/ruby/rubygems/pull/9213)
13
+ - Retain current bundler version on `bundle clean` [#9221](https://github.com/ruby/rubygems/pull/9221)
14
+
3
15
  ## 4.0.3 (2025-12-23)
4
16
 
5
17
  ### Enhancements:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2025-12-23".freeze
8
- @git_commit_sha = "28c66ecc1e".freeze
7
+ @built_at = "2026-01-15".freeze
8
+ @git_commit_sha = "49e812f884".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -36,6 +36,16 @@ module Bundler
36
36
  end
37
37
 
38
38
  def validate_options!
39
+ raise InvalidOption, "You cannot specify `--git` and `--github` at the same time." if options["git"] && options["github"]
40
+
41
+ unless options["git"] || options["github"]
42
+ raise InvalidOption, "You cannot specify `--branch` unless `--git` or `--github` is specified." if options["branch"]
43
+
44
+ raise InvalidOption, "You cannot specify `--ref` unless `--git` or `--github` is specified." if options["ref"]
45
+ end
46
+
47
+ raise InvalidOption, "You cannot specify `--branch` and `--ref` at the same time." if options["branch"] && options["ref"]
48
+
39
49
  raise InvalidOption, "You cannot specify `--strict` and `--optimistic` at the same time." if options[:strict] && options[:optimistic]
40
50
 
41
51
  # raise error when no gems are specified
@@ -11,7 +11,7 @@ module Bundler
11
11
  end
12
12
 
13
13
  class CurrentRuby
14
- ALL_RUBY_VERSIONS = [*18..27, *30..34, 40].freeze
14
+ ALL_RUBY_VERSIONS = [*18..27, *30..34, *40..41].freeze
15
15
  KNOWN_MINOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.reverse.join(".") }.freeze
16
16
  KNOWN_MAJOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.last.to_s }.uniq.freeze
17
17
  PLATFORM_MAP = {
@@ -1066,7 +1066,22 @@ module Bundler
1066
1066
 
1067
1067
  deps << dep if !replacement_source || lockfile_source.include?(replacement_source) || new_deps.include?(dep)
1068
1068
  else
1069
- replacement_source = sources.get(lockfile_source)
1069
+ parent_dep = @dependencies.find do |d|
1070
+ next unless d.source && d.source != lockfile_source
1071
+ next if d.source.is_a?(Source::Gemspec)
1072
+
1073
+ parent_locked_specs = @originally_locked_specs[d.name]
1074
+
1075
+ parent_locked_specs.any? do |parent_spec|
1076
+ parent_spec.runtime_dependencies.any? {|rd| rd.name == s.name }
1077
+ end
1078
+ end
1079
+
1080
+ if parent_dep
1081
+ replacement_source = parent_dep.source
1082
+ else
1083
+ replacement_source = sources.get(lockfile_source)
1084
+ end
1070
1085
  end
1071
1086
 
1072
1087
  # Replace the locked dependency's source with the equivalent source from the Gemfile
@@ -432,7 +432,7 @@ module Bundler
432
432
  end
433
433
 
434
434
  def find_bundler(version)
435
- find_name("bundler").find {|s| s.version.to_s == version }
435
+ find_name("bundler").find {|s| s.version.to_s == version.to_s }
436
436
  end
437
437
 
438
438
  def find_name(name)
@@ -174,7 +174,14 @@ module Bundler
174
174
  spec_cache_paths = []
175
175
  spec_gemspec_paths = []
176
176
  spec_extension_paths = []
177
- Bundler.rubygems.add_default_gems_to(specs).values.each do |spec|
177
+ specs_to_keep = Bundler.rubygems.add_default_gems_to(specs).values
178
+
179
+ current_bundler = Bundler.rubygems.find_bundler(Bundler.gem_version)
180
+ if current_bundler
181
+ specs_to_keep << current_bundler
182
+ end
183
+
184
+ specs_to_keep.each do |spec|
178
185
  spec_gem_paths << spec.full_gem_path
179
186
  # need to check here in case gems are nested like for the rails git repo
180
187
  md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "4.0.3".freeze
4
+ VERSION = "4.0.4".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko