Sha256: ba0d1de6effba5b35452a6acf92fc59e12e0f2057b2bfe86b3145745a38ef5f8

Contents?: true

Size: 518 Bytes

Versions: 8

Compression:

Stored size: 518 Bytes

Contents

module Licensee
  module Matchers
    class DistZilla < Package
      attr_reader :file

      LICENSE_REGEX = /^license\s*=\s*([a-z\-0-9\._]+)/i

      private

      def license_property
        match = file.content.match LICENSE_REGEX
        spdx_name(match[1]).downcase if match && match[1]
      end

      def spdx_name(perl_name)
        perl_name.sub('_', '-')
                 .sub('_', '.')
                 .sub('Mozilla', 'MPL')
                 .sub(/^GPL-(\d)$/, 'GPL-\1.0')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
licensee-8.9.2 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.9.0 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.8.5 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.8.4 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.8.3 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.8.2 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.8.1 lib/licensee/matchers/dist_zilla_matcher.rb
licensee-8.8.0 lib/licensee/matchers/dist_zilla_matcher.rb