From 57ff1f752e1c6e1720260e91f428afe93959b41a Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Sun, 2 Oct 2016 07:12:11 -0400 Subject: [PATCH] Colorized the output of the frames. --- lib/apex.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/apex.rb b/lib/apex.rb index 358132a..4efb943 100644 --- a/lib/apex.rb +++ b/lib/apex.rb @@ -10,17 +10,20 @@ module Apex frame[:path].each do |path| paths << path.colorize(:cyan) end - paths = ','.join(paths) - if frame['path'] - formatted_aprs = ','.join([formatted_aprs, paths]) + paths = paths.join(',') + if frame[:path] and frame[:path].length > 0 + formatted_aprs = [formatted_aprs, paths].join(',') end formatted_aprs += ':' - formatted_aprs += frame['text'] + formatted_aprs += frame[:text] if direction_in - click.echo(click.style(port_name + ' << ', fg='magenta') + formatted_aprs) + puts (port_name + ' << ').colorize(:magenta) + formatted_aprs else - click.echo(click.style(port_name + ' >> ', fg='magenta', bold=True, blink=True) + formatted_aprs) + # TODO : make this bold and/or blink + puts (port_name + ' >> ').colorize(:magenta) + formatted_aprs end + puts String.modes + puts String.colors end def self.main @@ -31,7 +34,7 @@ module Apex while true frame = aprs_kiss.read if frame - echo_color_frame(frame) + echo_color_frame(frame, true) else sleep(1) end -- GitLab