diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-06-30 16:57:39 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-07-04 14:54:25 +0900 |
| commit | 0ae2709dd71eaefe4a316bdbc9e97eaef3c7ae69 (patch) | |
| tree | 8b2ca7b790c3050533b45405ea9b61d853cc05b5 /lib | |
| parent | 0fcb4c6af72a5fe4222a705e161dc0b42d135fba (diff) | |
[rubygems/rubygems] When printing frozen errors, print only Gemfile information
https://github.com/rubygems/rubygems/commit/93f74abc5f
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/definition.rb | 4 | ||||
| -rw-r--r-- | lib/bundler/source/git.rb | 15 | ||||
| -rw-r--r-- | lib/bundler/source/rubygems.rb | 1 |
3 files changed, 17 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index d7246dadf0..1970782d55 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -394,8 +394,8 @@ module Bundler lock_source = lock_dep.source || sources.default_source next if lock_source.include?(gemfile_source) - gemfile_source_name = dep.source ? gemfile_source.identifier : "no specified source" - lockfile_source_name = lock_dep.source ? lock_source.identifier : "no specified source" + gemfile_source_name = dep.source ? gemfile_source.to_gemfile : "no specified source" + lockfile_source_name = lock_dep.source ? lock_source.to_gemfile : "no specified source" changed << "* #{name} from `#{lockfile_source_name}` to `#{gemfile_source_name}`" end diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 42897813b4..f7ad6057b4 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -46,6 +46,14 @@ module Bundler out << " specs:\n" end + def to_gemfile + specifiers = %w[ref branch tag submodules glob].map do |opt| + "#{opt}: #{options[opt]}" if options[opt] + end + + uri_with_specifiers(specifiers) + end + def hash [self.class, uri, ref, branch, name, version, glob, submodules].hash end @@ -80,7 +88,12 @@ module Bundler "" end - specifiers = [rev, glob_for_display].compact + uri_with_specifiers([rev, glob_for_display]) + end + + def uri_with_specifiers(specifiers) + specifiers.compact! + suffix = if specifiers.any? " (#{specifiers.join(", ")})" diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index af55ba0f2c..af57acbbc2 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -123,6 +123,7 @@ module Bundler end end alias_method :name, :identifier + alias_method :to_gemfile, :identifier def specs @specs ||= begin |
