Sha256: 581bcbfb9846c96e220e697f37df2ae291ccb8e716754d41e94b26d520ebfd0b

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 Bytes

Contents

module Licensee
  module Matchers
    class Gemspec < Licensee::Matchers::Package
      DECLARATION_REGEX = /
        ^\s*[a-z0-9_]+\.([a-z0-9_]+)\s*\=\s*[\'\"]([a-z\-0-9\.]+)[\'\"]\s*$
        /ix

      LICENSE_REGEX = /
           ^\s*[a-z0-9_]+\.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

      def declarations
        @declarations ||= @file.content.match DECLARATION_REGEX
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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