bundler 2.2.0.rc.2 → 2.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -1
- data/lib/bundler.rb +4 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +5 -2
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/exec.rb +3 -3
- data/lib/bundler/cli/outdated.rb +2 -4
- data/lib/bundler/compact_index_client/updater.rb +5 -5
- data/lib/bundler/definition.rb +4 -9
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher/index.rb +2 -3
- data/lib/bundler/friendly_errors.rb +15 -0
- data/lib/bundler/index.rb +5 -1
- data/lib/bundler/injector.rb +9 -2
- data/lib/bundler/installer.rb +7 -5
- data/lib/bundler/lazy_specification.rb +5 -7
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-binstubs.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-cache.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-check.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-clean.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-config.1.ronn +1 -9
- data/{man → lib/bundler/man}/bundle-doctor.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-exec.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-gem.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-info.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-init.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-inject.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-install.1.ronn +1 -1
- data/{man → lib/bundler/man}/bundle-list.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-lock.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-open.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-outdated.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-platform.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-pristine.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-remove.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-show.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-update.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle-viz.1.ronn +0 -0
- data/{man → lib/bundler/man}/bundle.1.ronn +0 -0
- data/{man → lib/bundler/man}/gemfile.5.ronn +0 -0
- data/lib/bundler/plugin/api/source.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/resolver.rb +2 -3
- data/lib/bundler/rubygems_integration.rb +4 -0
- data/lib/bundler/settings.rb +0 -1
- data/lib/bundler/source/git/git_proxy.rb +1 -1
- data/lib/bundler/spec_set.rb +1 -0
- data/lib/bundler/templates/newgem/README.md.tt +0 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -0
- data/lib/bundler/uri_credentials_filter.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +4 -7
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-add.1 +1 -1
- data/man/bundle-binstubs.1 +1 -1
- data/man/bundle-cache.1 +1 -1
- data/man/bundle-check.1 +1 -1
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-config.1 +2 -5
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-exec.1 +1 -1
- data/man/bundle-gem.1 +1 -1
- data/man/bundle-info.1 +1 -1
- data/man/bundle-init.1 +1 -1
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-install.1 +2 -2
- data/man/bundle-list.1 +1 -1
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-open.1 +1 -1
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-show.1 +1 -1
- data/man/bundle-update.1 +1 -1
- data/man/bundle-viz.1 +1 -1
- data/man/bundle.1 +1 -1
- data/man/gemfile.5 +1 -1
- data/man/index.txt +25 -0
- metadata +35 -32
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -250,14 +250,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
250
250
|
be changed in the next major version.
|
251
251
|
* `silence_root_warning` (`BUNDLE_SILENCE_ROOT_WARNING`):
|
252
252
|
Silence the warning Bundler prints when installing gems as root.
|
253
|
-
* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
|
254
|
-
Allow bundler to resolve for the specific running platform and store it in
|
255
|
-
the lockfile, instead of only using a generic platform.
|
256
|
-
A specific platform is the exact platform triple reported by
|
257
|
-
`Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
|
258
|
-
On the other hand, generic platforms are those such as `ruby`, `mswin`, or
|
259
|
-
`java`. In this example, `x86_64-darwin-16` would map to `ruby` and
|
260
|
-
`universal-java-1.8` to `java`.
|
261
253
|
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
262
254
|
Path to a designated CA certificate file or folder containing multiple
|
263
255
|
certificates for trusted CAs in PEM format.
|
@@ -371,7 +363,7 @@ Or you can set the credentials as an environment variable like this:
|
|
371
363
|
|
372
364
|
For gems with a git source with HTTP(S) URL you can specify credentials like so:
|
373
365
|
|
374
|
-
bundle config set --global https://github.com/
|
366
|
+
bundle config set --global https://github.com/rubygems/rubygems.git username:password
|
375
367
|
|
376
368
|
Or you can set the credentials as an environment variable like so:
|
377
369
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -105,7 +105,7 @@ automatically and that requires `bundler` to silently remember them. Since
|
|
105
105
|
|
106
106
|
* `--local`:
|
107
107
|
Do not attempt to connect to `rubygems.org`. Instead, Bundler will use the
|
108
|
-
gems already present in Rubygems' cache or in `vendor/cache`. Note that if
|
108
|
+
gems already present in Rubygems' cache or in `vendor/cache`. Note that if an
|
109
109
|
appropriate platform-specific gem exists on `rubygems.org` it will not be
|
110
110
|
found.
|
111
111
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/bundler/plugin/dsl.rb
CHANGED
@@ -10,7 +10,7 @@ module Bundler
|
|
10
10
|
# So that we don't have to override all there methods to dummy ones
|
11
11
|
# explicitly.
|
12
12
|
# They will be handled by method_missing
|
13
|
-
[:gemspec, :gem, :
|
13
|
+
[:gemspec, :gem, :install_if, :platforms, :env].each {|m| undef_method m }
|
14
14
|
|
15
15
|
# This lists the plugins that was added automatically and not specified by
|
16
16
|
# the user.
|
data/lib/bundler/resolver.rb
CHANGED
@@ -158,9 +158,8 @@ module Bundler
|
|
158
158
|
# spec group.
|
159
159
|
sg_ruby = sg.copy_for(Gem::Platform::RUBY)
|
160
160
|
selected_sgs << sg_ruby if sg_ruby
|
161
|
-
all_platforms = @platforms + [platform]
|
162
|
-
next if all_platforms.to_a == [Gem::Platform::RUBY]
|
163
161
|
sg_all_platforms = nil
|
162
|
+
all_platforms = @platforms + [platform]
|
164
163
|
self.class.sort_platforms(all_platforms).reverse_each do |other_platform|
|
165
164
|
if sg_all_platforms.nil?
|
166
165
|
sg_all_platforms = sg.copy_for(other_platform)
|
@@ -302,7 +301,7 @@ module Bundler
|
|
302
301
|
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
|
303
302
|
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
|
304
303
|
message << if versions_with_platforms.any?
|
305
|
-
"The source contains '#{name}'
|
304
|
+
"The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
|
306
305
|
else
|
307
306
|
"The source does not contain any versions of '#{name}'"
|
308
307
|
end
|
@@ -227,6 +227,10 @@ module Bundler
|
|
227
227
|
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
|
228
228
|
end
|
229
229
|
|
230
|
+
def load_env_plugins
|
231
|
+
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
|
232
|
+
end
|
233
|
+
|
230
234
|
def ui=(obj)
|
231
235
|
Gem::DefaultUserInteraction.ui = obj
|
232
236
|
end
|
data/lib/bundler/settings.rb
CHANGED
@@ -118,7 +118,7 @@ module Bundler
|
|
118
118
|
git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}")
|
119
119
|
File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
|
120
120
|
rescue Errno::EEXIST => e
|
121
|
-
file_path = e.message[%r{.*?(
|
121
|
+
file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1]
|
122
122
|
raise GitError, "Bundler could not install a gem because it needs to " \
|
123
123
|
"create a directory, but a file exists - #{file_path}. Please delete " \
|
124
124
|
"this file and try again."
|
data/lib/bundler/spec_set.rb
CHANGED
@@ -100,6 +100,7 @@ module Bundler
|
|
100
100
|
@specs.map do |s|
|
101
101
|
next s unless s.is_a?(LazySpecification)
|
102
102
|
s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
|
103
|
+
s.source.remote!
|
103
104
|
spec = s.__materialize__
|
104
105
|
raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
|
105
106
|
spec
|
@@ -33,7 +33,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
33
33
|
## Contributing
|
34
34
|
|
35
35
|
Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).<% end %>
|
36
|
-
|
37
36
|
<% if config[:mit] -%>
|
38
37
|
|
39
38
|
## License
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "<%= File.basename(config[:namespaced_path]) %>/version"
|
4
4
|
<%- if config[:ext] -%>
|
5
|
-
|
5
|
+
require_relative "<%= File.basename(config[:namespaced_path]) %>/<%= config[:underscored_name] %>"
|
6
6
|
<%- end -%>
|
7
7
|
|
8
8
|
<%- config[:constant_array].each_with_index do |c, i| -%>
|
@@ -33,4 +33,10 @@ Gem::Specification.new do |spec|
|
|
33
33
|
<%- if config[:ext] -%>
|
34
34
|
spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
|
35
35
|
<%- end -%>
|
36
|
+
|
37
|
+
# Uncomment to register a new dependency of your gem
|
38
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
39
|
+
|
40
|
+
# For more information and examples about making a new gem, checkout our
|
41
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
36
42
|
end
|
@@ -124,6 +124,7 @@ module Bundler::Molinillo
|
|
124
124
|
dot.join("\n")
|
125
125
|
end
|
126
126
|
|
127
|
+
# @param [DependencyGraph] other
|
127
128
|
# @return [Boolean] whether the two dependency graphs are equal, determined
|
128
129
|
# by a recursive traversal of each {#root_vertices} and its
|
129
130
|
# {Vertex#successors}
|
@@ -190,7 +191,7 @@ module Bundler::Molinillo
|
|
190
191
|
# @return [Edge] the added edge
|
191
192
|
def add_edge(origin, destination, requirement)
|
192
193
|
if destination.path_to?(origin)
|
193
|
-
raise CircularDependencyError.new(
|
194
|
+
raise CircularDependencyError.new(path(destination, origin))
|
194
195
|
end
|
195
196
|
add_edge_no_circular(origin, destination, requirement)
|
196
197
|
end
|
@@ -219,5 +220,37 @@ module Bundler::Molinillo
|
|
219
220
|
def add_edge_no_circular(origin, destination, requirement)
|
220
221
|
log.add_edge_no_circular(self, origin.name, destination.name, requirement)
|
221
222
|
end
|
223
|
+
|
224
|
+
# Returns the path between two vertices
|
225
|
+
# @raise [ArgumentError] if there is no path between the vertices
|
226
|
+
# @param [Vertex] from
|
227
|
+
# @param [Vertex] to
|
228
|
+
# @return [Array<Vertex>] the shortest path from `from` to `to`
|
229
|
+
def path(from, to)
|
230
|
+
distances = Hash.new(vertices.size + 1)
|
231
|
+
distances[from.name] = 0
|
232
|
+
predecessors = {}
|
233
|
+
each do |vertex|
|
234
|
+
vertex.successors.each do |successor|
|
235
|
+
if distances[successor.name] > distances[vertex.name] + 1
|
236
|
+
distances[successor.name] = distances[vertex.name] + 1
|
237
|
+
predecessors[successor] = vertex
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
path = [to]
|
243
|
+
while before = predecessors[to]
|
244
|
+
path << before
|
245
|
+
to = before
|
246
|
+
break if to == from
|
247
|
+
end
|
248
|
+
|
249
|
+
unless path.last.equal?(from)
|
250
|
+
raise ArgumentError, "There is no path from #{from.name} to #{to.name}"
|
251
|
+
end
|
252
|
+
|
253
|
+
path.reverse
|
254
|
+
end
|
222
255
|
end
|
223
256
|
end
|
@@ -65,7 +65,7 @@ module Bundler::Molinillo
|
|
65
65
|
# @param [SpecificationProvider] specification_provider see {#specification_provider}
|
66
66
|
def initialize(conflicts, specification_provider)
|
67
67
|
pairs = []
|
68
|
-
|
68
|
+
conflicts.values.flat_map(&:requirements).each do |conflicting|
|
69
69
|
conflicting.each do |source, conflict_requirements|
|
70
70
|
conflict_requirements.each do |c|
|
71
71
|
pairs << [c, source]
|
@@ -207,7 +207,7 @@ module Bundler::Molinillo
|
|
207
207
|
def start_resolution
|
208
208
|
@started_at = Time.now
|
209
209
|
|
210
|
-
|
210
|
+
push_initial_state
|
211
211
|
|
212
212
|
debug { "Starting resolution (#{@started_at})\nUser-requested dependencies: #{original_requested}" }
|
213
213
|
resolver_ui.before_resolution
|
@@ -273,10 +273,10 @@ module Bundler::Molinillo
|
|
273
273
|
states.last
|
274
274
|
end
|
275
275
|
|
276
|
-
# Creates the initial state for the resolution, based upon the
|
276
|
+
# Creates and pushes the initial state for the resolution, based upon the
|
277
277
|
# {#requested} dependencies
|
278
|
-
# @return [
|
279
|
-
def
|
278
|
+
# @return [void]
|
279
|
+
def push_initial_state
|
280
280
|
graph = DependencyGraph.new.tap do |dg|
|
281
281
|
original_requested.each do |requested|
|
282
282
|
vertex = dg.add_vertex(name_for(requested), nil, true)
|
@@ -285,18 +285,7 @@ module Bundler::Molinillo
|
|
285
285
|
dg.tag(:initial_state)
|
286
286
|
end
|
287
287
|
|
288
|
-
|
289
|
-
initial_requirement = requirements.shift
|
290
|
-
DependencyState.new(
|
291
|
-
initial_requirement && name_for(initial_requirement),
|
292
|
-
requirements,
|
293
|
-
graph,
|
294
|
-
initial_requirement,
|
295
|
-
possibilities_for_requirement(initial_requirement, graph),
|
296
|
-
0,
|
297
|
-
{},
|
298
|
-
[]
|
299
|
-
)
|
288
|
+
push_state_for_requirements(original_requested, true, graph)
|
300
289
|
end
|
301
290
|
|
302
291
|
# Unwinds the states stack because a conflict has been encountered
|
@@ -361,7 +350,7 @@ module Bundler::Molinillo
|
|
361
350
|
current_detail
|
362
351
|
end
|
363
352
|
|
364
|
-
# @param [Array<Object>] array of requirements that combine to create a conflict
|
353
|
+
# @param [Array<Object>] binding_requirements array of requirements that combine to create a conflict
|
365
354
|
# @return [Array<UnwindDetails>] array of UnwindDetails that have a chance
|
366
355
|
# of resolving the passed requirements
|
367
356
|
def unwind_options_for_requirements(binding_requirements)
|
@@ -429,7 +418,7 @@ module Bundler::Molinillo
|
|
429
418
|
end
|
430
419
|
|
431
420
|
# @param [DependencyState] state
|
432
|
-
# @param [Array] array of requirements
|
421
|
+
# @param [Array] binding_requirements array of requirements
|
433
422
|
# @return [Boolean] whether or not the given state has any possibilities
|
434
423
|
# that could satisfy the given requirements
|
435
424
|
def conflict_fixing_possibilities?(state, binding_requirements)
|
@@ -444,7 +433,8 @@ module Bundler::Molinillo
|
|
444
433
|
|
445
434
|
# Filter's a state's possibilities to remove any that would not fix the
|
446
435
|
# conflict we've just rewound from
|
447
|
-
# @param [UnwindDetails] details of the conflict just
|
436
|
+
# @param [UnwindDetails] unwind_details details of the conflict just
|
437
|
+
# unwound from
|
448
438
|
# @return [void]
|
449
439
|
def filter_possibilities_after_unwind(unwind_details)
|
450
440
|
return unless state && !state.possibilities.empty?
|
@@ -458,7 +448,7 @@ module Bundler::Molinillo
|
|
458
448
|
|
459
449
|
# Filter's a state's possibilities to remove any that would not satisfy
|
460
450
|
# the requirements in the conflict we've just rewound from
|
461
|
-
# @param [UnwindDetails] details of the conflict just unwound from
|
451
|
+
# @param [UnwindDetails] unwind_details details of the conflict just unwound from
|
462
452
|
# @return [void]
|
463
453
|
def filter_possibilities_for_primary_unwind(unwind_details)
|
464
454
|
unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
|
@@ -491,7 +481,7 @@ module Bundler::Molinillo
|
|
491
481
|
|
492
482
|
# Filter's a state's possibilities to remove any that would (eventually)
|
493
483
|
# create a requirement in the conflict we've just rewound from
|
494
|
-
# @param [UnwindDetails] details of the conflict just unwound from
|
484
|
+
# @param [UnwindDetails] unwind_details details of the conflict just unwound from
|
495
485
|
# @return [void]
|
496
486
|
def filter_possibilities_for_parent_unwind(unwind_details)
|
497
487
|
unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
|
@@ -500,7 +490,7 @@ module Bundler::Molinillo
|
|
500
490
|
primary_unwinds = unwinds_to_state.select(&:unwinding_to_primary_requirement?).uniq
|
501
491
|
parent_unwinds = unwinds_to_state.uniq - primary_unwinds
|
502
492
|
|
503
|
-
allowed_possibility_sets =
|
493
|
+
allowed_possibility_sets = primary_unwinds.flat_map do |unwind|
|
504
494
|
states[unwind.state_index].possibilities.select do |possibility_set|
|
505
495
|
possibility_set.possibilities.any? do |poss|
|
506
496
|
possibility_satisfies_requirements?(poss, unwind.conflicting_requirements)
|
@@ -508,7 +498,7 @@ module Bundler::Molinillo
|
|
508
498
|
end
|
509
499
|
end
|
510
500
|
|
511
|
-
requirements_to_avoid =
|
501
|
+
requirements_to_avoid = parent_unwinds.flat_map(&:sub_dependencies_to_avoid)
|
512
502
|
|
513
503
|
state.possibilities.reject! do |possibility_set|
|
514
504
|
!allowed_possibility_sets.include?(possibility_set) &&
|
@@ -524,12 +514,12 @@ module Bundler::Molinillo
|
|
524
514
|
|
525
515
|
possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
|
526
516
|
|
527
|
-
# When there
|
528
|
-
# (the one causing the circular) won
|
529
|
-
# (which won
|
530
|
-
# because it
|
531
|
-
# We need to make sure we have that requirement in the conflict
|
532
|
-
# otherwise we won
|
517
|
+
# When there's a `CircularDependency` error the conflicting requirement
|
518
|
+
# (the one causing the circular) won't be `conflict.requirement`
|
519
|
+
# (which won't be for the right state, because we won't have created it,
|
520
|
+
# because it's circular).
|
521
|
+
# We need to make sure we have that requirement in the conflict's list,
|
522
|
+
# otherwise we won't be able to unwind properly, so we just return all
|
533
523
|
# the requirements for the conflict.
|
534
524
|
return possible_binding_requirements if conflict.underlying_error
|
535
525
|
|
@@ -558,8 +548,8 @@ module Bundler::Molinillo
|
|
558
548
|
end
|
559
549
|
|
560
550
|
# @param [Object] requirement we wish to check
|
561
|
-
# @param [Array] array of requirements
|
562
|
-
# @param [Array] array of possibilities the requirements will be used to filter
|
551
|
+
# @param [Array] possible_binding_requirements array of requirements
|
552
|
+
# @param [Array] possibilities array of possibilities the requirements will be used to filter
|
563
553
|
# @return [Boolean] whether or not the given requirement is required to filter
|
564
554
|
# out all elements of the array of possibilities.
|
565
555
|
def binding_requirement_in_set?(requirement, possible_binding_requirements, possibilities)
|
@@ -568,6 +558,7 @@ module Bundler::Molinillo
|
|
568
558
|
end
|
569
559
|
end
|
570
560
|
|
561
|
+
# @param [Object] requirement
|
571
562
|
# @return [Object] the requirement that led to `requirement` being added
|
572
563
|
# to the list of requirements.
|
573
564
|
def parent_of(requirement)
|
@@ -577,6 +568,7 @@ module Bundler::Molinillo
|
|
577
568
|
parent_state.requirement
|
578
569
|
end
|
579
570
|
|
571
|
+
# @param [String] name
|
580
572
|
# @return [Object] the requirement that led to a version of a possibility
|
581
573
|
# with the given name being activated.
|
582
574
|
def requirement_for_existing_name(name)
|
@@ -585,6 +577,7 @@ module Bundler::Molinillo
|
|
585
577
|
states.find { |s| s.name == name }.requirement
|
586
578
|
end
|
587
579
|
|
580
|
+
# @param [Object] requirement
|
588
581
|
# @return [ResolutionState] the state whose `requirement` is the given
|
589
582
|
# `requirement`.
|
590
583
|
def find_state_for(requirement)
|
@@ -592,6 +585,7 @@ module Bundler::Molinillo
|
|
592
585
|
states.find { |i| requirement == i.requirement }
|
593
586
|
end
|
594
587
|
|
588
|
+
# @param [Object] underlying_error
|
595
589
|
# @return [Conflict] a {Conflict} that reflects the failure to activate
|
596
590
|
# the {#possibility} in conjunction with the current {#state}
|
597
591
|
def create_conflict(underlying_error = nil)
|
@@ -628,6 +622,7 @@ module Bundler::Molinillo
|
|
628
622
|
vertex.requirements.map { |r| requirement_tree_for(r) }
|
629
623
|
end
|
630
624
|
|
625
|
+
# @param [Object] requirement
|
631
626
|
# @return [Array<Object>] the list of requirements that led to
|
632
627
|
# `requirement` being required.
|
633
628
|
def requirement_tree_for(requirement)
|
@@ -673,9 +668,8 @@ module Bundler::Molinillo
|
|
673
668
|
attempt_to_filter_existing_spec(existing_vertex)
|
674
669
|
else
|
675
670
|
latest = possibility.latest_version
|
676
|
-
|
677
|
-
|
678
|
-
!requirement_satisfied_by?(requirement, activated, possibility)
|
671
|
+
possibility.possibilities.select! do |possibility|
|
672
|
+
requirement_satisfied_by?(requirement, activated, possibility)
|
679
673
|
end
|
680
674
|
if possibility.latest_version.nil?
|
681
675
|
# ensure there's a possibility for better error messages
|
@@ -705,7 +699,7 @@ module Bundler::Molinillo
|
|
705
699
|
|
706
700
|
# Generates a filtered version of the existing vertex's `PossibilitySet` using the
|
707
701
|
# current state's `requirement`
|
708
|
-
# @param [Object] existing vertex
|
702
|
+
# @param [Object] vertex existing vertex
|
709
703
|
# @return [PossibilitySet] filtered possibility set
|
710
704
|
def filtered_possibility_set(vertex)
|
711
705
|
PossibilitySet.new(vertex.payload.dependencies, vertex.payload.possibilities & possibility.possibilities)
|
@@ -730,7 +724,7 @@ module Bundler::Molinillo
|
|
730
724
|
end
|
731
725
|
|
732
726
|
# Requires the dependencies that the recently activated spec has
|
733
|
-
# @param [Object]
|
727
|
+
# @param [Object] possibility_set the PossibilitySet that has just been
|
734
728
|
# activated
|
735
729
|
# @return [void]
|
736
730
|
def require_nested_dependencies_for(possibility_set)
|
@@ -749,6 +743,8 @@ module Bundler::Molinillo
|
|
749
743
|
# Pushes a new {DependencyState} that encapsulates both existing and new
|
750
744
|
# requirements
|
751
745
|
# @param [Array] new_requirements
|
746
|
+
# @param [Boolean] requires_sort
|
747
|
+
# @param [Object] new_activated
|
752
748
|
# @return [void]
|
753
749
|
def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated)
|
754
750
|
new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort
|
@@ -767,7 +763,8 @@ module Bundler::Molinillo
|
|
767
763
|
|
768
764
|
# Checks a proposed requirement with any existing locked requirement
|
769
765
|
# before generating an array of possibilities for it.
|
770
|
-
# @param [Object] the proposed requirement
|
766
|
+
# @param [Object] requirement the proposed requirement
|
767
|
+
# @param [Object] activated
|
771
768
|
# @return [Array] possibilities
|
772
769
|
def possibilities_for_requirement(requirement, activated = self.activated)
|
773
770
|
return [] unless requirement
|
@@ -778,7 +775,8 @@ module Bundler::Molinillo
|
|
778
775
|
group_possibilities(search_for(requirement))
|
779
776
|
end
|
780
777
|
|
781
|
-
# @param [Object] the proposed requirement
|
778
|
+
# @param [Object] requirement the proposed requirement
|
779
|
+
# @param [Object] activated
|
782
780
|
# @return [Array] possibility set containing only the locked requirement, if any
|
783
781
|
def locked_requirement_possibility_set(requirement, activated = self.activated)
|
784
782
|
all_possibilities = search_for(requirement)
|
@@ -797,8 +795,8 @@ module Bundler::Molinillo
|
|
797
795
|
# Build an array of PossibilitySets, with each element representing a group of
|
798
796
|
# dependency versions that all have the same sub-dependency version constraints
|
799
797
|
# and are contiguous.
|
800
|
-
# @param [Array] an array of possibilities
|
801
|
-
# @return [Array] an array of possibility sets
|
798
|
+
# @param [Array] possibilities an array of possibilities
|
799
|
+
# @return [Array<PossibilitySet>] an array of possibility sets
|
802
800
|
def group_possibilities(possibilities)
|
803
801
|
possibility_sets = []
|
804
802
|
current_possibility_set = nil
|