Skip to content

Commit c4a2732

Browse files
committed
Sort the function history
We lost the sorting when we introduced concurrency in parsing the different versions. Bring it back.
1 parent f7a9aa4 commit c4a2732

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docurium.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
1313
s.description = s.summary
1414
s.license = 'MIT'
1515

16-
s.add_dependency "version_sorter", "~>1.1"
16+
s.add_dependency "version_sorter", "~>2.0"
1717
s.add_dependency "mustache", "~> 0.99"
1818
s.add_dependency "rocco", "~>0.8"
1919
s.add_dependency "gli", "~>2.5"

lib/docurium.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ def generate_docs
188188

189189
end
190190

191+
# We tally the sigantures in the order they finished, which is
192+
# arbitrary due to the concurrency, so we need to sort them once
193+
# they've finsihed.
194+
sort_sigs!
195+
191196
project = {
192197
:versions => versions.reverse,
193198
:github => @options['github'],
@@ -288,6 +293,14 @@ def tally_sigs!(version, data)
288293
end
289294
end
290295

296+
def sort_sigs!
297+
@sigs.keys.each do |fn|
298+
VersionSorter.sort!(@sigs[fn][:exists])
299+
# Put HEAD at the back
300+
@sigs[fn][:exists] << @sigs[fn][:exists].shift
301+
end
302+
end
303+
291304
def find_subtree(version, path)
292305
tree = nil
293306
if version == 'HEAD'

0 commit comments

Comments
 (0)