bundler 2.1.4 → 2.2.17
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 +1774 -1430
- data/README.md +6 -8
- data/bundler.gemspec +4 -4
- data/exe/bundle +3 -0
- data/lib/bundler.rb +33 -9
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli.rb +59 -23
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +2 -7
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +29 -2
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +1 -1
- data/lib/bundler/cli/exec.rb +4 -4
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +129 -28
- data/lib/bundler/cli/info.rb +15 -4
- data/lib/bundler/cli/init.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +13 -11
- data/lib/bundler/cli/issue.rb +2 -2
- data/lib/bundler/cli/list.rb +12 -10
- data/lib/bundler/cli/outdated.rb +88 -67
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +3 -1
- data/lib/bundler/compact_index_client.rb +1 -1
- data/lib/bundler/compact_index_client/cache.rb +6 -14
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +13 -17
- data/lib/bundler/current_ruby.rb +1 -0
- data/lib/bundler/definition.rb +121 -131
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +3 -10
- data/lib/bundler/dsl.rb +40 -33
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/environment_preserver.rb +26 -2
- data/lib/bundler/errors.rb +1 -0
- data/lib/bundler/feature_flag.rb +0 -5
- data/lib/bundler/fetcher.rb +5 -4
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +9 -5
- data/lib/bundler/fetcher/index.rb +3 -4
- data/lib/bundler/friendly_errors.rb +22 -13
- data/lib/bundler/gem_helper.rb +51 -18
- data/lib/bundler/gem_helpers.rb +36 -25
- data/lib/bundler/gem_version_promoter.rb +4 -4
- data/lib/bundler/graph.rb +1 -1
- data/lib/bundler/index.rb +12 -7
- data/lib/bundler/injector.rb +23 -5
- data/lib/bundler/inline.rb +3 -2
- data/lib/bundler/installer.rb +37 -49
- data/lib/bundler/installer/gem_installer.rb +3 -3
- data/lib/bundler/installer/parallel_installer.rb +46 -25
- data/lib/bundler/installer/standalone.rb +17 -2
- data/lib/bundler/lazy_specification.rb +45 -25
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +4 -14
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-config.1 +42 -34
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +51 -43
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-gem.1 +25 -3
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +30 -7
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-install.1 +30 -3
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
- data/{man → lib/bundler/man}/gemfile.5 +4 -4
- data/{man → lib/bundler/man}/gemfile.5.ronn +4 -4
- data/{man → lib/bundler/man}/index.txt +0 -0
- data/lib/bundler/mirror.rb +2 -2
- data/lib/bundler/plugin.rb +33 -7
- data/lib/bundler/plugin/api/source.rb +8 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +10 -1
- data/lib/bundler/plugin/installer.rb +9 -11
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/psyched_yaml.rb +0 -15
- data/lib/bundler/remote_specification.rb +5 -2
- data/lib/bundler/resolver.rb +133 -77
- data/lib/bundler/resolver/spec_group.rb +75 -48
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +69 -9
- data/lib/bundler/rubygems_gem_installer.rb +50 -9
- data/lib/bundler/rubygems_integration.rb +25 -60
- data/lib/bundler/runtime.rb +4 -14
- data/lib/bundler/settings.rb +107 -54
- data/lib/bundler/shared_helpers.rb +3 -3
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source.rb +7 -1
- data/lib/bundler/source/git.rb +24 -22
- data/lib/bundler/source/git/git_proxy.rb +82 -80
- data/lib/bundler/source/metadata.rb +0 -4
- data/lib/bundler/source/path.rb +10 -4
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/rubygems.rb +45 -24
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source_list.rb +31 -26
- data/lib/bundler/spec_set.rb +29 -17
- data/lib/bundler/stub_specification.rb +25 -7
- data/lib/bundler/templates/Gemfile +1 -1
- data/lib/bundler/templates/gems.rb +1 -1
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Gemfile.tt +9 -1
- data/lib/bundler/templates/newgem/README.md.tt +6 -5
- data/lib/bundler/templates/newgem/Rakefile.tt +19 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +16 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +15 -7
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/shell.rb +5 -5
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +49 -47
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendored_persistent.rb +0 -7
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +1 -1
- metadata +71 -85
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
@@ -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" "
|
4
|
+
.TH "BUNDLE\-OUTDATED" "1" "April 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
File without changes
|
@@ -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" "
|
4
|
+
.TH "BUNDLE\-PLATFORM" "1" "April 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-platform\fR \- Displays platform compatibility information
|
File without changes
|
@@ -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" "
|
4
|
+
.TH "BUNDLE\-PRISTINE" "1" "April 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
File without changes
|
File without changes
|
@@ -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" "
|
4
|
+
.TH "BUNDLE\-SHOW" "1" "April 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
|
File without changes
|
@@ -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" "
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "April 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
File without changes
|
File without changes
|
File without changes
|
@@ -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" "
|
4
|
+
.TH "GEMFILE" "5" "April 2021" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
@@ -150,7 +150,7 @@ gem "RedCloth", ">= 4\.1\.0", "< 4\.2\.0"
|
|
150
150
|
.IP "" 0
|
151
151
|
.
|
152
152
|
.SS "REQUIRE AS"
|
153
|
-
Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if file you want \fBrequired\fR has same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
|
153
|
+
Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if the file you want \fBrequired\fR has the same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
|
154
154
|
.
|
155
155
|
.IP "" 4
|
156
156
|
.
|
@@ -227,8 +227,8 @@ To specify multiple groups to ignore, specify a list of groups separated by spac
|
|
227
227
|
.
|
228
228
|
.nf
|
229
229
|
|
230
|
-
bundle config set without test
|
231
|
-
bundle config set without development test
|
230
|
+
bundle config set \-\-local without test
|
231
|
+
bundle config set \-\-local without development test
|
232
232
|
.
|
233
233
|
.fi
|
234
234
|
.
|
@@ -120,8 +120,8 @@ Each _gem_ `MAY` have one or more version specifiers.
|
|
120
120
|
### REQUIRE AS
|
121
121
|
|
122
122
|
Each _gem_ `MAY` specify files that should be used when autorequiring via
|
123
|
-
`Bundler.require`. You may pass an array with multiple files or `true` if file
|
124
|
-
you want `required` has same name as _gem_ or `false` to
|
123
|
+
`Bundler.require`. You may pass an array with multiple files or `true` if the file
|
124
|
+
you want `required` has the same name as _gem_ or `false` to
|
125
125
|
prevent any file from being autorequired.
|
126
126
|
|
127
127
|
gem "redis", :require => ["redis/connection/hiredis", "redis"]
|
@@ -163,8 +163,8 @@ not install with the `without` configuration.
|
|
163
163
|
|
164
164
|
To specify multiple groups to ignore, specify a list of groups separated by spaces.
|
165
165
|
|
166
|
-
bundle config set without test
|
167
|
-
bundle config set without development test
|
166
|
+
bundle config set --local without test
|
167
|
+
bundle config set --local without development test
|
168
168
|
|
169
169
|
Also, calling `Bundler.setup` with no parameters, or calling `require "bundler/setup"`
|
170
170
|
will setup all groups except for the ones you excluded via `--without` (since they
|
File without changes
|
data/lib/bundler/mirror.rb
CHANGED
@@ -43,7 +43,7 @@ module Bundler
|
|
43
43
|
config.update_mirror(mirror)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
private
|
47
47
|
|
48
48
|
def fetch_valid_mirror_for(uri)
|
49
49
|
downcased = uri.to_s.downcase
|
@@ -158,7 +158,7 @@ module Bundler
|
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
|
-
|
161
|
+
private
|
162
162
|
|
163
163
|
def wait_for_writtable_socket(socket, address, timeout)
|
164
164
|
if IO.select(nil, [socket], nil, timeout)
|
data/lib/bundler/plugin.rb
CHANGED
@@ -16,7 +16,7 @@ module Bundler
|
|
16
16
|
|
17
17
|
PLUGIN_FILE_NAME = "plugins.rb".freeze
|
18
18
|
|
19
|
-
|
19
|
+
module_function
|
20
20
|
|
21
21
|
def reset!
|
22
22
|
instance_variables.each {|i| remove_instance_variable(i) }
|
@@ -39,12 +39,37 @@ module Bundler
|
|
39
39
|
|
40
40
|
save_plugins names, specs
|
41
41
|
rescue PluginError => e
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
|
43
|
+
specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
|
44
|
+
|
45
|
+
names_list = names.map {|name| "`#{name}`" }.join(", ")
|
46
|
+
Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}"
|
47
|
+
end
|
48
|
+
|
49
|
+
# Uninstalls plugins by the given names
|
50
|
+
#
|
51
|
+
# @param [Array<String>] names the names of plugins to be uninstalled
|
52
|
+
def uninstall(names, options)
|
53
|
+
if names.empty? && !options[:all]
|
54
|
+
Bundler.ui.error "No plugins to uninstall. Specify at least 1 plugin to uninstall.\n"\
|
55
|
+
"Use --all option to uninstall all the installed plugins."
|
56
|
+
return
|
45
57
|
end
|
46
58
|
|
47
|
-
|
59
|
+
names = index.installed_plugins if options[:all]
|
60
|
+
if names.any?
|
61
|
+
names.each do |name|
|
62
|
+
if index.installed?(name)
|
63
|
+
Bundler.rm_rf(index.plugin_path(name))
|
64
|
+
index.unregister_plugin(name)
|
65
|
+
Bundler.ui.info "Uninstalled plugin #{name}"
|
66
|
+
else
|
67
|
+
Bundler.ui.error "Plugin #{name} is not installed \n"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
else
|
71
|
+
Bundler.ui.info "No plugins installed"
|
72
|
+
end
|
48
73
|
end
|
49
74
|
|
50
75
|
# List installed plugins and commands
|
@@ -80,6 +105,7 @@ module Bundler
|
|
80
105
|
else
|
81
106
|
builder.eval_gemfile(gemfile)
|
82
107
|
end
|
108
|
+
builder.check_primary_source_safety
|
83
109
|
definition = builder.to_definition(nil, true)
|
84
110
|
|
85
111
|
return if definition.dependencies.empty?
|
@@ -138,7 +164,7 @@ module Bundler
|
|
138
164
|
end
|
139
165
|
|
140
166
|
# To be called from Cli class to pass the command and argument to
|
141
|
-
#
|
167
|
+
# appropriate plugin class
|
142
168
|
def exec_command(command, args)
|
143
169
|
raise UndefinedCommandError, "Command `#{command}` not found" unless command? command
|
144
170
|
|
@@ -157,7 +183,7 @@ module Bundler
|
|
157
183
|
!index.source_plugin(name.to_s).nil?
|
158
184
|
end
|
159
185
|
|
160
|
-
# @return [Class] that handles the source. The
|
186
|
+
# @return [Class] that handles the source. The class includes API::Source
|
161
187
|
def source(name)
|
162
188
|
raise UnknownSourceError, "Source #{name} not found" unless source? name
|
163
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
|
@@ -260,7 +267,7 @@ module Bundler
|
|
260
267
|
end
|
261
268
|
|
262
269
|
def to_s
|
263
|
-
"plugin source for #{
|
270
|
+
"plugin source for #{@type} with uri #{@uri}"
|
264
271
|
end
|
265
272
|
|
266
273
|
# Note: Do not override if you don't know what you are doing.
|
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/plugin/index.rb
CHANGED
@@ -71,6 +71,15 @@ module Bundler
|
|
71
71
|
raise
|
72
72
|
end
|
73
73
|
|
74
|
+
def unregister_plugin(name)
|
75
|
+
@commands.delete_if {|_, v| v == name }
|
76
|
+
@sources.delete_if {|_, v| v == name }
|
77
|
+
@hooks.each {|_, plugin_names| plugin_names.delete(name) }
|
78
|
+
@plugin_paths.delete(name)
|
79
|
+
@load_paths.delete(name)
|
80
|
+
save_index
|
81
|
+
end
|
82
|
+
|
74
83
|
# Path of default index file
|
75
84
|
def index_file
|
76
85
|
Plugin.root.join("index")
|
@@ -124,7 +133,7 @@ module Bundler
|
|
124
133
|
@hooks[event] || []
|
125
134
|
end
|
126
135
|
|
127
|
-
|
136
|
+
private
|
128
137
|
|
129
138
|
# Reads the index file from the directory and initializes the instance
|
130
139
|
# variables.
|
@@ -16,15 +16,13 @@ module Bundler
|
|
16
16
|
|
17
17
|
version = options[:version] || [">= 0"]
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
install_rubygems(names, version, sources)
|
27
|
-
end
|
19
|
+
if options[:git]
|
20
|
+
install_git(names, version, options)
|
21
|
+
elsif options[:local_git]
|
22
|
+
install_local_git(names, version, options)
|
23
|
+
else
|
24
|
+
sources = options[:source] || Bundler.rubygems.sources
|
25
|
+
install_rubygems(names, version, sources)
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
@@ -41,7 +39,7 @@ module Bundler
|
|
41
39
|
install_from_specs specs
|
42
40
|
end
|
43
41
|
|
44
|
-
|
42
|
+
private
|
45
43
|
|
46
44
|
def check_sources_consistency!(options)
|
47
45
|
if options.key?(:git) && options.key?(:local_git)
|
@@ -79,7 +77,7 @@ module Bundler
|
|
79
77
|
source_list = SourceList.new
|
80
78
|
|
81
79
|
source_list.add_git_source(git_source_options) if git_source_options
|
82
|
-
source_list.
|
80
|
+
source_list.global_rubygems_source = rubygems_source if rubygems_source
|
83
81
|
|
84
82
|
deps = names.map {|name| Dependency.new name, version }
|
85
83
|
|
@@ -17,7 +17,11 @@ module Bundler
|
|
17
17
|
path_sources + git_sources + rubygems_sources + [metadata_source]
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
def default_source
|
21
|
+
git_sources.first || global_rubygems_source
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
21
25
|
|
22
26
|
def rubygems_aggregate_class
|
23
27
|
Plugin::Installer::Rubygems
|
data/lib/bundler/psyched_yaml.rb
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Psych could be a gem, so try to ask for it
|
4
|
-
begin
|
5
|
-
gem "psych"
|
6
|
-
rescue LoadError
|
7
|
-
end if defined?(gem)
|
8
|
-
|
9
3
|
# Psych could be in the stdlib
|
10
4
|
# but it's too late if Syck is already loaded
|
11
5
|
begin
|
@@ -26,12 +20,3 @@ module Bundler
|
|
26
20
|
YamlLibrarySyntaxError = ::ArgumentError
|
27
21
|
end
|
28
22
|
end
|
29
|
-
|
30
|
-
require_relative "deprecate"
|
31
|
-
begin
|
32
|
-
Bundler::Deprecate.skip_during do
|
33
|
-
require "rubygems/safe_yaml"
|
34
|
-
end
|
35
|
-
rescue LoadError
|
36
|
-
# it's OK if the file isn't there
|
37
|
-
end
|
@@ -50,6 +50,8 @@ module Bundler
|
|
50
50
|
# once the remote gem is downloaded, the backend specification will
|
51
51
|
# be swapped out.
|
52
52
|
def __swap__(spec)
|
53
|
+
raise APIResponseInvalidDependenciesError unless spec.dependencies.all? {|d| d.is_a?(Gem::Dependency) }
|
54
|
+
|
53
55
|
SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
|
54
56
|
@_remote_specification = spec
|
55
57
|
end
|
@@ -76,7 +78,8 @@ module Bundler
|
|
76
78
|
deps = method_missing(:dependencies)
|
77
79
|
|
78
80
|
# allow us to handle when the specs dependencies are an array of array of string
|
79
|
-
#
|
81
|
+
# in order to delay the crash to `#__swap__` where it results in a friendlier error
|
82
|
+
# see https://github.com/rubygems/bundler/issues/5797
|
80
83
|
deps = deps.map {|d| d.is_a?(Gem::Dependency) ? d : Gem::Dependency.new(*d) }
|
81
84
|
|
82
85
|
deps
|
@@ -88,7 +91,7 @@ module Bundler
|
|
88
91
|
" #{source.revision[0..6]}"
|
89
92
|
end
|
90
93
|
|
91
|
-
|
94
|
+
private
|
92
95
|
|
93
96
|
def to_ary
|
94
97
|
nil
|
data/lib/bundler/resolver.rb
CHANGED
@@ -5,6 +5,8 @@ module Bundler
|
|
5
5
|
require_relative "vendored_molinillo"
|
6
6
|
require_relative "resolver/spec_group"
|
7
7
|
|
8
|
+
include GemHelpers
|
9
|
+
|
8
10
|
# Figures out the best possible configuration of gems that satisfies
|
9
11
|
# the list of passed dependencies and any child dependencies without
|
10
12
|
# causing any gem activation errors.
|
@@ -15,31 +17,38 @@ module Bundler
|
|
15
17
|
# ==== Returns
|
16
18
|
# <GemBundle>,nil:: If the list of dependencies can be resolved, a
|
17
19
|
# collection of gemspecs is returned. Otherwise, nil is returned.
|
18
|
-
def self.resolve(requirements,
|
19
|
-
platforms = Set.new(platforms) if platforms
|
20
|
+
def self.resolve(requirements, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
|
20
21
|
base = SpecSet.new(base) unless base.is_a?(SpecSet)
|
21
|
-
resolver = new(
|
22
|
+
resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
|
22
23
|
result = resolver.start(requirements)
|
23
24
|
SpecSet.new(result)
|
24
25
|
end
|
25
26
|
|
26
|
-
def initialize(
|
27
|
-
@index = index
|
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
|
+
|
29
35
|
@base = base
|
30
36
|
@resolver = Molinillo::Resolver.new(self, self)
|
31
37
|
@search_for = {}
|
32
38
|
@base_dg = Molinillo::DependencyGraph.new
|
33
39
|
@base.each do |ls|
|
34
40
|
dep = Dependency.new(ls.name, ls.version)
|
35
|
-
@base_dg.add_vertex(ls.name, DepProxy.
|
41
|
+
@base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
|
36
42
|
end
|
37
43
|
additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
|
38
|
-
@platforms = platforms
|
44
|
+
@platforms = platforms.reject {|p| p != Gem::Platform::RUBY && (platforms - [p]).any? {|pl| generic(pl) == p } }
|
45
|
+
@resolving_only_for_ruby = platforms == [Gem::Platform::RUBY]
|
39
46
|
@gem_version_promoter = gem_version_promoter
|
40
|
-
@allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
|
41
47
|
@use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
|
42
|
-
@
|
48
|
+
@no_aggregate_global_source = @source_requirements[:global].nil?
|
49
|
+
|
50
|
+
@variant_specific_names = []
|
51
|
+
@generic_names = ["Ruby\0", "RubyGems\0"]
|
43
52
|
end
|
44
53
|
|
45
54
|
def start(requirements)
|
@@ -75,12 +84,17 @@ module Bundler
|
|
75
84
|
return unless debug?
|
76
85
|
debug_info = yield
|
77
86
|
debug_info = debug_info.inspect unless debug_info.is_a?(String)
|
78
|
-
|
87
|
+
puts debug_info.split("\n").map {|s| depth == 0 ? "BUNDLER: #{s}" : "BUNDLER(#{depth}): #{s}" }
|
79
88
|
end
|
80
89
|
|
81
90
|
def debug?
|
82
91
|
return @debug_mode if defined?(@debug_mode)
|
83
|
-
@debug_mode =
|
92
|
+
@debug_mode =
|
93
|
+
ENV["BUNDLER_DEBUG_RESOLVER"] ||
|
94
|
+
ENV["BUNDLER_DEBUG_RESOLVER_TREE"] ||
|
95
|
+
ENV["DEBUG_RESOLVER"] ||
|
96
|
+
ENV["DEBUG_RESOLVER_TREE"] ||
|
97
|
+
false
|
84
98
|
end
|
85
99
|
|
86
100
|
def before_resolution
|
@@ -98,21 +112,31 @@ module Bundler
|
|
98
112
|
include Molinillo::SpecificationProvider
|
99
113
|
|
100
114
|
def dependencies_for(specification)
|
101
|
-
specification.dependencies_for_activated_platforms
|
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
|
102
126
|
end
|
103
127
|
|
104
|
-
def search_for(
|
105
|
-
platform =
|
106
|
-
dependency =
|
107
|
-
|
108
|
-
|
109
|
-
results =
|
128
|
+
def search_for(dependency_proxy)
|
129
|
+
platform = dependency_proxy.__platform
|
130
|
+
dependency = dependency_proxy.dep
|
131
|
+
name = dependency.name
|
132
|
+
search_result = @search_for[dependency_proxy] ||= begin
|
133
|
+
results = results_for(dependency, @base[name])
|
110
134
|
|
111
|
-
if vertex = @base_dg.vertex_named(
|
135
|
+
if vertex = @base_dg.vertex_named(name)
|
112
136
|
locked_requirement = vertex.payload.requirement
|
113
137
|
end
|
114
138
|
|
115
|
-
if !@prerelease_specified[
|
139
|
+
if !@prerelease_specified[name] && (!@use_gvp || locked_requirement.nil?)
|
116
140
|
# Move prereleases to the beginning of the list, so they're considered
|
117
141
|
# last during resolution.
|
118
142
|
pre, results = results.partition {|spec| spec.version.prerelease? }
|
@@ -131,9 +155,20 @@ module Bundler
|
|
131
155
|
end
|
132
156
|
nested.reduce([]) do |groups, (version, specs)|
|
133
157
|
next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
|
134
|
-
|
135
|
-
|
136
|
-
|
158
|
+
|
159
|
+
specs_by_platform = Hash.new do |current_specs, current_platform|
|
160
|
+
current_specs[current_platform] = select_best_platform_match(specs, current_platform)
|
161
|
+
end
|
162
|
+
|
163
|
+
spec_group_ruby = SpecGroup.create_for(specs_by_platform, [Gem::Platform::RUBY], Gem::Platform::RUBY)
|
164
|
+
groups << spec_group_ruby if spec_group_ruby
|
165
|
+
|
166
|
+
next groups if @resolving_only_for_ruby
|
167
|
+
|
168
|
+
spec_group = SpecGroup.create_for(specs_by_platform, @platforms, platform)
|
169
|
+
groups << spec_group if spec_group
|
170
|
+
|
171
|
+
groups
|
137
172
|
end
|
138
173
|
else
|
139
174
|
[]
|
@@ -146,26 +181,41 @@ module Bundler
|
|
146
181
|
@gem_version_promoter.sort_versions(dependency, spec_groups)
|
147
182
|
end
|
148
183
|
end
|
149
|
-
|
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
|
150
200
|
end
|
151
201
|
|
152
202
|
def index_for(dependency)
|
153
|
-
source = @
|
203
|
+
source = @index_requirements[dependency.name]
|
154
204
|
if source
|
155
|
-
source
|
156
|
-
elsif @
|
205
|
+
source
|
206
|
+
elsif @no_aggregate_global_source
|
157
207
|
Index.build do |idx|
|
158
|
-
|
159
|
-
dependency.all_sources.each {|s| idx.add_source(s.specs) if s }
|
160
|
-
else
|
161
|
-
idx.add_source @source_requirements[:default].specs
|
162
|
-
end
|
208
|
+
dependency.all_sources.each {|s| idx.add_source(s.specs) }
|
163
209
|
end
|
164
210
|
else
|
165
|
-
@
|
211
|
+
@index_requirements[:global]
|
166
212
|
end
|
167
213
|
end
|
168
214
|
|
215
|
+
def results_for(dependency, base)
|
216
|
+
index_for(dependency).search(dependency, base)
|
217
|
+
end
|
218
|
+
|
169
219
|
def name_for(dependency)
|
170
220
|
dependency.name
|
171
221
|
end
|
@@ -183,26 +233,30 @@ module Bundler
|
|
183
233
|
end
|
184
234
|
|
185
235
|
def requirement_satisfied_by?(requirement, activated, spec)
|
186
|
-
|
187
|
-
|
188
|
-
|
236
|
+
requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
|
237
|
+
end
|
238
|
+
|
239
|
+
def dependencies_equal?(dependencies, other_dependencies)
|
240
|
+
dependencies.map(&:dep) == other_dependencies.map(&:dep)
|
189
241
|
end
|
190
242
|
|
191
243
|
def relevant_sources_for_vertex(vertex)
|
192
244
|
if vertex.root?
|
193
245
|
[@source_requirements[vertex.name]]
|
194
|
-
elsif @
|
246
|
+
elsif @no_aggregate_global_source
|
195
247
|
vertex.recursive_predecessors.map do |v|
|
196
248
|
@source_requirements[v.name]
|
197
|
-
end << @source_requirements[:default]
|
249
|
+
end.compact << @source_requirements[:default]
|
250
|
+
else
|
251
|
+
[]
|
198
252
|
end
|
199
253
|
end
|
200
254
|
|
201
255
|
def sort_dependencies(dependencies, activated, conflicts)
|
202
256
|
dependencies.sort_by do |dependency|
|
203
|
-
dependency.all_sources = relevant_sources_for_vertex(activated.vertex_named(dependency.name))
|
204
257
|
name = name_for(dependency)
|
205
258
|
vertex = activated.vertex_named(name)
|
259
|
+
dependency.all_sources = relevant_sources_for_vertex(vertex)
|
206
260
|
[
|
207
261
|
@base_dg.vertex_named(name) ? 0 : 1,
|
208
262
|
vertex.payload ? 0 : 1,
|
@@ -215,19 +269,13 @@ module Bundler
|
|
215
269
|
end
|
216
270
|
end
|
217
271
|
|
218
|
-
# Sort platforms from most general to most specific
|
219
|
-
def self.sort_platforms(platforms)
|
220
|
-
platforms.sort_by do |platform|
|
221
|
-
platform_sort_key(platform)
|
222
|
-
end
|
223
|
-
end
|
224
|
-
|
225
272
|
def self.platform_sort_key(platform)
|
226
|
-
|
227
|
-
|
273
|
+
# Prefer specific platform to not specific platform
|
274
|
+
return ["99-LAST", "", "", ""] if Gem::Platform::RUBY == platform
|
275
|
+
["00", *platform.to_a.map {|part| part || "" }]
|
228
276
|
end
|
229
277
|
|
230
|
-
|
278
|
+
private
|
231
279
|
|
232
280
|
# returns an integer \in (-\infty, 0]
|
233
281
|
# a number closer to 0 means the dependency is less constraining
|
@@ -275,16 +323,16 @@ module Bundler
|
|
275
323
|
"If you are updating multiple gems in your Gemfile at once,\n" \
|
276
324
|
"try passing them all to `bundle update`"
|
277
325
|
elsif source = @source_requirements[name]
|
278
|
-
specs = source.specs
|
326
|
+
specs = source.specs.search(name)
|
279
327
|
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
|
280
328
|
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
|
281
329
|
message << if versions_with_platforms.any?
|
282
|
-
"The source contains '#{name}'
|
330
|
+
"The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
|
283
331
|
else
|
284
332
|
"The source does not contain any versions of '#{name}'"
|
285
333
|
end
|
286
334
|
else
|
287
|
-
message = "Could not find gem '#{requirement}' in any of the gem sources " \
|
335
|
+
message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
|
288
336
|
"listed in your Gemfile#{cache_message}."
|
289
337
|
end
|
290
338
|
raise GemNotFound, message
|
@@ -305,10 +353,16 @@ module Bundler
|
|
305
353
|
def version_conflict_message(e)
|
306
354
|
# only show essential conflicts, if possible
|
307
355
|
conflicts = e.conflicts.dup
|
308
|
-
|
309
|
-
|
310
|
-
|
356
|
+
|
357
|
+
if conflicts["bundler"]
|
358
|
+
conflicts.replace("bundler" => conflicts["bundler"])
|
359
|
+
else
|
360
|
+
conflicts.delete_if do |_name, conflict|
|
361
|
+
deps = conflict.requirement_trees.map(&:last).flatten(1)
|
362
|
+
!Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
|
363
|
+
end
|
311
364
|
end
|
365
|
+
|
312
366
|
e = Molinillo::VersionConflict.new(conflicts, e.specification_provider) unless conflicts.empty?
|
313
367
|
|
314
368
|
solver_name = "Bundler"
|
@@ -336,15 +390,25 @@ module Bundler
|
|
336
390
|
:additional_message_for_conflict => lambda do |o, name, conflict|
|
337
391
|
if name == "bundler"
|
338
392
|
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
|
339
|
-
other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
340
|
-
end
|
341
393
|
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
394
|
+
conflict_dependency = conflict.requirement
|
395
|
+
conflict_requirement = conflict_dependency.requirement
|
396
|
+
other_bundler_required = !conflict_requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
397
|
+
|
398
|
+
if other_bundler_required
|
399
|
+
o << "\n\n"
|
400
|
+
|
401
|
+
candidate_specs = @index_requirements[:default_bundler].search(conflict_dependency)
|
402
|
+
if candidate_specs.any?
|
403
|
+
target_version = candidate_specs.last.version
|
404
|
+
new_command = [File.basename($PROGRAM_NAME), "_#{target_version}_", *ARGV].join(" ")
|
405
|
+
o << "Your bundle requires a different version of Bundler than the one you're running.\n"
|
406
|
+
o << "Install the necessary version with `gem install bundler:#{target_version}` and rerun bundler using `#{new_command}`\n"
|
407
|
+
else
|
408
|
+
o << "Your bundle requires a different version of Bundler than the one you're running, and that version could not be found.\n"
|
409
|
+
end
|
410
|
+
end
|
411
|
+
elsif conflict.locked_requirement
|
348
412
|
o << "\n"
|
349
413
|
o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
|
350
414
|
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|
@@ -353,14 +417,8 @@ module Bundler
|
|
353
417
|
|
354
418
|
relevant_sources = if conflict.requirement.source
|
355
419
|
[conflict.requirement.source]
|
356
|
-
elsif conflict.requirement.all_sources
|
357
|
-
conflict.requirement.all_sources
|
358
|
-
elsif @lockfile_uses_separate_rubygems_sources
|
359
|
-
# every conflict should have an explicit group of sources when we
|
360
|
-
# enforce strict pinning
|
361
|
-
raise "no source set for #{conflict}"
|
362
420
|
else
|
363
|
-
|
421
|
+
conflict.requirement.all_sources
|
364
422
|
end.compact.map(&:to_s).uniq.sort
|
365
423
|
|
366
424
|
metadata_requirement = name.end_with?("\0")
|
@@ -397,23 +455,21 @@ module Bundler
|
|
397
455
|
def validate_resolved_specs!(resolved_specs)
|
398
456
|
resolved_specs.each do |v|
|
399
457
|
name = v.name
|
400
|
-
|
401
|
-
sources.
|
458
|
+
sources = relevant_sources_for_vertex(v)
|
459
|
+
next unless sources.any?
|
402
460
|
if default_index = sources.index(@source_requirements[:default])
|
403
461
|
sources.delete_at(default_index)
|
404
462
|
end
|
405
|
-
sources.reject! {|s| s.specs
|
463
|
+
sources.reject! {|s| s.specs.search(name).empty? }
|
406
464
|
sources.uniq!
|
407
465
|
next if sources.size <= 1
|
408
466
|
|
409
|
-
multisource_disabled = Bundler.feature_flag.disable_multisource?
|
410
|
-
|
411
467
|
msg = ["The gem '#{name}' was found in multiple relevant sources."]
|
412
468
|
msg.concat sources.map {|s| " * #{s}" }.sort
|
413
|
-
msg << "You #{
|
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."
|
414
470
|
msg = msg.join("\n")
|
415
471
|
|
416
|
-
raise SecurityError, msg if
|
472
|
+
raise SecurityError, msg if @no_aggregate_global_source
|
417
473
|
Bundler.ui.warn "Warning: #{msg}"
|
418
474
|
end
|
419
475
|
end
|