Sha256: 24bba34bc7325d3cc470b1d5c140a50af2e37661d7b5a31c4320f08f9e49b3c4

Contents?: true

Size: 486 Bytes

Versions: 4

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true

module Licensee
  module Matchers
    class Spdx < Licensee::Matchers::Package
      # While we could parse the LICENSE.spdx file, prefer
      # a lenient regex for speed and security. Moar parsing moar problems.
      LICENSE_REGEX = /PackageLicenseDeclared:\s*([a-z\-0-9. +()]+)\s*/i

      private

      def license_property
        match = @file.content.match LICENSE_REGEX
        match[1].downcase if match && match[1]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
licensee-9.18.0 lib/licensee/matchers/spdx.rb
licensee-9.17.1 lib/licensee/matchers/spdx.rb
licensee-9.17.0 lib/licensee/matchers/spdx.rb
licensee-9.16.1 lib/licensee/matchers/spdx.rb