class Licensee::Matchers::Copyright

Constants

REGEX

Public Class Methods

new(file) click to toggle source
# File lib/licensee/matchers/copyright_matcher.rb, line 6
def initialize(file)
  @file = file
end

Public Instance Methods

confidence() click to toggle source
# File lib/licensee/matchers/copyright_matcher.rb, line 19
def confidence
  100
end
match() click to toggle source
# File lib/licensee/matchers/copyright_matcher.rb, line 10
def match
  # Note: must use content, and not content_normalized here
  if @file.content.strip =~ /\A#{REGEX}\z/i
    Licensee::License.find('no-license')
  end
rescue
  nil
end