Sha256: 0fae6009823b9660b13b5f0eb79e9ef4301df94f3f06aec857e8ad275fbc510d

Contents?: true

Size: 458 Bytes

Versions: 12

Compression:

Stored size: 458 Bytes

Contents

module Licensee
  module Matchers
    # Matches README files that include a license by reference
    class Reference < Licensee::Matchers::Matcher
      def match
        License.all(hidden: true, psuedo: false).find do |license|
          title_or_source = [license.title_regex, license.source_regex].compact
          /\b#{Regexp.union(title_or_source)}\b/ =~ file.content
        end
      end

      def confidence
        90
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
licensee-9.10.1 lib/licensee/matchers/reference.rb
licensee-9.10.0 lib/licensee/matchers/reference.rb
licensee-9.9.4 lib/licensee/matchers/reference.rb
licensee-9.9.3 lib/licensee/matchers/reference.rb
licensee-9.9.2 lib/licensee/matchers/reference.rb
licensee-9.9.1 lib/licensee/matchers/reference.rb
licensee-9.9.0 lib/licensee/matchers/reference.rb
licensee-9.9.0.beta.3 lib/licensee/matchers/reference.rb
licensee-9.9.0.beta.2 lib/licensee/matchers/reference.rb
licensee-9.8.0 lib/licensee/matchers/reference.rb
licensee-9.7.0 lib/licensee/matchers/reference.rb
licensee-9.6.0 lib/licensee/matchers/reference.rb