ruby-changes:62449
From: David <ko1@a...>
Date: Fri, 31 Jul 2020 21:08:17 +0900 (JST)
Subject: [ruby-changes:62449] 1260d22cae (master): [rubygems/rubygems] Extract some common code into a private method
https://git.ruby-lang.org/ruby.git/commit/?id=1260d22cae From 1260d22cae8697fc2f8e3999190a228cf23e7823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Wed, 8 Jul 2020 18:42:47 +0200 Subject: [rubygems/rubygems] Extract some common code into a private method https://github.com/rubygems/rubygems/commit/d1be8cdb3a diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index a2b982c..5e326e0 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1006,9 +1006,7 @@ class Gem::Specification < Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L1006 # Return currently unresolved specs that contain the file matching +path+. def self.find_in_unresolved(path) - specs = unresolved_deps.values.map {|dep| dep.to_specs }.flatten - - specs.find_all {|spec| spec.contains_requirable_file? path } + unresolved_specs.find_all {|spec| spec.contains_requirable_file? path } end ## @@ -1016,9 +1014,7 @@ class Gem::Specification < Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L1014 # specs that contain the file matching +path+. def self.find_in_unresolved_tree(path) - specs = unresolved_deps.values.map {|dep| dep.to_specs }.flatten - - specs.each do |spec| + unresolved_specs.each do |spec| spec.traverse do |from_spec, dep, to_spec, trail| if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail) :next @@ -1031,6 +1027,11 @@ class Gem::Specification < Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L1027 [] end + def self.unresolved_specs + unresolved_deps.values.map {|dep| dep.to_specs }.flatten + end + private_class_method :unresolved_specs + ## # Special loader for YAML files. When a Specification object is loaded # from a YAML file, it bypasses the normal Ruby object initialization -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/