Class: Licensee::CopyrightMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/licensee/matchers/copyright_matcher.rb

Constant Summary collapse

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

Instance Attribute Summary

Attributes inherited from Matcher

#file

Instance Method Summary collapse

Methods inherited from Matcher

#initialize, match

Constructor Details

This class inherits a constructor from Licensee::Matcher

Instance Method Details

#confidenceObject



12
13
14
# File 'lib/licensee/matchers/copyright_matcher.rb', line 12

def confidence
  100
end

#matchObject



6
7
8
9
10
# File 'lib/licensee/matchers/copyright_matcher.rb', line 6

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