Sha256: 6df5286a94e34f5ea8406e87d257ad4e37b125af57edf17316a26dd5cda10d7a
Contents?: true
Size: 490 Bytes
Versions: 3
Compression:
Stored size: 490 Bytes
Contents
class Licensee module ContentHelper def normalize_content(content) return unless content content = content.downcase content = content.gsub(/\A[[:space:]]+/, '') content = content.gsub(/[[:space:]]+\z/, '') content = content.gsub(/^#{CopyrightMatcher::REGEX}$/i, '') content = content.gsub(/[[:space:]]+/, ' ') content = content.gsub("\u0000", '') # Remove null byte which breaks Levenshtein content.squeeze(' ').strip end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
licensee-5.0.0 | lib/licensee/content_helper.rb |
licensee-5.0.0b7 | lib/licensee/content_helper.rb |
licensee-5.0.0b6 | lib/licensee/content_helper.rb |