1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Ensure module candidates are ordered consistently

This gets rid of annoying implementation specific ordering, at the
expense of adding our own arbitrary ordering to the mix.
This commit is contained in:
Conrad Irwin 2013-03-23 00:14:45 -07:00
parent b10403894a
commit 53c39fdac3

View file

@ -327,7 +327,7 @@ class Pry
ims = all_relevant_methods_for(wrapped) ims = all_relevant_methods_for(wrapped)
@all_source_locations_by_popularity = ims.group_by { |v| Array(v.source_location).first }. @all_source_locations_by_popularity = ims.group_by { |v| Array(v.source_location).first }.
sort_by { |k, v| -v.size } sort_by { |k, v| [-v.size, k] }
end end
# We only want methods that have a non-nil `source_location`. We also # We only want methods that have a non-nil `source_location`. We also