mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Remove the warning for not defining a gem server source
Bundler has deprecated gemfiles without a global source and this feature
is now obsolete. `Bundler::Definition#has_rubygems_remotes?` is removed
because it's not used anymore.
d29dd2cb7b
This commit is contained in:
parent
49176e8c8c
commit
bd8daa8523
3 changed files with 5 additions and 14 deletions
|
@ -83,18 +83,11 @@ module Bundler
|
||||||
end
|
end
|
||||||
|
|
||||||
Bundler::CLI::Common.output_fund_metadata_summary
|
Bundler::CLI::Common.output_fund_metadata_summary
|
||||||
rescue GemNotFound, VersionConflict => e
|
rescue GemNotFound => e
|
||||||
if options[:local] && Bundler.app_cache.exist?
|
if options[:local] && Bundler.app_cache.exist?
|
||||||
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
||||||
end
|
end
|
||||||
|
|
||||||
unless Bundler.definition.has_rubygems_remotes?
|
|
||||||
Bundler.ui.warn <<-WARN, :wrap => true
|
|
||||||
Your Gemfile has no gem server sources. If you need gems that are \
|
|
||||||
not already on your machine, add a line like this to your Gemfile:
|
|
||||||
source 'https://rubygems.org'
|
|
||||||
WARN
|
|
||||||
end
|
|
||||||
raise e
|
raise e
|
||||||
rescue Gem::InvalidSpecificationException => e
|
rescue Gem::InvalidSpecificationException => e
|
||||||
Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
|
Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
|
||||||
|
|
|
@ -279,10 +279,6 @@ module Bundler
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_rubygems_remotes?
|
|
||||||
sources.rubygems_sources.any? {|s| s.remotes.any? }
|
|
||||||
end
|
|
||||||
|
|
||||||
def spec_git_paths
|
def spec_git_paths
|
||||||
sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
|
sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
|
||||||
end
|
end
|
||||||
|
|
|
@ -331,11 +331,13 @@ RSpec.describe "bundle install with gem sources" do
|
||||||
|
|
||||||
it "gives a useful error if no sources are set" do
|
it "gives a useful error if no sources are set" do
|
||||||
install_gemfile <<-G, :raise_on_error => false
|
install_gemfile <<-G, :raise_on_error => false
|
||||||
source "#{file_uri_for(gem_repo1)}"
|
|
||||||
gem "rack"
|
gem "rack"
|
||||||
G
|
G
|
||||||
|
|
||||||
expect(err).to include("Your Gemfile has no gem server sources")
|
expect(err).to include("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
|
end
|
||||||
|
|
||||||
it "creates a Gemfile.lock on a blank Gemfile" do
|
it "creates a Gemfile.lock on a blank Gemfile" do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue