bundler 2.6.5 → 2.6.7

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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -6
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/checksum.rb +22 -12
  5. data/lib/bundler/cli/doctor.rb +14 -14
  6. data/lib/bundler/cli/inject.rb +2 -2
  7. data/lib/bundler/cli/lock.rb +2 -1
  8. data/lib/bundler/compact_index_client/cache.rb +1 -1
  9. data/lib/bundler/compact_index_client/parser.rb +1 -1
  10. data/lib/bundler/compact_index_client/updater.rb +2 -1
  11. data/lib/bundler/definition.rb +108 -91
  12. data/lib/bundler/dsl.rb +2 -3
  13. data/lib/bundler/errors.rb +18 -0
  14. data/lib/bundler/injector.rb +9 -9
  15. data/lib/bundler/lazy_specification.rb +9 -1
  16. data/lib/bundler/lockfile_parser.rb +8 -5
  17. data/lib/bundler/man/bundle-add.1 +1 -1
  18. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  19. data/lib/bundler/man/bundle-cache.1 +1 -1
  20. data/lib/bundler/man/bundle-check.1 +1 -1
  21. data/lib/bundler/man/bundle-clean.1 +1 -1
  22. data/lib/bundler/man/bundle-config.1 +6 -6
  23. data/lib/bundler/man/bundle-config.1.ronn +9 -4
  24. data/lib/bundler/man/bundle-console.1 +1 -1
  25. data/lib/bundler/man/bundle-doctor.1 +1 -1
  26. data/lib/bundler/man/bundle-env.1 +1 -1
  27. data/lib/bundler/man/bundle-exec.1 +3 -3
  28. data/lib/bundler/man/bundle-exec.1.ronn +2 -2
  29. data/lib/bundler/man/bundle-fund.1 +1 -1
  30. data/lib/bundler/man/bundle-gem.1 +1 -1
  31. data/lib/bundler/man/bundle-help.1 +1 -1
  32. data/lib/bundler/man/bundle-info.1 +1 -1
  33. data/lib/bundler/man/bundle-init.1 +1 -1
  34. data/lib/bundler/man/bundle-inject.1 +1 -1
  35. data/lib/bundler/man/bundle-install.1 +1 -1
  36. data/lib/bundler/man/bundle-issue.1 +1 -1
  37. data/lib/bundler/man/bundle-licenses.1 +1 -1
  38. data/lib/bundler/man/bundle-list.1 +1 -1
  39. data/lib/bundler/man/bundle-lock.1 +1 -1
  40. data/lib/bundler/man/bundle-open.1 +1 -1
  41. data/lib/bundler/man/bundle-outdated.1 +1 -1
  42. data/lib/bundler/man/bundle-platform.1 +1 -1
  43. data/lib/bundler/man/bundle-plugin.1 +1 -1
  44. data/lib/bundler/man/bundle-pristine.1 +1 -1
  45. data/lib/bundler/man/bundle-remove.1 +1 -1
  46. data/lib/bundler/man/bundle-show.1 +1 -1
  47. data/lib/bundler/man/bundle-update.1 +1 -1
  48. data/lib/bundler/man/bundle-version.1 +1 -1
  49. data/lib/bundler/man/bundle-viz.1 +1 -1
  50. data/lib/bundler/man/bundle.1 +1 -1
  51. data/lib/bundler/man/gemfile.5 +1 -1
  52. data/lib/bundler/plugin/api/source.rb +1 -1
  53. data/lib/bundler/plugin/index.rb +1 -1
  54. data/lib/bundler/plugin/installer/path.rb +8 -0
  55. data/lib/bundler/plugin.rb +1 -1
  56. data/lib/bundler/resolver/candidate.rb +12 -9
  57. data/lib/bundler/resolver/strategy.rb +40 -0
  58. data/lib/bundler/resolver.rb +11 -22
  59. data/lib/bundler/rubygems_ext.rb +15 -0
  60. data/lib/bundler/runtime.rb +8 -5
  61. data/lib/bundler/shared_helpers.rb +4 -0
  62. data/lib/bundler/source/gemspec.rb +1 -4
  63. data/lib/bundler/source/git/git_proxy.rb +14 -3
  64. data/lib/bundler/source/git.rb +5 -1
  65. data/lib/bundler/source/path.rb +2 -2
  66. data/lib/bundler/source/rubygems/remote.rb +11 -3
  67. data/lib/bundler/source_list.rb +29 -11
  68. data/lib/bundler/spec_set.rb +11 -4
  69. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
  70. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  71. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
  72. data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
  73. data/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  74. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
  75. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
  76. data/lib/bundler/vendor/uri/lib/uri/common.rb +7 -3
  77. data/lib/bundler/vendor/uri/lib/uri/generic.rb +12 -11
  78. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +6 -6
  79. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  80. data/lib/bundler/version.rb +1 -1
  81. metadata +5 -4
  82. data/lib/bundler/compact_index_client/gem_parser.rb +0 -32
@@ -173,39 +173,57 @@ module Bundler
173
173
 
174
174
  def map_sources(replacement_sources)
175
175
  rubygems = @rubygems_sources.map do |source|
176
- replace_rubygems_source(replacement_sources, source) || source
176
+ replace_rubygems_source(replacement_sources, source)
177
177
  end
178
178
 
179
179
  git, plugin = [@git_sources, @plugin_sources].map do |sources|
180
180
  sources.map do |source|
181
- replacement_sources.find {|s| s == source } || source
181
+ replace_source(replacement_sources, source)
182
182
  end
183
183
  end
184
184
 
185
185
  path = @path_sources.map do |source|
186
- replacement_sources.find {|s| s == (source.is_a?(Source::Gemspec) ? source.as_path_source : source) } || source
186
+ replace_path_source(replacement_sources, source)
187
187
  end
188
188
 
189
189
  [rubygems, path, git, plugin]
190
190
  end
191
191
 
192
192
  def global_replacement_source(replacement_sources)
193
- replacement_source = replace_rubygems_source(replacement_sources, global_rubygems_source)
194
- return global_rubygems_source unless replacement_source
195
-
196
- replacement_source.local!
197
- replacement_source
193
+ replace_rubygems_source(replacement_sources, global_rubygems_source, &:local!)
198
194
  end
199
195
 
200
196
  def replace_rubygems_source(replacement_sources, gemfile_source)
197
+ replace_source(replacement_sources, gemfile_source) do |replacement_source|
198
+ # locked sources never include credentials so always prefer remotes from the gemfile
199
+ replacement_source.remotes = gemfile_source.remotes
200
+
201
+ yield replacement_source if block_given?
202
+
203
+ replacement_source
204
+ end
205
+ end
206
+
207
+ def replace_source(replacement_sources, gemfile_source)
201
208
  replacement_source = replacement_sources.find {|s| s == gemfile_source }
202
- return unless replacement_source
209
+ return gemfile_source unless replacement_source
210
+
211
+ replacement_source = yield(replacement_source) if block_given?
203
212
 
204
- # locked sources never include credentials so always prefer remotes from the gemfile
205
- replacement_source.remotes = gemfile_source.remotes
206
213
  replacement_source
207
214
  end
208
215
 
216
+ def replace_path_source(replacement_sources, gemfile_source)
217
+ replace_source(replacement_sources, gemfile_source) do |replacement_source|
218
+ if gemfile_source.is_a?(Source::Gemspec)
219
+ gemfile_source.checksum_store = replacement_source.checksum_store
220
+ gemfile_source
221
+ else
222
+ replacement_source
223
+ end
224
+ end
225
+ end
226
+
209
227
  def different_sources?(lock_sources, replacement_sources)
210
228
  !equivalent_sources?(lock_sources, replacement_sources)
211
229
  end
@@ -47,8 +47,17 @@ module Bundler
47
47
  end.uniq
48
48
  end
49
49
 
50
+ def add_originally_invalid_platforms!(platforms, originally_invalid_platforms)
51
+ originally_invalid_platforms.each do |originally_invalid_platform|
52
+ platforms << originally_invalid_platform if complete_platform(originally_invalid_platform)
53
+ end
54
+ end
55
+
50
56
  def add_extra_platforms!(platforms)
51
- return platforms.concat([Gem::Platform::RUBY]).uniq if @specs.empty?
57
+ if @specs.empty?
58
+ platforms.concat([Gem::Platform::RUBY]).uniq
59
+ return
60
+ end
52
61
 
53
62
  new_platforms = all_platforms.select do |platform|
54
63
  next if platforms.include?(platform)
@@ -56,14 +65,12 @@ module Bundler
56
65
 
57
66
  complete_platform(platform)
58
67
  end
59
- return platforms if new_platforms.empty?
68
+ return if new_platforms.empty?
60
69
 
61
70
  platforms.concat(new_platforms)
62
71
 
63
72
  less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
64
73
  platforms.delete(Bundler.local_platform) if less_specific_platform
65
-
66
- platforms
67
74
  end
68
75
 
69
76
  def validate_deps(s)
@@ -41,6 +41,7 @@ class Bundler::ConnectionPool::TimedStack
41
41
  def push(obj, options = {})
42
42
  @mutex.synchronize do
43
43
  if @shutdown_block
44
+ @created -= 1 unless @created == 0
44
45
  @shutdown_block.call(obj)
45
46
  else
46
47
  store_connection obj, options
@@ -98,6 +99,26 @@ class Bundler::ConnectionPool::TimedStack
98
99
  end
99
100
  end
100
101
 
102
+ ##
103
+ # Reaps connections that were checked in more than +idle_seconds+ ago.
104
+ def reap(idle_seconds, &block)
105
+ raise ArgumentError, "reap must receive a block" unless block
106
+ raise ArgumentError, "idle_seconds must be a number" unless idle_seconds.is_a?(Numeric)
107
+ raise Bundler::ConnectionPool::PoolShuttingDownError if @shutdown_block
108
+
109
+ idle.times do
110
+ conn =
111
+ @mutex.synchronize do
112
+ raise Bundler::ConnectionPool::PoolShuttingDownError if @shutdown_block
113
+
114
+ reserve_idle_connection(idle_seconds)
115
+ end
116
+ break unless conn
117
+
118
+ block.call(conn)
119
+ end
120
+ end
121
+
101
122
  ##
102
123
  # Returns +true+ if there are no available connections.
103
124
 
@@ -112,6 +133,12 @@ class Bundler::ConnectionPool::TimedStack
112
133
  @max - @created + @que.length
113
134
  end
114
135
 
136
+ ##
137
+ # The number of connections created and available on the stack.
138
+ def idle
139
+ @que.length
140
+ end
141
+
115
142
  private
116
143
 
117
144
  def current_time
@@ -133,7 +160,7 @@ class Bundler::ConnectionPool::TimedStack
133
160
  # This method must return a connection from the stack.
134
161
 
135
162
  def fetch_connection(options = nil)
136
- @que.pop
163
+ @que.pop&.first
137
164
  end
138
165
 
139
166
  ##
@@ -144,9 +171,32 @@ class Bundler::ConnectionPool::TimedStack
144
171
  def shutdown_connections(options = nil)
145
172
  while connection_stored?(options)
146
173
  conn = fetch_connection(options)
174
+ @created -= 1 unless @created == 0
147
175
  @shutdown_block.call(conn)
148
176
  end
149
- @created = 0
177
+ end
178
+
179
+ ##
180
+ # This is an extension point for TimedStack and is called with a mutex.
181
+ #
182
+ # This method returns the oldest idle connection if it has been idle for more than idle_seconds.
183
+ # This requires that the stack is kept in order of checked in time (oldest first).
184
+
185
+ def reserve_idle_connection(idle_seconds)
186
+ return unless idle_connections?(idle_seconds)
187
+
188
+ @created -= 1 unless @created == 0
189
+
190
+ @que.shift.first
191
+ end
192
+
193
+ ##
194
+ # This is an extension point for TimedStack and is called with a mutex.
195
+ #
196
+ # Returns true if the first connection in the stack has been idle for more than idle_seconds
197
+
198
+ def idle_connections?(idle_seconds)
199
+ connection_stored? && (current_time - @que.first.last > idle_seconds)
150
200
  end
151
201
 
152
202
  ##
@@ -155,7 +205,7 @@ class Bundler::ConnectionPool::TimedStack
155
205
  # This method must return +obj+ to the stack.
156
206
 
157
207
  def store_connection(obj, options = nil)
158
- @que.push obj
208
+ @que.push [obj, current_time]
159
209
  end
160
210
 
161
211
  ##
@@ -1,3 +1,3 @@
1
1
  class Bundler::ConnectionPool
2
- VERSION = "2.4.1"
2
+ VERSION = "2.5.0"
3
3
  end
@@ -160,6 +160,12 @@ class Bundler::ConnectionPool
160
160
  @available.shutdown(reload: true, &block)
161
161
  end
162
162
 
163
+ ## Reaps idle connections that have been idle for over +idle_seconds+.
164
+ # +idle_seconds+ defaults to 60.
165
+ def reap(idle_seconds = 60, &block)
166
+ @available.reap(idle_seconds, &block)
167
+ end
168
+
163
169
  # Size of this connection pool
164
170
  attr_reader :size
165
171
  # Automatically drop all connections after fork
@@ -169,6 +175,11 @@ class Bundler::ConnectionPool
169
175
  def available
170
176
  @available.length
171
177
  end
178
+
179
+ # Number of pool entries created and idle in the pool.
180
+ def idle
181
+ @available.idle
182
+ end
172
183
  end
173
184
 
174
185
  require_relative "connection_pool/timed_stack"
@@ -79,29 +79,17 @@ module Bundler::PubGrub
79
79
  dependencies_for(@root_package, @root_version)
80
80
  end
81
81
 
82
- # Override me (maybe)
83
- #
84
- # If not overridden, the order returned by all_versions_for will be used
85
- #
86
- # Returns: Array of versions in preferred order
87
- def sort_versions_by_preferred(package, sorted_versions)
88
- indexes = @version_indexes[package]
89
- sorted_versions.sort_by { |version| indexes[version] }
90
- end
91
-
92
82
  def initialize
93
83
  @root_package = Package.root
94
84
  @root_version = Package.root_version
95
85
 
96
- @cached_versions = Hash.new do |h,k|
86
+ @sorted_versions = Hash.new do |h,k|
97
87
  if k == @root_package
98
88
  h[k] = [@root_version]
99
89
  else
100
- h[k] = all_versions_for(k)
90
+ h[k] = all_versions_for(k).sort
101
91
  end
102
92
  end
103
- @sorted_versions = Hash.new { |h,k| h[k] = @cached_versions[k].sort }
104
- @version_indexes = Hash.new { |h,k| h[k] = @cached_versions[k].each.with_index.to_h }
105
93
 
106
94
  @cached_dependencies = Hash.new do |packages, package|
107
95
  if package == @root_package
@@ -117,15 +105,7 @@ module Bundler::PubGrub
117
105
  end
118
106
 
119
107
  def versions_for(package, range=VersionRange.any)
120
- versions = range.select_versions(@sorted_versions[package])
121
-
122
- # Conditional avoids (among other things) calling
123
- # sort_versions_by_preferred with the root package
124
- if versions.size > 1
125
- sort_versions_by_preferred(package, versions)
126
- else
127
- versions
128
- end
108
+ range.select_versions(@sorted_versions[package])
129
109
  end
130
110
 
131
111
  def no_versions_incompatibility_for(_package, unsatisfied_term)
@@ -164,7 +144,7 @@ module Bundler::PubGrub
164
144
  sorted_versions[high]
165
145
  end
166
146
 
167
- range = VersionRange.new(min: low, max: high, include_min: true)
147
+ range = VersionRange.new(min: low, max: high, include_min: !low.nil?)
168
148
 
169
149
  self_constraint = VersionConstraint.new(package, range: range)
170
150
 
@@ -0,0 +1,42 @@
1
+ module Bundler::PubGrub
2
+ class Strategy
3
+ def initialize(source)
4
+ @source = source
5
+
6
+ @root_package = Package.root
7
+ @root_version = Package.root_version
8
+
9
+ @version_indexes = Hash.new do |h,k|
10
+ if k == @root_package
11
+ h[k] = { @root_version => 0 }
12
+ else
13
+ h[k] = @source.all_versions_for(k).each.with_index.to_h
14
+ end
15
+ end
16
+ end
17
+
18
+ def next_package_and_version(unsatisfied)
19
+ package, range = next_term_to_try_from(unsatisfied)
20
+
21
+ [package, most_preferred_version_of(package, range)]
22
+ end
23
+
24
+ private
25
+
26
+ def most_preferred_version_of(package, range)
27
+ versions = @source.versions_for(package, range)
28
+
29
+ indexes = @version_indexes[package]
30
+ versions.min_by { |version| indexes[version] }
31
+ end
32
+
33
+ def next_term_to_try_from(unsatisfied)
34
+ unsatisfied.min_by do |package, range|
35
+ matching_versions = @source.versions_for(package, range)
36
+ higher_versions = @source.versions_for(package, range.upper_invert)
37
+
38
+ [matching_versions.count <= 1 ? 0 : 1, higher_versions.count]
39
+ end
40
+ end
41
+ end
42
+ end
@@ -76,6 +76,9 @@ module Bundler::PubGrub
76
76
  end
77
77
 
78
78
  def initialize(min: nil, max: nil, include_min: false, include_max: false, name: nil)
79
+ raise ArgumentError, "Ranges without a lower bound cannot have include_min == true" if !min && include_min == true
80
+ raise ArgumentError, "Ranges without an upper bound cannot have include_max == true" if !max && include_max == true
81
+
79
82
  @min = min
80
83
  @max = max
81
84
  @include_min = include_min
@@ -311,10 +314,19 @@ module Bundler::PubGrub
311
314
 
312
315
  def contiguous_to?(other)
313
316
  return false if other.empty?
317
+ return true if any?
318
+
319
+ intersects?(other) || contiguous_below?(other) || contiguous_above?(other)
320
+ end
321
+
322
+ def contiguous_below?(other)
323
+ return false if !max || !other.min
324
+
325
+ max == other.min && (include_max || other.include_min)
326
+ end
314
327
 
315
- intersects?(other) ||
316
- (min == other.max && (include_min || other.include_max)) ||
317
- (max == other.min && (include_max || other.include_min))
328
+ def contiguous_above?(other)
329
+ other.contiguous_below?(self)
318
330
  end
319
331
 
320
332
  def allows_all?(other)
@@ -375,15 +387,15 @@ module Bundler::PubGrub
375
387
  def invert
376
388
  return self.class.empty if any?
377
389
 
378
- low = VersionRange.new(max: min, include_max: !include_min)
379
- high = VersionRange.new(min: max, include_min: !include_max)
390
+ low = -> { VersionRange.new(max: min, include_max: !include_min) }
391
+ high = -> { VersionRange.new(min: max, include_min: !include_max) }
380
392
 
381
393
  if !min
382
- high
394
+ high.call
383
395
  elsif !max
384
- low
396
+ low.call
385
397
  else
386
- low.union(high)
398
+ low.call.union(high.call)
387
399
  end
388
400
  end
389
401
 
@@ -2,17 +2,20 @@ require_relative 'partial_solution'
2
2
  require_relative 'term'
3
3
  require_relative 'incompatibility'
4
4
  require_relative 'solve_failure'
5
+ require_relative 'strategy'
5
6
 
6
7
  module Bundler::PubGrub
7
8
  class VersionSolver
8
9
  attr_reader :logger
9
10
  attr_reader :source
10
11
  attr_reader :solution
12
+ attr_reader :strategy
11
13
 
12
- def initialize(source:, root: Package.root, logger: Bundler::PubGrub.logger)
14
+ def initialize(source:, root: Package.root, strategy: Strategy.new(source), logger: Bundler::PubGrub.logger)
13
15
  @logger = logger
14
16
 
15
17
  @source = source
18
+ @strategy = strategy
16
19
 
17
20
  # { package => [incompatibility, ...]}
18
21
  @incompatibilities = Hash.new do |h, k|
@@ -36,26 +39,25 @@ module Bundler::PubGrub
36
39
 
37
40
  # Returns true if there is more work to be done, false otherwise
38
41
  def work
39
- return false if solved?
40
-
41
- next_package = choose_package_version
42
- propagate(next_package)
43
-
44
- if solved?
42
+ unsatisfied_terms = solution.unsatisfied
43
+ if unsatisfied_terms.empty?
45
44
  logger.info { "Solution found after #{solution.attempted_solutions} attempts:" }
46
45
  solution.decisions.each do |package, version|
47
46
  next if Package.root?(package)
48
47
  logger.info { "* #{package} #{version}" }
49
48
  end
50
49
 
51
- false
52
- else
53
- true
50
+ return false
54
51
  end
52
+
53
+ next_package = choose_package_version_from(unsatisfied_terms)
54
+ propagate(next_package)
55
+
56
+ true
55
57
  end
56
58
 
57
59
  def solve
58
- work until solved?
60
+ while work; end
59
61
 
60
62
  solution.decisions
61
63
  end
@@ -105,29 +107,15 @@ module Bundler::PubGrub
105
107
  unsatisfied.package
106
108
  end
107
109
 
108
- def next_package_to_try
109
- solution.unsatisfied.min_by do |term|
110
- package = term.package
111
- range = term.constraint.range
112
- matching_versions = source.versions_for(package, range)
113
- higher_versions = source.versions_for(package, range.upper_invert)
110
+ def choose_package_version_from(unsatisfied_terms)
111
+ remaining = unsatisfied_terms.map { |t| [t.package, t.constraint.range] }.to_h
114
112
 
115
- [matching_versions.count <= 1 ? 0 : 1, higher_versions.count]
116
- end.package
117
- end
118
-
119
- def choose_package_version
120
- if solution.unsatisfied.empty?
121
- logger.info "No packages unsatisfied. Solving complete!"
122
- return nil
123
- end
113
+ package, version = strategy.next_package_and_version(remaining)
124
114
 
125
- package = next_package_to_try
126
- unsatisfied_term = solution.unsatisfied.find { |t| t.package == package }
127
- version = source.versions_for(package, unsatisfied_term.constraint.range).first
128
115
  logger.debug { "attempting #{package} #{version}" }
129
116
 
130
117
  if version.nil?
118
+ unsatisfied_term = unsatisfied_terms.find { |t| t.package == package }
131
119
  add_incompatibility source.no_versions_incompatibility_for(package, unsatisfied_term)
132
120
  return package
133
121
  end
@@ -13,15 +13,19 @@ require_relative "rfc2396_parser"
13
13
  require_relative "rfc3986_parser"
14
14
 
15
15
  module Bundler::URI
16
+ # The default parser instance for RFC 2396.
16
17
  RFC2396_PARSER = RFC2396_Parser.new
17
18
  Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
18
19
 
20
+ # The default parser instance for RFC 3986.
19
21
  RFC3986_PARSER = RFC3986_Parser.new
20
22
  Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
21
23
 
24
+ # The default parser instance.
22
25
  DEFAULT_PARSER = RFC3986_PARSER
23
26
  Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
24
27
 
28
+ # Set the default parser instance.
25
29
  def self.parser=(parser = RFC3986_PARSER)
26
30
  remove_const(:Parser) if defined?(::Bundler::URI::Parser)
27
31
  const_set("Parser", parser.class)
@@ -40,7 +44,7 @@ module Bundler::URI
40
44
  end
41
45
  self.parser = RFC3986_PARSER
42
46
 
43
- def self.const_missing(const)
47
+ def self.const_missing(const) # :nodoc:
44
48
  if const == :REGEXP
45
49
  warn "Bundler::URI::REGEXP is obsolete. Use Bundler::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
46
50
  Bundler::URI::RFC2396_REGEXP
@@ -87,7 +91,7 @@ module Bundler::URI
87
91
  module_function :make_components_hash
88
92
  end
89
93
 
90
- module Schemes
94
+ module Schemes # :nodoc:
91
95
  end
92
96
  private_constant :Schemes
93
97
 
@@ -305,7 +309,7 @@ module Bundler::URI
305
309
  256.times do |i|
306
310
  TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
307
311
  end
308
- TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
312
+ TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
309
313
  TBLENCWWWCOMP_[' '] = '+'
310
314
  TBLENCWWWCOMP_.freeze
311
315
  TBLDECWWWCOMP_ = {} # :nodoc:
@@ -737,12 +737,12 @@ module Bundler::URI
737
737
  end
738
738
  private :check_registry
739
739
 
740
- def set_registry(v) #:nodoc:
740
+ def set_registry(v) # :nodoc:
741
741
  raise InvalidURIError, "cannot set registry"
742
742
  end
743
743
  protected :set_registry
744
744
 
745
- def registry=(v)
745
+ def registry=(v) # :nodoc:
746
746
  raise InvalidURIError, "cannot set registry"
747
747
  end
748
748
 
@@ -1133,17 +1133,16 @@ module Bundler::URI
1133
1133
  base.fragment=(nil)
1134
1134
 
1135
1135
  # RFC2396, Section 5.2, 4)
1136
- if !authority
1137
- base.set_path(merge_path(base.path, rel.path)) if base.path && rel.path
1138
- else
1139
- # RFC2396, Section 5.2, 4)
1140
- base.set_path(rel.path) if rel.path
1136
+ if authority
1137
+ base.set_userinfo(rel.userinfo)
1138
+ base.set_host(rel.host)
1139
+ base.set_port(rel.port || base.default_port)
1140
+ base.set_path(rel.path)
1141
+ elsif base.path && rel.path
1142
+ base.set_path(merge_path(base.path, rel.path))
1141
1143
  end
1142
1144
 
1143
1145
  # RFC2396, Section 5.2, 7)
1144
- base.set_userinfo(rel.userinfo) if rel.userinfo
1145
- base.set_host(rel.host) if rel.host
1146
- base.set_port(rel.port) if rel.port
1147
1146
  base.query = rel.query if rel.query
1148
1147
  base.fragment=(rel.fragment) if rel.fragment
1149
1148
 
@@ -1392,10 +1391,12 @@ module Bundler::URI
1392
1391
  end
1393
1392
  end
1394
1393
 
1394
+ # Returns the hash value.
1395
1395
  def hash
1396
1396
  self.component_ary.hash
1397
1397
  end
1398
1398
 
1399
+ # Compares with _oth_ for Hash.
1399
1400
  def eql?(oth)
1400
1401
  self.class == oth.class &&
1401
1402
  parser == oth.parser &&
@@ -1438,7 +1439,7 @@ module Bundler::URI
1438
1439
  end
1439
1440
  end
1440
1441
 
1441
- def inspect
1442
+ def inspect # :nodoc:
1442
1443
  "#<#{self.class} #{self}>"
1443
1444
  end
1444
1445
 
@@ -321,14 +321,14 @@ module Bundler::URI
321
321
  str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
322
322
  end
323
323
 
324
- @@to_s = Kernel.instance_method(:to_s)
325
- if @@to_s.respond_to?(:bind_call)
326
- def inspect
327
- @@to_s.bind_call(self)
324
+ TO_S = Kernel.instance_method(:to_s) # :nodoc:
325
+ if TO_S.respond_to?(:bind_call)
326
+ def inspect # :nodoc:
327
+ TO_S.bind_call(self)
328
328
  end
329
329
  else
330
- def inspect
331
- @@to_s.bind(self).call
330
+ def inspect # :nodoc:
331
+ TO_S.bind(self).call
332
332
  end
333
333
  end
334
334
 
@@ -1,6 +1,6 @@
1
1
  module Bundler::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '010002'.freeze
3
+ VERSION_CODE = '010003'.freeze
4
4
  VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
5
5
  # :startdoc:
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.6.5".freeze
4
+ VERSION = "2.6.7".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
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: 2.6.5
4
+ version: 2.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -21,7 +21,7 @@ authors:
21
21
  - Yehuda Katz
22
22
  bindir: exe
23
23
  cert_chain: []
24
- date: 2025-02-20 00:00:00.000000000 Z
24
+ date: 1980-01-02 00:00:00.000000000 Z
25
25
  dependencies: []
26
26
  description: Bundler manages an application's dependencies through its entire life,
27
27
  across many machines, systematically and repeatably
@@ -77,7 +77,6 @@ files:
77
77
  - lib/bundler/compact_index_client.rb
78
78
  - lib/bundler/compact_index_client/cache.rb
79
79
  - lib/bundler/compact_index_client/cache_file.rb
80
- - lib/bundler/compact_index_client/gem_parser.rb
81
80
  - lib/bundler/compact_index_client/parser.rb
82
81
  - lib/bundler/compact_index_client/updater.rb
83
82
  - lib/bundler/constants.rb
@@ -210,6 +209,7 @@ files:
210
209
  - lib/bundler/resolver/package.rb
211
210
  - lib/bundler/resolver/root.rb
212
211
  - lib/bundler/resolver/spec_group.rb
212
+ - lib/bundler/resolver/strategy.rb
213
213
  - lib/bundler/retry.rb
214
214
  - lib/bundler/ruby_dsl.rb
215
215
  - lib/bundler/ruby_version.rb
@@ -310,6 +310,7 @@ files:
310
310
  - lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb
311
311
  - lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb
312
312
  - lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb
313
+ - lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb
313
314
  - lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb
314
315
  - lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb
315
316
  - lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb
@@ -411,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
411
412
  - !ruby/object:Gem::Version
412
413
  version: 3.3.3
413
414
  requirements: []
414
- rubygems_version: 3.6.5
415
+ rubygems_version: 3.6.7
415
416
  specification_version: 4
416
417
  summary: The best way to manage your application's dependencies
417
418
  test_files: []