class Licensee::Matchers::Cabal

Constants

LICENSE_CONVERSIONS
LICENSE_REGEX

While we could parse the cabal file, prefer a lenient regex for speed and security. Moar parsing moar problems.

Private Instance Methods

license_property() click to toggle source
# File lib/licensee/matchers/cabal.rb, line 20
def license_property
  match = @file.content.match LICENSE_REGEX
  spdx_name(match[1]).downcase if match && match[1]
end
spdx_name(cabal_name) click to toggle source
# File lib/licensee/matchers/cabal.rb, line 25
def spdx_name(cabal_name)
  LICENSE_CONVERSIONS[cabal_name] || cabal_name
end