bundler 2.5.23 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +59 -0
  3. data/bundler.gemspec +2 -2
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/console.rb +0 -4
  6. data/lib/bundler/cli/doctor.rb +4 -4
  7. data/lib/bundler/cli/exec.rb +1 -0
  8. data/lib/bundler/cli/gem.rb +1 -1
  9. data/lib/bundler/cli/info.rb +2 -2
  10. data/lib/bundler/cli/inject.rb +1 -1
  11. data/lib/bundler/cli/install.rb +4 -0
  12. data/lib/bundler/cli/lock.rb +20 -1
  13. data/lib/bundler/cli/pristine.rb +1 -1
  14. data/lib/bundler/cli/show.rb +2 -2
  15. data/lib/bundler/cli.rb +22 -53
  16. data/lib/bundler/compact_index_client/cache_file.rb +0 -5
  17. data/lib/bundler/compact_index_client/updater.rb +0 -11
  18. data/lib/bundler/definition.rb +134 -61
  19. data/lib/bundler/dependency.rb +1 -1
  20. data/lib/bundler/dsl.rb +2 -13
  21. data/lib/bundler/endpoint_specification.rb +10 -1
  22. data/lib/bundler/errors.rb +10 -0
  23. data/lib/bundler/feature_flag.rb +1 -0
  24. data/lib/bundler/fetcher/compact_index.rb +1 -1
  25. data/lib/bundler/fetcher.rb +10 -3
  26. data/lib/bundler/gem_helpers.rb +21 -5
  27. data/lib/bundler/injector.rb +2 -2
  28. data/lib/bundler/installer/standalone.rb +2 -2
  29. data/lib/bundler/installer.rb +4 -38
  30. data/lib/bundler/lazy_specification.rb +65 -24
  31. data/lib/bundler/lockfile_parser.rb +9 -1
  32. data/lib/bundler/man/bundle-add.1 +13 -10
  33. data/lib/bundler/man/bundle-add.1.ronn +12 -9
  34. data/lib/bundler/man/bundle-binstubs.1 +7 -4
  35. data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  36. data/lib/bundler/man/bundle-cache.1 +30 -2
  37. data/lib/bundler/man/bundle-cache.1.ronn +31 -2
  38. data/lib/bundler/man/bundle-check.1 +3 -3
  39. data/lib/bundler/man/bundle-check.1.ronn +4 -2
  40. data/lib/bundler/man/bundle-clean.1 +1 -1
  41. data/lib/bundler/man/bundle-config.1 +3 -1
  42. data/lib/bundler/man/bundle-config.1.ronn +2 -0
  43. data/lib/bundler/man/bundle-console.1 +2 -4
  44. data/lib/bundler/man/bundle-console.1.ronn +2 -7
  45. data/lib/bundler/man/bundle-doctor.1 +2 -2
  46. data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  47. data/lib/bundler/man/bundle-env.1 +9 -0
  48. data/lib/bundler/man/bundle-env.1.ronn +10 -0
  49. data/lib/bundler/man/bundle-exec.1 +5 -2
  50. data/lib/bundler/man/bundle-exec.1.ronn +4 -1
  51. data/lib/bundler/man/bundle-fund.1 +22 -0
  52. data/lib/bundler/man/bundle-fund.1.ronn +25 -0
  53. data/lib/bundler/man/bundle-gem.1 +17 -5
  54. data/lib/bundler/man/bundle-gem.1.ronn +27 -6
  55. data/lib/bundler/man/bundle-help.1 +1 -1
  56. data/lib/bundler/man/bundle-info.1 +5 -2
  57. data/lib/bundler/man/bundle-info.1.ronn +6 -2
  58. data/lib/bundler/man/bundle-init.1 +3 -3
  59. data/lib/bundler/man/bundle-init.1.ronn +3 -2
  60. data/lib/bundler/man/bundle-inject.1 +10 -2
  61. data/lib/bundler/man/bundle-inject.1.ronn +9 -1
  62. data/lib/bundler/man/bundle-install.1 +14 -11
  63. data/lib/bundler/man/bundle-install.1.ronn +21 -16
  64. data/lib/bundler/man/bundle-issue.1 +45 -0
  65. data/lib/bundler/man/bundle-issue.1.ronn +37 -0
  66. data/lib/bundler/man/bundle-licenses.1 +9 -0
  67. data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  68. data/lib/bundler/man/bundle-list.1 +1 -1
  69. data/lib/bundler/man/bundle-list.1.ronn +4 -1
  70. data/lib/bundler/man/bundle-lock.1 +21 -6
  71. data/lib/bundler/man/bundle-lock.1.ronn +25 -4
  72. data/lib/bundler/man/bundle-open.1 +2 -2
  73. data/lib/bundler/man/bundle-open.1.ronn +2 -1
  74. data/lib/bundler/man/bundle-outdated.1 +8 -5
  75. data/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  76. data/lib/bundler/man/bundle-platform.1 +1 -1
  77. data/lib/bundler/man/bundle-plugin.1 +1 -1
  78. data/lib/bundler/man/bundle-pristine.1 +1 -1
  79. data/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  80. data/lib/bundler/man/bundle-remove.1 +1 -1
  81. data/lib/bundler/man/bundle-remove.1.ronn +1 -1
  82. data/lib/bundler/man/bundle-show.1 +5 -2
  83. data/lib/bundler/man/bundle-show.1.ronn +4 -0
  84. data/lib/bundler/man/bundle-update.1 +13 -7
  85. data/lib/bundler/man/bundle-update.1.ronn +14 -6
  86. data/lib/bundler/man/bundle-version.1 +1 -1
  87. data/lib/bundler/man/bundle-viz.1 +4 -4
  88. data/lib/bundler/man/bundle-viz.1.ronn +7 -3
  89. data/lib/bundler/man/bundle.1 +1 -1
  90. data/lib/bundler/man/gemfile.5 +1 -1
  91. data/lib/bundler/man/index.txt +4 -0
  92. data/lib/bundler/materialization.rb +59 -0
  93. data/lib/bundler/plugin/events.rb +24 -0
  94. data/lib/bundler/plugin/installer.rb +1 -1
  95. data/lib/bundler/process_lock.rb +1 -1
  96. data/lib/bundler/remote_specification.rb +6 -1
  97. data/lib/bundler/resolver/base.rb +2 -6
  98. data/lib/bundler/resolver/candidate.rb +2 -2
  99. data/lib/bundler/resolver/spec_group.rb +4 -3
  100. data/lib/bundler/resolver.rb +5 -5
  101. data/lib/bundler/rubygems_ext.rb +17 -28
  102. data/lib/bundler/rubygems_gem_installer.rb +0 -1
  103. data/lib/bundler/rubygems_integration.rb +21 -11
  104. data/lib/bundler/runtime.rb +27 -7
  105. data/lib/bundler/self_manager.rb +2 -3
  106. data/lib/bundler/settings.rb +1 -0
  107. data/lib/bundler/shared_helpers.rb +2 -2
  108. data/lib/bundler/source/git/git_proxy.rb +0 -6
  109. data/lib/bundler/source/git.rb +56 -31
  110. data/lib/bundler/source/path.rb +2 -2
  111. data/lib/bundler/source_list.rb +1 -1
  112. data/lib/bundler/spec_set.rb +81 -56
  113. data/lib/bundler/stub_specification.rb +8 -0
  114. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  115. data/lib/bundler/uri_credentials_filter.rb +1 -1
  116. data/lib/bundler/vendor/fileutils/COPYING +56 -0
  117. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  118. data/lib/bundler/vendor/securerandom/COPYING +56 -0
  119. data/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
  120. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  121. data/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  122. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  123. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  124. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  125. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  126. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  127. data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  128. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  129. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  130. data/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  131. data/lib/bundler/vendor/uri/COPYING +56 -0
  132. data/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
  133. data/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  134. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  135. data/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
  136. data/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  137. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  138. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  139. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  140. data/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  141. data/lib/bundler/vendored_securerandom.rb +0 -2
  142. data/lib/bundler/version.rb +1 -1
  143. data/lib/bundler.rb +37 -13
  144. metadata +18 -12
  145. data/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
  146. data/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
  147. data/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
  148. data/lib/bundler/vendor/uri/LICENSE.txt +0 -22
@@ -102,7 +102,7 @@ module Bundler
102
102
  end
103
103
 
104
104
  def identifier
105
- uri_with_specifiers([humanized_ref, cached_revision, glob_for_display])
105
+ uri_with_specifiers([humanized_ref, locked_revision, glob_for_display])
106
106
  end
107
107
 
108
108
  def uri_with_specifiers(specifiers)
@@ -176,10 +176,10 @@ module Bundler
176
176
  "#{current_branch} but Gemfile specifies #{branch}"
177
177
  end
178
178
 
179
- changed = cached_revision && cached_revision != revision
179
+ changed = locked_revision && locked_revision != revision
180
180
 
181
- if !Bundler.settings[:disable_local_revision_check] && changed && !@unlocked && !git_proxy.contains?(cached_revision)
182
- raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(cached_revision)} " \
181
+ if !Bundler.settings[:disable_local_revision_check] && changed && !@unlocked && !git_proxy.contains?(locked_revision)
182
+ raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(locked_revision)} " \
183
183
  "but the current branch in your local override for #{name} does not contain such commit. " \
184
184
  "Please make sure your branch is up to date."
185
185
  end
@@ -188,12 +188,10 @@ module Bundler
188
188
  end
189
189
 
190
190
  def specs(*)
191
- set_up_app_cache!(app_cache_path) if use_app_cache?
191
+ set_cache_path!(app_cache_path) if use_app_cache?
192
192
 
193
193
  if requires_checkout? && !@copied
194
- FileUtils.rm_rf(app_cache_path) if use_app_cache? && git_proxy.not_a_repository?
195
-
196
- fetch
194
+ fetch unless use_app_cache?
197
195
  checkout
198
196
  end
199
197
 
@@ -216,17 +214,16 @@ module Bundler
216
214
  requires_checkout? ? spec.post_install_message : nil
217
215
  end
218
216
 
217
+ def migrate_cache(custom_path = nil, local: false)
218
+ if local
219
+ cache_to(custom_path, try_migrate: false)
220
+ else
221
+ cache_to(custom_path, try_migrate: true)
222
+ end
223
+ end
224
+
219
225
  def cache(spec, custom_path = nil)
220
- app_cache_path = app_cache_path(custom_path)
221
- return unless Bundler.feature_flag.cache_all?
222
- return if install_path == app_cache_path
223
- return if cache_path == app_cache_path
224
- cached!
225
- FileUtils.rm_rf(app_cache_path)
226
- git_proxy.checkout if requires_checkout?
227
- FileUtils.cp_r("#{cache_path}/.", app_cache_path)
228
- FileUtils.touch(app_cache_path.join(".bundlecache"))
229
- FileUtils.rm_rf(Dir.glob(app_cache_path.join("hooks/*.sample")))
226
+ cache_to(custom_path, try_migrate: false)
230
227
  end
231
228
 
232
229
  def load_spec_files
@@ -249,7 +246,7 @@ module Bundler
249
246
  end
250
247
 
251
248
  def app_cache_dirname
252
- "#{base_name}-#{shortref_for_path(cached_revision || revision)}"
249
+ "#{base_name}-#{shortref_for_path(locked_revision || revision)}"
253
250
  end
254
251
 
255
252
  def revision
@@ -270,9 +267,38 @@ module Bundler
270
267
 
271
268
  private
272
269
 
270
+ def cache_to(custom_path, try_migrate: false)
271
+ return unless Bundler.feature_flag.cache_all?
272
+
273
+ app_cache_path = app_cache_path(custom_path)
274
+
275
+ migrate = try_migrate ? bare_repo?(app_cache_path) : false
276
+
277
+ set_cache_path!(nil) if migrate
278
+
279
+ return if cache_path == app_cache_path
280
+
281
+ cached!
282
+ FileUtils.rm_rf(app_cache_path)
283
+ git_proxy.checkout if migrate || requires_checkout?
284
+ git_proxy.copy_to(app_cache_path, @submodules)
285
+ end
286
+
273
287
  def checkout
274
288
  Bundler.ui.debug " * Checking out revision: #{ref}"
275
- git_proxy.copy_to(install_path, submodules)
289
+ if use_app_cache? && !bare_repo?(app_cache_path)
290
+ SharedHelpers.filesystem_access(install_path.dirname) do |p|
291
+ FileUtils.mkdir_p(p)
292
+ end
293
+ FileUtils.cp_r("#{app_cache_path}/.", install_path)
294
+ else
295
+ if use_app_cache? && bare_repo?(app_cache_path)
296
+ Bundler.ui.warn "Installing from cache in old \"bare repository\" format for compatibility. " \
297
+ "Please run `bundle cache` and commit the updated cache to migrate to the new format and get rid of this warning."
298
+ end
299
+
300
+ git_proxy.copy_to(install_path, submodules)
301
+ end
276
302
  serialize_gemspecs_in(install_path)
277
303
  @copied = true
278
304
  end
@@ -320,13 +346,8 @@ module Bundler
320
346
  @install_path = path
321
347
  end
322
348
 
323
- def set_up_app_cache!(path)
324
- FileUtils.mkdir_p(path.join("refs"))
325
- set_cache_path!(path)
326
- end
327
-
328
349
  def has_app_cache?
329
- cached_revision && super
350
+ locked_revision && super
330
351
  end
331
352
 
332
353
  def use_app_cache?
@@ -334,11 +355,11 @@ module Bundler
334
355
  end
335
356
 
336
357
  def requires_checkout?
337
- allow_git_ops? && !local? && !cached_revision_checked_out?
358
+ allow_git_ops? && !local? && !locked_revision_checked_out?
338
359
  end
339
360
 
340
- def cached_revision_checked_out?
341
- cached_revision && cached_revision == revision && install_path.exist?
361
+ def locked_revision_checked_out?
362
+ locked_revision && locked_revision == revision && install_path.exist?
342
363
  end
343
364
 
344
365
  def base_name
@@ -375,7 +396,7 @@ module Bundler
375
396
  Bundler::Digest.sha1(input)
376
397
  end
377
398
 
378
- def cached_revision
399
+ def locked_revision
379
400
  options["revision"]
380
401
  end
381
402
 
@@ -384,7 +405,7 @@ module Bundler
384
405
  end
385
406
 
386
407
  def git_proxy
387
- @git_proxy ||= GitProxy.new(cache_path, uri, options, cached_revision, self)
408
+ @git_proxy ||= GitProxy.new(cache_path, uri, options, locked_revision, self)
388
409
  end
389
410
 
390
411
  def fetch
@@ -417,6 +438,10 @@ module Bundler
417
438
  def override_for(path)
418
439
  Bundler.settings.local_overrides.key(path)
419
440
  end
441
+
442
+ def bare_repo?(path)
443
+ File.exist?(path.join("objects")) && File.exist?(path.join("HEAD"))
444
+ end
420
445
  end
421
446
  end
422
447
  end
@@ -214,7 +214,7 @@ module Bundler
214
214
 
215
215
  # Some gem authors put absolute paths in their gemspec
216
216
  # and we have to save them from themselves
217
- spec.files = spec.files.map do |path|
217
+ spec.files = spec.files.filter_map do |path|
218
218
  next path unless /\A#{Pathname::SEPARATOR_PAT}/o.match?(path)
219
219
  next if File.directory?(path)
220
220
  begin
@@ -222,7 +222,7 @@ module Bundler
222
222
  rescue ArgumentError
223
223
  path
224
224
  end
225
- end.compact
225
+ end
226
226
 
227
227
  installer = Path::Installer.new(
228
228
  spec,
@@ -91,7 +91,7 @@ module Bundler
91
91
  end
92
92
 
93
93
  def rubygems_remotes
94
- rubygems_sources.map(&:remotes).flatten.uniq
94
+ rubygems_sources.flat_map(&:remotes).uniq
95
95
  end
96
96
 
97
97
  def all_sources
@@ -7,49 +7,44 @@ module Bundler
7
7
  include Enumerable
8
8
  include TSort
9
9
 
10
- attr_reader :incomplete_specs
11
-
12
- def initialize(specs, incomplete_specs = [])
10
+ def initialize(specs)
13
11
  @specs = specs
14
- @incomplete_specs = incomplete_specs
15
12
  end
16
13
 
17
- def for(dependencies, check = false, platforms = [nil])
18
- handled = ["bundler"].product(platforms).map {|k| [k, true] }.to_h
19
- deps = dependencies.product(platforms)
20
- specs = []
14
+ def for(dependencies, platforms_or_legacy_check = [nil], legacy_platforms = [nil], skips: [])
15
+ platforms = if [true, false].include?(platforms_or_legacy_check)
16
+ Bundler::SharedHelpers.major_deprecation 2,
17
+ "SpecSet#for received a `check` parameter, but that's no longer used and deprecated. " \
18
+ "SpecSet#for always implicitly performs validation. Please remove this parameter",
19
+ print_caller_location: true
21
20
 
22
- loop do
23
- break unless dep = deps.shift
21
+ legacy_platforms
22
+ else
23
+ platforms_or_legacy_check
24
+ end
24
25
 
25
- name = dep[0].name
26
- platform = dep[1]
27
- incomplete = false
26
+ materialize_dependencies(dependencies, platforms, skips: skips)
28
27
 
29
- key = [name, platform]
30
- next if handled.key?(key)
28
+ @materializations.flat_map(&:specs).uniq
29
+ end
31
30
 
32
- handled[key] = true
31
+ def normalize_platforms!(deps, platforms)
32
+ complete_platforms = add_extra_platforms!(platforms)
33
33
 
34
- specs_for_dep = specs_for_dependency(*dep)
35
- if specs_for_dep.any?
36
- specs.concat(specs_for_dep)
34
+ complete_platforms.map do |platform|
35
+ next platform if platform == Gem::Platform::RUBY
37
36
 
38
- specs_for_dep.first.dependencies.each do |d|
39
- next if d.type == :development
40
- incomplete = true if d.name != "bundler" && lookup[d.name].nil?
41
- deps << [d, dep[1]]
42
- end
43
- else
44
- incomplete = true
37
+ begin
38
+ Integer(platform.version)
39
+ rescue ArgumentError, TypeError
40
+ next platform
45
41
  end
46
42
 
47
- if incomplete && check
48
- @incomplete_specs += lookup[name] || [LazySpecification.new(name, nil, nil)]
49
- end
50
- end
43
+ less_specific_platform = Gem::Platform.new([platform.cpu, platform.os, nil])
44
+ next platform if incomplete_for_platform?(deps, less_specific_platform)
51
45
 
52
- specs.uniq
46
+ less_specific_platform
47
+ end.uniq
53
48
  end
54
49
 
55
50
  def add_extra_platforms!(platforms)
@@ -112,19 +107,18 @@ module Bundler
112
107
  end
113
108
 
114
109
  def materialize(deps)
115
- materialized = self.for(deps, true)
110
+ materialize_dependencies(deps)
116
111
 
117
- SpecSet.new(materialized, incomplete_specs)
112
+ SpecSet.new(materialized_specs)
118
113
  end
119
114
 
120
115
  # Materialize for all the specs in the spec set, regardless of what platform they're for
121
- # This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
122
116
  # @return [Array<Gem::Specification>]
123
117
  def materialized_for_all_platforms
124
118
  @specs.map do |s|
125
119
  next s unless s.is_a?(LazySpecification)
126
120
  s.source.remote!
127
- spec = s.materialize_for_installation
121
+ spec = s.materialize_strictly
128
122
  raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
129
123
  spec
130
124
  end
@@ -133,15 +127,32 @@ module Bundler
133
127
  def incomplete_for_platform?(deps, platform)
134
128
  return false if @specs.empty?
135
129
 
136
- @incomplete_specs = []
130
+ validation_set = self.class.new(@specs)
131
+ validation_set.for(deps, [platform])
132
+
133
+ validation_set.incomplete_specs.any?
134
+ end
137
135
 
138
- self.for(deps, true, [platform])
136
+ def missing_specs_for(dependencies)
137
+ materialize_dependencies(dependencies)
139
138
 
140
- @incomplete_specs.any?
139
+ missing_specs
141
140
  end
142
141
 
143
142
  def missing_specs
144
- @specs.select {|s| s.is_a?(LazySpecification) }
143
+ @materializations.flat_map(&:completely_missing_specs)
144
+ end
145
+
146
+ def partially_missing_specs
147
+ @materializations.flat_map(&:partially_missing_specs)
148
+ end
149
+
150
+ def incomplete_specs
151
+ @materializations.flat_map(&:incomplete_specs)
152
+ end
153
+
154
+ def insecurely_materialized_specs
155
+ materialized_specs.select(&:insecurely_materialized?)
145
156
  end
146
157
 
147
158
  def -(other)
@@ -152,12 +163,6 @@ module Bundler
152
163
  @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
153
164
  end
154
165
 
155
- def specs_compatible_with(other)
156
- select do |spec|
157
- other.valid?(spec)
158
- end
159
- end
160
-
161
166
  def delete_by_name(name)
162
167
  @specs.reject! {|spec| spec.name == name }
163
168
 
@@ -201,6 +206,37 @@ module Bundler
201
206
 
202
207
  private
203
208
 
209
+ def materialize_dependencies(dependencies, platforms = [nil], skips: [])
210
+ handled = ["bundler"].product(platforms).map {|k| [k, true] }.to_h
211
+ deps = dependencies.product(platforms)
212
+ @materializations = []
213
+
214
+ loop do
215
+ break unless dep = deps.shift
216
+
217
+ dependency = dep[0]
218
+ platform = dep[1]
219
+ name = dependency.name
220
+
221
+ key = [name, platform]
222
+ next if handled.key?(key)
223
+
224
+ handled[key] = true
225
+
226
+ materialization = Materialization.new(dependency, platform, candidates: lookup[name])
227
+
228
+ deps.concat(materialization.dependencies) if materialization.complete?
229
+
230
+ @materializations << materialization unless skips.include?(name)
231
+ end
232
+
233
+ @materializations
234
+ end
235
+
236
+ def materialized_specs
237
+ @materializations.filter_map(&:materialized_spec)
238
+ end
239
+
204
240
  def reset!
205
241
  @sorted = nil
206
242
  @lookup = nil
@@ -273,17 +309,6 @@ module Bundler
273
309
  @specs.sort_by(&:name).each {|s| yield s }
274
310
  end
275
311
 
276
- def specs_for_dependency(dep, platform)
277
- specs_for_name = lookup[dep.name]
278
- return [] unless specs_for_name
279
-
280
- if platform
281
- GemHelpers.select_best_platform_match(specs_for_name, platform, force_ruby: dep.force_ruby_platform)
282
- else
283
- GemHelpers.select_best_local_platform_match(specs_for_name, force_ruby: dep.force_ruby_platform || dep.default_force_ruby_platform)
284
- end
285
- end
286
-
287
312
  def tsort_each_child(s)
288
313
  s.dependencies.sort_by(&:name).each do |d|
289
314
  next if d.type == :development
@@ -9,6 +9,10 @@ module Bundler
9
9
  spec
10
10
  end
11
11
 
12
+ def insecurely_materialized?
13
+ false
14
+ end
15
+
12
16
  attr_reader :checksum
13
17
  attr_accessor :stub, :ignored
14
18
 
@@ -112,6 +116,10 @@ module Bundler
112
116
  stub.raw_require_paths
113
117
  end
114
118
 
119
+ def inspect
120
+ "#<#{self.class} @name=\"#{name}\" (#{full_name.delete_prefix("#{name}-")})>"
121
+ end
122
+
115
123
  private
116
124
 
117
125
  def _remote_specification
@@ -26,7 +26,7 @@ TODO: Write usage instructions here
26
26
 
27
27
  ## Development
28
28
 
29
- After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test].sub('mini', '').sub('rspec', 'spec') %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
29
+ After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test_task] %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
30
30
 
31
31
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
32
  <% if config[:git] -%>
@@ -16,7 +16,7 @@ module Bundler
16
16
 
17
17
  if uri.userinfo
18
18
  # oauth authentication
19
- if uri.password == "x-oauth-basic" || uri.password == "x"
19
+ if uri.password == "x-oauth-basic" || uri.password == "x" || uri.password.nil?
20
20
  # URI as string does not display with password if no user is set
21
21
  oauth_designation = uri.password
22
22
  uri.user = oauth_designation
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a. place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b. use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c. give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d. make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a. distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b. accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c. give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d. make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
@@ -180,7 +180,8 @@ end
180
180
  # - {CVE-2004-0452}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452].
181
181
  #
182
182
  module Bundler::FileUtils
183
- VERSION = "1.7.2"
183
+ # The version number.
184
+ VERSION = "1.7.3"
184
185
 
185
186
  def self.private_module_function(name) #:nodoc:
186
187
  module_function name
@@ -1651,7 +1652,7 @@ module Bundler::FileUtils
1651
1652
  when "a"
1652
1653
  mask | 07777
1653
1654
  else
1654
- raise ArgumentError, "invalid `who' symbol in file mode: #{chr}"
1655
+ raise ArgumentError, "invalid 'who' symbol in file mode: #{chr}"
1655
1656
  end
1656
1657
  end
1657
1658
  end
@@ -1705,7 +1706,7 @@ module Bundler::FileUtils
1705
1706
  copy_mask = user_mask(chr)
1706
1707
  (current_mode & copy_mask) / (copy_mask & 0111) * (user_mask & 0111)
1707
1708
  else
1708
- raise ArgumentError, "invalid `perm' symbol in file mode: #{chr}"
1709
+ raise ArgumentError, "invalid 'perm' symbol in file mode: #{chr}"
1709
1710
  end
1710
1711
  end
1711
1712
 
@@ -2028,21 +2029,22 @@ module Bundler::FileUtils
2028
2029
 
2029
2030
  private
2030
2031
 
2031
- module StreamUtils_
2032
+ module StreamUtils_ # :nodoc:
2033
+
2032
2034
  private
2033
2035
 
2034
2036
  case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
2035
2037
  when /mswin|mingw/
2036
- def fu_windows?; true end
2038
+ def fu_windows?; true end #:nodoc:
2037
2039
  else
2038
- def fu_windows?; false end
2040
+ def fu_windows?; false end #:nodoc:
2039
2041
  end
2040
2042
 
2041
2043
  def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
2042
2044
  IO.copy_stream(src, dest)
2043
2045
  end
2044
2046
 
2045
- def fu_stream_blksize(*streams)
2047
+ def fu_stream_blksize(*streams) #:nodoc:
2046
2048
  streams.each do |s|
2047
2049
  next unless s.respond_to?(:stat)
2048
2050
  size = fu_blksize(s.stat)
@@ -2051,14 +2053,14 @@ module Bundler::FileUtils
2051
2053
  fu_default_blksize()
2052
2054
  end
2053
2055
 
2054
- def fu_blksize(st)
2056
+ def fu_blksize(st) #:nodoc:
2055
2057
  s = st.blksize
2056
2058
  return nil unless s
2057
2059
  return nil if s == 0
2058
2060
  s
2059
2061
  end
2060
2062
 
2061
- def fu_default_blksize
2063
+ def fu_default_blksize #:nodoc:
2062
2064
  1024
2063
2065
  end
2064
2066
  end
@@ -2503,7 +2505,7 @@ module Bundler::FileUtils
2503
2505
  end
2504
2506
  private_module_function :fu_output_message
2505
2507
 
2506
- def fu_split_path(path)
2508
+ def fu_split_path(path) #:nodoc:
2507
2509
  path = File.path(path)
2508
2510
  list = []
2509
2511
  until (parent, base = File.split(path); parent == path or parent == ".")
@@ -2524,7 +2526,7 @@ module Bundler::FileUtils
2524
2526
  end
2525
2527
  private_module_function :fu_relative_components_from
2526
2528
 
2527
- def fu_clean_components(*comp)
2529
+ def fu_clean_components(*comp) #:nodoc:
2528
2530
  comp.shift while comp.first == "."
2529
2531
  return comp if comp.empty?
2530
2532
  clean = [comp.shift]
@@ -2543,11 +2545,11 @@ module Bundler::FileUtils
2543
2545
  private_module_function :fu_clean_components
2544
2546
 
2545
2547
  if fu_windows?
2546
- def fu_starting_path?(path)
2548
+ def fu_starting_path?(path) #:nodoc:
2547
2549
  path&.start_with?(%r(\w:|/))
2548
2550
  end
2549
2551
  else
2550
- def fu_starting_path?(path)
2552
+ def fu_starting_path?(path) #:nodoc:
2551
2553
  path&.start_with?("/")
2552
2554
  end
2553
2555
  end
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a. place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b. use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c. give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d. make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a. distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b. accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c. give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d. make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.