diff options
author | David RodrÃguez <[email protected]> | 2025-01-30 09:27:20 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-02-14 16:13:27 +0900 |
commit | c94cec27f7bd7000e9944c2037bf4a4c255c0861 (patch) | |
tree | 495cdee178c7aa0f100633574c68fa75eae8273f /lib | |
parent | e59c90118e893fae3f37ca629291f37e26de48f4 (diff) |
[rubygems/rubygems] Simplify SpecSet#sorted
https://github.com/rubygems/rubygems/commit/a3f365bbaa
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/spec_set.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 599b5cf439..9586521b27 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -295,15 +295,12 @@ module Bundler end def sorted - rake = @specs.find {|s| s.name == "rake" } - begin - @sorted ||= ([rake] + tsort).compact.uniq - rescue TSort::Cyclic => error - cgems = extract_circular_gems(error) - raise CyclicDependencyError, "Your bundle requires gems that depend" \ - " on each other, creating an infinite loop. Please remove either" \ - " gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again." - end + @sorted ||= ([@specs.find {|s| s.name == "rake" }] + tsort).compact.uniq + rescue TSort::Cyclic => error + cgems = extract_circular_gems(error) + raise CyclicDependencyError, "Your bundle requires gems that depend" \ + " on each other, creating an infinite loop. Please remove either" \ + " gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again." end def extract_circular_gems(error) |