Sha256: 3b9c477d7828b0fe6c5155cf0a062f70f40f63bc623db0b733f48a14f1ee7516
Contents?: true
Size: 425 Bytes
Versions: 15
Compression:
Stored size: 425 Bytes
Contents
module Doing module Completion module StringUtils def short_desc split(/[,.]/)[0].sub(/ \(.*?\)?$/, '').strip end def ltrunc(max) if length > max sub(/^.*?(.{#{max - 3}})$/, '...\1') else self end end def ltrunc!(max) replace ltrunc(max) end end end end class ::String include Doing::Completion::StringUtils end
Version data entries
15 entries across 15 versions & 1 rubygems