Sha256: ca27bc00512c4e5daddab997499f6e2387fe75cc266aa6841b05e43dbd2e2c5c
Contents?: true
Size: 630 Bytes
Versions: 2
Compression:
Stored size: 630 Bytes
Contents
# frozen_string_literal: true module Licensee module Matchers class Copyright < Licensee::Matchers::Matcher attr_reader :file COPYRIGHT_SYMBOLS = Regexp.union([/copyright/i, /\(c\)/i, "\u00A9", "\xC2\xA9"]) REGEX = /#{ContentHelper::START_REGEX}(?:portions )?([_*\-\s]*#{COPYRIGHT_SYMBOLS}.*$)+$/i.freeze def match # 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 100 end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
licensee-9.15.1 | lib/licensee/matchers/copyright.rb |
licensee-9.15.0 | lib/licensee/matchers/copyright.rb |