Sha256: 5a844b6fd49b47b3376cf6f15d88c801576ead50055a5201f7125937ac507880
Contents?: true
Size: 634 Bytes
Versions: 18
Compression:
Stored size: 634 Bytes
Contents
module Fontist module Import module TextHelper class << self def cleanup(text) return unless text text.gsub("\r\n", "\n") .gsub("\r", "\n") .strip .lines .map(&:rstrip) .drop_while(&:empty?) .join("\n") end def longest_common_prefix(strs) return if strs.empty? min, max = strs.minmax idx = min.size.times { |i| break i if min[i] != max[i] } prefix = min[0...idx].strip return if prefix.size < 2 prefix end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems