summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-05-05 13:52:31 -0700
committerSamuel Giddins <segiddins@segiddins.me>2016-07-05 15:11:19 -0300
commit336585833fe152a93702b518d49b8c7dc9676fdc (patch)
tree584f3fb4d2109734401fd8002239d22eecb1bf70
parent61e00d657174e84f3b27570becdfe9bccc3b3a0c (diff)
downloadbundler-336585833fe152a93702b518d49b8c7dc9676fdc.tar.gz
note that disable_multisource will be the default
-rw-r--r--lib/bundler/dsl.rb3
-rw-r--r--spec/install/gemfile/sources_spec.rb6
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 6b07e5bea2..23d37ca596 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -415,13 +415,14 @@ module Bundler
def check_primary_source_safety(source)
return unless source.rubygems_primary_remotes.any?
+ # TODO: 2.0 upgrade from setting to default
if Bundler.settings[:disable_multisource]
raise GemspecError, "Warning: this Gemfile contains multiple primary sources. " \
"Each source after the first must include a block to indicate which gems " \
"should come from that source. To downgrade this error to a warning, run " \
"`bundle config --delete disable_multisource`"
else
- Bundler.ui.warn "Warning: this Gemfile contains multiple primary sources. " \
+ Bundler.ui.deprecate "Your Gemfile contains multiple primary sources. " \
"Using `source` more than once without a block is a security risk, and " \
"may result in installing unexpected gems. To resolve this warning, use " \
"a block to indicate which gems should come from the secondary source. " \
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index f34a5f2aeb..7411538955 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -31,7 +31,7 @@ describe "bundle install with gems on multiple sources" do
it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first" do
bundle :install
- expect(out).to include("Warning: this Gemfile contains multiple primary sources.")
+ expect(err).to include("DEPRECATION: Your Gemfile contains multiple primary sources.")
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(out).to include("Installed from: file:#{gem_repo1}")
should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
@@ -60,7 +60,7 @@ describe "bundle install with gems on multiple sources" do
it "warns about ambiguous gems, but installs anyway" do
bundle :install
- expect(out).to include("Warning: this Gemfile contains multiple primary sources.")
+ expect(err).to include("DEPRECATION: Your Gemfile contains multiple primary sources.")
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(out).to include("Installed from: file:#{gem_repo1}")
should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
@@ -224,7 +224,7 @@ describe "bundle install with gems on multiple sources" do
it "installs from the other source and warns about ambiguous gems" do
bundle :install
- expect(out).to include("Warning: this Gemfile contains multiple primary sources.")
+ expect(err).to include("DEPRECATION: Your Gemfile contains multiple primary sources.")
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(out).to include("Installed from: file:#{gem_repo2}")
should_be_installed("depends_on_rack 1.0.1", "rack 1.0.0")