module Doing::Completion::StringUtils
Public Instance Methods
Source
# File lib/doing/completion/completion_string.rb, line 19 def ltrunc(max) if length > max sub(/^.*?(.{#{max - 3}})$/, '...\1') else self end end
Truncate string from left
@param max The maximum number of characters
Source
# File lib/doing/completion/completion_string.rb, line 27 def ltrunc!(max) replace ltrunc(max) end
Source
# File lib/doing/completion/completion_string.rb, line 10 def short_desc split(/[,.]/)[0].sub(/ \(.*?\)?$/, '').strip end
Get short description for command completion
@return [String] Short description