Sha256: a9f29206fb2bfa5e47c274be4a11731860824ee7380f06a90d7e70c799a14c65
Contents?: true
Size: 695 Bytes
Versions: 1
Compression:
Stored size: 695 Bytes
Contents
module Licensee module Matchers class Copyright < Licensee::Matchers::Matcher attr_reader :file # rubocop:disable Metrics/LineLength COPYRIGHT_SYMBOLS = Regexp.union([/copyright/i, /\(c\)/i, "\u00A9", "\xC2\xA9"]) REGEX = /#{ContentHelper::START_REGEX}(?:portions )?(\s*#{COPYRIGHT_SYMBOLS}.*$)+$/i.freeze # rubocop:enable Metrics/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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
licensee-9.11.0 | lib/licensee/matchers/copyright.rb |