Module: Typingpool::App::CLI::Formatter

Defined in:
lib/typingpool/app/cli/formatter.rb

Instance Method Summary collapse

Instance Method Details

#cli_bold(text) ⇒ Object



6
7
8
# File 'lib/typingpool/app/cli/formatter.rb', line 6

def cli_bold(text)
  HighLine.color(text, :bold)
end

#cli_encode(text) ⇒ Object



14
15
16
17
18
19
# File 'lib/typingpool/app/cli/formatter.rb', line 14

def cli_encode(text)
  unless (text.encoding.to_s == Encoding.default_external.to_s)
    text.encode!(Encoding.default_external, :invalid => :replace, :undef => :replace, :replace => "?")
  end
  text
end

#cli_reverse(text) ⇒ Object



10
11
12
# File 'lib/typingpool/app/cli/formatter.rb', line 10

def cli_reverse(text)
  HighLine.color(text, :reverse)
end