Sha256: 33fc814729ee78d30b2f1aa2a3470deff36697dac6ac002b1b20ef0952de90d7
Contents?: true
Size: 659 Bytes
Versions: 10
Compression:
Stored size: 659 Bytes
Contents
class LicenseFinder::License::MIT < LicenseFinder::License::Base self.license_url = "http://opensource.org/licenses/mit-license" self.alternative_names = ["Expat", "MIT license", "MIT License"] HEADER_REGEX = /The MIT Licen[sc]e/ ONE_LINER_REGEX = /is released under the MIT licen[sc]e/ URL_REGEX = %r{MIT Licen[sc]e.*http://(?:www.)?opensource.org/licenses/mit-license} def matches? super || matches_url? || matches_header? end private def matches_url? !!(text =~ URL_REGEX) end def matches_header? header = text.split("\n").first header && ((header.strip =~ HEADER_REGEX) || !!(text =~ ONE_LINER_REGEX)) end end
Version data entries
10 entries across 10 versions & 1 rubygems