Sha256: 9e97768e07742c6ee37019fa51d653404696e23aacf451da7b5d8a3d8acec49a

Contents?: true

Size: 547 Bytes

Versions: 5

Compression:

Stored size: 547 Bytes

Contents

# frozen_string_literal: true

module Licensee
  module Matchers
    class NpmBower < Licensee::Matchers::Package
      # While we could parse the package.json or bower.json file, prefer
      # a lenient regex for speed and security. Moar parsing moar problems.
      LICENSE_REGEX = /
        \s*[\"\']license[\"\']\s*\:\s*[\'\"]([a-z\-0-9\.+ ()]+)[\'\"],?\s*
      /ix.freeze

      private

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
licensee-9.14.0 lib/licensee/matchers/npm_bower.rb
licensee-9.13.2 lib/licensee/matchers/npm_bower.rb
licensee-9.13.1 lib/licensee/matchers/npm_bower.rb
licensee-9.13.0 lib/licensee/matchers/npm_bower.rb
licensee-9.12.0 lib/licensee/matchers/npm_bower.rb