From 85735045ac22d5beda638929d511d8f32557cde4 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Sat, 26 Nov 2016 12:57:19 -0800 Subject: [PATCH 1/2] fix crash when sorting declarations with no USR since usr isn't present in all declarations, we need to fall back on something. fixes #661. --- lib/jazzy/doc_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jazzy/doc_builder.rb b/lib/jazzy/doc_builder.rb index 00a5e4093..a21b83c80 100644 --- a/lib/jazzy/doc_builder.rb +++ b/lib/jazzy/doc_builder.rb @@ -32,7 +32,7 @@ def self.prepare_output_dir(output_dir, clean) def self.doc_structure_for_docs(docs) docs.map do |doc| children = doc.children - .sort_by { |c| [c.nav_order, c.name, c.usr] } + .sort_by { |c| [c.nav_order, c.name, c.usr || ''] } .flat_map do |child| # FIXME: include arbitrarily nested extensible types [{ name: child.name, url: child.url }] + From b63432119bb04350d6f1206fe20d4740f1f5316c Mon Sep 17 00:00:00 2001 From: JP Simard Date: Sat, 26 Nov 2016 13:02:55 -0800 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1a3993b9..eb25fb22b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Master +##### Breaking + +* None. + ##### Enhancements * Podspec-based documentation will take trunk's `pushed_with_swift_version` @@ -18,6 +22,12 @@ * Rename Dash typedef type from "Alias" to "Type". [Bogdan Popescu](https://github.com/Kapeli) +* Fix crash when sorting multiple identically named declarations with no USR, + which is very common when generating docs for podspecs supporting multiple + platforms. + [JP Simard](https://github.com/jpsim) + [#661](https://github.com/realm/jazzy/issues/661) + ## 0.7.2 ##### Breaking