anchor copyright regex to start of file

This commit is contained in:
Ben Balter 2017-02-23 14:42:57 -05:00
parent 1ac12a180a
commit 2202ad4f46
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ module Licensee
# rubocop:disable Metrics/LineLength
COPYRIGHT_SYMBOLS = Regexp.union([/copyright/i, /\(c\)/i, "\u00A9", "\xC2\xA9"])
REGEX = /^\s*#{COPYRIGHT_SYMBOLS}.*$/i
REGEX = /\A\s*#{COPYRIGHT_SYMBOLS}.*$/i
# rubocop:enable Metrics/LineLength
def initialize(file)

View File

@ -41,7 +41,7 @@ module Licensee
def attribution
@attribution ||= begin
matches = /\A#{Matchers::Copyright::REGEX}$/i
matches = Matchers::Copyright::REGEX
.match(content_without_title_and_version)
matches[0] if matches
end