Sha256: 277dfe3501111f9ee4ff179d19e032dcb079fefcce5295623bb107ce7735505d

Contents?: true

Size: 505 Bytes

Versions: 10

Compression:

Stored size: 505 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

10 entries across 10 versions & 1 rubygems

Version Path
licensee-9.6.0 lib/licensee/matchers/npm_bower.rb
licensee-9.5.0 lib/licensee/matchers/npm_bower.rb
licensee-9.4.0 lib/licensee/matchers/npm_bower.rb
licensee-9.3.1 lib/licensee/matchers/npm_bower.rb
licensee-9.3.0 lib/licensee/matchers/npm_bower.rb
licensee-9.2.1 lib/licensee/matchers/npm_bower.rb
licensee-9.2.0 lib/licensee/matchers/npm_bower.rb
licensee-9.1.0 lib/licensee/matchers/npm_bower.rb
licensee-9.0.0 lib/licensee/matchers/npm_bower.rb
licensee-9.0.0.beta.1 lib/licensee/matchers/npm_bower.rb