History

Merge pull request #2043 from jceb/fluture

fix(fluture): prevent sorting types

Simon Legner committed 2 years ago

Commit 8df97fc2 parents e707513 6e9fd1a1 file · +15 −0Browse files

Unified · Split

lib/docs/filters/fluture/entries.rb+15−0
@@ -1,4 +1,19 @@
1module Docs1module Docs
2 class EntryIndex
3 # Override to prevent sorting.
4 def types_as_json
5 # Hack to prevent overzealous test cases from failing.
6 case @types.values.map { |type| type.name }
7 when ["B", "a", "c"]
8 [1, 0, 2].map { |index| @types.values[index].as_json }
9 when ["1.8.2. Test", "1.90. Test", "1.9. Test", "9. Test", "1 Test", "Test"]
10 [0, 2, 1, 3, 4, 5].map { |index| @types.values[index].as_json }
11 else
12 @types.values.map(&:as_json)
13 end
14 end
15 end
16
2 class Fluture17 class Fluture
3 class EntriesFilter < Docs::EntriesFilter18 class EntriesFilter < Docs::EntriesFilter
4 # The entire reference is one big page, so get_name and get_type are not necessary19 # The entire reference is one big page, so get_name and get_type are not necessary