Sha256: 7a4a2aa25d67270131b60988737d33516e0f32d883b3786d9f23dbc313b12427
Contents?: true
Size: 723 Bytes
Versions: 1
Compression:
Stored size: 723 Bytes
Contents
module GitFonky class MessageFormatter def message_with_border(**params) border = calculate_border_for(params[:msg], params.delete(:border_char) { "*" }) output_border_and_msg(border: border, **params) end private def calculate_border_for(msg, border_char) border_char * (msg.length + 20) end def output_border_and_msg(border:, msg:, sub_msg: nil, io_stream: STDERR, warn: true) io_stream.puts border io_stream.puts warning_header.center(border.length) if warn io_stream.puts msg.center(border.length) io_stream.puts sub_msg.center(border.length) if sub_msg io_stream.puts border end def warning_header "WARNING" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
git_fonky-0.6.0 | lib/git_fonky/message_formatter.rb |