Sha256: 5df26a10308bfc73ea039a71448de2363e331f7851b52eec88a62856b7513dad
Contents?: true
Size: 793 Bytes
Versions: 61
Compression:
Stored size: 793 Bytes
Contents
class StringUtil def self.backward_truncate(str) if str.length <= 50 spaces = "" (50-str.length).times{ spaces << " " } return str.dup << spaces else return "..." << str[str.length-50+3..str.length] end end def self.success(str) WebTranslateIt::Util.can_display_colors? ? "\e[32m#{str}\e[0m" : str end def self.failure(str) WebTranslateIt::Util.can_display_colors? ? "\e[31m#{str}\e[0m" : str end def self.checksumify(str) WebTranslateIt::Util.can_display_colors? ? "\e[33m#{str[0..6]}\e[0m" : str[0..6] end def self.titleize(str) WebTranslateIt::Util.can_display_colors? ? "\e[1m#{str}\e[0m\n\n" : str end def self.important(str) WebTranslateIt::Util.can_display_colors? ? "\e[1m#{str}\e[0m" : str end end
Version data entries
61 entries across 61 versions & 1 rubygems