module Spellr::StringFormat
Public Instance Methods
aqua(text)
click to toggle source
# File lib/spellr/string_format.rb, line 11 def aqua(text) "\e[36m#{text}#{normal}" end
bold(text)
click to toggle source
# File lib/spellr/string_format.rb, line 19 def bold(text) "\e[1;39m#{text}#{normal}" end
green(text)
click to toggle source
# File lib/spellr/string_format.rb, line 31 def green(text) "\e[1;32m#{text}#{normal}" end
key(label)
click to toggle source
# File lib/spellr/string_format.rb, line 35 def key(label) "[#{bold label[0]}]#{label[1..-1]}" end
lighten(text)
click to toggle source
# File lib/spellr/string_format.rb, line 23 def lighten(text) "\e[2;39m#{text}#{normal}" end
normal(text = '')
click to toggle source
# File lib/spellr/string_format.rb, line 15 def normal(text = '') "\e[0m#{text}" end
pluralize(word, count)
click to toggle source
# File lib/spellr/string_format.rb, line 7 def pluralize(word, count) "#{count} #{word}#{'s' if count != 1}" end
red(text)
click to toggle source
# File lib/spellr/string_format.rb, line 27 def red(text) "\e[1;31m#{text}#{normal}" end