Class: GemXray::LicenseMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/gemxray/license_matcher.rb

Constant Summary collapse

NOISE_WORDS =
%w[the license version v].freeze

Instance Method Summary collapse

Instance Method Details

#match?(license, allowed_list) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
# File 'lib/gemxray/license_matcher.rb', line 7

def match?(license, allowed_list)
  return false if allowed_list.empty?

  allowed_list.any? do |allowed|
    exact_match?(license, allowed) || fingerprint_match?(license, allowed)
  end
end