bundler 2.2.22 → 2.2.23

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd506f45451a29ba6416b7b97ee93f67f40e71b8ef9c9db79484ff6f840d6189
4
- data.tar.gz: bb18e91f6cfbd8c62febba280ebcb91de345e9fdc5599a7a44245ff47364a141
3
+ metadata.gz: a22f09c258df906bb0acb91d7c4b7cc04a527652c11af80e3e34de0b30431235
4
+ data.tar.gz: 587a4d96883fbec8b4de1b5f7b90748c2cda84dd7dead9dcf733e6e1700f16f3
5
5
  SHA512:
6
- metadata.gz: 1d9dc3b77ecff1849b900a3164578eb40371afeb49f2f1c557485b9647f71292fbf43dd61501416afdfdd9cd50d6da581606aec5c349550a1ea97153e3f94b98
7
- data.tar.gz: ae00d5fa66bd664d65915cf15df9431512dc6a77b35f4b60f7faf649962fbd06d56f0b7b7a0659b7ef9ff2c23860c862d8b5b888d43714c714a6af6fbd5b524a
6
+ metadata.gz: 7a08c50ac38e23d98cdf930668c0f276e857553c8412c4d92fc1692b0500eac62e1038330e685e183bac97ba27537e374f6e539a6189d712ceaafbf8d1ff28d4
7
+ data.tar.gz: 14b76dccfb16d4a8d1a9e3a5e867a1b6b552b6809f1b8244f11588e41e4affeb16365fe0cb53a707dba144cb2ce7c7e119882e4b3d8f6b38537b4ba8698a701b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 2.2.23 (July 9, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Fix `bundle install` on truffleruby selecting incorrect variant for `sorbet-static` gem [#4625](https://github.com/rubygems/rubygems/pull/4625)
6
+ - Spare meaningless warning on read-only bundle invocations [#4724](https://github.com/rubygems/rubygems/pull/4724)
7
+
8
+ ## Bug fixes:
9
+
10
+ - Fix incorrect warning about duplicated gems in the Gemfile [#4732](https://github.com/rubygems/rubygems/pull/4732)
11
+ - Fix `bundle plugin install foo` crashing [#4734](https://github.com/rubygems/rubygems/pull/4734)
12
+
1
13
  # 2.2.22 (July 6, 2021)
2
14
 
3
15
  ## Enhancements:
data/lib/bundler.rb CHANGED
@@ -236,8 +236,9 @@ module Bundler
236
236
  end
237
237
 
238
238
  if warning
239
- user_home = tmp_home_path(warning)
240
- Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
239
+ Bundler.ui.warn "#{warning}\n"
240
+ user_home = tmp_home_path
241
+ Bundler.ui.warn "Bundler will use `#{user_home}' as your home directory temporarily.\n"
241
242
  user_home
242
243
  else
243
244
  Pathname.new(home)
@@ -684,15 +685,13 @@ EOF
684
685
  Bundler.rubygems.clear_paths
685
686
  end
686
687
 
687
- def tmp_home_path(warning)
688
+ def tmp_home_path
688
689
  Kernel.send(:require, "tmpdir")
689
690
  SharedHelpers.filesystem_access(Dir.tmpdir) do
690
691
  path = Bundler.tmp
691
692
  at_exit { Bundler.rm_rf(path) }
692
693
  path
693
694
  end
694
- rescue RuntimeError => e
695
- raise e.exception("#{warning}\nBundler also failed to create a temporary home directory':\n#{e}")
696
695
  end
697
696
 
698
697
  # @param env [Hash]
@@ -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-06".freeze
8
- @git_commit_sha = "0bdd3e8e71".freeze
7
+ @built_at = "2021-07-09".freeze
8
+ @git_commit_sha = "e863a3905d".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
data/lib/bundler/dsl.rb CHANGED
@@ -102,28 +102,26 @@ 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
105
106
 
106
107
  if current.requirement != dep.requirement
107
- unless deleted_dep
108
- return if dep.type == :development
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")
119
- end
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")
120
119
  end
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
120
  end
126
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}"
127
125
  else
128
126
  Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
129
127
  "You should probably keep only one of them.\n" \
@@ -132,12 +130,10 @@ module Bundler
132
130
  end
133
131
 
134
132
  if current.source != dep.source
135
- unless deleted_dep
136
- return if dep.type == :development
137
- raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
138
- "You specified that #{dep.name} (#{dep.requirement}) should come from " \
139
- "#{current.source || "an unspecified source"} and #{dep.source}\n"
140
- end
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"
141
137
  end
142
138
  end
143
139
 
data/lib/bundler/index.rb CHANGED
@@ -195,11 +195,7 @@ module Bundler
195
195
  if base # allow all platforms when searching from a lockfile
196
196
  dependency.matches_spec?(spec)
197
197
  else
198
- if Gem::Platform.respond_to? :match_spec?
199
- dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
200
- else
201
- dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform)
202
- end
198
+ dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
203
199
  end
204
200
  end
205
201
 
@@ -77,7 +77,7 @@ module Bundler
77
77
  source_list = SourceList.new
78
78
 
79
79
  source_list.add_git_source(git_source_options) if git_source_options
80
- source_list.add_global_rubygems_remote(rubygems_source) if rubygems_source
80
+ Array(rubygems_source).each {|remote| source_list.add_global_rubygems_remote(remote) } if rubygems_source
81
81
 
82
82
  deps = names.map {|name| Dependency.new name, version }
83
83
 
@@ -174,20 +174,36 @@ module Gem
174
174
  end
175
175
  end
176
176
 
177
+ require "rubygems/platform"
178
+
177
179
  class Platform
178
180
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
179
181
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
180
182
  MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
181
183
  MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
182
184
  X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
185
+ end
183
186
 
184
- undef_method :hash if method_defined? :hash
185
- def hash
186
- @cpu.hash ^ @os.hash ^ @version.hash
187
- end
187
+ Platform.singleton_class.module_eval do
188
+ unless Platform.singleton_methods.include?(:match_spec?)
189
+ def match_spec?(spec)
190
+ match_gem?(spec.platform, spec.name)
191
+ end
188
192
 
189
- undef_method :eql? if method_defined? :eql?
190
- alias_method :eql?, :==
193
+ def match_gem?(platform, gem_name)
194
+ match_platforms?(platform, Gem.platforms)
195
+ end
196
+
197
+ private
198
+
199
+ def match_platforms?(platform, platforms)
200
+ platforms.any? do |local_platform|
201
+ platform.nil? ||
202
+ local_platform == platform ||
203
+ (local_platform != Gem::Platform::RUBY && local_platform =~ platform)
204
+ end
205
+ end
206
+ end
191
207
  end
192
208
 
193
209
  require "rubygems/util"
@@ -428,12 +428,8 @@ module Bundler
428
428
  def global_config_file
429
429
  if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
430
430
  Pathname.new(ENV["BUNDLE_CONFIG"])
431
- else
432
- begin
433
- Bundler.user_bundle_path("config")
434
- rescue PermissionError, GenericSystemCallError
435
- nil
436
- end
431
+ elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
432
+ Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
437
433
  end
438
434
  end
439
435
 
@@ -195,7 +195,7 @@ module Bundler
195
195
  def spec_for_dependency(dep, match_current_platform)
196
196
  specs_for_platforms = lookup[dep.name]
197
197
  if match_current_platform
198
- GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
198
+ GemHelpers.select_best_platform_match(specs_for_platforms.select{|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform)
199
199
  else
200
200
  GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
201
201
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.22".freeze
4
+ VERSION = "2.2.23".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.22
4
+ version: 2.2.23
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-06 00:00:00.000000000 Z
25
+ date: 2021-07-09 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.22
357
+ rubygems_version: 3.2.23
358
358
  signing_key:
359
359
  specification_version: 4
360
360
  summary: The best way to manage your application's dependencies