Sha256: 67cfd7152be2e87b4325820354e81bcfa491b2edd7f9eaddc389125a52c9c968

Contents?: true

Size: 496 Bytes

Versions: 8

Compression:

Stored size: 496 Bytes

Contents

class Licensee
  class GemspecMatcher < PackageMatcher

    # We definitely don't want to be evaling arbitrary Gemspec files
    # While not 100% accurate, use some lenient regex to try to grep the
    # license declaration from the Gemspec as a string, if any
    LICENSE_REGEX = /^\s*[a-z0-9_]+\.license\s*\=\s*[\'\"]([a-z\-0-9\.]+)[\'\"]\s*$/i

    private

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
licensee-5.0.0 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b7 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b6 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b5 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b4 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b3 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b2 lib/licensee/matchers/gemspec_matcher.rb
licensee-5.0.0b1 lib/licensee/matchers/gemspec_matcher.rb