Sha256: 8625282d81b7faadde5a65c82a6b9ef9539e233425cf0b233c76ad95eb6e5e02
Contents?: true
Size: 403 Bytes
Versions: 14
Compression:
Stored size: 403 Bytes
Contents
module LicenseFinder class License module Text SPACES = /\s+/ QUOTES = /['`"]{1,2}/ PLACEHOLDERS = /<[^<>]+>/ def self.normalize_punctuation(text) text.gsub(SPACES, ' ') .gsub(QUOTES, '"') .strip end def self.compile_to_regex(text) Regexp.new(Regexp.escape(text).gsub(PLACEHOLDERS, '(.*)')) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems