diff --git a/lib/jsduck/categories.rb b/lib/jsduck/categories.rb index a55604d95201fc46227e0b91e80cd0ead6bc63a1..6606030cc3cd4d4a3c5c546ab3607794fd08cfdc 100644 --- a/lib/jsduck/categories.rb +++ b/lib/jsduck/categories.rb @@ -15,6 +15,12 @@ module JsDuck def parse(path) @categories = JsonDuck.read(path) + # Don't crash if old syntax is used. + if @categories.is_a?(Hash) && @categories["categories"] + Logger.instance.warn('Update categories file to contain just the array inside {"categories": [...]}') + @categories = @categories["categories"] + end + # Perform expansion on all class names containing * wildcard @categories.each do |cat| cat["groups"].each do |group|