natty-ui 0.9.2 → 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.
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.2
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-09 00:00:00.000000000 Z
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/ansi_constants.rb
43
+ - lib/natty-ui/ansi/constants.rb
44
44
  - lib/natty-ui/ansi_wrapper.rb
45
- - lib/natty-ui/features.rb
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.14
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,77 +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
-
8
- CURSOR_HOME = cursor_pos(nil, nil)
9
- CURSOR_FIRST_ROW = cursor_pos(1).freeze
10
- CURSOR_FIRST_COLUMN = cursor_column(1).freeze
11
-
12
- CURSOR_SAFE_POS_SCO = "\e[s"
13
- CURSOR_SAFE_POS_DEC = "\e7"
14
- CURSOR_SAFE_POS = CURSOR_SAFE_POS_DEC
15
-
16
- CURSOR_RESTORE_POS_SCO = "\e[u"
17
- CURSOR_RESTORE_POS_DEC = "\e8"
18
- CURSOR_RESTORE_POS = CURSOR_RESTORE_POS_DEC
19
-
20
- SCREEN_ERASE = screen_erase(:entire)
21
-
22
- SCREEN_SAVE = "\e[?47h"
23
- SCREEN_RESTORE = "\e[?47l"
24
-
25
- SCREEN_ALTERNATE = "\e[?1049h"
26
- SCREEN_ALTERNATE_OFF = "\e[?1049l"
27
-
28
- LINE_PREVIOUS = cursor_previous_line(1).freeze
29
- LINE_NEXT = cursor_next_line(1).freeze
30
- LINE_ERASE = line_erase(:entire)
31
-
32
- RESET = self[:reset].freeze
33
-
34
- BOLD = self[:bold].freeze
35
- BOLD_OFF = self[:bold_off].freeze
36
-
37
- FAINT = self[:faint].freeze
38
- FAINT_OFF = self[:faint_off].freeze
39
-
40
- ITALIC = self[:italic].freeze
41
- ITALIC_OFF = self[:italic_off].freeze
42
-
43
- STRIKE = self[:strike].freeze
44
- STRIKE_OFF = self[:strike_off].freeze
45
-
46
- UNDERLINE = self[:underline].freeze
47
- DOUBLE_UNDERLINE = self[:double_underline].freeze
48
- UNDERLINE_OFF = self[:underline_off].freeze
49
-
50
- CURLY_UNDERLINE = self[:curly_underline].freeze
51
- CURLY_UNDERLINE_OFF = self[:curly_underline_off].freeze
52
-
53
- BLINK = self[:blink].freeze
54
- BLINK_OFF = self[:blink_off].freeze
55
-
56
- INVERT = self[:invert].freeze
57
- INVERT_OFF = self[:invert_off].freeze
58
-
59
- HIDE = self[:hide].freeze
60
- REVEAL = self[:reveal].freeze
61
-
62
- # @!visibility private
63
- CLS = (CURSOR_HOME + SCREEN_ERASE).freeze
64
-
65
- # @!visibility private
66
- CLL = (CURSOR_FIRST_COLUMN + LINE_ERASE).freeze
67
-
68
- # @!visibility private
69
- SCREEN_BLANK =
70
- (
71
- CURSOR_SAFE_POS + SCREEN_ALTERNATE + CURSOR_HOME + SCREEN_ERASE + RESET
72
- ).freeze
73
-
74
- # @!visibility private
75
- SCREEN_UNBLANK = (RESET + SCREEN_ALTERNATE_OFF + CURSOR_RESTORE_POS).freeze
76
- end
77
- 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