bundler 2.3.18 → 2.3.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli/common.rb +1 -0
  5. data/lib/bundler/definition.rb +31 -12
  6. data/lib/bundler/dsl.rb +2 -2
  7. data/lib/bundler/incomplete_specification.rb +12 -0
  8. data/lib/bundler/index.rb +10 -12
  9. data/lib/bundler/lazy_specification.rb +15 -6
  10. data/lib/bundler/man/bundle-add.1 +1 -1
  11. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  12. data/lib/bundler/man/bundle-cache.1 +1 -1
  13. data/lib/bundler/man/bundle-check.1 +1 -1
  14. data/lib/bundler/man/bundle-clean.1 +1 -1
  15. data/lib/bundler/man/bundle-config.1 +13 -3
  16. data/lib/bundler/man/bundle-config.1.ronn +9 -2
  17. data/lib/bundler/man/bundle-doctor.1 +1 -1
  18. data/lib/bundler/man/bundle-exec.1 +2 -2
  19. data/lib/bundler/man/bundle-exec.1.ronn +1 -1
  20. data/lib/bundler/man/bundle-gem.1 +1 -1
  21. data/lib/bundler/man/bundle-info.1 +1 -1
  22. data/lib/bundler/man/bundle-init.1 +1 -1
  23. data/lib/bundler/man/bundle-inject.1 +5 -2
  24. data/lib/bundler/man/bundle-inject.1.ronn +3 -1
  25. data/lib/bundler/man/bundle-install.1 +1 -1
  26. data/lib/bundler/man/bundle-list.1 +1 -1
  27. data/lib/bundler/man/bundle-lock.1 +1 -1
  28. data/lib/bundler/man/bundle-open.1 +1 -1
  29. data/lib/bundler/man/bundle-outdated.1 +1 -1
  30. data/lib/bundler/man/bundle-platform.1 +1 -1
  31. data/lib/bundler/man/bundle-pristine.1 +1 -1
  32. data/lib/bundler/man/bundle-remove.1 +1 -1
  33. data/lib/bundler/man/bundle-show.1 +1 -1
  34. data/lib/bundler/man/bundle-update.1 +1 -1
  35. data/lib/bundler/man/bundle-viz.1 +4 -1
  36. data/lib/bundler/man/bundle-viz.1.ronn +2 -0
  37. data/lib/bundler/man/bundle.1 +3 -3
  38. data/lib/bundler/man/bundle.1.ronn +2 -2
  39. data/lib/bundler/man/gemfile.5 +16 -10
  40. data/lib/bundler/man/gemfile.5.ronn +23 -16
  41. data/lib/bundler/remote_specification.rb +5 -4
  42. data/lib/bundler/resolver.rb +5 -6
  43. data/lib/bundler/rubygems_gem_installer.rb +19 -12
  44. data/lib/bundler/settings.rb +1 -0
  45. data/lib/bundler/spec_set.rb +29 -21
  46. data/lib/bundler/version.rb +1 -1
  47. data/lib/bundler.rb +1 -0
  48. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 677949dc949f82b847c011ee0a401b180743c294d2ea7cc62d1d969483289a59
4
- data.tar.gz: 4ad73bf323c1b3fe9370af0b853992249126ce54624fb97ea5e454f15dbb1e3f
3
+ metadata.gz: 3a381dcda0446bc5d93d2a6c1b16dcb28c53b151df2a3e9a9ed656f9e35bea2e
4
+ data.tar.gz: dd05bd4717edec09127afc27ff6f62473353a17b51df25feb3a7e637e86eb6a7
5
5
  SHA512:
6
- metadata.gz: 83b95a19fc8a0077e2660776321547d1b33a83fde01a60819d624b1a5df19e825cd6173d07f595b050f4b6686d82587a886bd5c1f88629b77538d24df65e09d3
7
- data.tar.gz: c29b1d158826b44d561a3dc3484f4a498bbfb9dd2d764160cbb16e5d84e78d7ef3098ce4b67a275f3d5622f94f0739cdf8f599d2e1bb17a20cc88137f82fa190
6
+ metadata.gz: 8dd22b1e85f5d0b785467676913165987430edced38c5683a6bc4c782180e74f383807fc784b4db8fcfbb28d0e9b685312395319776fb1db3a873420dbad17ee
7
+ data.tar.gz: dbf44b39dbafd1699ece2f9a0d656bc6a5ddd3070ca8884db61548701afa3ee57c1ef3ab639f724f721ee195e1ede80e9323c6d52fe3041457faca89aed682b0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ # 2.3.19 (July 27, 2022)
2
+
3
+ ## Enhancements:
4
+
5
+ - Add `Bundler.settings[:only]` to install gems of the specified groups [#5759](https://github.com/rubygems/rubygems/pull/5759)
6
+ - Add `ignore_funding_requests` config flag [#5767](https://github.com/rubygems/rubygems/pull/5767)
7
+ - Prevent random crash when autoloading `Pathname` [#5769](https://github.com/rubygems/rubygems/pull/5769)
8
+ - Don't corrupt lockfile when user moves a gem that's already in the lockfile to an incorrect source by mistake [#5070](https://github.com/rubygems/rubygems/pull/5070)
9
+ - Reconcile error/warning message for multiple global sources with documentation [#5741](https://github.com/rubygems/rubygems/pull/5741)
10
+ - Improve error message when gems cannot be found to include the source for each gem [#5729](https://github.com/rubygems/rubygems/pull/5729)
11
+
12
+ ## Bug fixes:
13
+
14
+ - Fix yet another TruffleRuby platform selection regression [#5746](https://github.com/rubygems/rubygems/pull/5746)
15
+ - Show a proper error if extension dir is not writable [#5726](https://github.com/rubygems/rubygems/pull/5726)
16
+
17
+ ## Performance:
18
+
19
+ - Lazily check incomplete lockfile to improve performance [#5546](https://github.com/rubygems/rubygems/pull/5546)
20
+
21
+ ## Documentation:
22
+
23
+ - Add deprecation notice of bundle inject [#5776](https://github.com/rubygems/rubygems/pull/5776)
24
+ - Add deprecation notice of `bundle viz` to man pages [#5765](https://github.com/rubygems/rubygems/pull/5765)
25
+ - Update command example in `bundle exec` man page [#5754](https://github.com/rubygems/rubygems/pull/5754)
26
+ - Remove bundle show from obsolete commands [#5753](https://github.com/rubygems/rubygems/pull/5753)
27
+ - Improve global source(s) documentation [#5732](https://github.com/rubygems/rubygems/pull/5732)
28
+ - Use https protocol for URLs for config mirror in bundler man [#5722](https://github.com/rubygems/rubygems/pull/5722)
29
+
1
30
  # 2.3.18 (July 14, 2022)
2
31
 
3
32
  ## 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 = "2022-07-14".freeze
8
- @git_commit_sha = "fc31b7f7d9".freeze
7
+ @built_at = "2022-07-27".freeze
8
+ @git_commit_sha = "4f496f93e6".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -15,6 +15,7 @@ module Bundler
15
15
  end
16
16
 
17
17
  def self.output_fund_metadata_summary
18
+ return if Bundler.settings["ignore_funding_requests"]
18
19
  definition = Bundler.definition
19
20
  current_dependencies = definition.requested_dependencies
20
21
  current_specs = definition.specs
@@ -138,13 +138,13 @@ module Bundler
138
138
  @unlock[:gems] ||= @dependencies.map(&:name)
139
139
  else
140
140
  eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
141
- @unlock[:gems] = @locked_specs.for(eager_unlock, false, false).map(&:name)
141
+ @unlock[:gems] = @locked_specs.for(eager_unlock, false, platforms).map(&:name)
142
142
  end
143
143
 
144
144
  @dependency_changes = converge_dependencies
145
145
  @local_changes = converge_locals
146
146
 
147
- @locked_specs_incomplete_for_platform = !@locked_specs.for(requested_dependencies & expand_dependencies(locked_dependencies), true, true)
147
+ @reresolve = nil
148
148
 
149
149
  @requires = compute_requires
150
150
  end
@@ -279,11 +279,8 @@ module Bundler
279
279
  end
280
280
  end
281
281
  else
282
- last_resolve = converge_locked_specs
283
- # Run a resolve against the locally available gems
284
282
  Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
285
- expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
286
- Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
283
+ @reresolve = reresolve
287
284
  end
288
285
  end
289
286
 
@@ -468,7 +465,7 @@ module Bundler
468
465
  private :sources
469
466
 
470
467
  def nothing_changed?
471
- !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@locked_specs_incomplete_for_platform
468
+ !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes
472
469
  end
473
470
 
474
471
  def unlocking?
@@ -477,8 +474,14 @@ module Bundler
477
474
 
478
475
  private
479
476
 
477
+ def reresolve
478
+ last_resolve = converge_locked_specs
479
+ expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
480
+ Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
481
+ end
482
+
480
483
  def filter_specs(specs, deps)
481
- SpecSet.new(specs).for(expand_dependencies(deps, true), false, false)
484
+ SpecSet.new(specs).for(expand_dependencies(deps, true), false, platforms)
482
485
  end
483
486
 
484
487
  def materialize(dependencies)
@@ -495,7 +498,22 @@ module Bundler
495
498
  "removed in order to install."
496
499
  end
497
500
 
498
- raise GemNotFound, "Could not find #{missing_specs.map(&:full_name).join(", ")} in any of the sources"
501
+ missing_specs_list = missing_specs.group_by(&:source).map do |source, missing_specs_for_source|
502
+ "#{missing_specs_for_source.map(&:full_name).join(", ")} in #{source}"
503
+ end
504
+
505
+ raise GemNotFound, "Could not find #{missing_specs_list.join(" nor ")}"
506
+ end
507
+
508
+ if @reresolve.nil?
509
+ incomplete_specs = specs.incomplete_specs
510
+
511
+ if incomplete_specs.any?
512
+ Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
513
+ @unlock[:gems].concat(incomplete_specs.map(&:name))
514
+ @resolve = reresolve
515
+ specs = resolve.materialize(dependencies)
516
+ end
499
517
  end
500
518
 
501
519
  unless specs["bundler"].any?
@@ -545,7 +563,6 @@ module Bundler
545
563
  [@new_platform, "you added a new platform to your gemfile"],
546
564
  [@path_changes, "the gemspecs for path gems changed"],
547
565
  [@local_changes, "the gemspecs for git local gems changed"],
548
- [@locked_specs_incomplete_for_platform, "the lockfile does not have all gems needed for the current platform"],
549
566
  ].select(&:first).map(&:last).join(", ")
550
567
  end
551
568
 
@@ -721,7 +738,7 @@ module Bundler
721
738
  # if we won't need the source (according to the lockfile),
722
739
  # don't error if the path/git source isn't available
723
740
  next if specs.
724
- for(requested_dependencies, false, true).
741
+ for(requested_dependencies, false).
725
742
  none? {|locked_spec| locked_spec.source == s.source }
726
743
 
727
744
  raise
@@ -789,7 +806,9 @@ module Bundler
789
806
  end
790
807
 
791
808
  def requested_groups
792
- groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
809
+ values = groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
810
+ values &= Bundler.settings[:only] unless Bundler.settings[:only].empty?
811
+ values
793
812
  end
794
813
 
795
814
  def lockfiles_equal?(current, proposed, preserve_unknown_sections)
data/lib/bundler/dsl.rb CHANGED
@@ -465,12 +465,12 @@ module Bundler
465
465
 
466
466
  def multiple_global_source_warning
467
467
  if Bundler.feature_flag.bundler_3_mode?
468
- msg = "This Gemfile contains multiple primary sources. " \
468
+ msg = "This Gemfile contains multiple global sources. " \
469
469
  "Each source after the first must include a block to indicate which gems " \
470
470
  "should come from that source"
471
471
  raise GemfileEvalError, msg
472
472
  else
473
- Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple primary sources. " \
473
+ Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple global sources. " \
474
474
  "Using `source` more than once without a block is a security risk, and " \
475
475
  "may result in installing unexpected gems. To resolve this warning, use " \
476
476
  "a block to indicate which gems should come from the secondary source."
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class IncompleteSpecification
5
+ attr_reader :name, :platform
6
+
7
+ def initialize(name, platform)
8
+ @name = name
9
+ @platform = platform
10
+ end
11
+ end
12
+ end
data/lib/bundler/index.rb CHANGED
@@ -56,17 +56,17 @@ module Bundler
56
56
 
57
57
  # Search this index's specs, and any source indexes that this index knows
58
58
  # about, returning all of the results.
59
- def search(query, base = nil)
60
- sort_specs(unsorted_search(query, base))
59
+ def search(query)
60
+ sort_specs(unsorted_search(query))
61
61
  end
62
62
 
63
- def unsorted_search(query, base)
64
- results = local_search(query, base)
63
+ def unsorted_search(query)
64
+ results = local_search(query)
65
65
 
66
66
  seen = results.map(&:full_name).uniq unless @sources.empty?
67
67
 
68
68
  @sources.each do |source|
69
- source.unsorted_search(query, base).each do |spec|
69
+ source.unsorted_search(query).each do |spec|
70
70
  next if seen.include?(spec.full_name)
71
71
 
72
72
  seen << spec.full_name
@@ -89,12 +89,12 @@ module Bundler
89
89
  self.class.sort_specs(specs)
90
90
  end
91
91
 
92
- def local_search(query, base = nil)
92
+ def local_search(query)
93
93
  case query
94
94
  when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
95
95
  when String then specs_by_name(query)
96
- when Gem::Dependency then search_by_dependency(query, base)
97
- when DepProxy then search_by_dependency(query.dep, base)
96
+ when Gem::Dependency then search_by_dependency(query)
97
+ when DepProxy then search_by_dependency(query.dep)
98
98
  else
99
99
  raise "You can't search for a #{query.inspect}."
100
100
  end
@@ -185,11 +185,9 @@ module Bundler
185
185
  @specs[name].values
186
186
  end
187
187
 
188
- def search_by_dependency(dependency, base = nil)
189
- @cache[base || false] ||= {}
190
- @cache[base || false][dependency] ||= begin
188
+ def search_by_dependency(dependency)
189
+ @cache[dependency] ||= begin
191
190
  specs = specs_by_name(dependency.name)
192
- specs += base if base
193
191
  found = specs.select do |spec|
194
192
  next true if spec.source.is_a?(Source::Gemspec)
195
193
  dependency.matches_spec?(spec)
@@ -19,7 +19,7 @@ module Bundler
19
19
  end
20
20
 
21
21
  def full_name
22
- if platform == Gem::Platform::RUBY || platform.nil?
22
+ if platform == Gem::Platform::RUBY
23
23
  "#{@name}-#{@version}"
24
24
  else
25
25
  "#{@name}-#{@version}-#{platform}"
@@ -61,7 +61,7 @@ module Bundler
61
61
  def to_lock
62
62
  out = String.new
63
63
 
64
- if platform == Gem::Platform::RUBY || platform.nil?
64
+ if platform == Gem::Platform::RUBY
65
65
  out << " #{name} (#{version})\n"
66
66
  else
67
67
  out << " #{name} (#{version}-#{platform})\n"
@@ -75,7 +75,17 @@ module Bundler
75
75
  out
76
76
  end
77
77
 
78
- def __materialize__
78
+ def materialize_for_installation
79
+ __materialize__(ruby_platform_materializes_to_ruby_platform? ? platform : Bundler.local_platform)
80
+ end
81
+
82
+ def materialize_for_resolution
83
+ return self unless Gem::Platform.match_spec?(self)
84
+
85
+ __materialize__(platform)
86
+ end
87
+
88
+ def __materialize__(platform)
79
89
  @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
80
90
  source.gemspec.tap {|s| s.source = source }
81
91
  else
@@ -84,10 +94,9 @@ module Bundler
84
94
  else
85
95
  ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
86
96
  end
87
- platform_object = ruby_platform_materializes_to_ruby_platform? ? Gem::Platform.new(platform) : Gem::Platform.local
88
97
  candidates = source.specs.search(search_object)
89
98
  same_platform_candidates = candidates.select do |spec|
90
- MatchPlatform.platforms_match?(spec.platform, platform_object)
99
+ MatchPlatform.platforms_match?(spec.platform, platform)
91
100
  end
92
101
  installable_candidates = same_platform_candidates.select do |spec|
93
102
  spec.is_a?(StubSpecification) ||
@@ -105,7 +114,7 @@ module Bundler
105
114
  end
106
115
 
107
116
  def to_s
108
- @__to_s ||= if platform == Gem::Platform::RUBY || platform.nil?
117
+ @__to_s ||= if platform == Gem::Platform::RUBY
109
118
  "#{name} (#{version})"
110
119
  else
111
120
  "#{name} (#{version}-#{platform})"
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -74,6 +74,10 @@ Creates a directory (defaults to \fB~/bin\fR) and place any executables from the
74
74
  In deployment mode, Bundler will \'roll\-out\' the bundle for \fBproduction\fR use\. Please check carefully if you want to have this option enabled in \fBdevelopment\fR or \fBtest\fR environments\.
75
75
  .
76
76
  .TP
77
+ \fBonly\fR
78
+ A space\-separated list of groups to install only gems of the specified groups\.
79
+ .
80
+ .TP
77
81
  \fBpath\fR
78
82
  The location to install the specified gems to\. This defaults to Rubygems\' setting\. Bundler shares this location with Rubygems, \fBgem install \.\.\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \.\.\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\.
79
83
  .
@@ -205,6 +209,9 @@ The following is a list of all configuration keys and their purpose\. You can le
205
209
  \fBglobal_gem_cache\fR (\fBBUNDLE_GLOBAL_GEM_CACHE\fR): Whether Bundler should cache all gems globally, rather than locally to the installing Ruby installation\.
206
210
  .
207
211
  .IP "\(bu" 4
212
+ \fBignore_funding_requests\fR (\fBBUNDLE_IGNORE_FUNDING_REQUESTS\fR): When set, no funding requests will be printed\.
213
+ .
214
+ .IP "\(bu" 4
208
215
  \fBignore_messages\fR (\fBBUNDLE_IGNORE_MESSAGES\fR): When set, no post install messages will be printed\. To silence a single gem, use dot notation like \fBignore_messages\.httparty true\fR\.
209
216
  .
210
217
  .IP "\(bu" 4
@@ -220,6 +227,9 @@ The following is a list of all configuration keys and their purpose\. You can le
220
227
  \fBno_prune\fR (\fBBUNDLE_NO_PRUNE\fR): Whether Bundler should leave outdated gems unpruned when caching\.
221
228
  .
222
229
  .IP "\(bu" 4
230
+ \fBonly\fR (\fBBUNDLE_ONLY\fR): A space\-separated list of groups to install only gems of the specified groups\.
231
+ .
232
+ .IP "\(bu" 4
223
233
  \fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. Defaults to \fBGem\.dir\fR\. When \-\-deployment is used, defaults to vendor/bundle\.
224
234
  .
225
235
  .IP "\(bu" 4
@@ -342,13 +352,13 @@ bundle config set \-\-global mirror\.SOURCE_URL MIRROR_URL
342
352
  .IP "" 0
343
353
  .
344
354
  .P
345
- For example, to use a mirror of rubygems\.org hosted at rubygems\-mirror\.org:
355
+ For example, to use a mirror of https://rubygems\.org hosted at https://example\.org:
346
356
  .
347
357
  .IP "" 4
348
358
  .
349
359
  .nf
350
360
 
351
- bundle config set \-\-global mirror\.http://rubygems\.org http://rubygems\-mirror\.org
361
+ bundle config set \-\-global mirror\.https://rubygems\.org https://example\.org
352
362
  .
353
363
  .fi
354
364
  .
@@ -74,6 +74,9 @@ The options that can be configured are:
74
74
  `production` use. Please check carefully if you want to have this option
75
75
  enabled in `development` or `test` environments.
76
76
 
77
+ * `only`:
78
+ A space-separated list of groups to install only gems of the specified groups.
79
+
77
80
  * `path`:
78
81
  The location to install the specified gems to. This defaults to Rubygems'
79
82
  setting. Bundler shares this location with Rubygems, `gem install ...` will
@@ -204,6 +207,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
204
207
  * `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
205
208
  Whether Bundler should cache all gems globally, rather than locally to the
206
209
  installing Ruby installation.
210
+ * `ignore_funding_requests` (`BUNDLE_IGNORE_FUNDING_REQUESTS`):
211
+ When set, no funding requests will be printed.
207
212
  * `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`):
208
213
  When set, no post install messages will be printed. To silence a single gem,
209
214
  use dot notation like `ignore_messages.httparty true`.
@@ -216,6 +221,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
216
221
  Whether `bundle package` should skip installing gems.
217
222
  * `no_prune` (`BUNDLE_NO_PRUNE`):
218
223
  Whether Bundler should leave outdated gems unpruned when caching.
224
+ * `only` (`BUNDLE_ONLY`):
225
+ A space-separated list of groups to install only gems of the specified groups.
219
226
  * `path` (`BUNDLE_PATH`):
220
227
  The location on disk where all gems in your bundle will be located regardless
221
228
  of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
@@ -321,9 +328,9 @@ mirror to fetch gems.
321
328
 
322
329
  bundle config set --global mirror.SOURCE_URL MIRROR_URL
323
330
 
324
- For example, to use a mirror of rubygems.org hosted at rubygems-mirror.org:
331
+ For example, to use a mirror of https://rubygems.org hosted at https://example.org:
325
332
 
326
- bundle config set --global mirror.http://rubygems.org http://rubygems-mirror.org
333
+ bundle config set --global mirror.https://rubygems.org https://example.org
327
334
 
328
335
  Each mirror also provides a fallback timeout setting. If the mirror does not
329
336
  respond within the fallback timeout, Bundler will try to use the original
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -155,7 +155,7 @@ You can find a list of all the gems containing gem plugins by running
155
155
  .
156
156
  .nf
157
157
 
158
- ruby \-rrubygems \-e "puts Gem\.find_files(\'rubygems_plugin\.rb\')"
158
+ ruby \-e "puts Gem\.find_files(\'rubygems_plugin\.rb\')"
159
159
  .
160
160
  .fi
161
161
  .
@@ -145,7 +145,7 @@ their plugins.
145
145
  You can find a list of all the gems containing gem plugins
146
146
  by running
147
147
 
148
- ruby -rrubygems -e "puts Gem.find_files('rubygems_plugin.rb')"
148
+ ruby -e "puts Gem.find_files('rubygems_plugin.rb')"
149
149
 
150
150
  At the very least, you should remove all but the newest
151
151
  version of each gem plugin, and also remove all gem plugins
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -30,4 +30,7 @@ bundle inject \'rack\' \'> 0\'
30
30
  .IP "" 0
31
31
  .
32
32
  .P
33
- This will inject the \'rack\' gem with a version greater than 0 in your [\fBGemfile(5)\fR][Gemfile(5)] and Gemfile\.lock
33
+ This will inject the \'rack\' gem with a version greater than 0 in your [\fBGemfile(5)\fR][Gemfile(5)] and Gemfile\.lock\.
34
+ .
35
+ .P
36
+ The \fBbundle inject\fR command was deprecated in Bundler 2\.1 and will be removed in Bundler 3\.0\.
@@ -19,4 +19,6 @@ Example:
19
19
  bundle inject 'rack' '> 0'
20
20
 
21
21
  This will inject the 'rack' gem with a version greater than 0 in your
22
- [`Gemfile(5)`][Gemfile(5)] and Gemfile.lock
22
+ [`Gemfile(5)`][Gemfile(5)] and Gemfile.lock.
23
+
24
+ The `bundle inject` command was deprecated in Bundler 2.1 and will be removed in Bundler 3.0.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "June 2022" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -15,6 +15,9 @@
15
15
  .P
16
16
  The associated gems must also be installed via \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR\.
17
17
  .
18
+ .P
19
+ \fBviz\fR command was deprecated in Bundler 2\.2\. Use bundler\-graph plugin \fIhttps://github\.com/rubygems/bundler\-graph\fR instead\.
20
+ .
18
21
  .SH "OPTIONS"
19
22
  .
20
23
  .TP
@@ -16,6 +16,8 @@ bundle-viz(1) -- Generates a visual dependency graph for your Gemfile
16
16
 
17
17
  The associated gems must also be installed via [`bundle install(1)`](bundle-install.1.html).
18
18
 
19
+ `viz` command was deprecated in Bundler 2.2. Use [bundler-graph plugin](https://github.com/rubygems/bundler-graph) instead.
20
+
19
21
  ## OPTIONS
20
22
 
21
23
  * `--file`, `-f`:
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "June 2022" "" ""
4
+ .TH "BUNDLE" "1" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -93,7 +93,7 @@ Open an installed gem in the editor
93
93
  Generate a lockfile for your dependencies
94
94
  .
95
95
  .TP
96
- \fBbundle viz(1)\fR \fIbundle\-viz\.1\.html\fR
96
+ \fBbundle viz(1)\fR \fIbundle\-viz\.1\.html\fR (deprecated)
97
97
  Generate a visual representation of your dependencies
98
98
  .
99
99
  .TP
@@ -130,7 +130,7 @@ These commands are obsolete and should no longer be used:
130
130
  \fBbundle cache(1)\fR
131
131
  .
132
132
  .IP "\(bu" 4
133
- \fBbundle show(1)\fR
133
+ \fBbundle inject(1)\fR
134
134
  .
135
135
  .IP "" 0
136
136
 
@@ -76,7 +76,7 @@ We divide `bundle` subcommands into primary commands and utilities:
76
76
  * [`bundle lock(1)`](bundle-lock.1.html):
77
77
  Generate a lockfile for your dependencies
78
78
 
79
- * [`bundle viz(1)`](bundle-viz.1.html):
79
+ * [`bundle viz(1)`](bundle-viz.1.html) (deprecated):
80
80
  Generate a visual representation of your dependencies
81
81
 
82
82
  * [`bundle init(1)`](bundle-init.1.html):
@@ -108,4 +108,4 @@ and execute it, passing down any extra arguments to it.
108
108
  These commands are obsolete and should no longer be used:
109
109
 
110
110
  * `bundle cache(1)`
111
- * `bundle show(1)`
111
+ * `bundle inject(1)`
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "June 2022" "" ""
4
+ .TH "GEMFILE" "5" "July 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -15,8 +15,8 @@ Place the \fBGemfile\fR in the root of the directory containing the associated c
15
15
  .SH "SYNTAX"
16
16
  A \fBGemfile\fR is evaluated as Ruby code, in a context which makes available a number of methods used to describe the gem requirements\.
17
17
  .
18
- .SH "GLOBAL SOURCES"
19
- At the top of the \fBGemfile\fR, add a line for the \fBRubygems\fR source that contains the gems listed in the \fBGemfile\fR\.
18
+ .SH "GLOBAL SOURCE"
19
+ At the top of the \fBGemfile\fR, add a single line for the \fBRubyGems\fR source that contains the gems listed in the \fBGemfile\fR\.
20
20
  .
21
21
  .IP "" 4
22
22
  .
@@ -29,10 +29,16 @@ source "https://rubygems\.org"
29
29
  .IP "" 0
30
30
  .
31
31
  .P
32
- It is possible, but not recommended as of Bundler 1\.7, to add multiple global \fBsource\fR lines\. Each of these \fBsource\fRs \fBMUST\fR be a valid Rubygems repository\.
32
+ You can add only one global source\. In Bundler 1\.13, adding multiple global sources was deprecated\. The \fBsource\fR \fBMUST\fR be a valid RubyGems repository\.
33
33
  .
34
34
  .P
35
- Sources are checked for gems following the heuristics described in \fISOURCE PRIORITY\fR\. If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available\. A specific source can be selected for gems that need to use a non\-standard repository, suppressing this warning, by using the \fI\fB:source\fR option\fR or a \fI\fBsource\fR block\fR\.
35
+ To use more than one source of RubyGems, you should use \fI\fBsource\fR block\fR\.
36
+ .
37
+ .P
38
+ A source is checked for gems following the heuristics described in \fISOURCE PRIORITY\fR\.
39
+ .
40
+ .P
41
+ \fBNote about a behavior of the feature deprecated in Bundler 1\.13\fR: If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available\. A specific source can be selected for gems that need to use a non\-standard repository, suppressing this warning, by using the \fI\fB:source\fR option\fR or \fBsource\fR block\.
36
42
  .
37
43
  .SS "CREDENTIALS"
38
44
  Some gem sources require a username and password\. Use bundle config(1) \fIbundle\-config\.1\.html\fR to set the username and password for any of the sources that need it\. The command must be run once on each computer that will install the Gemfile, but this keeps the credentials from being stored in plain text in version control\.
@@ -356,7 +362,7 @@ The platform specific variant does not yet support a newer ruby (and thus has a
356
362
  .IP "" 0
357
363
  .
358
364
  .SS "SOURCE"
359
- You can select an alternate Rubygems repository for a gem using the \':source\' option\.
365
+ You can select an alternate RubyGems repository for a gem using the \':source\' option\.
360
366
  .
361
367
  .IP "" 4
362
368
  .
@@ -369,13 +375,13 @@ gem "some_internal_gem", source: "https://gems\.example\.com"
369
375
  .IP "" 0
370
376
  .
371
377
  .P
372
- This forces the gem to be loaded from this source and ignores any global sources declared at the top level of the file\. If the gem does not exist in this source, it will not be installed\.
378
+ This forces the gem to be loaded from this source and ignores the global source declared at the top level of the file\. If the gem does not exist in this source, it will not be installed\.
373
379
  .
374
380
  .P
375
- Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on global sources using the ordering described in \fISOURCE PRIORITY\fR\.
381
+ Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall back on the global source\.
376
382
  .
377
383
  .P
378
- Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL SOURCES (#source)\fR\.
384
+ \fBNote about a behavior of the feature deprecated in Bundler 1\.13\fR: Selecting a specific source repository this way also suppresses the ambiguous gem warning described above in \fIGLOBAL SOURCE\fR\.
379
385
  .
380
386
  .P
381
387
  Using the \fB:source\fR option for an individual gem will also make that source available as a possible global source for any other gems which do not specify explicit sources\. Thus, when adding gems with explicit sources, it is recommended that you also ensure all other gems in the Gemfile are using explicit sources\.
@@ -730,7 +736,7 @@ The source explicitly attached to the gem (using \fB:source\fR, \fB:path\fR, or
730
736
  For implicit gems (dependencies of explicit gems), any source, git, or path repository declared on the parent\. This results in bundler prioritizing the ActiveSupport gem from the Rails git repository over ones from \fBrubygems\.org\fR
731
737
  .
732
738
  .IP "3." 4
733
- The sources specified via global \fBsource\fR lines, searching each source in your \fBGemfile\fR from last added to first added\.
739
+ If neither of the above conditions are met, the global source will be used\. If multiple global sources are specified, they will be prioritized from last to first, but this is deprecated since Bundler 1\.13, so Bundler prints a warning and will abort with an error in the future\.
734
740
  .
735
741
  .IP "" 0
736
742
 
@@ -15,23 +15,28 @@ directory as the `Rakefile`.
15
15
  A `Gemfile` is evaluated as Ruby code, in a context which makes available
16
16
  a number of methods used to describe the gem requirements.
17
17
 
18
- ## GLOBAL SOURCES
18
+ ## GLOBAL SOURCE
19
19
 
20
- At the top of the `Gemfile`, add a line for the `Rubygems` source that contains
21
- the gems listed in the `Gemfile`.
20
+ At the top of the `Gemfile`, add a single line for the `RubyGems` source that
21
+ contains the gems listed in the `Gemfile`.
22
22
 
23
23
  source "https://rubygems.org"
24
24
 
25
- It is possible, but not recommended as of Bundler 1.7, to add multiple global
26
- `source` lines. Each of these `source`s `MUST` be a valid Rubygems repository.
25
+ You can add only one global source. In Bundler 1.13, adding multiple global
26
+ sources was deprecated. The `source` `MUST` be a valid RubyGems repository.
27
27
 
28
- Sources are checked for gems following the heuristics described in
29
- [SOURCE PRIORITY][]. If a gem is found in more than one global source, Bundler
28
+ To use more than one source of RubyGems, you should use [`source` block
29
+ ](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
30
+
31
+ A source is checked for gems following the heuristics described in
32
+ [SOURCE PRIORITY][].
33
+
34
+ **Note about a behavior of the feature deprecated in Bundler 1.13**:
35
+ If a gem is found in more than one global source, Bundler
30
36
  will print a warning after installing the gem indicating which source was used,
31
37
  and listing the other sources where the gem is available. A specific source can
32
38
  be selected for gems that need to use a non-standard repository, suppressing
33
- this warning, by using the [`:source` option](#SOURCE) or a
34
- [`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
39
+ this warning, by using the [`:source` option](#SOURCE) or `source` block.
35
40
 
36
41
  ### CREDENTIALS
37
42
 
@@ -247,22 +252,22 @@ This can be handy (assuming the pure ruby variant works fine) when:
247
252
 
248
253
  ### SOURCE
249
254
 
250
- You can select an alternate Rubygems repository for a gem using the ':source'
255
+ You can select an alternate RubyGems repository for a gem using the ':source'
251
256
  option.
252
257
 
253
258
  gem "some_internal_gem", source: "https://gems.example.com"
254
259
 
255
- This forces the gem to be loaded from this source and ignores any global sources
260
+ This forces the gem to be loaded from this source and ignores the global source
256
261
  declared at the top level of the file. If the gem does not exist in this source,
257
262
  it will not be installed.
258
263
 
259
264
  Bundler will search for child dependencies of this gem by first looking in the
260
265
  source selected for the parent, but if they are not found there, it will fall
261
- back on global sources using the ordering described in [SOURCE PRIORITY][].
266
+ back on the global source.
262
267
 
268
+ **Note about a behavior of the feature deprecated in Bundler 1.13**:
263
269
  Selecting a specific source repository this way also suppresses the ambiguous
264
- gem warning described above in
265
- [GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
270
+ gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE).
266
271
 
267
272
  Using the `:source` option for an individual gem will also make that source
268
273
  available as a possible global source for any other gems which do not specify
@@ -535,5 +540,7 @@ bundler uses the following priority order:
535
540
  repository declared on the parent. This results in bundler prioritizing the
536
541
  ActiveSupport gem from the Rails git repository over ones from
537
542
  `rubygems.org`
538
- 3. The sources specified via global `source` lines, searching each source in
539
- your `Gemfile` from last added to first added.
543
+ 3. If neither of the above conditions are met, the global source will be used.
544
+ If multiple global sources are specified, they will be prioritized from
545
+ last to first, but this is deprecated since Bundler 1.13, so Bundler prints
546
+ a warning and will abort with an error in the future.
@@ -16,7 +16,8 @@ module Bundler
16
16
  def initialize(name, version, platform, spec_fetcher)
17
17
  @name = name
18
18
  @version = Gem::Version.create version
19
- @platform = platform
19
+ @original_platform = platform || Gem::Platform::RUBY
20
+ @platform = Gem::Platform.new(platform)
20
21
  @spec_fetcher = spec_fetcher
21
22
  @dependencies = nil
22
23
  end
@@ -35,10 +36,10 @@ module Bundler
35
36
  end
36
37
 
37
38
  def full_name
38
- if platform == Gem::Platform::RUBY || platform.nil?
39
+ if @original_platform == Gem::Platform::RUBY
39
40
  "#{@name}-#{@version}"
40
41
  else
41
- "#{@name}-#{@version}-#{platform}"
42
+ "#{@name}-#{@version}-#{@original_platform}"
42
43
  end
43
44
  end
44
45
 
@@ -105,7 +106,7 @@ module Bundler
105
106
  end
106
107
 
107
108
  def _remote_specification
108
- @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
109
+ @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @original_platform])
109
110
  @_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
110
111
  " missing from the server! Try installing with `--full-index` as a workaround.")
111
112
  end
@@ -22,17 +22,16 @@ module Bundler
22
22
  metadata_requirements, regular_requirements = requirements.partition {|dep| dep.name.end_with?("\0") }
23
23
  resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
24
24
  result = resolver.start(requirements)
25
- SpecSet.new(SpecSet.new(result).for(regular_requirements))
25
+ SpecSet.new(SpecSet.new(result).for(regular_requirements, false, platforms))
26
26
  end
27
27
 
28
28
  def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
29
29
  @source_requirements = source_requirements
30
30
  @metadata_requirements = metadata_requirements
31
- @base = base
32
31
  @resolver = Molinillo::Resolver.new(self, self)
33
32
  @search_for = {}
34
33
  @base_dg = Molinillo::DependencyGraph.new
35
- @base.each do |ls|
34
+ @base = base.materialized_for_resolution do |ls|
36
35
  dep = Dependency.new(ls.name, ls.version)
37
36
  @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
38
37
  end
@@ -111,7 +110,7 @@ module Bundler
111
110
  dependency = dependency_proxy.dep
112
111
  name = dependency.name
113
112
  @search_for[dependency_proxy] ||= begin
114
- results = results_for(dependency, @base[name])
113
+ results = results_for(dependency) + @base[name].select {|spec| requirement_satisfied_by?(dependency, nil, spec) }
115
114
 
116
115
  if vertex = @base_dg.vertex_named(name)
117
116
  locked_requirement = vertex.payload.requirement
@@ -176,8 +175,8 @@ module Bundler
176
175
  @source_requirements[name] || @source_requirements[:default]
177
176
  end
178
177
 
179
- def results_for(dependency, base)
180
- index_for(dependency).search(dependency, base)
178
+ def results_for(dependency)
179
+ index_for(dependency).search(dependency)
181
180
  end
182
181
 
183
182
  def name_for(dependency)
@@ -25,7 +25,7 @@ module Bundler
25
25
 
26
26
  extract_files
27
27
 
28
- build_extensions
28
+ build_extensions if spec.extensions.any?
29
29
  write_build_info_file
30
30
  run_post_build_hooks
31
31
 
@@ -66,26 +66,26 @@ module Bundler
66
66
 
67
67
  def build_extensions
68
68
  extension_cache_path = options[:bundler_extension_cache_path]
69
- unless extension_cache_path && extension_dir = spec.extension_dir
70
- require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
69
+ extension_dir = spec.extension_dir
70
+ unless extension_cache_path && extension_dir
71
+ prepare_extension_build(extension_dir)
71
72
  return super
72
73
  end
73
74
 
74
- extension_dir = Pathname.new(extension_dir)
75
75
  build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
76
76
  if build_complete && !options[:force]
77
- SharedHelpers.filesystem_access(extension_dir.parent, &:mkpath)
77
+ SharedHelpers.filesystem_access(File.dirname(extension_dir)) do |p|
78
+ FileUtils.mkpath p
79
+ end
78
80
  SharedHelpers.filesystem_access(extension_cache_path) do
79
- FileUtils.cp_r extension_cache_path, spec.extension_dir
81
+ FileUtils.cp_r extension_cache_path, extension_dir
80
82
  end
81
83
  else
82
- require "shellwords" # compensate missing require in rubygems before version 3.2.25
84
+ prepare_extension_build(extension_dir)
83
85
  super
84
- if extension_dir.directory? # not made for gems without extensions
85
- SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
86
- SharedHelpers.filesystem_access(extension_cache_path) do
87
- FileUtils.cp_r extension_dir, extension_cache_path
88
- end
86
+ SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
87
+ SharedHelpers.filesystem_access(extension_cache_path) do
88
+ FileUtils.cp_r extension_dir, extension_cache_path
89
89
  end
90
90
  end
91
91
  end
@@ -100,6 +100,13 @@ module Bundler
100
100
 
101
101
  private
102
102
 
103
+ def prepare_extension_build(extension_dir)
104
+ SharedHelpers.filesystem_access(extension_dir, :create) do
105
+ FileUtils.mkdir_p extension_dir
106
+ end
107
+ require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
108
+ end
109
+
103
110
  def strict_rm_rf(dir)
104
111
  Bundler.rm_rf dir
105
112
  rescue Errno::ENOTEMPTY => e
@@ -57,6 +57,7 @@ module Bundler
57
57
  ].freeze
58
58
 
59
59
  ARRAY_KEYS = %w[
60
+ only
60
61
  with
61
62
  without
62
63
  ].freeze
@@ -11,30 +11,27 @@ module Bundler
11
11
  @specs = specs
12
12
  end
13
13
 
14
- def for(dependencies, check = false, match_current_platform = false)
15
- # dep.name => [list, of, deps]
16
- handled = Hash.new {|h, k| h[k] = [] }
17
- deps = dependencies.dup
14
+ def for(dependencies, check = false, platforms = [nil])
15
+ handled = ["bundler"].product(platforms).map {|k| [k, true] }.to_h
16
+ deps = dependencies.product(platforms).map {|dep, platform| [dep.name, platform && dep.force_ruby_platform ? Gem::Platform::RUBY : platform] }
18
17
  specs = []
19
18
 
20
19
  loop do
21
20
  break unless dep = deps.shift
22
- next if handled[dep.name].any? {|d| match_current_platform || d.__platform == dep.__platform } || dep.name == "bundler"
21
+ next if handled.key?(dep)
23
22
 
24
- # use a hash here to ensure constant lookup time in the `any?` call above
25
- handled[dep.name] << dep
23
+ handled[dep] = true
26
24
 
27
- specs_for_dep = specs_for_dependency(dep, match_current_platform)
25
+ specs_for_dep = specs_for_dependency(*dep)
28
26
  if specs_for_dep.any?
29
27
  specs.concat(specs_for_dep)
30
28
 
31
29
  specs_for_dep.first.dependencies.each do |d|
32
30
  next if d.type == :development
33
- d = DepProxy.get_proxy(Dependency.new(d.name, d.requirement), dep.__platform) unless match_current_platform
34
- deps << d
31
+ deps << [d.name, dep[1]]
35
32
  end
36
33
  elsif check
37
- return false
34
+ specs << IncompleteSpecification.new(*dep)
38
35
  end
39
36
  end
40
37
 
@@ -42,9 +39,7 @@ module Bundler
42
39
  specs << spec
43
40
  end
44
41
 
45
- specs.uniq! unless match_current_platform
46
-
47
- check ? true : specs
42
+ specs
48
43
  end
49
44
 
50
45
  def [](key)
@@ -71,12 +66,12 @@ module Bundler
71
66
  end
72
67
 
73
68
  def materialize(deps)
74
- materialized = self.for(deps, false, true)
69
+ materialized = self.for(deps, true).uniq
75
70
 
76
71
  materialized.map! do |s|
77
72
  next s unless s.is_a?(LazySpecification)
78
73
  s.source.local!
79
- s.__materialize__ || s
74
+ s.materialize_for_installation || s
80
75
  end
81
76
  SpecSet.new(materialized)
82
77
  end
@@ -89,16 +84,29 @@ module Bundler
89
84
  next s unless s.is_a?(LazySpecification)
90
85
  s.source.local!
91
86
  s.source.remote!
92
- spec = s.__materialize__
87
+ spec = s.materialize_for_installation
93
88
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
94
89
  spec
95
90
  end
96
91
  end
97
92
 
93
+ def materialized_for_resolution
94
+ materialized = @specs.map do |s|
95
+ spec = s.materialize_for_resolution
96
+ yield spec if spec
97
+ spec
98
+ end.compact
99
+ SpecSet.new(materialized)
100
+ end
101
+
98
102
  def missing_specs
99
103
  @specs.select {|s| s.is_a?(LazySpecification) }
100
104
  end
101
105
 
106
+ def incomplete_specs
107
+ @specs.select {|s| s.is_a?(IncompleteSpecification) }
108
+ end
109
+
102
110
  def merge(set)
103
111
  arr = sorted.dup
104
112
  set.each do |set_spec|
@@ -173,12 +181,12 @@ module Bundler
173
181
  @specs.sort_by(&:name).each {|s| yield s }
174
182
  end
175
183
 
176
- def specs_for_dependency(dep, match_current_platform)
177
- specs_for_name = lookup[dep.name]
178
- if match_current_platform
184
+ def specs_for_dependency(name, platform)
185
+ specs_for_name = lookup[name]
186
+ if platform.nil?
179
187
  GemHelpers.select_best_platform_match(specs_for_name.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
180
188
  else
181
- specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, dep.force_ruby_platform ? Gem::Platform::RUBY : dep.__platform)
189
+ specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, platform)
182
190
  specs_for_name_and_platform.any? ? specs_for_name_and_platform : specs_for_name
183
191
  end
184
192
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.18".freeze
4
+ VERSION = "2.3.19".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/bundler.rb CHANGED
@@ -53,6 +53,7 @@ module Bundler
53
53
  autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
54
54
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
55
55
  autoload :Graph, File.expand_path("bundler/graph", __dir__)
56
+ autoload :IncompleteSpecification, File.expand_path("bundler/incomplete_specification", __dir__)
56
57
  autoload :Index, File.expand_path("bundler/index", __dir__)
57
58
  autoload :Injector, File.expand_path("bundler/injector", __dir__)
58
59
  autoload :Installer, File.expand_path("bundler/installer", __dir__)
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.3.18
4
+ version: 2.3.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2022-07-14 00:00:00.000000000 Z
25
+ date: 2022-07-27 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably
@@ -103,6 +103,7 @@ files:
103
103
  - lib/bundler/gem_tasks.rb
104
104
  - lib/bundler/gem_version_promoter.rb
105
105
  - lib/bundler/graph.rb
106
+ - lib/bundler/incomplete_specification.rb
106
107
  - lib/bundler/index.rb
107
108
  - lib/bundler/injector.rb
108
109
  - lib/bundler/inline.rb
@@ -369,7 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
369
370
  - !ruby/object:Gem::Version
370
371
  version: 2.5.2
371
372
  requirements: []
372
- rubygems_version: 3.3.18
373
+ rubygems_version: 3.3.19
373
374
  signing_key:
374
375
  specification_version: 4
375
376
  summary: The best way to manage your application's dependencies