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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa4b9f0f1b20297ceb096bcdc684ddc419fce1e2f4e9cbe415320f240ae4860a
4
- data.tar.gz: 91de55924ad0098435405f6d1c17bf88efe0310ad9688f6ac1d4485a5c91b5bb
3
+ metadata.gz: e92abc0c7952b3470af1cee08261712ecf8468b05944dd3967c46ee95c040806
4
+ data.tar.gz: a1b277e69f56f58c5dc1668565cc4cf763f17c5242d42d1f79b4590c432cb8da
5
5
  SHA512:
6
- metadata.gz: 651f40f3944c45389331a3f99f987d3cf5b774bd3f0132c94004d169406c6500d12dff9c102f652dd4f47a016b04717a90a42d239fcb2a747f2b5109f002f29c
7
- data.tar.gz: c29b0ac2c9959f6151c7801534f7c1bde4c6f9f42d1f13499f362752557e184f5a1a24561fd2c12b8be133a9478b9570d99c4a34b9d6c53a0f0815d58295434c
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 "[[bold]]Hello [[ff7bfd]]World[[/]]!"
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.each_line(
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 prepare_print(args, kwargs)
72
- Text.prepare_print(args, kwargs, -> { screen_columns }) do |str|
73
- Text.embellish(str)
74
- end
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(deco)
162
- @prefix = "#{color(deco[0])} "
163
- @suffix = "#{Ansi.cursor_column(parent.rcol)}#{color(deco[4])}"
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("#{deco[1]}#{deco[2] * aw}#{deco[3]}"))
166
- @finish = color("#{deco[5]}#{deco[6] * aw}#{deco[7]}")
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 = wrapper.glyph(glyph) || glyph
179
+ glyph = NattyUI.glyph(glyph) || glyph
177
180
  prefix_width = Text.width(glyph) + 1
178
181
  parent.puts(
179
182
  title,
@@ -31,5 +31,6 @@ module NattyUI
31
31
  end
32
32
 
33
33
  define default: Default
34
+ private_constant :Default
34
35
  end
35
36
  end
@@ -24,5 +24,6 @@ module NattyUI
24
24
  end
25
25
 
26
26
  define matrix: Matrix
27
+ private_constant :Matrix
27
28
  end
28
29
  end
@@ -26,5 +26,6 @@ module NattyUI
26
26
  end
27
27
 
28
28
  define rainbow: Rainbow
29
+ private_constant :Rainbow
29
30
  end
30
31
  end
@@ -40,5 +40,6 @@ module NattyUI
40
40
  end
41
41
 
42
42
  define type_writer: TypeWriter
43
+ private_constant :TypeWriter
43
44
  end
44
45
  end
@@ -36,6 +36,7 @@ module NattyUI
36
36
 
37
37
  SPACE = /[[:space:]]/
38
38
  end
39
+ private_constant :None
39
40
 
40
41
  dir = __dir__
41
42
  @defined = {
data/lib/natty-ui/text.rb CHANGED
@@ -68,99 +68,115 @@ module NattyUI
68
68
  nil
69
69
  end
70
70
 
71
- def each_line(strs, max_width)
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
- .to_s
76
- .each_line(chomp: true) do |line|
77
- next yield(line) if line.empty?
78
- current = String.new(encoding: line.encoding)
79
- seq = current.dup
80
- width = 0
81
- in_zero_width = false
82
- line = line.encode(UTF_8) if line.encoding != UTF_8
83
- line.scan(WIDTH_SCANNER) do |np_start, np_end, csi, osc, gc|
84
- next in_zero_width = (current << "\1") if np_start
85
- next in_zero_width = !(current << "\2") if np_end
86
- next (current << osc) && (seq << osc) if osc
87
- if csi
88
- current << csi
89
- next if in_zero_width
90
- next seq.clear if csi == "\e[m" || csi == "\e[0m"
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
- yield(current)
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 each_line_with_size(strs, max_width)
100
+ def first_plain_line(str, max_width)
109
101
  return if (max_width = max_width.to_i) <= 0
110
- strs.each do |str|
111
- str
112
- .to_s
113
- .each_line(chomp: true) do |line|
114
- next yield(line, 0) if line.empty?
115
- current = String.new(encoding: line.encoding)
116
- seq = current.dup
117
- width = 0
118
- in_zero_width = false
119
- line = line.encode(UTF_8) if line.encoding != UTF_8
120
- line.scan(WIDTH_SCANNER) do |np_start, np_end, csi, osc, gc|
121
- next in_zero_width = (current << "\1") if np_start
122
- next in_zero_width = !(current << "\2") if np_end
123
- next (current << osc) && (seq << osc) if osc
124
- if csi
125
- current << csi
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
- nil
119
+ [+'', 0]
143
120
  end
144
121
 
145
- def as_lines(strs, max_width)
122
+ def as_plain_lines(strs, width, height)
146
123
  ret = []
147
- each_line(strs, max_width) { ret << _1 }
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 prepare_print(args, kwargs, screen_columns, &cvt)
152
- prefix = kwargs[:prefix] and prefix = prefix.empty? ? '' : cvt[prefix]
153
- suffix = kwargs[:suffix] and suffix = suffix.empty? ? '' : cvt[suffix]
154
- return ["#{prefix}#{suffix}"] if args.empty?
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
- each_line(
157
- args.map!(&cvt),
158
- kwargs.fetch(:max_width) do
159
- screen_columns.call -
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
- ) { ret << "#{prefix}#{_1}#{suffix}" }
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module NattyUI
4
4
  # The version number of the gem.
5
- VERSION = '0.9.4'
5
+ VERSION = '0.10.0'
6
6
  end
@@ -56,7 +56,7 @@ module NattyUI
56
56
  end
57
57
 
58
58
  def draw(question)
59
- glyph = wrapper.glyph(:query)
59
+ glyph = NattyUI.glyph(:query)
60
60
  @parent.print(
61
61
  question,
62
62
  prefix: "#{glyph} #{Ansi[255]}",
@@ -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
- deco = as_deco(type)
33
- super(parent, prefix: "#{deco[0]} ", prefix_width: 2, suffix_width: 2)
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 as_deco(type)
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("#{deco[1]}#{deco[2] * aw}")
50
- @finish = "#{deco[5]}#{deco[6] * aw}"
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
@@ -94,7 +94,7 @@ module NattyUI
94
94
  protected
95
95
 
96
96
  def initialize(parent, title:, glyph:)
97
- glyph = parent.wrapper.glyph(glyph) || glyph
97
+ glyph = NattyUI.glyph(glyph) || glyph
98
98
  prefix_width = Text.width(glyph) + 1
99
99
  super(
100
100
  parent,
@@ -36,7 +36,7 @@ module NattyUI
36
36
 
37
37
  def draw(question)
38
38
  wrapper = @parent.wrapper
39
- glyph = wrapper.glyph(:query)
39
+ glyph = NattyUI.glyph(:query)
40
40
  @parent.print(
41
41
  question,
42
42
  prefix: "#{glyph} #{Ansi[255]}",
@@ -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.as_lines(row[col_idx], adjust_to)
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
@@ -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
- @stream.puts(args = prepare_print(args, kwargs))
55
- @lines_written += args.size
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
- @stream.print(*(args = prepare_print(args, kwargs)))
67
- @lines_written += args.size - 1
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 prepare_print(args, kwargs)
169
- Text.prepare_print(args, kwargs, -> { screen_columns }) { Text.plain(_1) }
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
- private_constant :LineAnimation, :KEY_MAP
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: natty-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Blumtritt