diff options
Diffstat (limited to 'lib/bundler/dsl.rb')
-rw-r--r-- | lib/bundler/dsl.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index ac955894a7..3517a109ed 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -447,8 +447,21 @@ repo_name ||= user_name end def check_rubygems_source_safety - return unless @sources.aggregate_global_source? + if @sources.implicit_global_source? + implicit_global_source_warning + elsif @sources.aggregate_global_source? + multiple_global_source_warning + end + end + + def implicit_global_source_warning + Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \ + "Not using an explicit global source may result in a different lockfile being generated depending on " \ + "the gems you have installed locally before bundler is run." \ + "Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"." + end + def multiple_global_source_warning if Bundler.feature_flag.bundler_3_mode? msg = "This Gemfile contains multiple primary sources. " \ "Each source after the first must include a block to indicate which gems " \ |