bundler 2.3.19 → 2.3.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a381dcda0446bc5d93d2a6c1b16dcb28c53b151df2a3e9a9ed656f9e35bea2e
4
- data.tar.gz: dd05bd4717edec09127afc27ff6f62473353a17b51df25feb3a7e637e86eb6a7
3
+ metadata.gz: d496688c0b2262b47e1df23183882af5e469ca4a70eb40bf962a9d1583409748
4
+ data.tar.gz: '087ba876a0582ff5200d5bdb766e4b2722e5c9ba0ff433b5f65c6e67dd8387b0'
5
5
  SHA512:
6
- metadata.gz: 8dd22b1e85f5d0b785467676913165987430edced38c5683a6bc4c782180e74f383807fc784b4db8fcfbb28d0e9b685312395319776fb1db3a873420dbad17ee
7
- data.tar.gz: dbf44b39dbafd1699ece2f9a0d656bc6a5ddd3070ca8884db61548701afa3ee57c1ef3ab639f724f721ee195e1ede80e9323c6d52fe3041457faca89aed682b0
6
+ metadata.gz: a9706bc28946dc9fbd2eaa60dad29eddf99f4d614c04d74b2524a3f2382290d546a634e2b6d1a072a5f5197a819af4c31ca1621cf1571b530f0672c43bb40e01
7
+ data.tar.gz: 660efd70ee1f43363d317ac3efd33c6f870987e1039991208258230983856b429ddcf9ea7763165452fa0f92a21f46e26c76fe279035be5a0fa0cee401340c80
data/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # 2.3.20 (August 10, 2022)
2
+
3
+ ## Enhancements:
4
+
5
+ - Consistently ignore patchlevel when reporting `bundle platform --ruby` [#5793](https://github.com/rubygems/rubygems/pull/5793)
6
+ - Make `--standalone` play nice with `--local` [#5762](https://github.com/rubygems/rubygems/pull/5762)
7
+ - Implement `bundle install --prefer-local` [#5761](https://github.com/rubygems/rubygems/pull/5761)
8
+
9
+ ## Bug fixes:
10
+
11
+ - Fix regression where yanked gems are now unintentionally updated when other gems are unlocked [#5812](https://github.com/rubygems/rubygems/pull/5812)
12
+ - Automatically remove "ruby" from lockfile if incomplete [#5807](https://github.com/rubygems/rubygems/pull/5807)
13
+ - Fix `bundle outdated --strict` showing too many outdated gems [#5798](https://github.com/rubygems/rubygems/pull/5798)
14
+ - Don't discard candidates matching Ruby metadata [#5784](https://github.com/rubygems/rubygems/pull/5784)
15
+ - Fix `bundle outdated` crash in debug mode [#5796](https://github.com/rubygems/rubygems/pull/5796)
16
+ - Fix `ruby` DSL requirement matching for head and prerelease rubies [#5766](https://github.com/rubygems/rubygems/pull/5766)
17
+
18
+ ## Documentation:
19
+
20
+ - Update Bundler support policies to match what we do these days [#5813](https://github.com/rubygems/rubygems/pull/5813)
21
+ - Fix arguments for bundle-config(1) docs [#5804](https://github.com/rubygems/rubygems/pull/5804)
22
+ - Improve `bundle platform` man page [#5788](https://github.com/rubygems/rubygems/pull/5788)
23
+ - Remove `bundle cache` from deprecated commands list, and consistently link to `bundle cache` in man pages [#5783](https://github.com/rubygems/rubygems/pull/5783)
24
+ - Add package/pack aliases to man pages for cache [#5785](https://github.com/rubygems/rubygems/pull/5785)
25
+ - Add deprecation notice of bundle console [#5775](https://github.com/rubygems/rubygems/pull/5775)
26
+
1
27
  # 2.3.19 (July 27, 2022)
2
28
 
3
29
  ## 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-27".freeze
8
- @git_commit_sha = "4f496f93e6".freeze
7
+ @built_at = "2022-08-10".freeze
8
+ @git_commit_sha = "4fd2813f54".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -147,8 +147,11 @@ module Bundler
147
147
  def normalize_settings
148
148
  Bundler.settings.set_command_option :path, nil if options[:system]
149
149
  Bundler.settings.set_command_option_if_given :path, options[:path]
150
- Bundler.settings.temporary(:path_relative_to_cwd => false) do
151
- Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
150
+
151
+ if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
152
+ Bundler.settings.temporary(:path_relative_to_cwd => false) do
153
+ Bundler.settings.set_command_option :path, "bundle"
154
+ end
152
155
  end
153
156
 
154
157
  bin_option = options["binstubs"]
@@ -46,7 +46,7 @@ module Bundler
46
46
 
47
47
  Bundler::CLI::Common.configure_gem_version_promoter(
48
48
  Bundler.definition,
49
- options
49
+ options.merge(:strict => @strict)
50
50
  )
51
51
 
52
52
  definition_resolution = proc do
@@ -129,6 +129,12 @@ module Bundler
129
129
 
130
130
  private
131
131
 
132
+ def loaded_from_for(spec)
133
+ return unless spec.respond_to?(:loaded_from)
134
+
135
+ spec.loaded_from
136
+ end
137
+
132
138
  def groups_text(group_text, groups)
133
139
  "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
134
140
  end
@@ -184,7 +190,10 @@ module Bundler
184
190
 
185
191
  def print_gem(current_spec, active_spec, dependency, groups)
186
192
  spec_version = "#{active_spec.version}#{active_spec.git_version}"
187
- spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
193
+ if Bundler.ui.debug?
194
+ loaded_from = loaded_from_for(active_spec)
195
+ spec_version += " (from #{loaded_from})" if loaded_from
196
+ end
188
197
  current_version = "#{current_spec.version}#{current_spec.git_version}"
189
198
 
190
199
  if dependency && dependency.specific?
@@ -211,7 +220,7 @@ module Bundler
211
220
  dependency = dependency.requirement if dependency
212
221
 
213
222
  ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
214
- ret_val << active_spec.loaded_from.to_s if Bundler.ui.debug?
223
+ ret_val << loaded_from_for(active_spec).to_s if Bundler.ui.debug?
215
224
  ret_val
216
225
  end
217
226
 
@@ -9,7 +9,7 @@ module Bundler
9
9
 
10
10
  def run
11
11
  platforms, ruby_version = Bundler.ui.silence do
12
- locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version
12
+ locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version.gsub(/p\d+\Z/, "")
13
13
  gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string
14
14
  [Bundler.definition.platforms.map {|p| "* #{p}" },
15
15
  locked_ruby_version || gemfile_ruby_version]
data/lib/bundler/cli.rb CHANGED
@@ -218,6 +218,8 @@ module Bundler
218
218
  "Specify the number of jobs to run in parallel"
219
219
  method_option "local", :type => :boolean, :banner =>
220
220
  "Do not attempt to fetch gems remotely and use the gem cache instead"
221
+ method_option "prefer-local", :type => :boolean, :banner =>
222
+ "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
221
223
  method_option "no-cache", :type => :boolean, :banner =>
222
224
  "Don't update the existing gem cache."
223
225
  method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
@@ -236,7 +238,7 @@ module Bundler
236
238
  "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
237
239
  method_option "trust-policy", :alias => "P", :type => :string, :banner =>
238
240
  "Gem trust policy (like gem install -P). Must be one of " +
239
- Bundler.rubygems.security_policy_keys.join("|")
241
+ Bundler.rubygems.security_policy_keys.join("|")
240
242
  method_option "without", :type => :array, :banner =>
241
243
  "Exclude gems that are part of the specified named group."
242
244
  method_option "with", :type => :array, :banner =>
@@ -399,9 +401,9 @@ module Bundler
399
401
  "Do not attempt to fetch gems remotely and use the gem cache instead"
400
402
  method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
401
403
  method_option "source", :type => :array, :banner => "Check against a specific source"
402
- method_option "filter-strict", :type => :boolean, :banner =>
404
+ method_option "filter-strict", :type => :boolean, :aliases => "--strict", :banner =>
403
405
  "Only list newer versions allowed by your Gemfile requirements"
404
- method_option "strict", :type => :boolean, :aliases => "--update-strict", :banner =>
406
+ method_option "update-strict", :type => :boolean, :banner =>
405
407
  "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
406
408
  method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
407
409
  method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
@@ -70,6 +70,7 @@ module Bundler
70
70
  @unlock = unlock
71
71
  @optional_groups = optional_groups
72
72
  @remote = false
73
+ @prefer_local = false
73
74
  @specs = nil
74
75
  @ruby_version = ruby_version
75
76
  @gemfiles = gemfiles
@@ -170,6 +171,13 @@ module Bundler
170
171
  resolve
171
172
  end
172
173
 
174
+ def resolve_prefering_local!
175
+ @prefer_local = true
176
+ @remote = true
177
+ sources.remote!
178
+ resolve
179
+ end
180
+
173
181
  def resolve_with_cache!
174
182
  sources.cached!
175
183
  resolve
@@ -476,6 +484,7 @@ module Bundler
476
484
 
477
485
  def reresolve
478
486
  last_resolve = converge_locked_specs
487
+ remove_ruby_from_platforms_if_necessary!(dependencies)
479
488
  expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
480
489
  Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
481
490
  end
@@ -516,10 +525,8 @@ module Bundler
516
525
  end
517
526
  end
518
527
 
519
- unless specs["bundler"].any?
520
- bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
521
- specs["bundler"] = bundler
522
- end
528
+ bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
529
+ specs["bundler"] = bundler
523
530
 
524
531
  specs
525
532
  end
@@ -528,6 +535,19 @@ module Bundler
528
535
  @remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
529
536
  end
530
537
 
538
+ def pin_locally_available_names(source_requirements)
539
+ source_requirements.each_with_object({}) do |(name, original_source), new_source_requirements|
540
+ local_source = original_source.dup
541
+ local_source.local_only!
542
+
543
+ new_source_requirements[name] = if local_source.specs.search(name).any?
544
+ local_source
545
+ else
546
+ original_source
547
+ end
548
+ end
549
+ end
550
+
531
551
  def current_ruby_platform_locked?
532
552
  return false unless generic_local_platform == Gem::Platform::RUBY
533
553
  return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
@@ -719,16 +739,24 @@ module Bundler
719
739
  specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
720
740
  end
721
741
 
742
+ @specs_that_changed_sources = []
743
+
722
744
  specs.each do |s|
723
- # Replace the locked dependency's source with the equivalent source from the Gemfile
724
745
  dep = @dependencies.find {|d| s.satisfies?(d) }
725
746
 
726
- s.source = (dep && dep.source) || sources.get(s.source) || sources.default_source
747
+ # Replace the locked dependency's source with the equivalent source from the Gemfile
748
+ s.source = if dep && dep.source
749
+ gemfile_source = dep.source
750
+ lockfile_source = s.source
727
751
 
728
- next if @unlock[:sources].include?(s.source.name)
752
+ @specs_that_changed_sources << s if gemfile_source != lockfile_source
729
753
 
730
- # If the spec is from a path source and it doesn't exist anymore
731
- # then we unlock it.
754
+ gemfile_source
755
+ else
756
+ sources.get_with_fallback(s.source)
757
+ end
758
+
759
+ next if @unlock[:sources].include?(s.source.name)
732
760
 
733
761
  # Path sources have special logic
734
762
  if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
@@ -765,7 +793,7 @@ module Bundler
765
793
 
766
794
  def metadata_dependencies
767
795
  @metadata_dependencies ||= [
768
- Dependency.new("Ruby\0", RubyVersion.system.gem_version),
796
+ Dependency.new("Ruby\0", Gem.ruby_version),
769
797
  Dependency.new("RubyGems\0", Gem::VERSION),
770
798
  ]
771
799
  end
@@ -792,7 +820,9 @@ module Bundler
792
820
  # specs will be available later when the resolver knows where to
793
821
  # look for that gemspec (or its dependencies)
794
822
  source_requirements = if precompute_source_requirements_for_indirect_dependencies?
795
- { :default => sources.default_source }.merge(source_map.all_requirements)
823
+ all_requirements = source_map.all_requirements
824
+ all_requirements = pin_locally_available_names(all_requirements) if @prefer_local
825
+ { :default => sources.default_source }.merge(all_requirements)
796
826
  else
797
827
  { :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
798
828
  end
@@ -802,9 +832,18 @@ module Bundler
802
832
  end
803
833
  source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
804
834
  source_requirements["bundler"] = sources.metadata_source # needs to come last to override
835
+ verify_changed_sources!
805
836
  source_requirements
806
837
  end
807
838
 
839
+ def verify_changed_sources!
840
+ @specs_that_changed_sources.each do |s|
841
+ if s.source.specs.search(s.name).empty?
842
+ raise GemNotFound, "Could not find gem '#{s.name}' in #{s.source}"
843
+ end
844
+ end
845
+ end
846
+
808
847
  def requested_groups
809
848
  values = groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
810
849
  values &= Bundler.settings[:only] unless Bundler.settings[:only].empty?
@@ -844,6 +883,17 @@ module Bundler
844
883
  end
845
884
  end
846
885
 
886
+ def remove_ruby_from_platforms_if_necessary!(dependencies)
887
+ return if Bundler.frozen_bundle? ||
888
+ Bundler.local_platform == Gem::Platform::RUBY ||
889
+ !platforms.include?(Gem::Platform::RUBY) ||
890
+ (@new_platform && platforms.last == Gem::Platform::RUBY) ||
891
+ !@originally_locked_specs.incomplete_ruby_specs?(dependencies)
892
+
893
+ remove_platform(Gem::Platform::RUBY)
894
+ add_current_platform
895
+ end
896
+
847
897
  def source_map
848
898
  @source_map ||= SourceMap.new(sources, dependencies, @locked_specs)
849
899
  end
@@ -240,8 +240,8 @@ module Bundler
240
240
  def connection
241
241
  @connection ||= begin
242
242
  needs_ssl = remote_uri.scheme == "https" ||
243
- Bundler.settings[:ssl_verify_mode] ||
244
- Bundler.settings[:ssl_client_cert]
243
+ Bundler.settings[:ssl_verify_mode] ||
244
+ Bundler.settings[:ssl_client_cert]
245
245
  raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
246
246
 
247
247
  con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
@@ -256,8 +256,8 @@ module Bundler
256
256
  end
257
257
 
258
258
  ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
259
- (Gem.configuration.ssl_client_cert if
260
- Gem.configuration.respond_to?(:ssl_client_cert))
259
+ (Gem.configuration.ssl_client_cert if
260
+ Gem.configuration.respond_to?(:ssl_client_cert))
261
261
  if ssl_client_cert
262
262
  pem = File.read(ssl_client_cert)
263
263
  con.cert = OpenSSL::X509::Certificate.new(pem)
@@ -288,8 +288,8 @@ module Bundler
288
288
  def bundler_cert_store
289
289
  store = OpenSSL::X509::Store.new
290
290
  ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
291
- (Gem.configuration.ssl_ca_cert if
292
- Gem.configuration.respond_to?(:ssl_ca_cert))
291
+ (Gem.configuration.ssl_ca_cert if
292
+ Gem.configuration.respond_to?(:ssl_ca_cert))
293
293
  if ssl_ca_cert
294
294
  if File.directory? ssl_ca_cert
295
295
  store.add_path ssl_ca_cert
@@ -44,6 +44,12 @@ module Bundler
44
44
 
45
45
  def select_best_platform_match(specs, platform)
46
46
  matching = specs.select {|spec| spec.match_platform(platform) }
47
+
48
+ sort_best_platform_match(matching, platform)
49
+ end
50
+ module_function :select_best_platform_match
51
+
52
+ def sort_best_platform_match(matching, platform)
47
53
  exact = matching.select {|spec| spec.platform == platform }
48
54
  return exact if exact.any?
49
55
 
@@ -52,7 +58,7 @@ module Bundler
52
58
 
53
59
  sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
54
60
  end
55
- module_function :select_best_platform_match
61
+ module_function :sort_best_platform_match
56
62
 
57
63
  class PlatformMatch
58
64
  def self.specificity_score(spec_platform, user_platform)
@@ -47,7 +47,7 @@ module Bundler
47
47
  end
48
48
 
49
49
  def bundler_path
50
- Bundler.root.join(Bundler.settings[:path], "bundler")
50
+ Bundler.root.join(Bundler.settings[:path].to_s, "bundler")
51
51
  end
52
52
 
53
53
  def gem_path(path, spec)
@@ -268,7 +268,14 @@ module Bundler
268
268
  return false if @definition.nothing_changed? && !@definition.missing_specs?
269
269
  end
270
270
 
271
- options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely!
271
+ if options["local"]
272
+ @definition.resolve_with_cache!
273
+ elsif options["prefer-local"]
274
+ @definition.resolve_prefering_local!
275
+ else
276
+ @definition.resolve_remotely!
277
+ end
278
+
272
279
  true
273
280
  end
274
281
 
@@ -76,35 +76,35 @@ module Bundler
76
76
  end
77
77
 
78
78
  def materialize_for_installation
79
- __materialize__(ruby_platform_materializes_to_ruby_platform? ? platform : Bundler.local_platform)
80
- end
79
+ source.local!
80
+
81
+ candidates = if source.is_a?(Source::Path) || !ruby_platform_materializes_to_ruby_platform?
82
+ target_platform = ruby_platform_materializes_to_ruby_platform? ? platform : Bundler.local_platform
83
+
84
+ source.specs.search(Dependency.new(name, version)).select do |spec|
85
+ MatchPlatform.platforms_match?(spec.platform, target_platform)
86
+ end
87
+ else
88
+ source.specs.search(self)
89
+ end
81
90
 
82
- def materialize_for_resolution
83
- return self unless Gem::Platform.match_spec?(self)
91
+ return self if candidates.empty?
84
92
 
85
- __materialize__(platform)
93
+ __materialize__(candidates)
86
94
  end
87
95
 
88
- def __materialize__(platform)
89
- @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
90
- source.gemspec.tap {|s| s.source = source }
91
- else
92
- search_object = if source.is_a?(Source::Path)
93
- Dependency.new(name, version)
94
- else
95
- ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
96
- end
97
- candidates = source.specs.search(search_object)
98
- same_platform_candidates = candidates.select do |spec|
99
- MatchPlatform.platforms_match?(spec.platform, platform)
100
- end
101
- installable_candidates = same_platform_candidates.select do |spec|
96
+ def __materialize__(candidates)
97
+ @specification = begin
98
+ search = candidates.reverse.find do |spec|
102
99
  spec.is_a?(StubSpecification) ||
103
100
  (spec.required_ruby_version.satisfied_by?(Gem.ruby_version) &&
104
101
  spec.required_rubygems_version.satisfied_by?(Gem.rubygems_version))
105
102
  end
106
- search = installable_candidates.last || same_platform_candidates.last
107
- search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
103
+ if search.nil? && Bundler.frozen_bundle?
104
+ search = candidates.last
105
+ else
106
+ search.dependencies = dependencies if search && search.full_name == full_name && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
107
+ end
108
108
  search
109
109
  end
110
110
  end
@@ -9,6 +9,9 @@
9
9
  .SH "SYNOPSIS"
10
10
  \fBbundle cache\fR
11
11
  .
12
+ .P
13
+ alias: \fBpackage\fR, \fBpack\fR
14
+ .
12
15
  .SH "DESCRIPTION"
13
16
  Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running [bundle install(1)][bundle\-install], use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
14
17
  .
@@ -53,3 +56,6 @@ One way to be sure that you have the right platformed versions of all your gems
53
56
  .
54
57
  .P
55
58
  By default, bundle cache(1) \fIbundle\-cache\.1\.html\fR fetches and also installs the gems to the default location\. To package the dependencies to \fBvendor/cache\fR without installing them to the local install location, you can run \fBbundle cache \-\-no\-install\fR\.
59
+ .
60
+ .SH "HISTORY"
61
+ In Bundler 2\.1, \fBcache\fR took in the functionalities of \fBpackage\fR and now \fBpackage\fR and \fBpack\fR are aliases of \fBcache\fR\.
@@ -5,6 +5,8 @@ bundle-cache(1) -- Package your needed `.gem` files into your application
5
5
 
6
6
  `bundle cache`
7
7
 
8
+ alias: `package`, `pack`
9
+
8
10
  ## DESCRIPTION
9
11
 
10
12
  Copy all of the `.gem` files needed to run the application into the
@@ -70,3 +72,8 @@ By default, [bundle cache(1)](bundle-cache.1.html) fetches and also
70
72
  installs the gems to the default location. To package the
71
73
  dependencies to `vendor/cache` without installing them to the
72
74
  local install location, you can run `bundle cache --no-install`.
75
+
76
+ ## HISTORY
77
+
78
+ In Bundler 2.1, `cache` took in the functionalities of `package` and now
79
+ `package` and `pack` are aliases of `cache`.
@@ -51,7 +51,7 @@ Executing \fBbundle config unset <name>\fR will delete the configuration in both
51
51
  Executing \fBbundle config unset \-\-global <name>\fR will delete the configuration only from the user configuration\.
52
52
  .
53
53
  .P
54
- Executing \fBbundle config unset \-\-local <name> <value>\fR will delete the configuration only from the local application\.
54
+ Executing \fBbundle config unset \-\-local <name>\fR will delete the configuration only from the local application\.
55
55
  .
56
56
  .P
57
57
  Executing bundle with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
@@ -298,7 +298,7 @@ The following is a list of all configuration keys and their purpose\. You can le
298
298
  .IP "" 0
299
299
  .
300
300
  .P
301
- In general, you should set these settings per\-application by using the applicable flag to the bundle install(1) \fIbundle\-install\.1\.html\fR or bundle package(1) \fIbundle\-package\.1\.html\fR command\.
301
+ In general, you should set these settings per\-application by using the applicable flag to the bundle install(1) \fIbundle\-install\.1\.html\fR or bundle cache(1) \fIbundle\-cache\.1\.html\fR command\.
302
302
  .
303
303
  .P
304
304
  You can set them globally either via environment variables or \fBbundle config\fR, whichever is preferable for your setup\. If you use both, environment variables will take preference over global settings\.
@@ -43,8 +43,8 @@ local and global sources.
43
43
  Executing `bundle config unset --global <name>` will delete the configuration
44
44
  only from the user configuration.
45
45
 
46
- Executing `bundle config unset --local <name> <value>` will delete the
47
- configuration only from the local application.
46
+ Executing `bundle config unset --local <name>` will delete the configuration
47
+ only from the local application.
48
48
 
49
49
  Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
50
50
  cause it to ignore all configuration.
@@ -280,7 +280,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
280
280
  A `:`-separated list of groups whose gems bundler should not install.
281
281
 
282
282
  In general, you should set these settings per-application by using the applicable
283
- flag to the [bundle install(1)](bundle-install.1.html) or [bundle package(1)](bundle-package.1.html) command.
283
+ flag to the [bundle install(1)](bundle-install.1.html) or [bundle cache(1)](bundle-cache.1.html) command.
284
284
 
285
285
  You can set them globally either via environment variables or `bundle config`,
286
286
  whichever is preferable for your setup. If you use both, environment variables
@@ -70,6 +70,10 @@ The maximum number of parallel download and install jobs\. The default is the nu
70
70
  Do not attempt to connect to \fBrubygems\.org\fR\. Instead, Bundler will use the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if an appropriate platform\-specific gem exists on \fBrubygems\.org\fR it will not be found\.
71
71
  .
72
72
  .TP
73
+ \fB\-\-prefer\-local\fR
74
+ Force using locally installed gems, or gems already present in Rubygems\' cache or in \fBvendor/cache\fR, when resolving, even if newer versions are available remotely\. Only attempt to connect to \fBrubygems\.org\fR for gems that are not present locally\.
75
+ .
76
+ .TP
73
77
  \fB\-\-no\-cache\fR
74
78
  Do not update the cache in \fBvendor/cache\fR with the newly bundled gems\. This does not remove any gems in the cache but keeps the newly bundled gems from being cached during the install\.
75
79
  .
@@ -109,6 +109,12 @@ automatically and that requires `bundler` to silently remember them. Since
109
109
  appropriate platform-specific gem exists on `rubygems.org` it will not be
110
110
  found.
111
111
 
112
+ * `--prefer-local`:
113
+ Force using locally installed gems, or gems already present in Rubygems' cache
114
+ or in `vendor/cache`, when resolving, even if newer versions are available
115
+ remotely. Only attempt to connect to `rubygems.org` for gems that are not
116
+ present locally.
117
+
112
118
  * `--no-cache`:
113
119
  Do not update the cache in `vendor/cache` with the newly bundled gems. This
114
120
  does not remove any gems in the cache but keeps the newly bundled gems from
@@ -10,7 +10,7 @@
10
10
  \fBbundle platform\fR [\-\-ruby]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
- \fBplatform\fR will display information from your Gemfile, Gemfile\.lock, and Ruby VM about your platform\.
13
+ \fBplatform\fR displays information from your Gemfile, Gemfile\.lock, and Ruby VM about your platform\.
14
14
  .
15
15
  .P
16
16
  For instance, using this Gemfile(5):
@@ -21,7 +21,7 @@ For instance, using this Gemfile(5):
21
21
 
22
22
  source "https://rubygems\.org"
23
23
 
24
- ruby "1\.9\.3"
24
+ ruby "3\.1\.2"
25
25
 
26
26
  gem "rack"
27
27
  .
@@ -30,7 +30,7 @@ gem "rack"
30
30
  .IP "" 0
31
31
  .
32
32
  .P
33
- If you run \fBbundle platform\fR on Ruby 1\.9\.3, it will display the following output:
33
+ If you run \fBbundle platform\fR on Ruby 3\.1\.2, it displays the following output:
34
34
  .
35
35
  .IP "" 4
36
36
  .
@@ -39,10 +39,13 @@ If you run \fBbundle platform\fR on Ruby 1\.9\.3, it will display the following
39
39
  Your platform is: x86_64\-linux
40
40
 
41
41
  Your app has gems that work on these platforms:
42
+ * arm64\-darwin\-21
42
43
  * ruby
44
+ * x64\-mingw\-ucrt
45
+ * x86_64\-linux
43
46
 
44
47
  Your Gemfile specifies a Ruby version requirement:
45
- * ruby 1\.9\.3
48
+ * ruby 3\.1\.2
46
49
 
47
50
  Your current platform satisfies the Ruby version requirement\.
48
51
  .
@@ -51,11 +54,18 @@ Your current platform satisfies the Ruby version requirement\.
51
54
  .IP "" 0
52
55
  .
53
56
  .P
54
- \fBplatform\fR will list all the platforms in your \fBGemfile\.lock\fR as well as the \fBruby\fR directive if applicable from your Gemfile(5)\. It will also let you know if the \fBruby\fR directive requirement has been met\. If \fBruby\fR directive doesn\'t match the running Ruby VM, it will tell you what part does not\.
57
+ \fBplatform\fR lists all the platforms in your \fBGemfile\.lock\fR as well as the \fBruby\fR directive if applicable from your Gemfile(5)\. It also lets you know if the \fBruby\fR directive requirement has been met\. If \fBruby\fR directive doesn\'t match the running Ruby VM, it tells you what part does not\.
55
58
  .
56
59
  .SH "OPTIONS"
57
60
  .
58
61
  .TP
59
62
  \fB\-\-ruby\fR
60
63
  It will display the ruby directive information, so you don\'t have to parse it from the Gemfile(5)\.
64
+ .
65
+ .SH "SEE ALSO"
66
+ .
67
+ .IP "\(bu" 4
68
+ bundle\-lock(1) \fIbundle\-lock\.1\.ronn\fR
69
+ .
70
+ .IP "" 0
61
71
 
@@ -7,36 +7,43 @@ bundle-platform(1) -- Displays platform compatibility information
7
7
 
8
8
  ## DESCRIPTION
9
9
 
10
- `platform` will display information from your Gemfile, Gemfile.lock, and Ruby
10
+ `platform` displays information from your Gemfile, Gemfile.lock, and Ruby
11
11
  VM about your platform.
12
12
 
13
13
  For instance, using this Gemfile(5):
14
14
 
15
15
  source "https://rubygems.org"
16
16
 
17
- ruby "1.9.3"
17
+ ruby "3.1.2"
18
18
 
19
19
  gem "rack"
20
20
 
21
- If you run `bundle platform` on Ruby 1.9.3, it will display the following output:
21
+ If you run `bundle platform` on Ruby 3.1.2, it displays the following output:
22
22
 
23
23
  Your platform is: x86_64-linux
24
24
 
25
25
  Your app has gems that work on these platforms:
26
+ * arm64-darwin-21
26
27
  * ruby
28
+ * x64-mingw-ucrt
29
+ * x86_64-linux
27
30
 
28
31
  Your Gemfile specifies a Ruby version requirement:
29
- * ruby 1.9.3
32
+ * ruby 3.1.2
30
33
 
31
34
  Your current platform satisfies the Ruby version requirement.
32
35
 
33
- `platform` will list all the platforms in your `Gemfile.lock` as well as the
34
- `ruby` directive if applicable from your Gemfile(5). It will also let you know
36
+ `platform` lists all the platforms in your `Gemfile.lock` as well as the
37
+ `ruby` directive if applicable from your Gemfile(5). It also lets you know
35
38
  if the `ruby` directive requirement has been met. If `ruby` directive doesn't
36
- match the running Ruby VM, it will tell you what part does not.
39
+ match the running Ruby VM, it tells you what part does not.
37
40
 
38
41
  ## OPTIONS
39
42
 
40
43
  * `--ruby`:
41
44
  It will display the ruby directive information, so you don't have to
42
45
  parse it from the Gemfile(5).
46
+
47
+ ## SEE ALSO
48
+
49
+ * [bundle-lock(1)](bundle-lock.1.ronn)
@@ -43,8 +43,8 @@ Install the gems specified by the \fBGemfile\fR or \fBGemfile\.lock\fR
43
43
  Update dependencies to their latest versions
44
44
  .
45
45
  .TP
46
- \fBbundle package(1)\fR \fIbundle\-package\.1\.html\fR
47
- Package the \.gem files required by your application into the \fBvendor/cache\fR directory
46
+ \fBbundle cache(1)\fR \fIbundle\-cache\.1\.html\fR
47
+ Package the \.gem files required by your application into the \fBvendor/cache\fR directory (aliases: \fBbundle package\fR, \fBbundle pack\fR)
48
48
  .
49
49
  .TP
50
50
  \fBbundle exec(1)\fR \fIbundle\-exec\.1\.html\fR
@@ -81,7 +81,7 @@ Show the source location of a particular gem in the bundle
81
81
  Show all of the outdated gems in the current bundle
82
82
  .
83
83
  .TP
84
- \fBbundle console(1)\fR
84
+ \fBbundle console(1)\fR (deprecated)
85
85
  Start an IRB session in the current bundle
86
86
  .
87
87
  .TP
@@ -127,9 +127,6 @@ When running a command that isn\'t listed in PRIMARY COMMANDS or UTILITIES, Bund
127
127
  These commands are obsolete and should no longer be used:
128
128
  .
129
129
  .IP "\(bu" 4
130
- \fBbundle cache(1)\fR
131
- .
132
- .IP "\(bu" 4
133
130
  \fBbundle inject(1)\fR
134
131
  .
135
132
  .IP "" 0
@@ -36,9 +36,9 @@ We divide `bundle` subcommands into primary commands and utilities:
36
36
  * [`bundle update(1)`](bundle-update.1.html):
37
37
  Update dependencies to their latest versions
38
38
 
39
- * [`bundle package(1)`](bundle-package.1.html):
39
+ * [`bundle cache(1)`](bundle-cache.1.html):
40
40
  Package the .gem files required by your application into the
41
- `vendor/cache` directory
41
+ `vendor/cache` directory (aliases: `bundle package`, `bundle pack`)
42
42
 
43
43
  * [`bundle exec(1)`](bundle-exec.1.html):
44
44
  Execute a script in the current bundle
@@ -67,7 +67,7 @@ We divide `bundle` subcommands into primary commands and utilities:
67
67
  * [`bundle outdated(1)`](bundle-outdated.1.html):
68
68
  Show all of the outdated gems in the current bundle
69
69
 
70
- * `bundle console(1)`:
70
+ * `bundle console(1)` (deprecated):
71
71
  Start an IRB session in the current bundle
72
72
 
73
73
  * [`bundle open(1)`](bundle-open.1.html):
@@ -107,5 +107,4 @@ and execute it, passing down any extra arguments to it.
107
107
 
108
108
  These commands are obsolete and should no longer be used:
109
109
 
110
- * `bundle cache(1)`
111
110
  * `bundle inject(1)`
@@ -28,10 +28,11 @@ module Bundler
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
31
32
  @resolver = Molinillo::Resolver.new(self, self)
32
33
  @search_for = {}
33
34
  @base_dg = Molinillo::DependencyGraph.new
34
- @base = base.materialized_for_resolution do |ls|
35
+ base.each do |ls|
35
36
  dep = Dependency.new(ls.name, ls.version)
36
37
  @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
37
38
  end
@@ -9,7 +9,7 @@ module Bundler
9
9
  raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
10
10
 
11
11
  if options[:engine] == "ruby" && options[:engine_version] &&
12
- ruby_version != Array(options[:engine_version])
12
+ ruby_version != Array(options[:engine_version])
13
13
  raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
14
14
  end
15
15
  @ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
@@ -32,12 +32,12 @@ module Bundler
32
32
  @engine = engine && engine.to_s || "ruby"
33
33
  @engine_versions = (engine_version && Array(engine_version)) || @versions
34
34
  @engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
35
- @patchlevel = patchlevel
35
+ @patchlevel = patchlevel || (@gem_version.prerelease? ? "-1" : nil)
36
36
  end
37
37
 
38
38
  def to_s(versions = self.versions)
39
39
  output = String.new("ruby #{versions_string(versions)}")
40
- output << "p#{patchlevel}" if patchlevel
40
+ output << "p#{patchlevel}" if patchlevel && patchlevel != "-1"
41
41
  output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
42
42
 
43
43
  output
@@ -46,7 +46,7 @@ module Bundler
46
46
  # @private
47
47
  PATTERN = /
48
48
  ruby\s
49
- ([\d.]+) # ruby version
49
+ (\d+\.\d+\.\d+(?:\.\S+)?) # ruby version
50
50
  (?:p(-?\d+))? # optional patchlevel
51
51
  (?:\s\((\S+)\s(.+)\))? # optional engine info
52
52
  /xo.freeze
@@ -103,8 +103,8 @@ module Bundler
103
103
 
104
104
  def self.system
105
105
  ruby_engine = RUBY_ENGINE.dup
106
- ruby_version = RUBY_VERSION.dup
107
- ruby_engine_version = RUBY_ENGINE_VERSION.dup
106
+ ruby_version = Gem.ruby_version.to_s
107
+ ruby_engine_version = RUBY_ENGINE == "ruby" ? ruby_version : RUBY_ENGINE_VERSION.dup
108
108
  patchlevel = RUBY_PATCHLEVEL.to_s
109
109
 
110
110
  @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
@@ -17,6 +17,15 @@ require "rubygems/source"
17
17
 
18
18
  require_relative "match_platform"
19
19
 
20
+ # Cherry-pick fixes to `Gem.ruby_version` to be useful for modern Bundler
21
+ # versions and ignore patchlevels
22
+ # (https://github.com/rubygems/rubygems/pull/5472,
23
+ # https://github.com/rubygems/rubygems/pull/5486). May be removed once RubyGems
24
+ # 3.3.12 support is dropped.
25
+ unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
26
+ Gem.instance_variable_set(:@ruby_version, Gem::Version.new(RUBY_VERSION))
27
+ end
28
+
20
29
  module Gem
21
30
  class Specification
22
31
  include ::Bundler::MatchPlatform
@@ -146,6 +155,10 @@ module Gem
146
155
 
147
156
  alias_method :eql?, :==
148
157
 
158
+ def force_ruby_platform
159
+ false
160
+ end
161
+
149
162
  def encode_with(coder)
150
163
  to_yaml_properties.each do |ivar|
151
164
  coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
@@ -5,7 +5,7 @@ module Bundler
5
5
  class Metadata < Source
6
6
  def specs
7
7
  @specs ||= Index.build do |idx|
8
- idx << Gem::Specification.new("Ruby\0", RubyVersion.system.gem_version)
8
+ idx << Gem::Specification.new("Ruby\0", Gem.ruby_version)
9
9
  idx << Gem::Specification.new("RubyGems\0", Gem::VERSION) do |s|
10
10
  s.required_rubygems_version = Gem::Requirement.default
11
11
  end
@@ -101,6 +101,10 @@ module Bundler
101
101
  source_list_for(source).find {|s| equivalent_source?(source, s) }
102
102
  end
103
103
 
104
+ def get_with_fallback(source)
105
+ get(source) || default_source
106
+ end
107
+
104
108
  def lock_sources
105
109
  lock_other_sources + lock_rubygems_sources
106
110
  end
@@ -13,14 +13,16 @@ module Bundler
13
13
 
14
14
  def for(dependencies, check = false, platforms = [nil])
15
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] }
16
+ deps = dependencies.product(platforms)
17
17
  specs = []
18
18
 
19
19
  loop do
20
20
  break unless dep = deps.shift
21
- next if handled.key?(dep)
22
21
 
23
- handled[dep] = true
22
+ key = [dep[0].name, dep[1]]
23
+ next if handled.key?(key)
24
+
25
+ handled[key] = true
24
26
 
25
27
  specs_for_dep = specs_for_dependency(*dep)
26
28
  if specs_for_dep.any?
@@ -28,17 +30,13 @@ module Bundler
28
30
 
29
31
  specs_for_dep.first.dependencies.each do |d|
30
32
  next if d.type == :development
31
- deps << [d.name, dep[1]]
33
+ deps << [d, dep[1]]
32
34
  end
33
35
  elsif check
34
- specs << IncompleteSpecification.new(*dep)
36
+ specs << IncompleteSpecification.new(*key)
35
37
  end
36
38
  end
37
39
 
38
- if spec = lookup["bundler"].first
39
- specs << spec
40
- end
41
-
42
40
  specs
43
41
  end
44
42
 
@@ -66,13 +64,8 @@ module Bundler
66
64
  end
67
65
 
68
66
  def materialize(deps)
69
- materialized = self.for(deps, true).uniq
67
+ materialized = self.for(deps, true)
70
68
 
71
- materialized.map! do |s|
72
- next s unless s.is_a?(LazySpecification)
73
- s.source.local!
74
- s.materialize_for_installation || s
75
- end
76
69
  SpecSet.new(materialized)
77
70
  end
78
71
 
@@ -82,7 +75,6 @@ module Bundler
82
75
  def materialized_for_all_platforms
83
76
  @specs.map do |s|
84
77
  next s unless s.is_a?(LazySpecification)
85
- s.source.local!
86
78
  s.source.remote!
87
79
  spec = s.materialize_for_installation
88
80
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
@@ -90,13 +82,8 @@ module Bundler
90
82
  end
91
83
  end
92
84
 
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)
85
+ def incomplete_ruby_specs?(deps)
86
+ self.class.new(self.for(deps, true, [Gem::Platform::RUBY])).incomplete_specs.any?
100
87
  end
101
88
 
102
89
  def missing_specs
@@ -181,13 +168,13 @@ module Bundler
181
168
  @specs.sort_by(&:name).each {|s| yield s }
182
169
  end
183
170
 
184
- def specs_for_dependency(name, platform)
185
- specs_for_name = lookup[name]
171
+ def specs_for_dependency(dep, platform)
172
+ specs_for_name = lookup[dep.name]
186
173
  if platform.nil?
187
- GemHelpers.select_best_platform_match(specs_for_name.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
174
+ matching_specs = specs_for_name.map {|s| s.materialize_for_installation if Gem::Platform.match_spec?(s) }.compact
175
+ GemHelpers.sort_best_platform_match(matching_specs, Bundler.local_platform)
188
176
  else
189
- specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, platform)
190
- specs_for_name_and_platform.any? ? specs_for_name_and_platform : specs_for_name
177
+ GemHelpers.select_best_platform_match(specs_for_name, dep.force_ruby_platform ? Gem::Platform::RUBY : platform)
191
178
  end
192
179
  end
193
180
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.19".freeze
4
+ VERSION = "2.3.20".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.3.19
4
+ version: 2.3.20
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-27 00:00:00.000000000 Z
25
+ date: 2022-08-10 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
@@ -370,7 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
370
370
  - !ruby/object:Gem::Version
371
371
  version: 2.5.2
372
372
  requirements: []
373
- rubygems_version: 3.3.19
373
+ rubygems_version: 3.3.20
374
374
  signing_key:
375
375
  specification_version: 4
376
376
  summary: The best way to manage your application's dependencies