lib/cli/ui/glyph.rb in cli-ui-1.2.3 vs lib/cli/ui/glyph.rb in cli-ui-1.3.0
- old
+ new
@@ -27,32 +27,26 @@
#
def initialize(handle, codepoint, color)
@handle = handle
@codepoint = codepoint
@color = color
- @char = [codepoint].pack('U')
+ @char = Array(codepoint).pack('U*')
@to_s = color.code + char + Color::RESET.code
@fmt = "{{#{color.name}:#{char}}}"
MAP[handle] = self
end
# Mapping of glyphs to terminal output
MAP = {}
- # YELLOw SMALL STAR (โญ)
- STAR = new('*', 0x2b51, Color::YELLOW)
- # BLUE MATHEMATICAL SCRIPT SMALL i (๐พ)
- INFO = new('i', 0x1d4be, Color::BLUE)
- # BLUE QUESTION MARK (?)
- QUESTION = new('?', 0x003f, Color::BLUE)
- # GREEN CHECK MARK (โ)
- CHECK = new('v', 0x2713, Color::GREEN)
- # RED BALLOT X (โ)
- X = new('x', 0x2717, Color::RED)
- # Bug emoji (๐)
- BUG = new('b', 0x1f41b, Color::WHITE)
- # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (ยป)
- CHEVRON = new('>', 0xbb, Color::YELLOW)
+ STAR = new('*', 0x2b51, Color::YELLOW) # YELLOW SMALL STAR (โญ)
+ INFO = new('i', 0x1d4be, Color::BLUE) # BLUE MATHEMATICAL SCRIPT SMALL i (๐พ)
+ QUESTION = new('?', 0x003f, Color::BLUE) # BLUE QUESTION MARK (?)
+ CHECK = new('v', 0x2713, Color::GREEN) # GREEN CHECK MARK (โ)
+ X = new('x', 0x2717, Color::RED) # RED BALLOT X (โ)
+ BUG = new('b', 0x1f41b, Color::WHITE) # Bug emoji (๐)
+ CHEVRON = new('>', 0xbb, Color::YELLOW) # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (ยป)
+ HOURGLASS = new('H', [0x231b, 0xfe0e], Color::BLUE) # HOURGLASS + VARIATION SELECTOR 15 (โ๏ธ)
# Looks up a glyph by name
#
# ==== Raises
# Raises a InvalidGlyphHandle if the glyph is not available