bundler 2.2.13 → 2.2.18

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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +85 -5
  3. data/bundler.gemspec +2 -3
  4. data/lib/bundler.rb +1 -0
  5. data/lib/bundler/build_metadata.rb +2 -2
  6. data/lib/bundler/cli.rb +16 -35
  7. data/lib/bundler/cli/common.rb +15 -2
  8. data/lib/bundler/cli/gem.rb +9 -1
  9. data/lib/bundler/cli/outdated.rb +8 -11
  10. data/lib/bundler/compact_index_client/updater.rb +10 -6
  11. data/lib/bundler/current_ruby.rb +1 -0
  12. data/lib/bundler/definition.rb +40 -87
  13. data/lib/bundler/dsl.rb +3 -6
  14. data/lib/bundler/feature_flag.rb +0 -2
  15. data/lib/bundler/fetcher.rb +2 -1
  16. data/lib/bundler/fetcher/downloader.rb +8 -4
  17. data/lib/bundler/friendly_errors.rb +1 -1
  18. data/lib/bundler/gem_helper.rb +16 -0
  19. data/lib/bundler/index.rb +1 -2
  20. data/lib/bundler/injector.rb +2 -2
  21. data/lib/bundler/inline.rb +1 -1
  22. data/lib/bundler/installer/parallel_installer.rb +36 -15
  23. data/lib/bundler/lazy_specification.rb +6 -1
  24. data/lib/bundler/lockfile_parser.rb +2 -16
  25. data/lib/bundler/man/bundle-add.1 +1 -1
  26. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  27. data/lib/bundler/man/bundle-cache.1 +1 -1
  28. data/lib/bundler/man/bundle-check.1 +1 -1
  29. data/lib/bundler/man/bundle-clean.1 +1 -1
  30. data/lib/bundler/man/bundle-config.1 +21 -10
  31. data/lib/bundler/man/bundle-config.1.ronn +21 -11
  32. data/lib/bundler/man/bundle-doctor.1 +1 -1
  33. data/lib/bundler/man/bundle-exec.1 +1 -1
  34. data/lib/bundler/man/bundle-gem.1 +1 -1
  35. data/lib/bundler/man/bundle-info.1 +1 -1
  36. data/lib/bundler/man/bundle-init.1 +1 -1
  37. data/lib/bundler/man/bundle-inject.1 +1 -1
  38. data/lib/bundler/man/bundle-install.1 +1 -1
  39. data/lib/bundler/man/bundle-list.1 +1 -1
  40. data/lib/bundler/man/bundle-lock.1 +1 -1
  41. data/lib/bundler/man/bundle-open.1 +1 -1
  42. data/lib/bundler/man/bundle-outdated.1 +1 -1
  43. data/lib/bundler/man/bundle-platform.1 +1 -1
  44. data/lib/bundler/man/bundle-pristine.1 +1 -1
  45. data/lib/bundler/man/bundle-remove.1 +1 -1
  46. data/lib/bundler/man/bundle-show.1 +1 -1
  47. data/lib/bundler/man/bundle-update.1 +1 -1
  48. data/lib/bundler/man/bundle-viz.1 +1 -1
  49. data/lib/bundler/man/bundle.1 +1 -1
  50. data/lib/bundler/man/gemfile.5 +1 -1
  51. data/lib/bundler/plugin.rb +2 -2
  52. data/lib/bundler/plugin/api/source.rb +21 -0
  53. data/lib/bundler/resolver.rb +13 -96
  54. data/lib/bundler/resolver/spec_group.rb +0 -24
  55. data/lib/bundler/retry.rb +1 -1
  56. data/lib/bundler/rubygems_ext.rb +2 -2
  57. data/lib/bundler/settings.rb +60 -11
  58. data/lib/bundler/source.rb +15 -0
  59. data/lib/bundler/source/metadata.rb +0 -4
  60. data/lib/bundler/source/path.rb +3 -1
  61. data/lib/bundler/source/path/installer.rb +1 -1
  62. data/lib/bundler/source/rubygems.rb +37 -10
  63. data/lib/bundler/source/rubygems_aggregate.rb +64 -0
  64. data/lib/bundler/source_list.rb +37 -8
  65. data/lib/bundler/source_map.rb +58 -0
  66. data/lib/bundler/spec_set.rb +18 -5
  67. data/lib/bundler/templates/Gemfile +1 -1
  68. data/lib/bundler/templates/gems.rb +1 -1
  69. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -4
  70. data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  71. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
  72. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +1 -1
  73. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
  74. data/lib/bundler/version.rb +1 -1
  75. metadata +9 -4
@@ -47,10 +47,6 @@ configuration only from the local application.
47
47
  Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
48
48
  cause it to ignore all configuration.
49
49
 
50
- Executing `bundle config set --local disable_multisource true` upgrades the warning about
51
- the Gemfile containing multiple primary sources to an error. Executing `bundle
52
- config unset disable_multisource` downgrades this error to a warning.
53
-
54
50
  ## REMEMBERING OPTIONS
55
51
 
56
52
  Flags passed to `bundle install` or the Bundler runtime, such as `--path foo` or
@@ -178,10 +174,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
178
174
  * `disable_local_revision_check` (`BUNDLE_DISABLE_LOCAL_REVISION_CHECK`):
179
175
  Allow Bundler to use a local git override without checking if the revision
180
176
  present in the lockfile is present in the repository.
181
- * `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
182
- When set, Gemfiles containing multiple sources will produce errors
183
- instead of warnings.
184
- Use `bundle config unset disable_multisource` to unset.
185
177
  * `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
186
178
  Stop Bundler from accessing gems installed to RubyGems' normal location.
187
179
  * `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
@@ -194,6 +186,10 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
194
186
  Disallow changes to the `Gemfile`. When the `Gemfile` is changed and the
195
187
  lockfile has not been updated, running Bundler commands will be blocked.
196
188
  Defaults to `true` when `--deployment` is used.
189
+ * `gem.github_username` (`BUNDLE_GEM__GITHUB_USERNAME`):
190
+ Sets a GitHub username or organization to be used in `README` file when you
191
+ create a new gem via `bundle gem` command. It can be overridden by passing an
192
+ explicit `--github-username` flag to `bundle gem`.
197
193
  * `gem.push_key` (`BUNDLE_GEM__PUSH_KEY`):
198
194
  Sets the `--key` parameter for `gem push` when using the `rake release`
199
195
  command with a private gemstash server.
@@ -218,9 +214,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
218
214
  Whether `bundle package` should skip installing gems.
219
215
  * `no_prune` (`BUNDLE_NO_PRUNE`):
220
216
  Whether Bundler should leave outdated gems unpruned when caching.
221
- * `only_update_to_newer_versions` (`BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS`):
222
- During `bundle update`, only resolve to newer versions of the gems in the
223
- lockfile.
224
217
  * `path` (`BUNDLE_PATH`):
225
218
  The location on disk where all gems in your bundle will be located regardless
226
219
  of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
@@ -375,6 +368,23 @@ where you can use personal OAuth tokens:
375
368
 
376
369
  export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
377
370
 
371
+ Note that any configured credentials will be redacted by informative commands
372
+ such as `bundle config list` or `bundle config get`, unless you use the
373
+ `--parseable` flag. This is to avoid unintentially leaking credentials when
374
+ copy-pasting bundler output.
375
+
376
+ Also note that to guarantee a sane mapping between valid environment variable
377
+ names and valid host names, bundler makes the following transformations:
378
+
379
+ * Any `-` characters in a host name are mapped to a triple dash (`___`) in the
380
+ corresponding enviroment variable.
381
+
382
+ * Any `.` characters in a host name are mapped to a double dash (`__`) in the
383
+ corresponding environment variable.
384
+
385
+ This means that if you have a gem server named `my.gem-host.com`, you'll need to
386
+ use the `BUNDLE_MY__GEM___HOST__COM` variable to configure credentials for it
387
+ through ENV.
378
388
 
379
389
  ## CONFIGURE BUNDLER DIRECTORIES
380
390
 
@@ -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" "January 2021" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "May 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of 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\-GEM" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "May 2021" "" ""
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\-INFO" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "May 2021" "" ""
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\-PRISTINE" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "May 2021" "" ""
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\-VIZ" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "BUNDLE" "1" "May 2021" "" ""
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" "January 2021" "" ""
4
+ .TH "GEMFILE" "5" "May 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -164,7 +164,7 @@ module Bundler
164
164
  end
165
165
 
166
166
  # To be called from Cli class to pass the command and argument to
167
- # approriate plugin class
167
+ # appropriate plugin class
168
168
  def exec_command(command, args)
169
169
  raise UndefinedCommandError, "Command `#{command}` not found" unless command? command
170
170
 
@@ -183,7 +183,7 @@ module Bundler
183
183
  !index.source_plugin(name.to_s).nil?
184
184
  end
185
185
 
186
- # @return [Class] that handles the source. The calss includes API::Source
186
+ # @return [Class] that handles the source. The class includes API::Source
187
187
  def source(name)
188
188
  raise UnknownSourceError, "Source #{name} not found" unless source? name
189
189
 
@@ -140,6 +140,13 @@ module Bundler
140
140
  end
141
141
  end
142
142
 
143
+ # Set internal representation to fetch the gems/specs locally.
144
+ #
145
+ # When this is called, the source should try to fetch the specs and
146
+ # install from the local system.
147
+ def local!
148
+ end
149
+
143
150
  # Set internal representation to fetch the gems/specs from remote.
144
151
  #
145
152
  # When this is called, the source should try to fetch the specs and
@@ -237,6 +244,20 @@ module Bundler
237
244
  specs.unmet_dependency_names
238
245
  end
239
246
 
247
+ # Used by definition.
248
+ #
249
+ # Note: Do not override if you don't know what you are doing.
250
+ def spec_names
251
+ specs.spec_names
252
+ end
253
+
254
+ # Used by definition.
255
+ #
256
+ # Note: Do not override if you don't know what you are doing.
257
+ def add_dependency_names(names)
258
+ @dependencies |= Array(names)
259
+ end
260
+
240
261
  # Note: Do not override if you don't know what you are doing.
241
262
  def can_lock?(spec)
242
263
  spec.source == self
@@ -21,17 +21,11 @@ module Bundler
21
21
  base = SpecSet.new(base) unless base.is_a?(SpecSet)
22
22
  resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
23
23
  result = resolver.start(requirements)
24
- SpecSet.new(result)
24
+ SpecSet.new(result).for(requirements.reject{|dep| dep.name.end_with?("\0") })
25
25
  end
26
26
 
27
27
  def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
28
28
  @source_requirements = source_requirements
29
-
30
- @index_requirements = source_requirements.each_with_object({}) do |source_requirement, index_requirements|
31
- name, source = source_requirement
32
- index_requirements[name] = name == :global ? source : source.specs
33
- end
34
-
35
29
  @base = base
36
30
  @resolver = Molinillo::Resolver.new(self, self)
37
31
  @search_for = {}
@@ -45,10 +39,6 @@ module Bundler
45
39
  @resolving_only_for_ruby = platforms == [Gem::Platform::RUBY]
46
40
  @gem_version_promoter = gem_version_promoter
47
41
  @use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
48
- @no_aggregate_global_source = @source_requirements[:global].nil?
49
-
50
- @variant_specific_names = []
51
- @generic_names = ["Ruby\0", "RubyGems\0"]
52
42
  end
53
43
 
54
44
  def start(requirements)
@@ -58,7 +48,6 @@ module Bundler
58
48
  verify_gemfile_dependencies_are_found!(requirements)
59
49
  dg = @resolver.resolve(requirements, @base_dg)
60
50
  dg.
61
- tap {|resolved| validate_resolved_specs!(resolved) }.
62
51
  map(&:payload).
63
52
  reject {|sg| sg.name.end_with?("\0") }.
64
53
  map(&:to_specs).
@@ -112,24 +101,14 @@ module Bundler
112
101
  include Molinillo::SpecificationProvider
113
102
 
114
103
  def dependencies_for(specification)
115
- all_dependencies = specification.dependencies_for_activated_platforms
116
-
117
- if @variant_specific_names.include?(specification.name)
118
- @variant_specific_names |= all_dependencies.map(&:name) - @generic_names
119
- else
120
- generic_names, variant_specific_names = specification.partitioned_dependency_names_for_activated_platforms
121
- @variant_specific_names |= variant_specific_names - @generic_names
122
- @generic_names |= generic_names
123
- end
124
-
125
- all_dependencies
104
+ specification.dependencies_for_activated_platforms
126
105
  end
127
106
 
128
107
  def search_for(dependency_proxy)
129
108
  platform = dependency_proxy.__platform
130
109
  dependency = dependency_proxy.dep
131
110
  name = dependency.name
132
- search_result = @search_for[dependency_proxy] ||= begin
111
+ @search_for[dependency_proxy] ||= begin
133
112
  results = results_for(dependency, @base[name])
134
113
 
135
114
  if vertex = @base_dg.vertex_named(name)
@@ -181,35 +160,14 @@ module Bundler
181
160
  @gem_version_promoter.sort_versions(dependency, spec_groups)
182
161
  end
183
162
  end
184
-
185
- unless search_result.empty?
186
- specific_dependency = @variant_specific_names.include?(name)
187
- return search_result unless specific_dependency
188
-
189
- search_result.each do |sg|
190
- if @generic_names.include?(name)
191
- @variant_specific_names -= [name]
192
- sg.activate_all_platforms!
193
- else
194
- sg.activate_platform!(platform)
195
- end
196
- end
197
- end
198
-
199
- search_result
200
163
  end
201
164
 
202
165
  def index_for(dependency)
203
- source = @index_requirements[dependency.name]
204
- if source
205
- source
206
- elsif @no_aggregate_global_source
207
- Index.build do |idx|
208
- dependency.all_sources.each {|s| idx.add_source(s.specs) }
209
- end
210
- else
211
- @index_requirements[:global]
212
- end
166
+ source_for(dependency.name).specs
167
+ end
168
+
169
+ def source_for(name)
170
+ @source_requirements[name] || @source_requirements[:default]
213
171
  end
214
172
 
215
173
  def results_for(dependency, base)
@@ -240,23 +198,10 @@ module Bundler
240
198
  dependencies.map(&:dep) == other_dependencies.map(&:dep)
241
199
  end
242
200
 
243
- def relevant_sources_for_vertex(vertex)
244
- if vertex.root?
245
- [@source_requirements[vertex.name]]
246
- elsif @no_aggregate_global_source
247
- vertex.recursive_predecessors.map do |v|
248
- @source_requirements[v.name]
249
- end.compact << @source_requirements[:default]
250
- else
251
- []
252
- end
253
- end
254
-
255
201
  def sort_dependencies(dependencies, activated, conflicts)
256
202
  dependencies.sort_by do |dependency|
257
203
  name = name_for(dependency)
258
204
  vertex = activated.vertex_named(name)
259
- dependency.all_sources = relevant_sources_for_vertex(vertex)
260
205
  [
261
206
  @base_dg.vertex_named(name) ? 0 : 1,
262
207
  vertex.payload ? 0 : 1,
@@ -398,7 +343,7 @@ module Bundler
398
343
  if other_bundler_required
399
344
  o << "\n\n"
400
345
 
401
- candidate_specs = @index_requirements[:default_bundler].search(conflict_dependency)
346
+ candidate_specs = source_for(:default_bundler).specs.search(conflict_dependency)
402
347
  if candidate_specs.any?
403
348
  target_version = candidate_specs.last.version
404
349
  new_command = [File.basename($PROGRAM_NAME), "_#{target_version}_", *ARGV].join(" ")
@@ -415,11 +360,7 @@ module Bundler
415
360
  elsif !conflict.existing
416
361
  o << "\n"
417
362
 
418
- relevant_sources = if conflict.requirement.source
419
- [conflict.requirement.source]
420
- else
421
- conflict.requirement.all_sources
422
- end.compact.map(&:to_s).uniq.sort
363
+ relevant_source = conflict.requirement.source || source_for(name)
423
364
 
424
365
  metadata_requirement = name.end_with?("\0")
425
366
 
@@ -432,12 +373,10 @@ module Bundler
432
373
  end
433
374
  o << " "
434
375
 
435
- o << if relevant_sources.empty?
436
- "in any of the sources.\n"
437
- elsif metadata_requirement
438
- "is not available in #{relevant_sources.join(" or ")}"
376
+ o << if metadata_requirement
377
+ "is not available in #{relevant_source}"
439
378
  else
440
- "in any of the relevant sources:\n #{relevant_sources * "\n "}\n"
379
+ "in #{relevant_source}.\n"
441
380
  end
442
381
  end
443
382
  end,
@@ -451,27 +390,5 @@ module Bundler
451
390
  end
452
391
  )
453
392
  end
454
-
455
- def validate_resolved_specs!(resolved_specs)
456
- resolved_specs.each do |v|
457
- name = v.name
458
- sources = relevant_sources_for_vertex(v)
459
- next unless sources.any?
460
- if default_index = sources.index(@source_requirements[:default])
461
- sources.delete_at(default_index)
462
- end
463
- sources.reject! {|s| s.specs.search(name).empty? }
464
- sources.uniq!
465
- next if sources.size <= 1
466
-
467
- msg = ["The gem '#{name}' was found in multiple relevant sources."]
468
- msg.concat sources.map {|s| " * #{s}" }.sort
469
- msg << "You #{@no_aggregate_global_source ? :must : :should} add this gem to the source block for the source you wish it to be installed from."
470
- msg = msg.join("\n")
471
-
472
- raise SecurityError, msg if @no_aggregate_global_source
473
- Bundler.ui.warn "Warning: #{msg}"
474
- end
475
- end
476
393
  end
477
394
  end