natty-ui 0.9.1 → 0.9.3
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/examples/3bit-colors.rb +2 -2
- data/examples/demo.rb +1 -1
- data/examples/illustration.rb +4 -3
- data/examples/table.rb +17 -12
- data/lib/natty-ui/ansi/constants.rb +75 -0
- data/lib/natty-ui/ansi.rb +15 -9
- data/lib/natty-ui/ansi_wrapper.rb +23 -33
- data/lib/natty-ui/east_asian_width.rb +1271 -0
- data/lib/natty-ui/line_animation/default.rb +1 -1
- data/lib/natty-ui/line_animation/matrix.rb +1 -1
- data/lib/natty-ui/line_animation/rainbow.rb +1 -1
- data/lib/natty-ui/line_animation/type_writer.rb +5 -25
- data/lib/natty-ui/line_animation.rb +2 -8
- data/lib/natty-ui/preload.rb +9 -0
- data/lib/natty-ui/text/east_asian_width.rb +1275 -0
- data/lib/natty-ui/text.rb +213 -0
- data/lib/natty-ui/version.rb +1 -1
- data/lib/natty-ui/wrapper/ask.rb +1 -1
- data/lib/natty-ui/wrapper/element.rb +1 -1
- data/lib/natty-ui/wrapper/horizontal_rule.rb +1 -1
- data/lib/natty-ui/wrapper/list_in_columns.rb +6 -8
- data/lib/natty-ui/wrapper/message.rb +1 -1
- data/lib/natty-ui/wrapper/query.rb +0 -1
- data/lib/natty-ui/wrapper/request.rb +1 -1
- data/lib/natty-ui/wrapper/section.rb +2 -2
- data/lib/natty-ui/wrapper/table.rb +10 -18
- data/lib/natty-ui/wrapper.rb +3 -22
- data/lib/natty-ui.rb +22 -82
- metadata +9 -6
- data/lib/natty-ui/ansi_constants.rb +0 -73
- data/lib/natty-ui/line_animation/test.rb +0 -29
- /data/lib/natty-ui/{features.rb → wrapper/features.rb} +0 -0
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: natty-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Blumtritt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
This is the beautiful, nice, nifty, fancy, neat, pretty, cool, lovely,
|
@@ -40,21 +40,24 @@ files:
|
|
40
40
|
- examples/table.rb
|
41
41
|
- lib/natty-ui.rb
|
42
42
|
- lib/natty-ui/ansi.rb
|
43
|
-
- lib/natty-ui/
|
43
|
+
- lib/natty-ui/ansi/constants.rb
|
44
44
|
- lib/natty-ui/ansi_wrapper.rb
|
45
|
-
- lib/natty-ui/
|
45
|
+
- lib/natty-ui/east_asian_width.rb
|
46
46
|
- lib/natty-ui/key_map.rb
|
47
47
|
- lib/natty-ui/line_animation.rb
|
48
48
|
- lib/natty-ui/line_animation/default.rb
|
49
49
|
- lib/natty-ui/line_animation/matrix.rb
|
50
50
|
- lib/natty-ui/line_animation/rainbow.rb
|
51
|
-
- lib/natty-ui/line_animation/test.rb
|
52
51
|
- lib/natty-ui/line_animation/type_writer.rb
|
52
|
+
- lib/natty-ui/preload.rb
|
53
|
+
- lib/natty-ui/text.rb
|
54
|
+
- lib/natty-ui/text/east_asian_width.rb
|
53
55
|
- lib/natty-ui/version.rb
|
54
56
|
- lib/natty-ui/wrapper.rb
|
55
57
|
- lib/natty-ui/wrapper/animate.rb
|
56
58
|
- lib/natty-ui/wrapper/ask.rb
|
57
59
|
- lib/natty-ui/wrapper/element.rb
|
60
|
+
- lib/natty-ui/wrapper/features.rb
|
58
61
|
- lib/natty-ui/wrapper/framed.rb
|
59
62
|
- lib/natty-ui/wrapper/heading.rb
|
60
63
|
- lib/natty-ui/wrapper/horizontal_rule.rb
|
@@ -92,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
95
|
- !ruby/object:Gem::Version
|
93
96
|
version: '0'
|
94
97
|
requirements: []
|
95
|
-
rubygems_version: 3.5.
|
98
|
+
rubygems_version: 3.5.15
|
96
99
|
signing_key:
|
97
100
|
specification_version: 4
|
98
101
|
summary: This is the beautiful, nice, nifty, fancy, neat, pretty, cool, lovely, natty
|
@@ -1,73 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NattyUI
|
4
|
-
module Ansi
|
5
|
-
CURSOR_SHOW = "\e[?25h"
|
6
|
-
CURSOR_HIDE = "\e[?25l"
|
7
|
-
CURSOR_HOME = cursor_pos(nil, nil)
|
8
|
-
CURSOR_FIRST_ROW = cursor_pos(1).freeze
|
9
|
-
CURSOR_FIRST_COLUMN = cursor_column(1).freeze
|
10
|
-
CURSOR_SAFE_POS_SCO = "\e[s"
|
11
|
-
CURSOR_RESTORE_POS_SCO = "\e[u"
|
12
|
-
CURSOR_SAFE_POS_DEC = "\e7"
|
13
|
-
CURSOR_RESTORE_POS_DEC = "\e8"
|
14
|
-
CURSOR_SAFE_POS = CURSOR_SAFE_POS_DEC
|
15
|
-
CURSOR_RESTORE_POS = CURSOR_RESTORE_POS_DEC
|
16
|
-
|
17
|
-
CURSOR_ALIGN_RIGHT = "\e[9999G\e[1D\e[1C" # @!visibility private
|
18
|
-
|
19
|
-
SCREEN_ERASE = screen_erase(:entire)
|
20
|
-
SCREEN_SAVE = "\e[?47h"
|
21
|
-
SCREEN_RESTORE = "\e[?47l"
|
22
|
-
SCREEN_ALTERNATE = "\e[?1049h"
|
23
|
-
SCREEN_ALTERNATE_OFF = "\e[?1049l"
|
24
|
-
SCREEN_SAVE_ATTRIBUTES = '\e[#{'
|
25
|
-
SCREEN_RESTORE_ATTRIBUTES = '\e[#}'
|
26
|
-
|
27
|
-
SCREEN_BLANK = "\e[0m\e[s\e[?47h\e[H\e[2J" # @!visibility private
|
28
|
-
SCREEN_UNBLANK = "\e[?47l\e[u\e[0m" # @!visibility private
|
29
|
-
|
30
|
-
LINE_PREVIOUS = cursor_previous_line(1).freeze
|
31
|
-
LINE_NEXT = cursor_next_line(1).freeze
|
32
|
-
LINE_ERASE = line_erase(:entire)
|
33
|
-
|
34
|
-
# ANSI control code sequence to erase the screen and set cursor position on
|
35
|
-
# upper left corner.
|
36
|
-
CLS = (CURSOR_HOME + SCREEN_ERASE).freeze
|
37
|
-
|
38
|
-
# ANSI control code sequence to erase current line and position to first
|
39
|
-
# column.
|
40
|
-
CLL = (LINE_ERASE + CURSOR_FIRST_COLUMN).freeze
|
41
|
-
|
42
|
-
# ANSI control code to reset all attributes.
|
43
|
-
RESET = self[:reset].freeze
|
44
|
-
|
45
|
-
BOLD = self[:bold].freeze
|
46
|
-
BOLD_OFF = self[:bold_off].freeze
|
47
|
-
|
48
|
-
FAINT = self[:faint].freeze
|
49
|
-
FAINT_OFF = self[:faint_off].freeze
|
50
|
-
|
51
|
-
ITALIC = self[:italic].freeze
|
52
|
-
ITALIC_OFF = self[:italic_off].freeze
|
53
|
-
|
54
|
-
STRIKE = self[:strike].freeze
|
55
|
-
STRIKE_OFF = self[:strike_off].freeze
|
56
|
-
|
57
|
-
UNDERLINE = self[:underline].freeze
|
58
|
-
DOUBLE_UNDERLINE = self[:double_underline].freeze
|
59
|
-
UNDERLINE_OFF = self[:underline_off].freeze
|
60
|
-
|
61
|
-
CURLY_UNDERLINE = self[:curly_underline].freeze
|
62
|
-
CURLY_UNDERLINE_OFF = self[:curly_underline_off].freeze
|
63
|
-
|
64
|
-
BLINK = self[:blink].freeze
|
65
|
-
BLINK_OFF = self[:blink_off].freeze
|
66
|
-
|
67
|
-
INVERT = self[:invert].freeze
|
68
|
-
INVERT_OFF = self[:invert_off].freeze
|
69
|
-
|
70
|
-
HIDE = self[:hide].freeze
|
71
|
-
REVEAL = self[:reveal].freeze
|
72
|
-
end
|
73
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module NattyUI
|
4
|
-
module LineAnimation
|
5
|
-
class Test < None
|
6
|
-
def initialize(*_)
|
7
|
-
super
|
8
|
-
@color = attribute(:color, :default)
|
9
|
-
end
|
10
|
-
|
11
|
-
def print(line, column)
|
12
|
-
prefix = "#{Ansi.cursor_column(column)}#{@color}"
|
13
|
-
line = plain(line)
|
14
|
-
str = Array.new(line.size) { CHARS.sample }.join
|
15
|
-
pos = Array.new(line.size, &:itself).shuffle
|
16
|
-
until pos.size < 4
|
17
|
-
pos.shift(pos.size / 4).each { str[_1] = line[_1] }
|
18
|
-
pos.sample(pos.size / 2).each { str[_1] = CHARS.sample }
|
19
|
-
(@stream << "#{prefix}#{str}").flush
|
20
|
-
sleep(0.08)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
CHARS = '2598Z*):.\=+-¦|_ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ'.chars
|
25
|
-
end
|
26
|
-
|
27
|
-
define test: Test
|
28
|
-
end
|
29
|
-
end
|
File without changes
|