bundler 2.2.0.rc.1 → 2.2.0.rc.2

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.

Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +725 -687
  3. data/lib/bundler.rb +6 -3
  4. data/lib/bundler/build_metadata.rb +3 -11
  5. data/lib/bundler/cli.rb +27 -14
  6. data/lib/bundler/cli/add.rb +1 -1
  7. data/lib/bundler/cli/cache.rb +1 -7
  8. data/lib/bundler/cli/clean.rb +1 -1
  9. data/lib/bundler/cli/common.rb +14 -0
  10. data/lib/bundler/cli/doctor.rb +1 -1
  11. data/lib/bundler/cli/exec.rb +1 -1
  12. data/lib/bundler/cli/fund.rb +36 -0
  13. data/lib/bundler/cli/gem.rb +1 -1
  14. data/lib/bundler/cli/info.rb +2 -1
  15. data/lib/bundler/cli/init.rb +1 -1
  16. data/lib/bundler/cli/inject.rb +1 -1
  17. data/lib/bundler/cli/install.rb +4 -2
  18. data/lib/bundler/cli/list.rb +1 -1
  19. data/lib/bundler/cli/outdated.rb +1 -1
  20. data/lib/bundler/cli/pristine.rb +1 -1
  21. data/lib/bundler/cli/show.rb +1 -1
  22. data/lib/bundler/cli/update.rb +2 -0
  23. data/lib/bundler/compact_index_client.rb +1 -1
  24. data/lib/bundler/compact_index_client/cache.rb +1 -1
  25. data/lib/bundler/definition.rb +28 -37
  26. data/lib/bundler/dep_proxy.rb +1 -1
  27. data/lib/bundler/dsl.rb +4 -4
  28. data/lib/bundler/endpoint_specification.rb +1 -1
  29. data/lib/bundler/fetcher.rb +3 -3
  30. data/lib/bundler/fetcher/base.rb +1 -1
  31. data/lib/bundler/fetcher/compact_index.rb +1 -1
  32. data/lib/bundler/fetcher/downloader.rb +1 -1
  33. data/lib/bundler/fetcher/index.rb +1 -1
  34. data/lib/bundler/friendly_errors.rb +3 -3
  35. data/lib/bundler/gem_helper.rb +17 -9
  36. data/lib/bundler/gem_helpers.rb +6 -1
  37. data/lib/bundler/gem_version_promoter.rb +1 -1
  38. data/lib/bundler/graph.rb +1 -1
  39. data/lib/bundler/index.rb +1 -1
  40. data/lib/bundler/injector.rb +1 -1
  41. data/lib/bundler/installer.rb +1 -1
  42. data/lib/bundler/installer/gem_installer.rb +1 -1
  43. data/lib/bundler/installer/parallel_installer.rb +1 -1
  44. data/lib/bundler/installer/standalone.rb +2 -2
  45. data/lib/bundler/lazy_specification.rb +3 -3
  46. data/lib/bundler/lockfile_generator.rb +1 -1
  47. data/lib/bundler/lockfile_parser.rb +1 -1
  48. data/lib/bundler/mirror.rb +2 -2
  49. data/lib/bundler/plugin.rb +5 -6
  50. data/lib/bundler/plugin/index.rb +1 -1
  51. data/lib/bundler/plugin/installer.rb +1 -1
  52. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  53. data/lib/bundler/plugin/source_list.rb +1 -1
  54. data/lib/bundler/remote_specification.rb +1 -1
  55. data/lib/bundler/resolver.rb +4 -4
  56. data/lib/bundler/resolver/spec_group.rb +2 -2
  57. data/lib/bundler/retry.rb +1 -1
  58. data/lib/bundler/ruby_version.rb +1 -1
  59. data/lib/bundler/rubygems_ext.rb +46 -1
  60. data/lib/bundler/rubygems_gem_installer.rb +2 -2
  61. data/lib/bundler/rubygems_integration.rb +18 -6
  62. data/lib/bundler/runtime.rb +2 -2
  63. data/lib/bundler/settings.rb +49 -42
  64. data/lib/bundler/shared_helpers.rb +1 -1
  65. data/lib/bundler/similarity_detector.rb +1 -1
  66. data/lib/bundler/source.rb +1 -1
  67. data/lib/bundler/source/git.rb +1 -1
  68. data/lib/bundler/source/git/git_proxy.rb +4 -2
  69. data/lib/bundler/source/path.rb +2 -2
  70. data/lib/bundler/source/path/installer.rb +1 -1
  71. data/lib/bundler/source/rubygems.rb +2 -2
  72. data/lib/bundler/source/rubygems/remote.rb +1 -1
  73. data/lib/bundler/source_list.rb +2 -2
  74. data/lib/bundler/spec_set.rb +1 -1
  75. data/lib/bundler/stub_specification.rb +1 -1
  76. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  77. data/lib/bundler/templates/newgem/bin/console.tt +1 -2
  78. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  79. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -1
  80. data/lib/bundler/ui/shell.rb +5 -5
  81. data/lib/bundler/uri_credentials_filter.rb +1 -1
  82. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +7 -4
  83. data/lib/bundler/vendored_persistent.rb +0 -7
  84. data/lib/bundler/version.rb +1 -1
  85. data/lib/bundler/worker.rb +1 -1
  86. data/lib/bundler/yaml_serializer.rb +1 -1
  87. data/man/bundle-add.1 +1 -1
  88. data/man/{bundle-add.ronn → bundle-add.1.ronn} +0 -0
  89. data/man/bundle-binstubs.1 +5 -3
  90. data/man/{bundle-binstubs.ronn → bundle-binstubs.1.ronn} +2 -4
  91. data/man/bundle-cache.1 +1 -1
  92. data/man/{bundle-cache.ronn → bundle-cache.1.ronn} +0 -0
  93. data/man/bundle-check.1 +1 -1
  94. data/man/{bundle-check.ronn → bundle-check.1.ronn} +0 -0
  95. data/man/bundle-clean.1 +1 -1
  96. data/man/{bundle-clean.ronn → bundle-clean.1.ronn} +0 -0
  97. data/man/bundle-config.1 +14 -14
  98. data/man/{bundle-config.ronn → bundle-config.1.ronn} +14 -13
  99. data/man/bundle-doctor.1 +1 -1
  100. data/man/{bundle-doctor.ronn → bundle-doctor.1.ronn} +0 -0
  101. data/man/bundle-exec.1 +1 -1
  102. data/man/{bundle-exec.ronn → bundle-exec.1.ronn} +0 -0
  103. data/man/bundle-gem.1 +1 -1
  104. data/man/{bundle-gem.ronn → bundle-gem.1.ronn} +0 -0
  105. data/man/bundle-info.1 +1 -1
  106. data/man/{bundle-info.ronn → bundle-info.1.ronn} +0 -0
  107. data/man/bundle-init.1 +1 -1
  108. data/man/{bundle-init.ronn → bundle-init.1.ronn} +0 -0
  109. data/man/bundle-inject.1 +1 -1
  110. data/man/{bundle-inject.ronn → bundle-inject.1.ronn} +0 -0
  111. data/man/bundle-install.1 +29 -2
  112. data/man/{bundle-install.ronn → bundle-install.1.ronn} +24 -2
  113. data/man/bundle-list.1 +1 -1
  114. data/man/{bundle-list.ronn → bundle-list.1.ronn} +0 -0
  115. data/man/bundle-lock.1 +1 -1
  116. data/man/{bundle-lock.ronn → bundle-lock.1.ronn} +0 -0
  117. data/man/bundle-open.1 +1 -1
  118. data/man/{bundle-open.ronn → bundle-open.1.ronn} +0 -0
  119. data/man/bundle-outdated.1 +1 -1
  120. data/man/{bundle-outdated.ronn → bundle-outdated.1.ronn} +0 -0
  121. data/man/bundle-platform.1 +1 -1
  122. data/man/{bundle-platform.ronn → bundle-platform.1.ronn} +0 -0
  123. data/man/bundle-pristine.1 +1 -1
  124. data/man/{bundle-pristine.ronn → bundle-pristine.1.ronn} +0 -0
  125. data/man/bundle-remove.1 +1 -1
  126. data/man/{bundle-remove.ronn → bundle-remove.1.ronn} +0 -0
  127. data/man/bundle-show.1 +1 -1
  128. data/man/{bundle-show.ronn → bundle-show.1.ronn} +0 -0
  129. data/man/bundle-update.1 +1 -1
  130. data/man/{bundle-update.ronn → bundle-update.1.ronn} +0 -0
  131. data/man/bundle-viz.1 +1 -1
  132. data/man/{bundle-viz.ronn → bundle-viz.1.ronn} +0 -0
  133. data/man/bundle.1 +1 -1
  134. data/man/{bundle.ronn → bundle.1.ronn} +0 -0
  135. data/man/gemfile.5 +4 -4
  136. data/man/gemfile.5.ronn +4 -4
  137. metadata +28 -53
  138. data/man/bundle-add.1.txt +0 -58
  139. data/man/bundle-binstubs.1.txt +0 -48
  140. data/man/bundle-cache.1.txt +0 -78
  141. data/man/bundle-check.1.txt +0 -33
  142. data/man/bundle-clean.1.txt +0 -26
  143. data/man/bundle-config.1.txt +0 -527
  144. data/man/bundle-doctor.1.txt +0 -44
  145. data/man/bundle-exec.1.txt +0 -181
  146. data/man/bundle-gem.1.txt +0 -117
  147. data/man/bundle-info.1.txt +0 -21
  148. data/man/bundle-init.1.txt +0 -34
  149. data/man/bundle-inject.1.txt +0 -32
  150. data/man/bundle-install.1.txt +0 -401
  151. data/man/bundle-list.1.txt +0 -44
  152. data/man/bundle-lock.1.txt +0 -93
  153. data/man/bundle-open.1.txt +0 -29
  154. data/man/bundle-outdated.1.txt +0 -131
  155. data/man/bundle-platform.1.txt +0 -57
  156. data/man/bundle-pristine.1.txt +0 -44
  157. data/man/bundle-remove.1.txt +0 -34
  158. data/man/bundle-show.1.txt +0 -27
  159. data/man/bundle-update.1.txt +0 -391
  160. data/man/bundle-viz.1.txt +0 -39
  161. data/man/bundle.1.txt +0 -116
  162. data/man/gemfile.5.txt +0 -651
  163. data/man/index.txt +0 -25
@@ -87,13 +87,13 @@ module Bundler
87
87
  name.hash ^ version.hash ^ sorted_activated_platforms.hash ^ source.hash
88
88
  end
89
89
 
90
- protected
90
+ protected
91
91
 
92
92
  def sorted_activated_platforms
93
93
  @activated_platforms.sort_by(&:to_s)
94
94
  end
95
95
 
96
- private
96
+ private
97
97
 
98
98
  def __dependencies
99
99
  @dependencies = Hash.new do |dependencies, platform|
@@ -32,7 +32,7 @@ module Bundler
32
32
  end
33
33
  alias_method :attempts, :attempt
34
34
 
35
- private
35
+ private
36
36
 
37
37
  def run(&block)
38
38
  @failed = false
@@ -123,7 +123,7 @@ module Bundler
123
123
  @exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
124
124
  end
125
125
 
126
- private
126
+ private
127
127
 
128
128
  def matches?(requirements, version)
129
129
  # Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
@@ -85,7 +85,7 @@ module Gem
85
85
  dependencies - development_dependencies
86
86
  end
87
87
 
88
- private
88
+ private
89
89
 
90
90
  def dependencies_to_gemfile(dependencies, group = nil)
91
91
  gemfile = String.new
@@ -129,6 +129,35 @@ module Gem
129
129
  end
130
130
  end
131
131
 
132
+ # comparison is done order independently since rubygems 3.2.0.rc.2
133
+ unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
134
+ class Requirement
135
+ module OrderIndependentComparison
136
+ def ==(other)
137
+ if _requirements_sorted? && other._requirements_sorted?
138
+ super
139
+ else
140
+ _with_sorted_requirements == other._with_sorted_requirements
141
+ end
142
+ end
143
+
144
+ protected
145
+
146
+ def _requirements_sorted?
147
+ return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
148
+ strings = as_list
149
+ @_are_requirements_sorted = strings == strings.sort
150
+ end
151
+
152
+ def _with_sorted_requirements
153
+ @_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
154
+ end
155
+ end
156
+
157
+ prepend OrderIndependentComparison
158
+ end
159
+ end
160
+
132
161
  class Platform
133
162
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
134
163
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
@@ -144,6 +173,22 @@ module Gem
144
173
  undef_method :eql? if method_defined? :eql?
145
174
  alias_method :eql?, :==
146
175
  end
176
+
177
+ require "rubygems/util"
178
+
179
+ Util.singleton_class.module_eval do
180
+ if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
181
+ remove_method :glob_files_in_dir
182
+ end
183
+
184
+ def glob_files_in_dir(glob, base_path)
185
+ if RUBY_VERSION >= "2.5"
186
+ Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
187
+ else
188
+ Dir.glob(File.join(base_path.to_s.gsub(/[\[\]]/, '\\\\\\&'), glob)).map! {|f| File.expand_path(f) }
189
+ end
190
+ end
191
+ end
147
192
  end
148
193
 
149
194
  module Gem
@@ -34,7 +34,7 @@ module Bundler
34
34
  end
35
35
  end
36
36
 
37
- private
37
+ private
38
38
 
39
39
  def validate_bundler_checksum(checksum)
40
40
  return true if Bundler.settings[:disable_checksum_validation]
@@ -60,7 +60,7 @@ module Bundler
60
60
 
61
61
  If you wish to continue installing the downloaded gem, and are certain it does not pose a \
62
62
  security issue despite the mismatching checksum, do the following:
63
- 1. run `bundle config set disable_checksum_validation true` to turn off checksum verification
63
+ 1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
64
64
  2. run `bundle install`
65
65
 
66
66
  (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
@@ -313,8 +313,13 @@ module Bundler
313
313
  end
314
314
 
315
315
  message = if spec.nil?
316
+ target_file = begin
317
+ Bundler.default_gemfile.basename
318
+ rescue GemfileNotFound
319
+ "inline Gemfile"
320
+ end
316
321
  "#{dep.name} is not part of the bundle." \
317
- " Add it to your #{Bundler.default_gemfile.basename}."
322
+ " Add it to your #{target_file}."
318
323
  else
319
324
  "can't activate #{dep}, already activated #{spec.full_name}. " \
320
325
  "Make sure all dependencies are added to Gemfile."
@@ -406,6 +411,17 @@ module Bundler
406
411
  # Replace or hook into RubyGems to provide a bundlerized view
407
412
  # of the world.
408
413
  def replace_entrypoints(specs)
414
+ specs_by_name = add_default_gems_to(specs)
415
+
416
+ replace_gem(specs, specs_by_name)
417
+ stub_rubygems(specs)
418
+ replace_bin_path(specs_by_name)
419
+
420
+ Gem.clear_paths
421
+ end
422
+
423
+ # Add default gems not already present in specs, and return them as a hash.
424
+ def add_default_gems_to(specs)
409
425
  specs_by_name = specs.reduce({}) do |h, s|
410
426
  h[s.name] = s
411
427
  h
@@ -420,11 +436,7 @@ module Bundler
420
436
  specs_by_name[default_spec_name] = default_spec
421
437
  end
422
438
 
423
- replace_gem(specs, specs_by_name)
424
- stub_rubygems(specs)
425
- replace_bin_path(specs_by_name)
426
-
427
- Gem.clear_paths
439
+ specs_by_name
428
440
  end
429
441
 
430
442
  def undo_replacements
@@ -155,7 +155,7 @@ module Bundler
155
155
  spec_cache_paths = []
156
156
  spec_gemspec_paths = []
157
157
  spec_extension_paths = []
158
- specs.each do |spec|
158
+ Bundler.rubygems.add_default_gems_to(specs).values.each do |spec|
159
159
  spec_gem_paths << spec.full_gem_path
160
160
  # need to check here in case gems are nested like for the rails git repo
161
161
  md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
@@ -203,7 +203,7 @@ module Bundler
203
203
  output
204
204
  end
205
205
 
206
- private
206
+ private
207
207
 
208
208
  def prune_gem_cache(resolve, cache_path)
209
209
  cached = Dir["#{cache_path}/*.gem"]
@@ -63,30 +63,25 @@ module Bundler
63
63
  ].freeze
64
64
 
65
65
  DEFAULT_CONFIG = {
66
- :silence_deprecations => false,
67
- :disable_version_check => true,
68
- :prefer_patch => false,
69
- :redirect => 5,
70
- :retry => 3,
71
- :timeout => 10,
66
+ "BUNDLE_SILENCE_DEPRECATIONS" => false,
67
+ "BUNDLE_DISABLE_VERSION_CHECK" => true,
68
+ "BUNDLE_PREFER_PATCH" => false,
69
+ "BUNDLE_REDIRECT" => 5,
70
+ "BUNDLE_RETRY" => 3,
71
+ "BUNDLE_TIMEOUT" => 10,
72
72
  }.freeze
73
73
 
74
74
  def initialize(root = nil)
75
75
  @root = root
76
76
  @local_config = load_config(local_config_file)
77
+ @env_config = ENV.to_h.select {|key, _value| key =~ /\ABUNDLE_.+/ }
77
78
  @global_config = load_config(global_config_file)
78
79
  @temporary = {}
79
80
  end
80
81
 
81
82
  def [](name)
82
83
  key = key_for(name)
83
- value = @temporary.fetch(key) do
84
- @local_config.fetch(key) do
85
- ENV.fetch(key) do
86
- @global_config.fetch(key) do
87
- DEFAULT_CONFIG.fetch(name) do
88
- nil
89
- end end end end end
84
+ value = configs.values.map {|config| config[key] }.compact.first
90
85
 
91
86
  converted_value(value, name)
92
87
  end
@@ -129,9 +124,7 @@ module Bundler
129
124
  end
130
125
 
131
126
  def all
132
- env_keys = ENV.keys.grep(/\ABUNDLE_.+/)
133
-
134
- keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
127
+ keys = @temporary.keys | @global_config.keys | @local_config.keys | @env_config.keys
135
128
 
136
129
  keys.map do |key|
137
130
  key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
@@ -168,13 +161,11 @@ module Bundler
168
161
 
169
162
  def locations(key)
170
163
  key = key_for(key)
171
- locations = {}
172
- locations[:temporary] = @temporary[key] if @temporary.key?(key)
173
- locations[:local] = @local_config[key] if @local_config.key?(key)
174
- locations[:env] = ENV[key] if ENV[key]
175
- locations[:global] = @global_config[key] if @global_config.key?(key)
176
- locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
177
- locations
164
+ configs.keys.inject({}) do |partial_locations, level|
165
+ value_on_level = configs[level][key]
166
+ partial_locations[level] = value_on_level unless value_on_level.nil?
167
+ partial_locations
168
+ end
178
169
  end
179
170
 
180
171
  def pretty_values_for(exposed_key)
@@ -182,20 +173,20 @@ module Bundler
182
173
 
183
174
  locations = []
184
175
 
185
- if @temporary.key?(key)
186
- locations << "Set for the current command: #{converted_value(@temporary[key], exposed_key).inspect}"
176
+ if value = @temporary[key]
177
+ locations << "Set for the current command: #{converted_value(value, exposed_key).inspect}"
187
178
  end
188
179
 
189
- if @local_config.key?(key)
190
- locations << "Set for your local app (#{local_config_file}): #{converted_value(@local_config[key], exposed_key).inspect}"
180
+ if value = @local_config[key]
181
+ locations << "Set for your local app (#{local_config_file}): #{converted_value(value, exposed_key).inspect}"
191
182
  end
192
183
 
193
- if value = ENV[key]
184
+ if value = @env_config[key]
194
185
  locations << "Set via #{key}: #{converted_value(value, exposed_key).inspect}"
195
186
  end
196
187
 
197
- if @global_config.key?(key)
198
- locations << "Set for the current user (#{global_config_file}): #{converted_value(@global_config[key], exposed_key).inspect}"
188
+ if value = @global_config[key]
189
+ locations << "Set for the current user (#{global_config_file}): #{converted_value(value, exposed_key).inspect}"
199
190
  end
200
191
 
201
192
  return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
@@ -204,17 +195,19 @@ module Bundler
204
195
 
205
196
  # for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
206
197
  def path
207
- key = key_for(:path)
208
- path = ENV[key] || @global_config[key]
209
- if path && !@temporary.key?(key) && !@local_config.key?(key)
210
- return Path.new(path, false, false)
198
+ configs.each do |_level, settings|
199
+ path = value_for("path", settings)
200
+ path_system = value_for("path.system", settings)
201
+ disabled_shared_gems = value_for("disable_shared_gems", settings)
202
+ next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
203
+ system_path = path_system || (disabled_shared_gems == false)
204
+ return Path.new(path, system_path)
211
205
  end
212
206
 
213
- system_path = self["path.system"] || (self[:disable_shared_gems] == false)
214
- Path.new(self[:path], system_path, Bundler.feature_flag.default_install_uses_path?)
207
+ Path.new(nil, false)
215
208
  end
216
209
 
217
- Path = Struct.new(:explicit_path, :system_path, :default_install_uses_path) do
210
+ Path = Struct.new(:explicit_path, :system_path) do
218
211
  def path
219
212
  path = base_path
220
213
  path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
@@ -224,7 +217,7 @@ module Bundler
224
217
  def use_system_gems?
225
218
  return true if system_path
226
219
  return false if explicit_path
227
- !default_install_uses_path
220
+ !Bundler.feature_flag.default_install_uses_path?
228
221
  end
229
222
 
230
223
  def base_path
@@ -277,9 +270,9 @@ module Bundler
277
270
 
278
271
  def validate!
279
272
  all.each do |raw_key|
280
- [@local_config, ENV, @global_config].each do |settings|
281
- value = converted_value(settings[key_for(raw_key)], raw_key)
282
- Validator.validate!(raw_key, value, settings.to_hash.dup)
273
+ [@local_config, @env_config, @global_config].each do |settings|
274
+ value = value_for(raw_key, settings)
275
+ Validator.validate!(raw_key, value, settings.dup)
283
276
  end
284
277
  end
285
278
  end
@@ -290,7 +283,21 @@ module Bundler
290
283
  "BUNDLE_#{key}"
291
284
  end
292
285
 
293
- private
286
+ private
287
+
288
+ def configs
289
+ {
290
+ :temporary => @temporary,
291
+ :local => @local_config,
292
+ :env => @env_config,
293
+ :global => @global_config,
294
+ :default => DEFAULT_CONFIG,
295
+ }
296
+ end
297
+
298
+ def value_for(name, config)
299
+ converted_value(config[key_for(name)], name)
300
+ end
294
301
 
295
302
  def parent_setting_for(name)
296
303
  split_specific_setting_for(name)[0]
@@ -212,7 +212,7 @@ module Bundler
212
212
  filesystem_access(gemfile_path) {|g| File.open(g, "w") {|file| file.puts contents } }
213
213
  end
214
214
 
215
- private
215
+ private
216
216
 
217
217
  def validate_bundle_path
218
218
  path_separator = Bundler.rubygems.path_separator
@@ -26,7 +26,7 @@ module Bundler
26
26
  end
27
27
  end
28
28
 
29
- protected
29
+ protected
30
30
 
31
31
  # https://www.informit.com/articles/article.aspx?p=683059&seqNum=36
32
32
  def levenshtein_distance(this, that, ins = 2, del = 2, sub = 1)
@@ -63,7 +63,7 @@ module Bundler
63
63
  )
64
64
  end
65
65
 
66
- private
66
+ private
67
67
 
68
68
  def version_color(spec_version, locked_spec_version)
69
69
  if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)
@@ -234,7 +234,7 @@ module Bundler
234
234
  @local
235
235
  end
236
236
 
237
- private
237
+ private
238
238
 
239
239
  def serialize_gemspecs_in(destination)
240
240
  destination = destination.expand_path(Bundler.root) if destination.relative?
@@ -136,11 +136,13 @@ module Bundler
136
136
  if submodules
137
137
  git_retry "submodule update --init --recursive", :dir => destination
138
138
  elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
139
- git_retry "submodule deinit --all --force", :dir => destination
139
+ inner_command = "git -C $toplevel submodule deinit --force $sm_path"
140
+ inner_command = inner_command.gsub("$") { '\$' } unless Bundler::WINDOWS
141
+ git_retry "submodule foreach --quiet \"#{inner_command}\"", :dir => destination
140
142
  end
141
143
  end
142
144
 
143
- private
145
+ private
144
146
 
145
147
  def git_null(command, dir: SharedHelpers.pwd)
146
148
  check_allowed(command)
@@ -125,7 +125,7 @@ module Bundler
125
125
  @expanded_original_path ||= expand(original_path)
126
126
  end
127
127
 
128
- private
128
+ private
129
129
 
130
130
  def expanded_path
131
131
  @expanded_path ||= expand(path)
@@ -171,7 +171,7 @@ module Bundler
171
171
 
172
172
  if File.directory?(expanded_path)
173
173
  # We sort depth-first since `<<` will override the earlier-found specs
174
- Dir["#{expanded_path}/#{@glob}"].sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
174
+ Gem::Util.glob_files_in_dir(@glob, expanded_path).sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
175
175
  next unless spec = load_gemspec(file)
176
176
  spec.source = self
177
177
 
@@ -40,7 +40,7 @@ module Bundler
40
40
  Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
41
41
  end
42
42
 
43
- private
43
+ private
44
44
 
45
45
  def generate_bin
46
46
  super
@@ -291,7 +291,7 @@ module Bundler
291
291
  names
292
292
  end
293
293
 
294
- protected
294
+ protected
295
295
 
296
296
  def credless_remotes
297
297
  remotes.map(&method(:suppress_configured_credentials))
@@ -465,7 +465,7 @@ module Bundler
465
465
  Bundler.app_cache
466
466
  end
467
467
 
468
- private
468
+ private
469
469
 
470
470
  # Checks if the requested spec exists in the global cache. If it does,
471
471
  # we copy it to the download path, and if it does not, we download it.