diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-06-14 12:55:54 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-07-07 10:03:15 +0900 |
commit | 1e98ec27f6ab893d7c9c1d48214fbe9bb2aa049c (patch) | |
tree | ccec4cac42bde6676ae6914976dff64656dea667 /lib/bundler | |
parent | f63d3bbb6e27daaac8211c57929d62add4fef1ad (diff) |
Merge RubyGems-3.2.20 and Bundler-2.2.20
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/bundler.gemspec | 2 | ||||
-rw-r--r-- | lib/bundler/cli/check.rb | 6 | ||||
-rw-r--r-- | lib/bundler/cli/outdated.rb | 2 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 6 | ||||
-rw-r--r-- | lib/bundler/fetcher/index.rb | 1 | ||||
-rw-r--r-- | lib/bundler/friendly_errors.rb | 4 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 7 | ||||
-rw-r--r-- | lib/bundler/source.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 6 | ||||
-rw-r--r-- | lib/bundler/source_list.rb | 4 | ||||
-rw-r--r-- | lib/bundler/version.rb | 2 |
11 files changed, 31 insertions, 11 deletions
diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec index 1a2ced54d3..f91798ab64 100644 --- a/lib/bundler/bundler.gemspec +++ b/lib/bundler/bundler.gemspec @@ -39,7 +39,7 @@ Gem::Specification.new do |s| # include the gemspec itself because warbler breaks w/o it s.files += %w[bundler.gemspec] - s.extra_rdoc_files = %w[CHANGELOG.md LICENSE.md README.md] + s.files += %w[CHANGELOG.md LICENSE.md README.md] s.bindir = "exe" s.executables = %w[bundle bundler] s.require_paths = ["lib"] diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb index 19c0aaea06..65c51337d2 100644 --- a/lib/bundler/cli/check.rb +++ b/lib/bundler/cli/check.rb @@ -11,9 +11,11 @@ module Bundler def run Bundler.settings.set_command_option_if_given :path, options[:path] + definition = Bundler.definition + definition.validate_runtime! + begin - definition = Bundler.definition - definition.validate_runtime! + definition.resolve_only_locally! not_installed = definition.missing_specs rescue GemNotFound, VersionConflict Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies." diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index d86ed2d002..d5183b060b 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -147,6 +147,8 @@ module Bundler def retrieve_active_spec(definition, current_spec) active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform) + return unless active_spec + return active_spec if strict active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index bdf287b1e7..bc75e83908 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -160,6 +160,12 @@ module Bundler @disable_multisource end + def resolve_only_locally! + @remote = false + sources.local_only! + resolve + end + def resolve_with_cache! sources.cached! resolve diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb index 08b041897e..0d14c47aa7 100644 --- a/lib/bundler/fetcher/index.rb +++ b/lib/bundler/fetcher/index.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require_relative "base" -require "rubygems/remote_fetcher" module Bundler class Fetcher diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb index c5a19d3eea..db43e0f654 100644 --- a/lib/bundler/friendly_errors.rb +++ b/lib/bundler/friendly_errors.rb @@ -49,8 +49,6 @@ module Bundler "Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)." else request_issue_report_for(error) end - rescue StandardError - raise error end def exit_status(error) @@ -111,7 +109,7 @@ module Bundler First, try this link to see if there are any existing issue reports for this error: #{issues_url(e)} - If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: + If there aren't any reports for this error yet, please copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md EOS end diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index d060e21f50..21ce12ecda 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -526,13 +526,14 @@ module Bundler Bundler::Retry.new("download gem from #{uri}").attempts do fetcher.download(spec, uri, path) end + rescue Gem::RemoteFetcher::FetchError => e + raise Bundler::HTTPError, "Could not download gem from #{uri} due to underlying error <#{e.message}>" end def gem_remote_fetcher - require "resolv" + require "rubygems/remote_fetcher" proxy = configuration[:http_proxy] - dns = Resolv::DNS.new - Gem::RemoteFetcher.new(proxy, dns) + Gem::RemoteFetcher.new(proxy) end def gem_from_path(path, policy = nil) diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index f39072791c..5388a7681e 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -36,6 +36,8 @@ module Bundler def local!; end + def local_only!; end + def cached!; end def remote!; end diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index ee317957f0..590c3ec939 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -26,6 +26,12 @@ module Bundler Array(options["remotes"]).reverse_each {|r| add_remote(r) } end + def local_only! + @specs = nil + @allow_local = true + @allow_remote = false + end + def local! return if @allow_local diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb index f7eb3a1c03..584d693dea 100644 --- a/lib/bundler/source_list.rb +++ b/lib/bundler/source_list.rb @@ -132,6 +132,10 @@ module Bundler false end + def local_only! + all_sources.each(&:local_only!) + end + def cached! all_sources.each(&:cached!) end diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index de2a02d140..4302fb9892 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false module Bundler - VERSION = "2.2.19".freeze + VERSION = "2.2.20".freeze def self.bundler_major_version @bundler_major_version ||= VERSION.split(".").first.to_i |