lib/licensee/matchers/copyright.rb in licensee-9.14.1 vs lib/licensee/matchers/copyright.rb in licensee-9.15.0
- old
+ new
@@ -3,19 +3,14 @@
module Licensee
module Matchers
class Copyright < Licensee::Matchers::Matcher
attr_reader :file
- # rubocop:disable Layout/LineLength
COPYRIGHT_SYMBOLS = Regexp.union([/copyright/i, /\(c\)/i, "\u00A9", "\xC2\xA9"])
REGEX = /#{ContentHelper::START_REGEX}(?:portions )?([_*\-\s]*#{COPYRIGHT_SYMBOLS}.*$)+$/i.freeze
- # rubocop:enable Layout/LineLength
-
def match
- # Note: must use content, and not content_normalized here
- if file.content.strip =~ /#{REGEX}+\z/i
- Licensee::License.find('no-license')
- end
+ # NOTE: must use content, and not content_normalized here
+ Licensee::License.find('no-license') if /#{REGEX}+\z/io.match?(file.content.strip)
rescue Encoding::CompatibilityError
nil
end
def confidence