Sha256: 944cabd5268f35e3635a51b7be96ddbfb99923575063aa4ecf5c6308c87d06c2

Contents?: true

Size: 746 Bytes

Versions: 7

Compression:

Stored size: 746 Bytes

Contents

module Licensee
  class Project
    class LicenseFile < Licensee::Project::File
      include Licensee::ContentHelper

      def possible_matchers
        [Matchers::Copyright, Matchers::Exact, Matchers::Dice]
      end

      def attribution
        matches = /^#{Matchers::Copyright::REGEX}$/i.match(content)
        matches[0].strip if matches
      end

      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
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
licensee-8.3.1 lib/licensee/project_files/license_file.rb
licensee-8.3.0 lib/licensee/project_files/license_file.rb
licensee-8.2.0 lib/licensee/project_files/license_file.rb
licensee-8.1.0 lib/licensee/project_files/license_file.rb
licensee-8.0.0 lib/licensee/project_files/license_file.rb
licensee-7.0.1 lib/licensee/project_files/license_file.rb
licensee-7.0.0 lib/licensee/project_files/license_file.rb