Sha256: 6f15c151bc7fe8c88a55fc1c4777e62faf7027d2d9aaf34cdd0fb99f8c701a7e
Contents?: true
Size: 598 Bytes
Versions: 26
Compression:
Stored size: 598 Bytes
Contents
module Airbrussh # Very basic support for ANSI color, so that we don't have to rely on # any external dependencies. module Colors ANSI_CODES = { :red => 31, :green => 32, :yellow => 33, :blue => 34, :gray => 90 }.freeze # Define red, green, blue, etc. methods that return a copy of the # String that is wrapped in the corresponding ANSI color escape # sequence. ANSI_CODES.each do |name, code| define_method(name) do |string| "\e[0;#{code};49m#{string}\e[0m" end module_function(name) end end end
Version data entries
26 entries across 26 versions & 2 rubygems