Sha256: 8865851dff63d8a24ef108e5431b36581d187cb54abe11c5d5c8e2c6f1757a81
Contents?: true
Size: 724 Bytes
Versions: 3
Compression:
Stored size: 724 Bytes
Contents
# frozen_string_literal: true 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 rescue Encoding::CompatibilityError nil end def confidence 100 end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
licensee-9.14.0 | lib/licensee/matchers/copyright.rb |
licensee-9.13.2 | lib/licensee/matchers/copyright.rb |
licensee-9.13.1 | lib/licensee/matchers/copyright.rb |