diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-10-11 19:59:46 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-10-13 16:21:42 +0900 |
commit | bd87397f73c36f1428b4cf8de24918b98fa71c8a (patch) | |
tree | cfade99e157243a1a79d38893e6a43c5a6690eb5 /lib/bundler/source | |
parent | d6627ab85c7e29a45ee61af350a38c37ea2bd83b (diff) |
[rubygems/rubygems] Use correct way to detect default gems
The other way, in particular matching a substring in the gemspec
summary, is brittle and no longer used since Ruby 2.0.
This needed rewriting the specs that depended on that way.
https://github.com/rubygems/rubygems/commit/059dbfa971
Diffstat (limited to 'lib/bundler/source')
-rw-r--r-- | lib/bundler/source/rubygems.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 7f8699b91c..593f68d5cd 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -135,7 +135,7 @@ module Bundler force = opts[:force] ensure_builtin_gems_cached = opts[:ensure_builtin_gems_cached] - if ensure_builtin_gems_cached && builtin_gem?(spec) + if ensure_builtin_gems_cached && spec.default_gem? if !cached_path(spec) cached_built_in_gem(spec) unless spec.remote force = true @@ -233,7 +233,7 @@ module Bundler end def cache(spec, custom_path = nil) - if builtin_gem?(spec) + if spec.default_gem? cached_path = cached_built_in_gem(spec) else cached_path = cached_gem(spec) @@ -479,14 +479,6 @@ module Bundler Bundler.rm_rf(download_path) if requires_sudo? end - def builtin_gem?(spec) - # Ruby 2.1, where all included gems have this summary - return true if spec.summary =~ /is bundled with Ruby/ - - # Ruby 2.0, where gemspecs are stored in specifications/default/ - spec.loaded_from && spec.loaded_from.include?("specifications/default/") - end - def installed?(spec) installed_specs[spec].any? end |