Sha256: 033bf195a302931ba2c1544a1d4577405fe87ba7c2bc69574bc25d6da653d64f
Contents?: true
Size: 567 Bytes
Versions: 10
Compression:
Stored size: 567 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, file.similarity(l)] }.select { |l,sim| sim > 0 } 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
10 entries across 10 versions & 1 rubygems