bundler 2.2.26 → 2.2.27

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: 0f6b49cdd4d65c0b945ba09e5a1f49de540a778e19e0157ed2a376a6daf9511c
4
- data.tar.gz: 52ade727aa83b8390bb5eeaceda718c1d194d00251ea535013c9da8e58b79094
3
+ metadata.gz: 5988e5fd0ca1324bf9c9b8e72a362895d08607a7abc9a50505a86bab3fd1edf8
4
+ data.tar.gz: 1b1d0176667a30f138c328ac6a44e303f468786b9449f027c7d4a93343724d85
5
5
  SHA512:
6
- metadata.gz: 2e9f6084d7c8059af49ed11ccc1b0748babe41d40d6a363b7dad9091762c979091ad5388cc913545eb2853867ebe9ee7088c3ffb331e667eb57d04345799ab87
7
- data.tar.gz: dab0d503f64a592ec7dcc8e91ff509f149cc65e20b83db73857ea3e750f10bec57301042db96639f3d77707db78fea0a1f29338a4a3c5721dad3b8db906fd71b
6
+ metadata.gz: 70567def38031cfe17536a800a8c49ec5733a1e3f4e4399fc675bd634dfa7b87f78293bd648b387bc77a0023f06f095d7899516125032a5f7c5de4698f204170
7
+ data.tar.gz: d4c4c08b25b691821035d712cac6f31553c2d73c9b6682d1eb3e355183453cd3980d008f736cc5042d3f7a647181e3ab0875463679192cfc16305232866f5413
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # 2.2.27 (September 3, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Optimize some requires [#4887](https://github.com/rubygems/rubygems/pull/4887)
6
+ - Correctly redact credentials when using x-oauth-basic [#4866](https://github.com/rubygems/rubygems/pull/4866)
7
+
8
+ ## Bug fixes:
9
+
10
+ - Add missing key `branches:` to template for GitHub Actions [#4883](https://github.com/rubygems/rubygems/pull/4883)
11
+ - Fix `bundle plugin install` detection of already installed plugins [#4869](https://github.com/rubygems/rubygems/pull/4869)
12
+ - Make plugin installation idempotent [#4864](https://github.com/rubygems/rubygems/pull/4864)
13
+ - Fix `bundle check` showing duplicated gems when multiple platforms are locked [#4854](https://github.com/rubygems/rubygems/pull/4854)
14
+ - Fix `bundle check` incorrectly considering cached gems [#4853](https://github.com/rubygems/rubygems/pull/4853)
15
+
1
16
  # 2.2.26 (August 17, 2021)
2
17
 
3
18
  ## 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-08-17".freeze
8
- @git_commit_sha = "21fd333002".freeze
7
+ @built_at = "2021-09-03".freeze
8
+ @git_commit_sha = "b737e1c930".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -15,7 +15,7 @@ module Bundler
15
15
  definition.validate_runtime!
16
16
 
17
17
  begin
18
- definition.resolve_with_cache!
18
+ definition.resolve_only_locally!
19
19
  not_installed = definition.missing_specs
20
20
  rescue GemNotFound, VersionConflict
21
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -161,6 +161,12 @@ module Bundler
161
161
  @multisource_allowed
162
162
  end
163
163
 
164
+ def resolve_only_locally!
165
+ @remote = false
166
+ sources.local_only!
167
+ resolve
168
+ end
169
+
164
170
  def resolve_with_cache!
165
171
  sources.cached!
166
172
  resolve
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rubygems/dependency_installer"
4
3
  require_relative "worker"
5
4
  require_relative "installer/parallel_installer"
6
5
  require_relative "installer/standalone"
@@ -81,6 +81,8 @@ module Bundler
81
81
 
82
82
  deps = names.map {|name| Dependency.new name, version }
83
83
 
84
+ Bundler.configure_gem_home_and_path(Plugin.root)
85
+
84
86
  definition = Definition.new(nil, deps, source_list, true)
85
87
  install_definition(definition)
86
88
  end
@@ -13,6 +13,7 @@ module Bundler
13
13
  class MalformattedPlugin < PluginError; end
14
14
  class UndefinedCommandError < PluginError; end
15
15
  class UnknownSourceError < PluginError; end
16
+ class PluginInstallError < PluginError; end
16
17
 
17
18
  PLUGIN_FILE_NAME = "plugins.rb".freeze
18
19
 
@@ -38,12 +39,11 @@ module Bundler
38
39
  specs = Installer.new.install(names, options)
39
40
 
40
41
  save_plugins names, specs
41
- rescue PluginError => e
42
+ rescue PluginError
42
43
  specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
43
44
  specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
44
45
 
45
- names_list = names.map {|name| "`#{name}`" }.join(", ")
46
- Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}"
46
+ raise
47
47
  end
48
48
 
49
49
  # Uninstalls plugins by the given names
@@ -245,10 +245,11 @@ module Bundler
245
245
  # @param [Array<String>] names of inferred source plugins that can be ignored
246
246
  def save_plugins(plugins, specs, optional_plugins = [])
247
247
  plugins.each do |name|
248
+ next if index.installed?(name)
249
+
248
250
  spec = specs[name]
249
- validate_plugin! Pathname.new(spec.full_gem_path)
250
- installed = register_plugin(name, spec, optional_plugins.include?(name))
251
- Bundler.ui.info "Installed plugin #{name}" if installed
251
+
252
+ save_plugin(name, spec, optional_plugins.include?(name))
252
253
  end
253
254
  end
254
255
 
@@ -263,6 +264,22 @@ module Bundler
263
264
  raise MalformattedPlugin, "#{PLUGIN_FILE_NAME} was not found in the plugin." unless plugin_file.file?
264
265
  end
265
266
 
267
+ # Validates and registers a plugin.
268
+ #
269
+ # @param [String] name the name of the plugin
270
+ # @param [Specification] spec of installed plugin
271
+ # @param [Boolean] optional_plugin, removed if there is conflict with any
272
+ # other plugin (used for default source plugins)
273
+ #
274
+ # @raise [PluginInstallError] if validation or registration raises any error
275
+ def save_plugin(name, spec, optional_plugin = false)
276
+ validate_plugin! Pathname.new(spec.full_gem_path)
277
+ installed = register_plugin(name, spec, optional_plugin)
278
+ Bundler.ui.info "Installed plugin #{name}" if installed
279
+ rescue PluginError => e
280
+ raise PluginInstallError, "Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})"
281
+ end
282
+
266
283
  # Runs the plugins.rb file in an isolated namespace, records the plugin
267
284
  # actions it registers for and then passes the data to index to be stored.
268
285
  #
@@ -34,10 +34,12 @@ module Bundler
34
34
  end
35
35
 
36
36
  def build_args
37
+ require "rubygems/command"
37
38
  Gem::Command.build_args
38
39
  end
39
40
 
40
41
  def build_args=(args)
42
+ require "rubygems/command"
41
43
  Gem::Command.build_args = args
42
44
  end
43
45
 
@@ -419,7 +419,15 @@ module Bundler
419
419
  elsif is_credential(key)
420
420
  "[REDACTED]"
421
421
  elsif is_userinfo(converted)
422
- converted.gsub(/:.*$/, ":[REDACTED]")
422
+ username, pass = converted.split(":", 2)
423
+
424
+ if pass == "x-oauth-basic"
425
+ username = "[REDACTED]"
426
+ else
427
+ pass = "[REDACTED]"
428
+ end
429
+
430
+ [username, pass].join(":")
423
431
  else
424
432
  converted
425
433
  end
@@ -26,6 +26,13 @@ module Bundler
26
26
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
27
27
  end
28
28
 
29
+ def local_only!
30
+ @specs = nil
31
+ @allow_local = true
32
+ @allow_cached = false
33
+ @allow_remote = false
34
+ end
35
+
29
36
  def local!
30
37
  return if @allow_local
31
38
 
@@ -137,7 +144,7 @@ module Bundler
137
144
  end
138
145
  end
139
146
 
140
- if (installed?(spec) || Plugin.installed?(spec.name)) && !force
147
+ if installed?(spec) && !force
141
148
  print_using_message "Using #{version_message(spec)}"
142
149
  return nil # no post-install message
143
150
  end
@@ -36,6 +36,8 @@ module Bundler
36
36
 
37
37
  def local!; end
38
38
 
39
+ def local_only!; end
40
+
39
41
  def cached!; end
40
42
 
41
43
  def remote!; end
@@ -136,6 +136,10 @@ module Bundler
136
136
  different_sources?(lock_sources, replacement_sources)
137
137
  end
138
138
 
139
+ def local_only!
140
+ all_sources.each(&:local_only!)
141
+ end
142
+
139
143
  def cached!
140
144
  all_sources.each(&:cached!)
141
145
  end
@@ -24,7 +24,7 @@ module Bundler
24
24
 
25
25
  specs_for_dep = spec_for_dependency(dep, match_current_platform)
26
26
  if specs_for_dep.any?
27
- specs += specs_for_dep
27
+ match_current_platform ? specs += specs_for_dep : specs |= specs_for_dep
28
28
 
29
29
  specs_for_dep.first.dependencies.each do |d|
30
30
  next if d.type == :development
@@ -2,7 +2,8 @@ name: Ruby
2
2
 
3
3
  on:
4
4
  push:
5
- - <%= config[:git_default_branch] %>
5
+ branches:
6
+ - <%= config[:git_default_branch] %>
6
7
 
7
8
  pull_request:
8
9
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.26".freeze
4
+ VERSION = "2.2.27".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
@@ -636,6 +636,12 @@ EOF
636
636
  @rubygems = nil
637
637
  end
638
638
 
639
+ def configure_gem_home_and_path(path = bundle_path)
640
+ configure_gem_path
641
+ configure_gem_home(path)
642
+ Bundler.rubygems.clear_paths
643
+ end
644
+
639
645
  private
640
646
 
641
647
  def eval_yaml_gemspec(path, contents)
@@ -656,29 +662,17 @@ EOF
656
662
  raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
657
663
  end
658
664
 
659
- def configure_gem_home_and_path
660
- configure_gem_path
661
- configure_gem_home
662
- bundle_path
663
- end
664
-
665
- def configure_gem_path(env = ENV)
666
- blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
667
- if !use_system_gems?
665
+ def configure_gem_path
666
+ unless use_system_gems?
668
667
  # this needs to be empty string to cause
669
668
  # PathSupport.split_gem_path to only load up the
670
669
  # Bundler --path setting as the GEM_PATH.
671
- env["GEM_PATH"] = ""
672
- elsif blank_home
673
- possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
674
- paths = possibles.flatten.compact.uniq.reject(&:empty?)
675
- env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
670
+ Bundler::SharedHelpers.set_env "GEM_PATH", ""
676
671
  end
677
672
  end
678
673
 
679
- def configure_gem_home
680
- Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
681
- Bundler.rubygems.clear_paths
674
+ def configure_gem_home(path)
675
+ Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s
682
676
  end
683
677
 
684
678
  def tmp_home_path
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.26
4
+ version: 2.2.27
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-08-17 00:00:00.000000000 Z
25
+ date: 2021-09-03 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.26
357
+ rubygems_version: 3.2.27
358
358
  signing_key:
359
359
  specification_version: 4
360
360
  summary: The best way to manage your application's dependencies