File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ def print_undocumented_objects
7878 return if !@undoc_list || @undoc_list . empty?
7979 log . puts
8080 log . puts "Undocumented Objects:"
81-
82- objects = @undoc_list . sort_by { |o | o . file . to_s }
83- max = objects . sort_by { |o | o . path . length } . last . path . length
81+ # array needed for sort due to none stable sorting
82+ objects = @undoc_list . sort_by { |o | [ o . file . to_s , o . path ] }
83+ max = objects . max { |a , b | a . path . length <=> b . path . length } . path . length
8484 if @compact
8585 objects . each do |object |
8686 log . puts ( "%-#{ max } s (%s)" % [ object . path ,
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ module B; end
4141Undocumented Objects:
4242
4343(in file: (stdin))
44- B
4544A
46- A::CONST
4745A#foo
46+ A::CONST
47+ B
4848eof
4949 end
5050
@@ -69,10 +69,10 @@ def foo; end
6969 expect ( @output . string ) . to eq <<-eof
7070#{ @main_stats }
7171Undocumented Objects:
72- B ((stdin):11)
7372A ((stdin):1)
74- A::CONST ((stdin):2)
7573A#foo ((stdin):4)
74+ A::CONST ((stdin):2)
75+ B ((stdin):11)
7676eof
7777 end
7878
You can’t perform that action at this time.
0 commit comments