rubygems-update 3.4.20 → 3.4.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/Manifest.txt +6 -0
  4. data/bundler/CHANGELOG.md +55 -3
  5. data/bundler/README.md +1 -2
  6. data/bundler/lib/bundler/build_metadata.rb +3 -3
  7. data/bundler/lib/bundler/cli/check.rb +1 -1
  8. data/bundler/lib/bundler/cli/gem.rb +4 -3
  9. data/bundler/lib/bundler/cli/install.rb +2 -2
  10. data/bundler/lib/bundler/cli/lock.rb +26 -23
  11. data/bundler/lib/bundler/cli/open.rb +5 -7
  12. data/bundler/lib/bundler/definition.rb +43 -26
  13. data/bundler/lib/bundler/endpoint_specification.rb +1 -1
  14. data/bundler/lib/bundler/env.rb +2 -2
  15. data/bundler/lib/bundler/errors.rb +15 -0
  16. data/bundler/lib/bundler/gem_helpers.rb +7 -0
  17. data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
  18. data/bundler/lib/bundler/injector.rb +1 -1
  19. data/bundler/lib/bundler/installer/gem_installer.rb +5 -5
  20. data/bundler/lib/bundler/installer/parallel_installer.rb +0 -26
  21. data/bundler/lib/bundler/installer/standalone.rb +13 -6
  22. data/bundler/lib/bundler/lazy_specification.rb +4 -0
  23. data/bundler/lib/bundler/lockfile_parser.rb +29 -24
  24. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
  33. data/bundler/lib/bundler/man/bundle-exec.1.ronn +2 -3
  34. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-plugin.1 +17 -17
  46. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +5 -5
  47. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle.1 +1 -1
  54. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  55. data/bundler/lib/bundler/plugin/index.rb +8 -0
  56. data/bundler/lib/bundler/plugin.rb +9 -2
  57. data/bundler/lib/bundler/resolver/package.rb +5 -0
  58. data/bundler/lib/bundler/resolver.rb +27 -7
  59. data/bundler/lib/bundler/ruby_version.rb +8 -1
  60. data/bundler/lib/bundler/rubygems_ext.rb +3 -4
  61. data/bundler/lib/bundler/rubygems_gem_installer.rb +23 -8
  62. data/bundler/lib/bundler/settings.rb +53 -16
  63. data/bundler/lib/bundler/shared_helpers.rb +16 -1
  64. data/bundler/lib/bundler/source/git/git_proxy.rb +21 -4
  65. data/bundler/lib/bundler/source/metadata.rb +1 -1
  66. data/bundler/lib/bundler/spec_set.rb +7 -4
  67. data/bundler/lib/bundler/stub_specification.rb +4 -2
  68. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +6 -2
  69. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  70. data/bundler/lib/bundler/ui/shell.rb +1 -1
  71. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +1 -0
  72. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +21 -9
  73. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
  74. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
  75. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
  76. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
  77. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +8 -10
  78. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +15 -4
  79. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +15 -15
  80. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
  81. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
  82. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +4 -0
  83. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +16 -25
  84. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
  85. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
  86. data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
  87. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
  88. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
  89. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
  90. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +44 -6
  91. data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
  92. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
  93. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +26 -150
  94. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +4 -46
  95. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  96. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -45
  97. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
  98. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
  99. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  100. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  101. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  102. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
  103. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  104. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +155 -8
  105. data/bundler/lib/bundler/version.rb +1 -1
  106. data/bundler/lib/bundler/yaml_serializer.rb +12 -8
  107. data/bundler/lib/bundler.rb +0 -8
  108. data/lib/rubygems/basic_specification.rb +1 -1
  109. data/lib/rubygems/command.rb +5 -5
  110. data/lib/rubygems/command_manager.rb +1 -1
  111. data/lib/rubygems/commands/cert_command.rb +3 -3
  112. data/lib/rubygems/commands/check_command.rb +5 -1
  113. data/lib/rubygems/commands/cleanup_command.rb +1 -1
  114. data/lib/rubygems/commands/contents_command.rb +2 -2
  115. data/lib/rubygems/commands/environment_command.rb +2 -2
  116. data/lib/rubygems/commands/help_command.rb +3 -3
  117. data/lib/rubygems/commands/open_command.rb +1 -3
  118. data/lib/rubygems/commands/owner_command.rb +1 -1
  119. data/lib/rubygems/commands/setup_command.rb +10 -10
  120. data/lib/rubygems/commands/specification_command.rb +5 -1
  121. data/lib/rubygems/commands/stale_command.rb +1 -1
  122. data/lib/rubygems/commands/uninstall_command.rb +4 -4
  123. data/lib/rubygems/commands/unpack_command.rb +3 -3
  124. data/lib/rubygems/commands/update_command.rb +4 -4
  125. data/lib/rubygems/commands/yank_command.rb +1 -1
  126. data/lib/rubygems/config_file.rb +63 -16
  127. data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
  128. data/lib/rubygems/core_ext/kernel_require.rb +2 -2
  129. data/lib/rubygems/defaults.rb +6 -2
  130. data/lib/rubygems/dependency_installer.rb +4 -4
  131. data/lib/rubygems/deprecate.rb +2 -1
  132. data/lib/rubygems/doctor.rb +2 -2
  133. data/lib/rubygems/errors.rb +1 -1
  134. data/lib/rubygems/exceptions.rb +1 -1
  135. data/lib/rubygems/ext/builder.rb +5 -4
  136. data/lib/rubygems/ext/cargo_builder.rb +2 -2
  137. data/lib/rubygems/ext/ext_conf_builder.rb +1 -1
  138. data/lib/rubygems/ext/rake_builder.rb +1 -1
  139. data/lib/rubygems/gem_runner.rb +5 -1
  140. data/lib/rubygems/gemcutter_utilities.rb +2 -2
  141. data/lib/rubygems/indexer.rb +1 -1
  142. data/lib/rubygems/install_update_options.rb +1 -1
  143. data/lib/rubygems/installer.rb +15 -20
  144. data/lib/rubygems/local_remote_options.rb +1 -1
  145. data/lib/rubygems/package/digest_io.rb +1 -1
  146. data/lib/rubygems/package/old.rb +1 -1
  147. data/lib/rubygems/package/tar_header.rb +2 -2
  148. data/lib/rubygems/package/tar_reader.rb +9 -2
  149. data/lib/rubygems/package/tar_writer.rb +2 -2
  150. data/lib/rubygems/package.rb +9 -9
  151. data/lib/rubygems/path_support.rb +1 -1
  152. data/lib/rubygems/platform.rb +12 -6
  153. data/lib/rubygems/query_utils.rb +4 -4
  154. data/lib/rubygems/remote_fetcher.rb +12 -4
  155. data/lib/rubygems/request.rb +1 -1
  156. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  157. data/lib/rubygems/request_set.rb +2 -1
  158. data/lib/rubygems/requirement.rb +1 -1
  159. data/lib/rubygems/resolver/api_set.rb +2 -1
  160. data/lib/rubygems/resolver/api_specification.rb +1 -1
  161. data/lib/rubygems/resolver.rb +3 -3
  162. data/lib/rubygems/security/signer.rb +10 -2
  163. data/lib/rubygems/security/trust_dir.rb +5 -5
  164. data/lib/rubygems/security.rb +1 -1
  165. data/lib/rubygems/security_option.rb +1 -1
  166. data/lib/rubygems/source/local.rb +2 -1
  167. data/lib/rubygems/source.rb +5 -1
  168. data/lib/rubygems/source_list.rb +1 -1
  169. data/lib/rubygems/spec_fetcher.rb +2 -2
  170. data/lib/rubygems/specification.rb +30 -23
  171. data/lib/rubygems/specification_policy.rb +11 -11
  172. data/lib/rubygems/uninstaller.rb +3 -3
  173. data/lib/rubygems/update_suggestion.rb +1 -1
  174. data/lib/rubygems/user_interaction.rb +2 -2
  175. data/lib/rubygems/util/licenses.rb +48 -0
  176. data/lib/rubygems/util.rb +5 -1
  177. data/lib/rubygems/validator.rb +1 -1
  178. data/lib/rubygems/version.rb +6 -5
  179. data/lib/rubygems/yaml_serializer.rb +93 -0
  180. data/lib/rubygems.rb +9 -9
  181. data/rubygems-update.gemspec +1 -1
  182. data/setup.rb +2 -0
  183. data/test/rubygems/bundler_test_gem.rb +6 -3
  184. data/test/rubygems/helper.rb +29 -21
  185. data/test/rubygems/package/tar_test_case.rb +2 -2
  186. data/test/rubygems/test_gem.rb +51 -26
  187. data/test/rubygems/test_gem_command.rb +3 -1
  188. data/test/rubygems/test_gem_command_manager.rb +6 -6
  189. data/test/rubygems/test_gem_commands_cert_command.rb +23 -23
  190. data/test/rubygems/test_gem_commands_cleanup_command.rb +2 -2
  191. data/test/rubygems/test_gem_commands_environment_command.rb +2 -1
  192. data/test/rubygems/test_gem_commands_exec_command.rb +5 -1
  193. data/test/rubygems/test_gem_commands_install_command.rb +5 -5
  194. data/test/rubygems/test_gem_commands_open_command.rb +5 -2
  195. data/test/rubygems/test_gem_commands_pristine_command.rb +2 -2
  196. data/test/rubygems/test_gem_commands_push_command.rb +7 -6
  197. data/test/rubygems/test_gem_commands_signin_command.rb +8 -8
  198. data/test/rubygems/test_gem_commands_uninstall_command.rb +21 -1
  199. data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
  200. data/test/rubygems/test_gem_config_file.rb +46 -12
  201. data/test/rubygems/test_gem_ext_builder.rb +1 -1
  202. data/test/rubygems/test_gem_ext_cargo_builder.rb +2 -2
  203. data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -5
  204. data/test/rubygems/test_gem_install_update_options.rb +3 -3
  205. data/test/rubygems/test_gem_installer.rb +16 -16
  206. data/test/rubygems/test_gem_package.rb +35 -34
  207. data/test/rubygems/test_gem_package_old.rb +1 -1
  208. data/test/rubygems/test_gem_package_tar_header.rb +3 -3
  209. data/test/rubygems/test_gem_package_tar_reader.rb +19 -4
  210. data/test/rubygems/test_gem_package_tar_writer.rb +28 -28
  211. data/test/rubygems/test_gem_rdoc.rb +2 -2
  212. data/test/rubygems/test_gem_remote_fetcher.rb +13 -9
  213. data/test/rubygems/test_gem_request.rb +5 -5
  214. data/test/rubygems/test_gem_request_connection_pools.rb +2 -1
  215. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +14 -7
  216. data/test/rubygems/test_gem_security.rb +2 -2
  217. data/test/rubygems/test_gem_security_policy.rb +2 -2
  218. data/test/rubygems/test_gem_security_signer.rb +2 -2
  219. data/test/rubygems/test_gem_security_trust_dir.rb +6 -6
  220. data/test/rubygems/test_gem_spec_fetcher.rb +2 -2
  221. data/test/rubygems/test_gem_specification.rb +29 -29
  222. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  223. data/test/rubygems/test_gem_update_suggestion.rb +12 -6
  224. data/test/rubygems/test_gem_util.rb +2 -2
  225. data/test/rubygems/test_gem_version.rb +4 -2
  226. data/test/rubygems/utilities.rb +4 -3
  227. metadata +9 -3
@@ -12,6 +12,7 @@ module Bundler
12
12
  end
13
13
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
14
14
  file.puts "require 'rbconfig'"
15
+ file.puts prevent_gem_activation
15
16
  file.puts define_path_helpers
16
17
  file.puts reverse_rubygems_kernel_mixin
17
18
  paths.each do |path|
@@ -55,18 +56,24 @@ module Bundler
55
56
  if spec.source.instance_of?(Source::Path) && spec.source.path.absolute?
56
57
  full_path
57
58
  else
58
- relative_path_from(Bundler.root.join(bundler_path), :to => full_path) || full_path
59
+ SharedHelpers.relative_path_to(full_path, :from => Bundler.root.join(bundler_path))
59
60
  end
60
61
  rescue TypeError
61
62
  error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
62
63
  raise Gem::InvalidSpecificationException.new(error_message)
63
64
  end
64
65
 
65
- def relative_path_from(source, to:)
66
- Pathname.new(to).relative_path_from(source).to_s
67
- rescue ArgumentError
68
- # on Windows, if source and destination are on different drivers, there's no relative path from one to the other
69
- nil
66
+ def prevent_gem_activation
67
+ <<~'END'
68
+ module Kernel
69
+ remove_method(:gem) if private_method_defined?(:gem)
70
+
71
+ def gem(*)
72
+ end
73
+
74
+ private :gem
75
+ end
76
+ END
70
77
  end
71
78
 
72
79
  def define_path_helpers
@@ -134,6 +134,10 @@ module Bundler
134
134
  " #{source.revision[0..6]}"
135
135
  end
136
136
 
137
+ def force_ruby_platform!
138
+ @force_ruby_platform = true
139
+ end
140
+
137
141
  private
138
142
 
139
143
  def use_exact_resolved_specifications?
@@ -23,13 +23,15 @@ module Bundler
23
23
  Gem::Version.create("1.13") => [PLUGIN].freeze,
24
24
  }.freeze
25
25
 
26
- KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
26
+ KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten!.freeze
27
27
 
28
28
  ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
29
29
  deprecate_constant(:ENVIRONMENT_VERSION_SECTIONS)
30
30
 
31
31
  def self.sections_in_lockfile(lockfile_contents)
32
- lockfile_contents.scan(/^\w[\w ]*$/).uniq
32
+ sections = lockfile_contents.scan(/^\w[\w ]*$/)
33
+ sections.uniq!
34
+ sections
33
35
  end
34
36
 
35
37
  def self.unknown_sections_in_lockfile(lockfile_contents)
@@ -38,7 +40,7 @@ module Bundler
38
40
 
39
41
  def self.sections_to_ignore(base_version = nil)
40
42
  base_version &&= base_version.release
41
- base_version ||= Gem::Version.create("1.0".dup)
43
+ base_version ||= Gem::Version.create("1.0")
42
44
  attributes = []
43
45
  SECTIONS_BY_VERSION_INTRODUCED.each do |version, introduced|
44
46
  next if version <= base_version
@@ -61,36 +63,36 @@ module Bundler
61
63
  @platforms = []
62
64
  @sources = []
63
65
  @dependencies = {}
64
- @state = nil
66
+ @parse_method = nil
65
67
  @specs = {}
66
68
 
67
69
  if lockfile.match?(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
68
- raise LockfileError, "Your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} contains merge conflicts.\n" \
69
- "Run `git checkout HEAD -- #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` first to get a clean lock."
70
+ raise LockfileError, "Your lockfile contains merge conflicts.\n" \
71
+ "Run `git checkout HEAD -- #{SharedHelpers.relative_lockfile_path}` first to get a clean lock."
70
72
  end
71
73
 
72
- lockfile.split(/(?:\r?\n)+/).each do |line|
74
+ lockfile.split(/(?:\r?\n)+/) do |line|
73
75
  if SOURCE.include?(line)
74
- @state = :source
76
+ @parse_method = :parse_source
75
77
  parse_source(line)
76
78
  elsif line == DEPENDENCIES
77
- @state = :dependency
79
+ @parse_method = :parse_dependency
78
80
  elsif line == PLATFORMS
79
- @state = :platform
81
+ @parse_method = :parse_platform
80
82
  elsif line == RUBY
81
- @state = :ruby
83
+ @parse_method = :parse_ruby
82
84
  elsif line == BUNDLED
83
- @state = :bundled_with
85
+ @parse_method = :parse_bundled_with
84
86
  elsif /^[^\s]/.match?(line)
85
- @state = nil
86
- elsif @state
87
- send("parse_#{@state}", line)
87
+ @parse_method = nil
88
+ elsif @parse_method
89
+ send(@parse_method, line)
88
90
  end
89
91
  end
90
- @specs = @specs.values.sort_by(&:full_name)
92
+ @specs = @specs.values.sort_by!(&:full_name)
91
93
  rescue ArgumentError => e
92
94
  Bundler.ui.debug(e)
93
- raise LockfileError, "Your lockfile is unreadable. Run `rm #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` " \
95
+ raise LockfileError, "Your lockfile is unreadable. Run `rm #{SharedHelpers.relative_lockfile_path}` " \
94
96
  "and then `bundle install` to generate a new lockfile."
95
97
  end
96
98
 
@@ -149,11 +151,11 @@ module Bundler
149
151
  return unless line =~ NAME_VERSION
150
152
  spaces = $1
151
153
  return unless spaces.size == 2
152
- name = $2
154
+ name = -$2
153
155
  version = $3
154
156
  pinned = $5
155
157
 
156
- version = version.split(",").map(&:strip) if version
158
+ version = version.split(",").each(&:strip!) if version
157
159
 
158
160
  dep = Bundler::Dependency.new(name, version)
159
161
 
@@ -177,11 +179,13 @@ module Bundler
177
179
  def parse_spec(line)
178
180
  return unless line =~ NAME_VERSION
179
181
  spaces = $1
180
- name = $2
182
+ name = -$2
181
183
  version = $3
182
- platform = $4
183
184
 
184
185
  if spaces.size == 4
186
+ # only load platform for non-dependency (spec) line
187
+ platform = $4
188
+
185
189
  version = Gem::Version.new(version)
186
190
  platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
187
191
  @current_spec = LazySpecification.new(name, version, platform)
@@ -190,7 +194,7 @@ module Bundler
190
194
 
191
195
  @specs[@current_spec.full_name] = @current_spec
192
196
  elsif spaces.size == 6
193
- version = version.split(",").map(&:strip) if version
197
+ version = version.split(",").each(&:strip!) if version
194
198
  dep = Gem::Dependency.new(name, version)
195
199
  @current_spec.dependencies << dep
196
200
  end
@@ -201,13 +205,14 @@ module Bundler
201
205
  end
202
206
 
203
207
  def parse_bundled_with(line)
204
- line = line.strip
208
+ line.strip!
205
209
  return unless Gem::Version.correct?(line)
206
210
  @bundler_version = Gem::Version.create(line)
207
211
  end
208
212
 
209
213
  def parse_ruby(line)
210
- @ruby_version = line.strip
214
+ line.strip!
215
+ @ruby_version = line
211
216
  end
212
217
  end
213
218
  end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONSOLE" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-CONSOLE" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -22,7 +22,7 @@ Note that \fBbundle exec\fR does not require that an executable is available on
22
22
  .
23
23
  .TP
24
24
  \fB\-\-keep\-file\-descriptors\fR
25
- Exec in Ruby 2\.0 began discarding non\-standard file descriptors\. When this flag is passed, exec will revert to the 1\.9 behaviour of passing all file descriptors to the new process\.
25
+ Passes all file descriptors to the new processes\. Default is true from bundler version 2\.2\.26\. Setting it to false is now deprecated\.
26
26
  .
27
27
  .SH "BUNDLE INSTALL \-\-BINSTUBS"
28
28
  If you use the \fB\-\-binstubs\fR flag in bundle install(1) \fIbundle\-install\.1\.html\fR, Bundler will automatically create a directory (which defaults to \fBapp_root/bin\fR) containing all of the executables available from gems in the bundle\.
@@ -21,9 +21,8 @@ available on your shell's `$PATH`.
21
21
  ## OPTIONS
22
22
 
23
23
  * `--keep-file-descriptors`:
24
- Exec in Ruby 2.0 began discarding non-standard file descriptors. When this
25
- flag is passed, exec will revert to the 1.9 behaviour of passing all file
26
- descriptors to the new process.
24
+ Passes all file descriptors to the new processes. Default is true from
25
+ bundler version 2.2.26. Setting it to false is now deprecated.
27
26
 
28
27
  ## BUNDLE INSTALL --BINSTUBS
29
28
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-HELP" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-HELP" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLUGIN" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-PLUGIN" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-plugin\fR \- Manage Bundler plugins
@@ -26,37 +26,37 @@ You can install, uninstall, and list plugin(s) with this command to extend funct
26
26
  .SS "install"
27
27
  Install the given plugin(s)\.
28
28
  .
29
- .IP "\(bu" 4
30
- \fBbundle plugin install bundler\-graph\fR: Install bundler\-graph gem from RubyGems\.org\. The global source, specified in source in Gemfile is ignored\.
29
+ .TP
30
+ \fBbundle plugin install bundler\-graph\fR
31
+ Install bundler\-graph gem from globally configured sources (defaults to RubyGems\.org)\. The global source, specified in source in Gemfile is ignored\.
31
32
  .
32
- .IP "\(bu" 4
33
- \fBbundle plugin install bundler\-graph \-\-source https://example\.com\fR: Install bundler\-graph gem from example\.com\. The global source, specified in source in Gemfile is not considered\.
33
+ .TP
34
+ \fBbundle plugin install bundler\-graph \-\-source https://example\.com\fR
35
+ Install bundler\-graph gem from example\.com\. The global source, specified in source in Gemfile is not considered\.
34
36
  .
35
- .IP "\(bu" 4
36
- \fBbundle plugin install bundler\-graph \-\-version 0\.2\.1\fR: You can specify the version of the gem via \fB\-\-version\fR\.
37
+ .TP
38
+ \fBbundle plugin install bundler\-graph \-\-version 0\.2\.1\fR
39
+ You can specify the version of the gem via \fB\-\-version\fR\.
37
40
  .
38
- .IP "\(bu" 4
39
- \fBbundle plugin install bundler\-graph \-\-git https://github\.com/rubygems/bundler\-graph\fR: Install bundler\-graph gem from Git repository\. \fB\-\-git\fR can be replaced with \fB\-\-local\-git\fR\. You cannot use both \fB\-\-git\fR and \fB\-\-local\-git\fR\. You can use standard Git URLs like:
41
+ .TP
42
+ \fBbundle plugin install bundler\-graph \-\-git https://github\.com/rubygems/bundler\-graph\fR
43
+ Install bundler\-graph gem from Git repository\. \fB\-\-git\fR can be replaced with \fB\-\-local\-git\fR\. You cannot use both \fB\-\-git\fR and \fB\-\-local\-git\fR\. You can use standard Git URLs like:
40
44
  .
41
- .IP "\(bu" 4
45
+ .IP
42
46
  \fBssh://[user@]host\.xz[:port]/path/to/repo\.git\fR
43
47
  .
44
- .IP "\(bu" 4
48
+ .br
45
49
  \fBhttp[s]://host\.xz[:port]/path/to/repo\.git\fR
46
50
  .
47
- .IP "\(bu" 4
51
+ .br
48
52
  \fB/path/to/repo\fR
49
53
  .
50
- .IP "\(bu" 4
54
+ .br
51
55
  \fBfile:///path/to/repo\fR
52
56
  .
53
- .IP "" 0
54
- .
55
57
  .IP
56
58
  When you specify \fB\-\-git\fR/\fB\-\-local\-git\fR, you can use \fB\-\-branch\fR or \fB\-\-ref\fR to specify any branch, tag, or commit hash (revision) to use\. When you specify both, only the latter is used\.
57
59
  .
58
- .IP "" 0
59
- .
60
60
  .SS "uninstall"
61
61
  Uninstall the plugin(s) specified in PLUGINS\.
62
62
  .
@@ -20,7 +20,7 @@ You can install, uninstall, and list plugin(s) with this command to extend funct
20
20
  Install the given plugin(s).
21
21
 
22
22
  * `bundle plugin install bundler-graph`:
23
- Install bundler-graph gem from RubyGems.org. The global source, specified in source in Gemfile is ignored.
23
+ Install bundler-graph gem from globally configured sources (defaults to RubyGems.org). The global source, specified in source in Gemfile is ignored.
24
24
 
25
25
  * `bundle plugin install bundler-graph --source https://example.com`:
26
26
  Install bundler-graph gem from example.com. The global source, specified in source in Gemfile is not considered.
@@ -31,10 +31,10 @@ Install the given plugin(s).
31
31
  * `bundle plugin install bundler-graph --git https://github.com/rubygems/bundler-graph`:
32
32
  Install bundler-graph gem from Git repository. `--git` can be replaced with `--local-git`. You cannot use both `--git` and `--local-git`. You can use standard Git URLs like:
33
33
 
34
- * `ssh://[user@]host.xz[:port]/path/to/repo.git`
35
- * `http[s]://host.xz[:port]/path/to/repo.git`
36
- * `/path/to/repo`
37
- * `file:///path/to/repo`
34
+ `ssh://[user@]host.xz[:port]/path/to/repo.git`<br>
35
+ `http[s]://host.xz[:port]/path/to/repo.git`<br>
36
+ `/path/to/repo`<br>
37
+ `file:///path/to/repo`
38
38
 
39
39
  When you specify `--git`/`--local-git`, you can use `--branch` or `--ref` to specify any branch, tag, or commit hash (revision) to use. When you specify both, only the latter is used.
40
40
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VERSION" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-VERSION" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-version\fR \- Prints Bundler version information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "August 2023" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "August 2023" "" ""
4
+ .TH "BUNDLE" "1" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "August 2023" "" ""
4
+ .TH "GEMFILE" "5" "October 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -136,6 +136,14 @@ module Bundler
136
136
  @hooks[event] || []
137
137
  end
138
138
 
139
+ # This plugin is installed inside the .bundle/plugin directory,
140
+ # and thus is managed solely by Bundler
141
+ def installed_in_plugin_root?(name)
142
+ return false unless (path = installed?(name))
143
+
144
+ path.start_with?("#{Plugin.root}/")
145
+ end
146
+
139
147
  private
140
148
 
141
149
  # Reads the index file from the directory and initializes the instance
@@ -62,7 +62,8 @@ module Bundler
62
62
  if names.any?
63
63
  names.each do |name|
64
64
  if index.installed?(name)
65
- Bundler.rm_rf(index.plugin_path(name))
65
+ path = index.plugin_path(name).to_s
66
+ Bundler.rm_rf(path) if index.installed_in_plugin_root?(name)
66
67
  index.unregister_plugin(name)
67
68
  Bundler.ui.info "Uninstalled plugin #{name}"
68
69
  else
@@ -227,7 +228,7 @@ module Bundler
227
228
  plugins = index.hook_plugins(event)
228
229
  return unless plugins.any?
229
230
 
230
- (plugins - @loaded_plugin_names).each {|name| load_plugin(name) }
231
+ plugins.each {|name| load_plugin(name) }
231
232
 
232
233
  @hooks_by_event[event].each {|blk| blk.call(*args, &arg_blk) }
233
234
  end
@@ -239,6 +240,11 @@ module Bundler
239
240
  Index.new.installed?(plugin)
240
241
  end
241
242
 
243
+ # @return [true, false] whether the plugin is loaded
244
+ def loaded?(plugin)
245
+ @loaded_plugin_names.include?(plugin)
246
+ end
247
+
242
248
  # Post installation processing and registering with index
243
249
  #
244
250
  # @param [Array<String>] plugins list to be installed
@@ -329,6 +335,7 @@ module Bundler
329
335
  # @param [String] name of the plugin
330
336
  def load_plugin(name)
331
337
  return unless name && !name.empty?
338
+ return if loaded?(name)
332
339
 
333
340
  # Need to ensure before this that plugin root where the rest of gems
334
341
  # are installed to be on load path to support plugin deps. Currently not