class Autoproj::Stats::Sanitizer

Class passed to the stats generators to sanitize names and compute copyright

Attributes

aliases[R]
licenses[R]
simple_copyrights[R]
timeline_affiliations[R]

Public Class Methods

new(aliases: Hash.new) click to toggle source
# File lib/autoproj/stats/sanitizer.rb, line 11
def initialize(aliases: Hash.new)
    @simple_copyrights = Hash.new
    @timeline_affiliations = Hash.new
    @aliases = aliases
end

Public Instance Methods

license_of(pkg) click to toggle source
# File lib/autoproj/stats/sanitizer.rb, line 32
def license_of(pkg)
    licenses[pkg.name]
end
load(path) click to toggle source
# File lib/autoproj/stats/sanitizer.rb, line 17
def load(path)
    config = YAML.load(File.read(path))
    @aliases = config['aliases']
    @licenses = config['licenses'] || Hash.new
    if affiliations = config['affiliations']
        affiliations.each do |name, entry|
            if entry.respond_to?(:to_str)
                simple_copyrights[name] = entry
            else
                timeline_affiliations[name] = entry.sort_by(&:last)
            end
        end
    end
end
sanitize_author_name(name) click to toggle source
# File lib/autoproj/stats/sanitizer.rb, line 36
def sanitize_author_name(name)
    aliases[name] || name
end