Sha256: 14b4413df643a04a8b4dc0f282da2b84e2ac2d30eea558c40582a571546d7ffe
Contents?: true
Size: 639 Bytes
Versions: 15
Compression:
Stored size: 639 Bytes
Contents
class Licensee class GitMatcher < Matcher def match match_info[0] unless match_info.nil? end def confidence match_info[1] unless match_info.nil? end private def matches @matches ||= Licensee.licenses.map { |l| [l, similarity(l)] }.select { |l,sim| sim > 0 } end def similarity(other) file.blob.similarity(other.hashsig) end # Pulled out for easier testing def match_info @match_info ||= begin match = matches.max_by { |license, similarity| similarity } match if match && match[1] > Licensee::CONFIDENCE_THRESHOLD end end end end
Version data entries
15 entries across 15 versions & 1 rubygems