Sha256: c2c2130dc308cdfd04fd450921165bcd9bded339f499e598af2d69bfbb368742
Contents?: true
Size: 455 Bytes
Versions: 16
Compression:
Stored size: 455 Bytes
Contents
# frozen_string_literal: true module LicenseFinder class License module Text SPACES = /\s+/.freeze QUOTES = /['`"]{1,2}/.freeze PLACEHOLDERS = /<[^<>]+>/.freeze 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
16 entries across 16 versions & 1 rubygems