bundler 2.4.22 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/bundler.gemspec +4 -2
  4. data/exe/bundle +1 -10
  5. data/lib/bundler/build_metadata.rb +3 -3
  6. data/lib/bundler/capistrano.rb +1 -1
  7. data/lib/bundler/checksum.rb +245 -0
  8. data/lib/bundler/ci_detector.rb +75 -0
  9. data/lib/bundler/cli/add.rb +3 -3
  10. data/lib/bundler/cli/binstubs.rb +4 -4
  11. data/lib/bundler/cli/cache.rb +1 -1
  12. data/lib/bundler/cli/check.rb +1 -1
  13. data/lib/bundler/cli/common.rb +9 -1
  14. data/lib/bundler/cli/config.rb +8 -7
  15. data/lib/bundler/cli/console.rb +3 -2
  16. data/lib/bundler/cli/doctor.rb +2 -2
  17. data/lib/bundler/cli/exec.rb +1 -1
  18. data/lib/bundler/cli/gem.rb +28 -23
  19. data/lib/bundler/cli/info.rb +2 -13
  20. data/lib/bundler/cli/install.rb +5 -4
  21. data/lib/bundler/cli/issue.rb +1 -1
  22. data/lib/bundler/cli/lock.rb +4 -4
  23. data/lib/bundler/cli/open.rb +1 -1
  24. data/lib/bundler/cli/outdated.rb +6 -6
  25. data/lib/bundler/cli/plugin.rb +7 -14
  26. data/lib/bundler/cli/pristine.rb +38 -30
  27. data/lib/bundler/cli/show.rb +2 -2
  28. data/lib/bundler/cli/update.rb +5 -5
  29. data/lib/bundler/cli.rb +215 -263
  30. data/lib/bundler/compact_index_client/cache.rb +29 -9
  31. data/lib/bundler/compact_index_client/cache_file.rb +153 -0
  32. data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
  33. data/lib/bundler/compact_index_client/updater.rb +79 -81
  34. data/lib/bundler/compact_index_client.rb +14 -7
  35. data/lib/bundler/constants.rb +1 -1
  36. data/lib/bundler/current_ruby.rb +5 -21
  37. data/lib/bundler/definition.rb +42 -15
  38. data/lib/bundler/dependency.rb +16 -12
  39. data/lib/bundler/digest.rb +2 -2
  40. data/lib/bundler/dsl.rb +43 -25
  41. data/lib/bundler/endpoint_specification.rb +5 -1
  42. data/lib/bundler/env.rb +1 -3
  43. data/lib/bundler/errors.rb +43 -0
  44. data/lib/bundler/fetcher/base.rb +3 -1
  45. data/lib/bundler/fetcher/compact_index.rb +4 -4
  46. data/lib/bundler/fetcher/downloader.rb +13 -11
  47. data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
  48. data/lib/bundler/fetcher/index.rb +1 -1
  49. data/lib/bundler/fetcher.rb +28 -25
  50. data/lib/bundler/friendly_errors.rb +5 -5
  51. data/lib/bundler/gem_helper.rb +1 -1
  52. data/lib/bundler/gem_helpers.rb +5 -2
  53. data/lib/bundler/graph.rb +9 -9
  54. data/lib/bundler/index.rb +1 -2
  55. data/lib/bundler/injector.rb +1 -1
  56. data/lib/bundler/inline.rb +3 -3
  57. data/lib/bundler/installer/gem_installer.rb +5 -5
  58. data/lib/bundler/installer/parallel_installer.rb +16 -8
  59. data/lib/bundler/installer/standalone.rb +2 -3
  60. data/lib/bundler/installer.rb +9 -9
  61. data/lib/bundler/lazy_specification.rb +24 -17
  62. data/lib/bundler/lockfile_generator.rb +9 -0
  63. data/lib/bundler/lockfile_parser.rb +81 -10
  64. data/lib/bundler/man/bundle-add.1 +3 -26
  65. data/lib/bundler/man/bundle-binstubs.1 +4 -16
  66. data/lib/bundler/man/bundle-cache.1 +3 -24
  67. data/lib/bundler/man/bundle-check.1 +3 -12
  68. data/lib/bundler/man/bundle-clean.1 +3 -10
  69. data/lib/bundler/man/bundle-config.1 +20 -211
  70. data/lib/bundler/man/bundle-config.1.ronn +6 -0
  71. data/lib/bundler/man/bundle-console.1 +4 -22
  72. data/lib/bundler/man/bundle-doctor.1 +4 -18
  73. data/lib/bundler/man/bundle-exec.1 +12 -73
  74. data/lib/bundler/man/bundle-gem.1 +13 -49
  75. data/lib/bundler/man/bundle-help.1 +3 -7
  76. data/lib/bundler/man/bundle-info.1 +3 -9
  77. data/lib/bundler/man/bundle-init.1 +3 -12
  78. data/lib/bundler/man/bundle-inject.1 +6 -19
  79. data/lib/bundler/man/bundle-install.1 +27 -125
  80. data/lib/bundler/man/bundle-install.1.ronn +1 -0
  81. data/lib/bundler/man/bundle-list.1 +4 -19
  82. data/lib/bundler/man/bundle-lock.1 +5 -29
  83. data/lib/bundler/man/bundle-open.1 +7 -27
  84. data/lib/bundler/man/bundle-outdated.1 +3 -55
  85. data/lib/bundler/man/bundle-outdated.1.ronn +1 -0
  86. data/lib/bundler/man/bundle-platform.1 +5 -27
  87. data/lib/bundler/man/bundle-plugin.1 +3 -29
  88. data/lib/bundler/man/bundle-pristine.1 +5 -16
  89. data/lib/bundler/man/bundle-remove.1 +4 -14
  90. data/lib/bundler/man/bundle-show.1 +3 -10
  91. data/lib/bundler/man/bundle-update.1 +18 -137
  92. data/lib/bundler/man/bundle-version.1 +3 -16
  93. data/lib/bundler/man/bundle-viz.1 +4 -16
  94. data/lib/bundler/man/bundle.1 +5 -44
  95. data/lib/bundler/man/gemfile.5 +24 -301
  96. data/lib/bundler/man/gemfile.5.ronn +4 -0
  97. data/lib/bundler/match_metadata.rb +4 -0
  98. data/lib/bundler/match_platform.rb +1 -1
  99. data/lib/bundler/plugin/api/source.rb +3 -2
  100. data/lib/bundler/plugin/installer.rb +1 -1
  101. data/lib/bundler/plugin.rb +3 -3
  102. data/lib/bundler/resolver/base.rb +1 -1
  103. data/lib/bundler/resolver/incompatibility.rb +1 -1
  104. data/lib/bundler/resolver/spec_group.rb +1 -4
  105. data/lib/bundler/resolver.rb +16 -16
  106. data/lib/bundler/ruby_dsl.rb +20 -12
  107. data/lib/bundler/ruby_version.rb +1 -1
  108. data/lib/bundler/rubygems_ext.rb +24 -50
  109. data/lib/bundler/rubygems_gem_installer.rb +6 -56
  110. data/lib/bundler/rubygems_integration.rb +25 -94
  111. data/lib/bundler/runtime.rb +2 -2
  112. data/lib/bundler/self_manager.rb +23 -7
  113. data/lib/bundler/settings.rb +27 -7
  114. data/lib/bundler/setup.rb +4 -1
  115. data/lib/bundler/shared_helpers.rb +35 -13
  116. data/lib/bundler/source/git/git_proxy.rb +15 -15
  117. data/lib/bundler/source/git.rb +4 -3
  118. data/lib/bundler/source/metadata.rb +15 -15
  119. data/lib/bundler/source/path.rb +7 -6
  120. data/lib/bundler/source/rubygems.rb +21 -14
  121. data/lib/bundler/source.rb +2 -0
  122. data/lib/bundler/spec_set.rb +38 -10
  123. data/lib/bundler/stub_specification.rb +1 -0
  124. data/lib/bundler/templates/Executable.bundler +1 -1
  125. data/lib/bundler/templates/newgem/README.md.tt +3 -3
  126. data/lib/bundler/templates/newgem/Rakefile.tt +2 -6
  127. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
  128. data/lib/bundler/templates/newgem/standard.yml.tt +1 -1
  129. data/lib/bundler/ui/shell.rb +1 -1
  130. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  131. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +53 -6
  132. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +8 -20
  133. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +3 -3
  134. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +2 -2
  135. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
  136. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +35 -35
  137. data/lib/bundler/vendor/tsort/lib/tsort.rb +3 -0
  138. data/lib/bundler/vendor/uri/lib/uri/common.rb +256 -132
  139. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1 -0
  140. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +95 -31
  141. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  142. data/lib/bundler/vendored_net_http.rb +8 -0
  143. data/lib/bundler/vendored_persistent.rb +0 -4
  144. data/lib/bundler/vendored_timeout.rb +8 -0
  145. data/lib/bundler/version.rb +1 -1
  146. data/lib/bundler/vlad.rb +1 -1
  147. data/lib/bundler/yaml_serializer.rb +3 -3
  148. data/lib/bundler.rb +38 -27
  149. metadata +11 -5
@@ -11,7 +11,7 @@ module Bundler
11
11
  class CLI::Gem
12
12
  TEST_FRAMEWORK_VERSIONS = {
13
13
  "rspec" => "3.0",
14
- "minitest" => "5.0",
14
+ "minitest" => "5.16",
15
15
  "test-unit" => "3.0",
16
16
  }.freeze
17
17
 
@@ -59,23 +59,23 @@ module Bundler
59
59
  end
60
60
 
61
61
  config = {
62
- :name => name,
63
- :underscored_name => underscored_name,
64
- :namespaced_path => namespaced_path,
65
- :makefile_path => "#{underscored_name}/#{underscored_name}",
66
- :constant_name => constant_name,
67
- :constant_array => constant_array,
68
- :author => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
69
- :email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
70
- :test => options[:test],
71
- :ext => extension,
72
- :exe => options[:exe],
73
- :bundler_version => bundler_dependency_version,
74
- :git => use_git,
75
- :github_username => github_username.empty? ? "[USERNAME]" : github_username,
76
- :required_ruby_version => required_ruby_version,
77
- :rust_builder_required_rubygems_version => rust_builder_required_rubygems_version,
78
- :minitest_constant_name => minitest_constant_name,
62
+ name: name,
63
+ underscored_name: underscored_name,
64
+ namespaced_path: namespaced_path,
65
+ makefile_path: "#{underscored_name}/#{underscored_name}",
66
+ constant_name: constant_name,
67
+ constant_array: constant_array,
68
+ author: git_author_name.empty? ? "TODO: Write your name" : git_author_name,
69
+ email: git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
70
+ test: options[:test],
71
+ ext: extension,
72
+ exe: options[:exe],
73
+ bundler_version: bundler_dependency_version,
74
+ git: use_git,
75
+ github_username: github_username.empty? ? "[USERNAME]" : github_username,
76
+ required_ruby_version: required_ruby_version,
77
+ rust_builder_required_rubygems_version: rust_builder_required_rubygems_version,
78
+ minitest_constant_name: minitest_constant_name,
79
79
  }
80
80
  ensure_safe_gem_name(name, constant_array)
81
81
 
@@ -236,7 +236,7 @@ module Bundler
236
236
  end
237
237
 
238
238
  if use_git
239
- IO.popen(%w[git add .], { :chdir => target }, &:read)
239
+ IO.popen(%w[git add .], { chdir: target }, &:read)
240
240
  end
241
241
 
242
242
  # Open gemspec in editor
@@ -349,7 +349,7 @@ module Bundler
349
349
  Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
350
350
  "Supported Linters:\n" \
351
351
  "* RuboCop: https://rubocop.org\n" \
352
- "* Standard: https://github.com/testdouble/standard\n" \
352
+ "* Standard: https://github.com/standardrb/standard\n" \
353
353
  "\n"
354
354
  Bundler.ui.info hint_text("linter")
355
355
 
@@ -380,15 +380,20 @@ module Bundler
380
380
  def deprecated_rubocop_option
381
381
  if !options[:rubocop].nil?
382
382
  if options[:rubocop]
383
- Bundler::SharedHelpers.major_deprecation 2, "--rubocop is deprecated, use --linter=rubocop"
383
+ Bundler::SharedHelpers.major_deprecation 2,
384
+ "--rubocop is deprecated, use --linter=rubocop",
385
+ removed_message: "--rubocop has been removed, use --linter=rubocop"
384
386
  "rubocop"
385
387
  else
386
- Bundler::SharedHelpers.major_deprecation 2, "--no-rubocop is deprecated, use --linter"
388
+ Bundler::SharedHelpers.major_deprecation 2,
389
+ "--no-rubocop is deprecated, use --linter",
390
+ removed_message: "--no-rubocop has been removed, use --linter"
387
391
  false
388
392
  end
389
393
  elsif !Bundler.settings["gem.rubocop"].nil?
390
394
  Bundler::SharedHelpers.major_deprecation 2,
391
- "config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
395
+ "config gem.rubocop is deprecated; we've updated your config to use gem.linter instead",
396
+ removed_message: "config gem.rubocop has been removed; we've updated your config to use gem.linter instead"
392
397
  Bundler.settings["gem.rubocop"] ? "rubocop" : false
393
398
  end
394
399
  end
@@ -25,19 +25,8 @@ module Bundler
25
25
 
26
26
  private
27
27
 
28
- def spec_for_gem(gem_name)
29
- spec = Bundler.definition.specs.find {|s| s.name == gem_name }
30
- spec || default_gem_spec(gem_name) || Bundler::CLI::Common.select_spec(gem_name, :regex_match)
31
- end
32
-
33
- def default_gem_spec(gem_name)
34
- return unless Gem::Specification.respond_to?(:find_all_by_name)
35
- gem_spec = Gem::Specification.find_all_by_name(gem_name).last
36
- gem_spec if gem_spec&.default_gem?
37
- end
38
-
39
- def spec_not_found(gem_name)
40
- raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
28
+ def spec_for_gem(name)
29
+ Bundler::CLI::Common.select_spec(name, :regex_match)
41
30
  end
42
31
 
43
32
  def print_gem_version(spec)
@@ -51,7 +51,8 @@ module Bundler
51
51
 
52
52
  if options["binstubs"]
53
53
  Bundler::SharedHelpers.major_deprecation 2,
54
- "The --binstubs option will be removed in favor of `bundle binstubs --all`"
54
+ "The --binstubs option will be removed in favor of `bundle binstubs --all`",
55
+ removed_message: "The --binstubs option have been removed in favor of `bundle binstubs --all`"
55
56
  end
56
57
 
57
58
  Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
@@ -61,7 +62,7 @@ module Bundler
61
62
 
62
63
  installer = Installer.install(Bundler.root, definition, options)
63
64
 
64
- Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
65
+ Bundler.settings.temporary(cache_all_platforms: options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
65
66
  Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
66
67
  end
67
68
 
@@ -95,7 +96,7 @@ module Bundler
95
96
  def warn_if_root
96
97
  return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero?
97
98
  Bundler.ui.warn "Don't run Bundler as root. Installing your bundle as root " \
98
- "will break this application for all non-root users on this machine.", :wrap => true
99
+ "will break this application for all non-root users on this machine.", wrap: true
99
100
  end
100
101
 
101
102
  def dependencies_count_for(definition)
@@ -148,7 +149,7 @@ module Bundler
148
149
  Bundler.settings.set_command_option_if_given :path, options[:path]
149
150
 
150
151
  if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
151
- Bundler.settings.temporary(:path_relative_to_cwd => false) do
152
+ Bundler.settings.temporary(path_relative_to_cwd: false) do
152
153
  Bundler.settings.set_command_option :path, "bundle"
153
154
  end
154
155
  end
@@ -5,7 +5,7 @@ require "rbconfig"
5
5
  module Bundler
6
6
  class CLI::Issue
7
7
  def run
8
- Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
8
+ Bundler.ui.info <<~EOS
9
9
  Did you find an issue with Bundler? Before filing a new issue,
10
10
  be sure to check out these resources:
11
11
 
@@ -26,14 +26,14 @@ module Bundler
26
26
 
27
27
  if update.is_a?(Array) # unlocking specific gems
28
28
  Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
29
- update = { :gems => update, :conservative => conservative }
29
+ update = { gems: update, conservative: conservative }
30
30
  elsif update && conservative
31
- update = { :conservative => conservative }
31
+ update = { conservative: conservative }
32
32
  elsif update && bundler
33
- update = { :bundler => bundler }
33
+ update = { bundler: bundler }
34
34
  end
35
35
 
36
- Bundler.settings.temporary(:frozen => false) do
36
+ Bundler.settings.temporary(frozen: false) do
37
37
  definition = Bundler.definition(update)
38
38
 
39
39
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
@@ -21,7 +21,7 @@ module Bundler
21
21
  require "shellwords"
22
22
  command = Shellwords.split(editor) << File.join([root_path, path].compact)
23
23
  Bundler.with_original_env do
24
- system(*command, { :chdir => root_path })
24
+ system(*command, { chdir: root_path })
25
25
  end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
26
26
  end
27
27
  end
@@ -41,12 +41,12 @@ module Bundler
41
41
  # We're doing a full update
42
42
  Bundler.definition(true)
43
43
  else
44
- Bundler.definition(:gems => gems, :sources => sources)
44
+ Bundler.definition(gems: gems, sources: sources)
45
45
  end
46
46
 
47
47
  Bundler::CLI::Common.configure_gem_version_promoter(
48
48
  Bundler.definition,
49
- options.merge(:strict => @strict)
49
+ options.merge(strict: @strict)
50
50
  )
51
51
 
52
52
  definition_resolution = proc do
@@ -90,10 +90,10 @@ module Bundler
90
90
  end
91
91
 
92
92
  outdated_gems << {
93
- :active_spec => active_spec,
94
- :current_spec => current_spec,
95
- :dependency => dependency,
96
- :groups => groups,
93
+ active_spec: active_spec,
94
+ current_spec: current_spec,
95
+ dependency: dependency,
96
+ groups: groups,
97
97
  }
98
98
  end
99
99
 
@@ -7,18 +7,12 @@ module Bundler
7
7
  long_desc <<-D
8
8
  Install plugins either from the rubygems source provided (with --source option) or from a git source provided with --git (for remote repos) or --local_git (for local repos). If no sources are provided, it uses Gem.sources
9
9
  D
10
- method_option "source", :type => :string, :default => nil, :banner =>
11
- "URL of the RubyGems source to fetch the plugin from"
12
- method_option "version", :type => :string, :default => nil, :banner =>
13
- "The version of the plugin to fetch"
14
- method_option "git", :type => :string, :default => nil, :banner =>
15
- "URL of the git repo to fetch from"
16
- method_option "local_git", :type => :string, :default => nil, :banner =>
17
- "Path of the local git repo to fetch from"
18
- method_option "branch", :type => :string, :default => nil, :banner =>
19
- "The git branch to checkout"
20
- method_option "ref", :type => :string, :default => nil, :banner =>
21
- "The git revision to check out"
10
+ method_option "source", type: :string, default: nil, banner: "URL of the RubyGems source to fetch the plugin from"
11
+ method_option "version", type: :string, default: nil, banner: "The version of the plugin to fetch"
12
+ method_option "git", type: :string, default: nil, banner: "URL of the git repo to fetch from"
13
+ method_option "local_git", type: :string, default: nil, banner: "Path of the local git repo to fetch from"
14
+ method_option "branch", type: :string, default: nil, banner: "The git branch to checkout"
15
+ method_option "ref", type: :string, default: nil, banner: "The git revision to check out"
22
16
  def install(*plugins)
23
17
  Bundler::Plugin.install(plugins, options)
24
18
  end
@@ -27,8 +21,7 @@ module Bundler
27
21
  long_desc <<-D
28
22
  Uninstall given list of plugins. To uninstall all the plugins, use -all option.
29
23
  D
30
- method_option "all", :type => :boolean, :default => nil, :banner =>
31
- "Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
24
+ method_option "all", type: :boolean, default: nil, banner: "Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
32
25
  def uninstall(*plugins)
33
26
  Bundler::Plugin.uninstall(plugins, options)
34
27
  end
@@ -12,40 +12,48 @@ module Bundler
12
12
  definition.validate_runtime!
13
13
  installer = Bundler::Installer.new(Bundler.root, definition)
14
14
 
15
- Bundler.load.specs.each do |spec|
16
- next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
17
- next if !@gems.empty? && !@gems.include?(spec.name)
18
-
19
- gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
20
- gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
21
-
22
- case source = spec.source
23
- when Source::Rubygems
24
- cached_gem = spec.cache_file
25
- unless File.exist?(cached_gem)
26
- Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
15
+ ProcessLock.lock do
16
+ installed_specs = definition.specs.reject do |spec|
17
+ next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
18
+ next if !@gems.empty? && !@gems.include?(spec.name)
19
+
20
+ gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
21
+ gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
22
+
23
+ case source = spec.source
24
+ when Source::Rubygems
25
+ cached_gem = spec.cache_file
26
+ unless File.exist?(cached_gem)
27
+ Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
28
+ next
29
+ end
30
+
31
+ FileUtils.rm_rf spec.full_gem_path
32
+ when Source::Git
33
+ if source.local?
34
+ Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
35
+ next
36
+ end
37
+
38
+ source.remote!
39
+ if extension_cache_path = source.extension_cache_path(spec)
40
+ FileUtils.rm_rf extension_cache_path
41
+ end
42
+ FileUtils.rm_rf spec.extension_dir
43
+ FileUtils.rm_rf spec.full_gem_path
44
+ else
45
+ Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
27
46
  next
28
47
  end
29
48
 
30
- FileUtils.rm_rf spec.full_gem_path
31
- when Source::Git
32
- if source.local?
33
- Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
34
- next
35
- end
49
+ true
50
+ end.map(&:name)
36
51
 
37
- source.remote!
38
- if extension_cache_path = source.extension_cache_path(spec)
39
- FileUtils.rm_rf extension_cache_path
40
- end
41
- FileUtils.rm_rf spec.extension_dir
42
- FileUtils.rm_rf spec.full_gem_path
43
- else
44
- Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
45
- next
46
- end
47
-
48
- Bundler::GemInstaller.new(spec, installer, false, 0, true).install_from_spec
52
+ jobs = installer.send(:installation_parallelization, {})
53
+ pristine_count = definition.specs.count - installed_specs.count
54
+ # allow a pristining a single gem to skip the parallel worker
55
+ jobs = [jobs, pristine_count].min
56
+ ParallelInstaller.call(installer, definition.specs, jobs, false, true, skip: installed_specs)
49
57
  end
50
58
  end
51
59
  end
@@ -40,8 +40,8 @@ module Bundler
40
40
  desc = " * #{s.name} (#{s.version}#{s.git_version})"
41
41
  if @verbose
42
42
  latest = latest_specs.find {|l| l.name == s.name }
43
- Bundler.ui.info <<-END.gsub(/^ +/, "")
44
- #{desc}
43
+ Bundler.ui.info <<~END
44
+ #{desc.lstrip}
45
45
  \tSummary: #{s.summary || "No description available."}
46
46
  \tHomepage: #{s.homepage || "No website available."}
47
47
  \tStatus: #{outdated?(s, latest) ? "Outdated - #{s.version} < #{latest.version}" : "Up to date"}
@@ -35,7 +35,7 @@ module Bundler
35
35
 
36
36
  if full_update
37
37
  if conservative
38
- Bundler.definition(:conservative => conservative)
38
+ Bundler.definition(conservative: conservative)
39
39
  else
40
40
  Bundler.definition(true)
41
41
  end
@@ -51,9 +51,9 @@ module Bundler
51
51
  gems.concat(deps.map(&:name))
52
52
  end
53
53
 
54
- Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
55
- :conservative => conservative,
56
- :bundler => update_bundler)
54
+ Bundler.definition(gems: gems, sources: sources, ruby: options[:ruby],
55
+ conservative: conservative,
56
+ bundler: update_bundler)
57
57
  end
58
58
 
59
59
  Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
@@ -71,7 +71,7 @@ module Bundler
71
71
 
72
72
  if locked_gems = Bundler.definition.locked_gems
73
73
  previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
74
- h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
74
+ h[s.name] = { spec: s, version: s.version, source: s.source.identifier }
75
75
  h
76
76
  end
77
77
  end