templates/default/module/setup.rb in yard-0.9.12 vs templates/default/module/setup.rb in yard-0.9.13

- old
+ new

@@ -129,20 +129,25 @@ yield(items, name) unless items.empty? end else others = [] group_data = {} - list.each do |meth| - if meth.group - (group_data[meth.group] ||= []) << meth + list.each do |itm| + if itm.group + (group_data[itm.group] ||= []) << itm else - others << meth + others << itm end end group_data.each {|group, items| yield(items, group) unless items.empty? } end - scopes(others) {|items, scope| yield(items, "#{scope.to_s.capitalize} #{type} Summary") } + return if others.empty? + if others.first.respond_to?(:scope) + scopes(others) {|items, scope| yield(items, "#{scope.to_s.capitalize} #{type} Summary") } + else + yield(others, "#{type} Summary") + end end def scopes(list) [:class, :instance].each do |scope| items = list.select {|m| m.scope == scope }