Sha256: f3c2e8239f3aa3994b84c68b41bdb08255d4b267723bbb27381c013e82cf60e0

Contents?: true

Size: 509 Bytes

Versions: 11

Compression:

Stored size: 509 Bytes

Contents

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

      private

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

Version data entries

11 entries across 11 versions & 1 rubygems

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