Sha256: 8b3ceeb193978ee6d8e9116f70a9681b492cd48baa16db323a30071f6eb9a091

Contents?: true

Size: 372 Bytes

Versions: 3

Compression:

Stored size: 372 Bytes

Contents

# encoding=utf-8
class Licensee
  class CopyrightMatcher < Matcher

    REGEX = /\ACopyright (©|\(c\)|\xC2\xA9)? ?\d{4}.*?\n?\z/i

    def match
      no_license if file.content.strip =~ REGEX
    rescue
      nil
    end

    def confidence
      100
    end

    private

    def no_license
      @no_license ||= Licensee::Licenses.find("no-license")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
licensee-4.9.0 lib/licensee/matchers/copyright_matcher.rb
licensee-4.8.0 lib/licensee/matchers/copyright_matcher.rb
licensee-4.7.4 lib/licensee/matchers/copyright_matcher.rb