class Licensee::Project::LicenseFile
Public Class Methods
name_score(filename)
click to toggle source
# File lib/licensee/project_files/license_file.rb, line 15 def self.name_score(filename) return 1.0 if filename =~ /\A(un)?licen[sc]e\z/i return 0.9 if filename =~ /\A(un)?licen[sc]e\.(md|markdown|txt)\z/i return 0.8 if filename =~ /\Acopy(ing|right)(\.[^.]+)?\z/i return 0.7 if filename =~ /\A(un)?licen[sc]e\.[^.]+\z/i return 0.5 if filename =~ /licen[sc]e/i 0.0 end
Public Instance Methods
attribution()
click to toggle source
# File lib/licensee/project_files/license_file.rb, line 10 def attribution matches = /^#{Matchers::Copyright::REGEX}$/i.match(content) matches[0].strip if matches end
possible_matchers()
click to toggle source
# File lib/licensee/project_files/license_file.rb, line 6 def possible_matchers [Matchers::Copyright, Matchers::Exact, Matchers::Dice] end