natty-ui 0.9.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/natty-ui/ansi_wrapper.rb +19 -16
- data/lib/natty-ui/line_animation/default.rb +1 -0
- data/lib/natty-ui/line_animation/matrix.rb +1 -0
- data/lib/natty-ui/line_animation/rainbow.rb +1 -0
- data/lib/natty-ui/line_animation/type_writer.rb +1 -0
- data/lib/natty-ui/line_animation.rb +1 -0
- data/lib/natty-ui/text.rb +92 -75
- data/lib/natty-ui/version.rb +1 -1
- data/lib/natty-ui/wrapper/ask.rb +1 -1
- data/lib/natty-ui/wrapper/framed.rb +6 -26
- data/lib/natty-ui/wrapper/message.rb +1 -1
- data/lib/natty-ui/wrapper/request.rb +1 -1
- data/lib/natty-ui/wrapper/table.rb +4 -1
- data/lib/natty-ui/wrapper.rb +20 -40
- data/lib/natty-ui.rb +60 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e92abc0c7952b3470af1cee08261712ecf8468b05944dd3967c46ee95c040806
|
4
|
+
data.tar.gz: a1b277e69f56f58c5dc1668565cc4cf763f17c5242d42d1f79b4590c432cb8da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47aa3f7076379258e10a78592ca2375146c15850f234f2f69085ef41e88a168855bcd8e19fa1d21c09aad0917e872d3fd2d1941b2dc10bb0e74aa17e47ee1608
|
7
|
+
data.tar.gz: 79e91c8b88e746064393df5b1d46f355184983ce9ff821f786a9452c99f5b5c40d2980226ff055e6fe8a51e18d18617a78a35535d514cf8d7cd1234dca098ce1
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Here you find elegant, simple and beautiful tools that enhance your command line
|
|
13
13
|
You can simply decorate your text with named ANSI attributes and colors
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
ui.puts
|
16
|
+
ui.puts '[[bold underline]]Hello [[ff7bfd]]World[[/]]!'
|
17
17
|
```
|
18
18
|
|
19
19
|
or use different types of messages
|
@@ -26,7 +26,7 @@ module NattyUI
|
|
26
26
|
mw = kwargs[:max_width]
|
27
27
|
unless mw
|
28
28
|
mw = screen_columns - prefix_width
|
29
|
-
mw -= kwargs[:suffix_width] || Text.(suffix) if suffix
|
29
|
+
mw -= kwargs[:suffix_width] || Text.width(suffix) if suffix
|
30
30
|
end
|
31
31
|
kwargs[:max_width] = mw
|
32
32
|
|
@@ -34,10 +34,7 @@ module NattyUI
|
|
34
34
|
animation = LineAnimation[animation].new(@stream, kwargs)
|
35
35
|
prefix = "#{Ansi::RESET}#{Ansi::CLL}#{prefix}"
|
36
36
|
|
37
|
-
Text.
|
38
|
-
args.map! { Text.embellish(Ansi.blemish(_1)) },
|
39
|
-
mw
|
40
|
-
) do |line|
|
37
|
+
Text.each_embellished_line(args.map! { Ansi.blemish(_1) }, mw) do |line|
|
41
38
|
@stream << prefix
|
42
39
|
animation.print(line)
|
43
40
|
(@stream << "#{prefix}#{line}#{suffix}\n").flush
|
@@ -68,10 +65,17 @@ module NattyUI
|
|
68
65
|
|
69
66
|
protected
|
70
67
|
|
71
|
-
def
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
def pprint(args, kwargs)
|
69
|
+
prefix = kwargs[:prefix] and prefix = Text.embellish(prefix)
|
70
|
+
suffix = kwargs[:suffix] and suffix = Text.embellish(suffix)
|
71
|
+
return yield("#{prefix}#{suffix}") if args.empty?
|
72
|
+
Text.each_embellished_line(
|
73
|
+
args,
|
74
|
+
kwargs.fetch(:max_width) do
|
75
|
+
screen_columns - kwargs.fetch(:prefix_width) { Text.width(prefix) } -
|
76
|
+
kwargs.fetch(:suffix_width) { Text.width(suffix) }
|
77
|
+
end
|
78
|
+
) { yield("#{prefix}#{_1}#{suffix}") }
|
75
79
|
end
|
76
80
|
|
77
81
|
def temp_func
|
@@ -158,12 +162,12 @@ module NattyUI
|
|
158
162
|
class Framed < Framed
|
159
163
|
def color(str) = "#{Ansi[39]}#{str}#{Ansi::RESET}"
|
160
164
|
|
161
|
-
def init(
|
162
|
-
@prefix = "#{color(
|
163
|
-
@suffix = "#{Ansi.cursor_column(parent.rcol)}#{color(
|
165
|
+
def init(type)
|
166
|
+
@prefix = "#{color(type[0])} "
|
167
|
+
@suffix = "#{Ansi.cursor_column(parent.rcol)}#{color(type[4])}"
|
164
168
|
aw = @parent.available_width - 2
|
165
|
-
parent.puts(color("#{
|
166
|
-
@finish = color("#{
|
169
|
+
parent.puts(color("#{type[1]}#{type[2] * aw}#{type[3]}"))
|
170
|
+
@finish = color("#{type[5]}#{type[6] * aw}#{type[7]}")
|
167
171
|
end
|
168
172
|
end
|
169
173
|
|
@@ -171,9 +175,8 @@ module NattyUI
|
|
171
175
|
protected
|
172
176
|
|
173
177
|
def initialize(parent, title:, glyph:)
|
174
|
-
wrapper = parent.wrapper
|
175
178
|
color = COLORS[glyph] || COLORS[:default]
|
176
|
-
glyph =
|
179
|
+
glyph = NattyUI.glyph(glyph) || glyph
|
177
180
|
prefix_width = Text.width(glyph) + 1
|
178
181
|
parent.puts(
|
179
182
|
title,
|
data/lib/natty-ui/text.rb
CHANGED
@@ -68,99 +68,115 @@ module NattyUI
|
|
68
68
|
nil
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def each_plain_line(strs, max_width)
|
72
72
|
return if (max_width = max_width.to_i) <= 0
|
73
73
|
strs.each do |str|
|
74
|
-
str
|
75
|
-
.
|
76
|
-
.
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
next seq << csi
|
92
|
-
end
|
93
|
-
next current << gc if in_zero_width
|
94
|
-
cw = char_width(gc)
|
95
|
-
if (width += cw) > max_width
|
96
|
-
yield(current)
|
97
|
-
width = cw
|
98
|
-
current = seq.dup
|
99
|
-
end
|
100
|
-
current << gc
|
74
|
+
plain_but_ansi(str).each_line(chomp: true) do |line|
|
75
|
+
next yield(line, 0) if line.empty?
|
76
|
+
empty = String.new(encoding: line.encoding)
|
77
|
+
current = empty.dup
|
78
|
+
width = 0
|
79
|
+
in_zero_width = false
|
80
|
+
line = line.encode(UTF_8) if line.encoding != UTF_8
|
81
|
+
line.scan(WIDTH_SCANNER) do |np_start, np_end, csi, osc, gc|
|
82
|
+
next in_zero_width = (current << "\1") if np_start
|
83
|
+
next in_zero_width = !(current << "\2") if np_end
|
84
|
+
next if osc || csi
|
85
|
+
next current << gc if in_zero_width
|
86
|
+
cw = char_width(gc)
|
87
|
+
if (width += cw) > max_width
|
88
|
+
yield(current, width - cw)
|
89
|
+
width = cw
|
90
|
+
current = empty.dup
|
101
91
|
end
|
102
|
-
|
92
|
+
current << gc
|
103
93
|
end
|
94
|
+
yield(current, width)
|
95
|
+
end
|
104
96
|
end
|
105
97
|
nil
|
106
98
|
end
|
107
99
|
|
108
|
-
def
|
100
|
+
def first_plain_line(str, max_width)
|
109
101
|
return if (max_width = max_width.to_i) <= 0
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
next if in_zero_width
|
127
|
-
next seq.clear if csi == "\e[m" || csi == "\e[0m"
|
128
|
-
next seq << csi
|
129
|
-
end
|
130
|
-
next current << gc if in_zero_width
|
131
|
-
cw = char_width(gc)
|
132
|
-
if (width += cw) > max_width
|
133
|
-
yield(current, width - cw)
|
134
|
-
width = cw
|
135
|
-
current = seq.dup
|
136
|
-
end
|
137
|
-
current << gc
|
138
|
-
end
|
139
|
-
yield(current, width)
|
140
|
-
end
|
102
|
+
plain_but_ansi(str).each_line(chomp: true) do |line|
|
103
|
+
return line, 0 if line.empty?
|
104
|
+
current = String.new(encoding: line.encoding)
|
105
|
+
width = 0
|
106
|
+
in_zero_width = false
|
107
|
+
line = line.encode(UTF_8) if line.encoding != UTF_8
|
108
|
+
line.scan(WIDTH_SCANNER) do |np_start, np_end, csi, osc, gc|
|
109
|
+
next in_zero_width = (current << "\1") if np_start
|
110
|
+
next in_zero_width = !(current << "\2") if np_end
|
111
|
+
next if osc || csi
|
112
|
+
next current << gc if in_zero_width
|
113
|
+
cw = char_width(gc)
|
114
|
+
return current, width - cw if (width += cw) > max_width
|
115
|
+
current << gc
|
116
|
+
end
|
117
|
+
return current, width
|
141
118
|
end
|
142
|
-
|
119
|
+
[+'', 0]
|
143
120
|
end
|
144
121
|
|
145
|
-
def
|
122
|
+
def as_plain_lines(strs, width, height)
|
146
123
|
ret = []
|
147
|
-
|
124
|
+
each_plain_line(strs, width) do |*info|
|
125
|
+
ret << info
|
126
|
+
break if ret.size == height
|
127
|
+
end
|
148
128
|
ret
|
149
129
|
end
|
150
130
|
|
151
|
-
def
|
152
|
-
|
153
|
-
|
154
|
-
|
131
|
+
def each_embellished_line(strs, max_width)
|
132
|
+
return if (max_width = max_width.to_i) <= 0
|
133
|
+
simple_each_line(strs) do |line|
|
134
|
+
line = embellish(line)
|
135
|
+
next yield(line, 0) if line.empty?
|
136
|
+
current = String.new(encoding: line.encoding)
|
137
|
+
seq = current.dup
|
138
|
+
width = 0
|
139
|
+
in_zero_width = false
|
140
|
+
line = line.encode(UTF_8) if line.encoding != UTF_8
|
141
|
+
line.scan(WIDTH_SCANNER) do |np_start, np_end, csi, osc, gc|
|
142
|
+
next in_zero_width = (current << "\1") if np_start
|
143
|
+
next in_zero_width = !(current << "\2") if np_end
|
144
|
+
next (current << osc) && (seq << osc) if osc
|
145
|
+
if csi
|
146
|
+
current << csi
|
147
|
+
next if in_zero_width
|
148
|
+
next seq.clear if csi == "\e[m" || csi == "\e[0m"
|
149
|
+
next seq << csi
|
150
|
+
end
|
151
|
+
next current << gc if in_zero_width
|
152
|
+
cw = char_width(gc)
|
153
|
+
if (width += cw) > max_width
|
154
|
+
yield(current, width - cw)
|
155
|
+
width = cw
|
156
|
+
current = seq.dup
|
157
|
+
end
|
158
|
+
current << gc
|
159
|
+
end
|
160
|
+
yield(current, width)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
def as_embellished_lines(strs, width, height = nil)
|
155
165
|
ret = []
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
kwargs.fetch(:prefix_width) { width(prefix) } -
|
161
|
-
kwargs.fetch(:suffix_width) { width(suffix) }
|
166
|
+
if height
|
167
|
+
each_embellished_line(strs, width) do |*info|
|
168
|
+
ret << info
|
169
|
+
break if ret.size == height
|
162
170
|
end
|
163
|
-
|
171
|
+
else
|
172
|
+
each_embellished_line(strs, width) { |*info| ret << info }
|
173
|
+
end
|
174
|
+
ret
|
175
|
+
end
|
176
|
+
|
177
|
+
def as_embellished_lines_min(strs, width)
|
178
|
+
ret = []
|
179
|
+
each_embellished_line(strs, width) { ret << _1 }
|
164
180
|
ret
|
165
181
|
end
|
166
182
|
end
|
@@ -205,6 +221,7 @@ module NattyUI
|
|
205
221
|
}.compare_by_identity.freeze
|
206
222
|
|
207
223
|
autoload(:EastAsianWidth, File.join(__dir__, 'text', 'east_asian_width'))
|
224
|
+
private_constant :EastAsianWidth
|
208
225
|
|
209
226
|
@ambiguous_char_width = 1
|
210
227
|
end
|
data/lib/natty-ui/version.rb
CHANGED
data/lib/natty-ui/wrapper/ask.rb
CHANGED
@@ -16,7 +16,7 @@ module NattyUI
|
|
16
16
|
# @return [Object] the result of the code block
|
17
17
|
# @return [Wrapper::Framed] itself, when no code block is given
|
18
18
|
def framed(*args, type: :rounded, &block)
|
19
|
-
_section(:Framed, args, type: type, &block)
|
19
|
+
_section(:Framed, args, type: NattyUI.frame(type), &block)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -29,37 +29,17 @@ module NattyUI
|
|
29
29
|
protected
|
30
30
|
|
31
31
|
def initialize(parent, type:)
|
32
|
-
|
33
|
-
|
34
|
-
init(deco)
|
32
|
+
super(parent, prefix: "#{type[0]} ", prefix_width: 2, suffix_width: 2)
|
33
|
+
init(type)
|
35
34
|
end
|
36
35
|
|
37
|
-
def
|
38
|
-
if type.is_a?(Symbol)
|
39
|
-
ret = DECO[type] and return ret
|
40
|
-
elsif type.is_a?(String)
|
41
|
-
return type if type.size == 8
|
42
|
-
return type * 8 if type.size == 1
|
43
|
-
end
|
44
|
-
raise(ArgumentError, "invalid frame type - #{type.inspect}")
|
45
|
-
end
|
46
|
-
|
47
|
-
def init(deco)
|
36
|
+
def init(type)
|
48
37
|
aw = @parent.available_width - 1
|
49
|
-
parent.puts("#{
|
50
|
-
@finish = "#{
|
38
|
+
parent.puts("#{type[1]}#{type[2] * aw}")
|
39
|
+
@finish = "#{type[5]}#{type[6] * aw}"
|
51
40
|
end
|
52
41
|
|
53
42
|
def finish = @parent.puts(@finish)
|
54
|
-
|
55
|
-
DECO = {
|
56
|
-
rounded: '│╭─╮│╰─╯',
|
57
|
-
simple: '│┌─┐│└─┘',
|
58
|
-
heavy: '┃┏━┓┃┗━┛',
|
59
|
-
double: '║╔═╗║╚═╝',
|
60
|
-
semi: '│╒═╕│╘═╛',
|
61
|
-
block: '▌▛▀▜▐▙▄▟'
|
62
|
-
}.compare_by_identity.freeze
|
63
43
|
end
|
64
44
|
end
|
65
45
|
end
|
@@ -235,7 +235,10 @@ module NattyUI
|
|
235
235
|
diff.each do |col_idx|
|
236
236
|
adjust_to = adjusted[col_idx]
|
237
237
|
next if matrix[row_idx][col_idx] <= adjust_to
|
238
|
-
row[col_idx] = Text.
|
238
|
+
row[col_idx] = Text.as_embellished_lines_min(
|
239
|
+
row[col_idx],
|
240
|
+
adjust_to
|
241
|
+
)
|
239
242
|
end
|
240
243
|
end
|
241
244
|
adjusted
|
data/lib/natty-ui/wrapper.rb
CHANGED
@@ -51,8 +51,10 @@ module NattyUI
|
|
51
51
|
# @param [#to_s] ... objects to print
|
52
52
|
# @return [Wrapper] itself
|
53
53
|
def puts(*args, **kwargs)
|
54
|
-
|
55
|
-
|
54
|
+
pprint(args, kwargs) do |line|
|
55
|
+
@stream.puts(line)
|
56
|
+
@lines_written += 1
|
57
|
+
end
|
56
58
|
@stream.flush
|
57
59
|
self
|
58
60
|
end
|
@@ -63,8 +65,11 @@ module NattyUI
|
|
63
65
|
# @param [#to_s] ... objects to print
|
64
66
|
# @return [Wrapper] itself
|
65
67
|
def print(*args, **kwargs)
|
66
|
-
|
67
|
-
|
68
|
+
pprint(args, kwargs) do |line|
|
69
|
+
@stream.print(line)
|
70
|
+
@lines_written += 1
|
71
|
+
end
|
72
|
+
@lines_written -= 1
|
68
73
|
@stream.flush
|
69
74
|
self
|
70
75
|
end
|
@@ -152,21 +157,19 @@ module NattyUI
|
|
152
157
|
# @!visibility private
|
153
158
|
def prefix = nil
|
154
159
|
|
155
|
-
# @return [Array<Symbol>] available glyph names
|
156
|
-
def glyph_names = GLYPHS.keys
|
157
|
-
|
158
|
-
#
|
159
|
-
# Get a pre-defined glyph
|
160
|
-
#
|
161
|
-
# @param [Symbol] name glyph name
|
162
|
-
# @return [String] the named glyph
|
163
|
-
# @return [nil] when glyph is not defined
|
164
|
-
def glyph(name) = GLYPHS[name]
|
165
|
-
|
166
160
|
protected
|
167
161
|
|
168
|
-
def
|
169
|
-
|
162
|
+
def pprint(args, kwargs)
|
163
|
+
prefix = kwargs[:prefix] and prefix = Text.plain(prefix)
|
164
|
+
suffix = kwargs[:suffix] and suffix = Text.plain(suffix)
|
165
|
+
return yield("#{prefix}#{suffix}") if args.empty?
|
166
|
+
Text.each_plain_line(
|
167
|
+
args,
|
168
|
+
kwargs.fetch(:max_width) do
|
169
|
+
screen_columns - kwargs.fetch(:prefix_width) { Text.width(prefix) } -
|
170
|
+
kwargs.fetch(:suffix_width) { Text.width(suffix) }
|
171
|
+
end
|
172
|
+
) { yield("#{prefix}#{_1}#{suffix}") }
|
170
173
|
end
|
171
174
|
|
172
175
|
def temp_func
|
@@ -206,28 +209,5 @@ module NattyUI
|
|
206
209
|
rescue SystemCallError
|
207
210
|
nil
|
208
211
|
end
|
209
|
-
|
210
|
-
GLYPHS = {
|
211
|
-
default: "#{Ansi[:bold, 255]}•#{Ansi::RESET}",
|
212
|
-
information: "#{Ansi[:bold, 119]}𝒊#{Ansi::RESET}",
|
213
|
-
warning: "#{Ansi[:bold, 221]}!#{Ansi::RESET}",
|
214
|
-
error: "#{Ansi[:bold, 208]}𝙓#{Ansi::RESET}",
|
215
|
-
completed: "#{Ansi[:bold, 82]}✓#{Ansi::RESET}",
|
216
|
-
failed: "#{Ansi[:bold, 196]}𝑭#{Ansi::RESET}",
|
217
|
-
task: "#{Ansi[:bold, 39]}➔#{Ansi::RESET}",
|
218
|
-
query: "#{Ansi[:bold, 39]}▸#{Ansi::RESET}"
|
219
|
-
}.compare_by_identity.freeze
|
220
|
-
|
221
|
-
# GLYPHS = {
|
222
|
-
# default: '●',
|
223
|
-
# information: '🅸 ',
|
224
|
-
# warning: '🆆 ',
|
225
|
-
# error: '🅴 ',
|
226
|
-
# completed: '✓',
|
227
|
-
# failed: '🅵 ',
|
228
|
-
# task: '➔',
|
229
|
-
# query: '🆀 '
|
230
|
-
# }.compare_by_identity.freeze
|
231
|
-
private_constant :GLYPHS
|
232
212
|
end
|
233
213
|
end
|
data/lib/natty-ui.rb
CHANGED
@@ -135,6 +135,34 @@ module NattyUI
|
|
135
135
|
nil
|
136
136
|
end
|
137
137
|
|
138
|
+
# @return [Array<Symbol>] available glyph names
|
139
|
+
def glyph_names = GLYPH.keys
|
140
|
+
|
141
|
+
# Get a pre-defined glyph.
|
142
|
+
#
|
143
|
+
# @param [Symbol] name glyph name
|
144
|
+
# @return [String] the glyph
|
145
|
+
# @return [nil] when glyph is not defined
|
146
|
+
def glyph(name) = GLYPH[name]
|
147
|
+
|
148
|
+
# @return [Array<Symbol>] available frame names
|
149
|
+
def frame_names = FRAME.keys
|
150
|
+
|
151
|
+
# Get a frame definition.
|
152
|
+
#
|
153
|
+
# @param [Symbol] name frame type name
|
154
|
+
# @return [String] the frame definition
|
155
|
+
# @raise [ArgumentError] when an invalid name is specified
|
156
|
+
def frame(name)
|
157
|
+
if name.is_a?(Symbol)
|
158
|
+
ret = FRAME[name] and return ret
|
159
|
+
elsif name.is_a?(String)
|
160
|
+
return name if name.size == 8
|
161
|
+
return name * 8 if name.size == 1
|
162
|
+
end
|
163
|
+
raise(ArgumentError, "invalid frame type - #{name.inspect}")
|
164
|
+
end
|
165
|
+
|
138
166
|
private
|
139
167
|
|
140
168
|
def wrapper_class(stream, ansi)
|
@@ -162,7 +190,38 @@ module NattyUI
|
|
162
190
|
autoload(:LineAnimation, File.join(dir, 'natty-ui', 'line_animation'))
|
163
191
|
autoload(:KEY_MAP, File.join(dir, 'natty-ui', 'key_map'))
|
164
192
|
|
165
|
-
|
193
|
+
GLYPH = {
|
194
|
+
default: "#{Ansi[:bold, 255]}•#{Ansi::RESET}",
|
195
|
+
information: "#{Ansi[:bold, 119]}𝒊#{Ansi::RESET}",
|
196
|
+
warning: "#{Ansi[:bold, 221]}!#{Ansi::RESET}",
|
197
|
+
error: "#{Ansi[:bold, 208]}𝙓#{Ansi::RESET}",
|
198
|
+
completed: "#{Ansi[:bold, 82]}✓#{Ansi::RESET}",
|
199
|
+
failed: "#{Ansi[:bold, 196]}𝑭#{Ansi::RESET}",
|
200
|
+
task: "#{Ansi[:bold, 39]}➔#{Ansi::RESET}",
|
201
|
+
query: "#{Ansi[:bold, 39]}▸#{Ansi::RESET}"
|
202
|
+
}.compare_by_identity.freeze
|
203
|
+
|
204
|
+
# GLYPH = {
|
205
|
+
# default: '●',
|
206
|
+
# information: '🅸 ',
|
207
|
+
# warning: '🆆 ',
|
208
|
+
# error: '🅴 ',
|
209
|
+
# completed: '✓',
|
210
|
+
# failed: '🅵 ',
|
211
|
+
# task: '➔',
|
212
|
+
# query: '🆀 '
|
213
|
+
# }.compare_by_identity.freeze
|
214
|
+
|
215
|
+
FRAME = {
|
216
|
+
rounded: '│╭─╮│╰─╯',
|
217
|
+
simple: '│┌─┐│└─┘',
|
218
|
+
heavy: '┃┏━┓┃┗━┛',
|
219
|
+
double: '║╔═╗║╚═╝',
|
220
|
+
semi: '│╒═╕│╘═╛',
|
221
|
+
block: '▌▛▀▜▐▙▄▟'
|
222
|
+
}.compare_by_identity.freeze
|
223
|
+
|
224
|
+
private_constant :LineAnimation, :KEY_MAP, :GLYPH, :FRAME
|
166
225
|
|
167
226
|
@element = StdOut
|
168
227
|
self.in_stream = STDIN
|