method
check_primary_source_safety
v2_6_3 -
Show latest stable
- Class:
Bundler::Dsl
check_primary_source_safety(source_list)private
No documentation available.
# File lib/bundler/dsl.rb, line 470
def check_primary_source_safety(source_list)
return if source_list.rubygems_primary_remotes.empty? && source_list.global_rubygems_source.nil?
if Bundler.feature_flag.disable_multisource?
msg = "This Gemfile contains multiple primary sources. " "Each source after the first must include a block to indicate which gems " "should come from that source"
unless Bundler.feature_flag.bundler_2_mode?
msg += ". To downgrade this error to a warning, run " "`bundle config --delete disable_multisource`"
end
raise GemfileEvalError, msg
else
Bundler::SharedHelpers.major_deprecation 2, "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. " "To upgrade this warning to an error, run `bundle config " "disable_multisource true`."
end
end