bundler 2.2.23 → 2.2.24

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: a22f09c258df906bb0acb91d7c4b7cc04a527652c11af80e3e34de0b30431235
4
- data.tar.gz: 587a4d96883fbec8b4de1b5f7b90748c2cda84dd7dead9dcf733e6e1700f16f3
3
+ metadata.gz: 2bc6a3aafe599f19f103462212788c65ebd7558c7c0ba8208730b58f06a07d2a
4
+ data.tar.gz: 36328d242818c34ef2a7477ea918941cbbd9469d3e747eed35eacbc178709a65
5
5
  SHA512:
6
- metadata.gz: 7a08c50ac38e23d98cdf930668c0f276e857553c8412c4d92fc1692b0500eac62e1038330e685e183bac97ba27537e374f6e539a6189d712ceaafbf8d1ff28d4
7
- data.tar.gz: 14b76dccfb16d4a8d1a9e3a5e867a1b6b552b6809f1b8244f11588e41e4affeb16365fe0cb53a707dba144cb2ce7c7e119882e4b3d8f6b38537b4ba8698a701b
6
+ metadata.gz: 1bbd69e10ba06b85eba9d4d282c0ca7337b2d97c614418dfa036883ae9cf0ff34eb50ecfb025a7555abf65026d64359b061ade7fdb76a57558d3f9b025ffff8e
7
+ data.tar.gz: affea641347f4d123b2d24b39ea6b2eb0f0a97fb8377b9d3a52812dab08faa7c0a134f41a33cf785fc498ba3cf32162f5d213a33f825d24bcdd053ed90332b20
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 2.2.24 (July 15, 2021)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Fix development gem unintentionally removed on an edge case [#4751](https://github.com/rubygems/rubygems/pull/4751)
6
+ - Fix dangling empty plugin hooks [#4755](https://github.com/rubygems/rubygems/pull/4755)
7
+ - Fix `bundle plugin install --help` showing `bundle install`'s help [#4756](https://github.com/rubygems/rubygems/pull/4756)
8
+ - Make sure `bundle check` shows uniq missing gems [#4749](https://github.com/rubygems/rubygems/pull/4749)
9
+
10
+ ## Performance:
11
+
12
+ - Slightly speed up `bundler/setup` [#4750](https://github.com/rubygems/rubygems/pull/4750)
13
+
1
14
  # 2.2.23 (July 9, 2021)
2
15
 
3
16
  ## 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 = "2021-07-09".freeze
8
- @git_commit_sha = "e863a3905d".freeze
7
+ @built_at = "2021-07-15".freeze
8
+ @git_commit_sha = "d78b1ee235".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
data/lib/bundler/cli.rb CHANGED
@@ -14,6 +14,7 @@ module Bundler
14
14
  COMMAND_ALIASES = {
15
15
  "check" => "c",
16
16
  "install" => "i",
17
+ "plugin" => "",
17
18
  "list" => "ls",
18
19
  "exec" => ["e", "ex", "exe"],
19
20
  "cache" => ["package", "pack"],
@@ -133,7 +133,7 @@ module Bundler
133
133
  @unlock[:gems] ||= @dependencies.map(&:name)
134
134
  else
135
135
  eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
136
- @unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
136
+ @unlock[:gems] = @locked_specs.for(eager_unlock, false, false, false).map(&:name)
137
137
  end
138
138
 
139
139
  @dependency_changes = converge_dependencies
@@ -185,25 +185,15 @@ module Bundler
185
185
  #
186
186
  # @return [Bundler::SpecSet]
187
187
  def specs
188
- @specs ||= begin
189
- begin
190
- specs = resolve.materialize(requested_dependencies)
191
- rescue GemNotFound => e # Handle yanked gem
192
- gem_name, gem_version = extract_gem_info(e)
193
- locked_gem = @locked_specs[gem_name].last
194
- raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
195
- raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
196
- "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
197
- "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
198
- "removed in order to install."
199
- end
200
- unless specs["bundler"].any?
201
- bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
202
- specs["bundler"] = bundler
203
- end
204
-
205
- specs
206
- end
188
+ @specs ||= add_bundler_to(resolve.materialize(requested_dependencies))
189
+ rescue GemNotFound => e # Handle yanked gem
190
+ gem_name, gem_version = extract_gem_info(e)
191
+ locked_gem = @locked_specs[gem_name].last
192
+ raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
193
+ raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
194
+ "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
195
+ "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
196
+ "removed in order to install."
207
197
  end
208
198
 
209
199
  def new_specs
@@ -235,17 +225,11 @@ module Bundler
235
225
  end
236
226
 
237
227
  def requested_specs
238
- @requested_specs ||= begin
239
- groups = requested_groups
240
- groups.map!(&:to_sym)
241
- specs_for(groups)
242
- end
228
+ specs_for(requested_groups)
243
229
  end
244
230
 
245
231
  def requested_dependencies
246
- groups = requested_groups
247
- groups.map!(&:to_sym)
248
- dependencies_for(groups)
232
+ dependencies_for(requested_groups)
249
233
  end
250
234
 
251
235
  def current_dependencies
@@ -255,11 +239,13 @@ module Bundler
255
239
  end
256
240
 
257
241
  def specs_for(groups)
242
+ groups = requested_groups if groups.empty?
258
243
  deps = dependencies_for(groups)
259
- SpecSet.new(specs.for(expand_dependencies(deps)))
244
+ add_bundler_to(resolve.materialize(expand_dependencies(deps)))
260
245
  end
261
246
 
262
247
  def dependencies_for(groups)
248
+ groups.map!(&:to_sym)
263
249
  current_dependencies.reject do |d|
264
250
  (d.groups & groups).empty?
265
251
  end
@@ -507,6 +493,15 @@ module Bundler
507
493
 
508
494
  private
509
495
 
496
+ def add_bundler_to(specs)
497
+ unless specs["bundler"].any?
498
+ bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
499
+ specs["bundler"] = bundler
500
+ end
501
+
502
+ specs
503
+ end
504
+
510
505
  def precompute_source_requirements_for_indirect_dependencies?
511
506
  sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
512
507
  end
@@ -735,7 +730,7 @@ module Bundler
735
730
  # if we won't need the source (according to the lockfile),
736
731
  # don't error if the path/git source isn't available
737
732
  next if @locked_specs.
738
- for(requested_dependencies, [], false, true, false).
733
+ for(requested_dependencies, false, true, false).
739
734
  none? {|locked_spec| locked_spec.source == s.source }
740
735
 
741
736
  raise
@@ -754,8 +749,8 @@ module Bundler
754
749
  end
755
750
 
756
751
  resolve = SpecSet.new(converged)
757
- @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), @unlock[:gems], true, true)
758
- resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), [], false, false, false).reject{|s| @unlock[:gems].include?(s.name) })
752
+ @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), true, true)
753
+ resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false, false).reject{|s| @unlock[:gems].include?(s.name) })
759
754
  diff = nil
760
755
 
761
756
  # Now, we unlock any sources that do not have anymore gems pinned to it
data/lib/bundler/dsl.rb CHANGED
@@ -102,38 +102,39 @@ module Bundler
102
102
  # if there's already a dependency with this name we try to prefer one
103
103
  if current = @dependencies.find {|d| d.name == dep.name }
104
104
  deleted_dep = @dependencies.delete(current) if current.type == :development
105
- return if deleted_dep
106
105
 
107
- if current.requirement != dep.requirement
108
- return if dep.type == :development
106
+ unless deleted_dep
107
+ if current.requirement != dep.requirement
108
+ return if dep.type == :development
109
109
 
110
- update_prompt = ""
110
+ update_prompt = ""
111
111
 
112
- if File.basename(@gemfile) == Injector::INJECTED_GEMS
113
- if dep.requirements_list.include?(">= 0") && !current.requirements_list.include?(">= 0")
114
- update_prompt = ". Gem already added"
115
- else
116
- update_prompt = ". If you want to update the gem version, run `bundle update #{current.name}`"
112
+ if File.basename(@gemfile) == Injector::INJECTED_GEMS
113
+ if dep.requirements_list.include?(">= 0") && !current.requirements_list.include?(">= 0")
114
+ update_prompt = ". Gem already added"
115
+ else
116
+ update_prompt = ". If you want to update the gem version, run `bundle update #{current.name}`"
117
117
 
118
- update_prompt += ". You may also need to change the version requirement specified in the Gemfile if it's too restrictive." unless current.requirements_list.include?(">= 0")
118
+ update_prompt += ". You may also need to change the version requirement specified in the Gemfile if it's too restrictive." unless current.requirements_list.include?(">= 0")
119
+ end
119
120
  end
120
- end
121
121
 
122
- raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
123
- "You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
124
- "#{update_prompt}"
125
- else
126
- Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
127
- "You should probably keep only one of them.\n" \
128
- "Remove any duplicate entries and specify the gem only once.\n" \
129
- "While it's not a problem now, it could cause errors if you change the version of one of them later."
130
- end
122
+ raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
123
+ "You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
124
+ "#{update_prompt}"
125
+ else
126
+ Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
127
+ "You should probably keep only one of them.\n" \
128
+ "Remove any duplicate entries and specify the gem only once.\n" \
129
+ "While it's not a problem now, it could cause errors if you change the version of one of them later."
130
+ end
131
131
 
132
- if current.source != dep.source
133
- return if dep.type == :development
134
- raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
135
- "You specified that #{dep.name} (#{dep.requirement}) should come from " \
136
- "#{current.source || "an unspecified source"} and #{dep.source}\n"
132
+ if current.source != dep.source
133
+ return if dep.type == :development
134
+ raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
135
+ "You specified that #{dep.name} (#{dep.requirement}) should come from " \
136
+ "#{current.source || "an unspecified source"} and #{dep.source}\n"
137
+ end
137
138
  end
138
139
  end
139
140
 
@@ -3,7 +3,7 @@
3
3
  module Bundler
4
4
  class Standalone
5
5
  def initialize(groups, definition)
6
- @specs = groups.empty? ? definition.requested_specs : definition.specs_for(groups.map(&:to_sym))
6
+ @specs = definition.specs_for(groups)
7
7
  end
8
8
 
9
9
  def generate
@@ -309,6 +309,8 @@ module Bundler
309
309
  #
310
310
  # @param [String] name of the plugin
311
311
  def load_plugin(name)
312
+ return unless name && !name.empty?
313
+
312
314
  # Need to ensure before this that plugin root where the rest of gems
313
315
  # are installed to be on load path to support plugin deps. Currently not
314
316
  # done to avoid conflicts
@@ -74,7 +74,10 @@ module Bundler
74
74
  def unregister_plugin(name)
75
75
  @commands.delete_if {|_, v| v == name }
76
76
  @sources.delete_if {|_, v| v == name }
77
- @hooks.each {|_, plugin_names| plugin_names.delete(name) }
77
+ @hooks.each do |hook, names|
78
+ names.delete(name)
79
+ @hooks.delete(hook) if names.empty?
80
+ end
78
81
  @plugin_paths.delete(name)
79
82
  @load_paths.delete(name)
80
83
  save_index
@@ -12,12 +12,10 @@ module Bundler
12
12
  def setup(*groups)
13
13
  @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle?
14
14
 
15
- groups.map!(&:to_sym)
16
-
17
15
  # Has to happen first
18
16
  clean_load_path
19
17
 
20
- specs = groups.any? ? @definition.specs_for(groups) : requested_specs
18
+ specs = @definition.specs_for(groups)
21
19
 
22
20
  SharedHelpers.set_bundle_environment
23
21
  Bundler.rubygems.replace_entrypoints(specs)
@@ -11,15 +11,14 @@ module Bundler
11
11
  @specs = specs
12
12
  end
13
13
 
14
- def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
14
+ def for(dependencies, check = false, match_current_platform = false, raise_on_missing = true)
15
15
  handled = []
16
16
  deps = dependencies.dup
17
17
  specs = []
18
- skip += ["bundler"]
19
18
 
20
19
  loop do
21
20
  break unless dep = deps.shift
22
- next if handled.include?(dep) || skip.include?(dep.name)
21
+ next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"
23
22
 
24
23
  handled << dep
25
24
 
@@ -73,7 +72,7 @@ module Bundler
73
72
  end
74
73
 
75
74
  def materialize(deps, missing_specs = nil)
76
- materialized = self.for(deps, [], false, true, !missing_specs)
75
+ materialized = self.for(deps, false, true, !missing_specs)
77
76
 
78
77
  materialized.group_by(&:source).each do |source, specs|
79
78
  next unless specs.any?{|s| s.is_a?(LazySpecification) }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.23".freeze
4
+ VERSION = "2.2.24".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.2.23
4
+ version: 2.2.24
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: 2021-07-09 00:00:00.000000000 Z
25
+ date: 2021-07-15 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
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
354
354
  - !ruby/object:Gem::Version
355
355
  version: 2.5.2
356
356
  requirements: []
357
- rubygems_version: 3.2.23
357
+ rubygems_version: 3.2.24
358
358
  signing_key:
359
359
  specification_version: 4
360
360
  summary: The best way to manage your application's dependencies