Sha256: 3b48750f9f09033f1654d0205e0a512733f8319ef8bb8765d056df422ad745c7

Contents?: true

Size: 756 Bytes

Versions: 3

Compression:

Stored size: 756 Bytes

Contents

module MotionTable
  # @author Silas J Matson
  # 
  # Provides coloring for displaying messages in console when running in the simulator
  class Console
    NAME = "MotionTable::Console"
    DEFAULT_COLOR = [ '', '' ]
    RED_COLOR = [ "\e[0;31m", "\e[0m" ] # Must be in double quotes
    GREEN_COLOR = [ "\e[0;32m", "\e[0m" ] 
    PURPLE_COLOR = [ "\e[0;35m", "\e[0m" ] 

    class << self
      def log(obj, actionNotImplemented:action)
        log " actionNotImplemented -- the action :#{action} is not implemented in #{obj.class.to_s}", withColor: RED_COLOR
      end

      def log(log, withColor:color)
        puts color[0] + NAME + log + color[1]
      end

      def log(log)
        log(log, withColor: DEFAULT_COLOR)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-table-0.1.7 lib/motion-table/console.rb
motion-table-0.1.6 lib/motion-table/console.rb
motion-table-0.1.5 lib/motion-table/console.rb