static Set populateTags()

in buildSrc/src/main/groovy/org/grails/guides/TagUtils.groovy [9:22]


    static Set<Tag> populateTags(List<Guide> guides) {
        Map<String, Integer> tagsMap = [:]
        if ( guides ) {
            for ( Guide guide : guides ) {
                if (guide.tags) {
                    for ( String tag : guide.tags ) {
                        String k = tag.trim().toLowerCase()
                        tagsMap[k] = tagsMap.containsKey(k) ? ( 1 + tagsMap[k] ) : 1
                    }
                }
            }
        }
        populateWithTagsMap(tagsMap)
    }