Sha256: 4e1a3f28b626db9345492e9b42c447abb2cd19d101e8b6b076a37eefcf74596e
Contents?: true
Size: 552 Bytes
Versions: 9
Compression:
Stored size: 552 Bytes
Contents
module Licensee class Project class Readme < LicenseFile SCORES = { /\AREADME\z/i => 1.0, /\AREADME\.(md|markdown|txt)\z/i => 0.9 }.freeze CONTENT_REGEX = /^#+ Licen[sc]e$(.*?)(?=#+|\z)/im def self.name_score(filename) SCORES.each do |pattern, score| return score if pattern =~ filename end 0.0 end def self.license_content(content) match = CONTENT_REGEX.match(content) match[1].strip if match end end end end
Version data entries
9 entries across 9 versions & 1 rubygems