Skip to content

Commit c94cec2

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] Simplify SpecSet#sorted
ruby/rubygems@a3f365bbaa
1 parent e59c901 commit c94cec2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lib/bundler/spec_set.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,12 @@ def valid_dependencies?(s)
295295
end
296296

297297
def sorted
298-
rake = @specs.find {|s| s.name == "rake" }
299-
begin
300-
@sorted ||= ([rake] + tsort).compact.uniq
301-
rescue TSort::Cyclic => error
302-
cgems = extract_circular_gems(error)
303-
raise CyclicDependencyError, "Your bundle requires gems that depend" \
304-
" on each other, creating an infinite loop. Please remove either" \
305-
" gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again."
306-
end
298+
@sorted ||= ([@specs.find {|s| s.name == "rake" }] + tsort).compact.uniq
299+
rescue TSort::Cyclic => error
300+
cgems = extract_circular_gems(error)
301+
raise CyclicDependencyError, "Your bundle requires gems that depend" \
302+
" on each other, creating an infinite loop. Please remove either" \
303+
" gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again."
307304
end
308305

309306
def extract_circular_gems(error)

0 commit comments

Comments
 (0)