natty-ui 0.30.0 → 0.31.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 +2 -1
- data/examples/cols.rb +4 -6
- data/examples/hbars.rb +2 -3
- data/examples/illustration.rb +13 -14
- data/examples/info.rb +9 -13
- data/examples/named-colors.rb +3 -5
- data/examples/tables.rb +5 -8
- data/examples/tasks.rb +14 -14
- data/examples/themes.rb +51 -0
- data/lib/natty-ui/attributes.rb +37 -38
- data/lib/natty-ui/features.rb +58 -31
- data/lib/natty-ui/hbars_renderer.rb +51 -43
- data/lib/natty-ui/progress.rb +5 -7
- data/lib/natty-ui/shell_command.rb +132 -0
- data/lib/natty-ui/table.rb +47 -12
- data/lib/natty-ui/table_renderer.rb +3 -2
- data/lib/natty-ui/theme.rb +326 -282
- data/lib/natty-ui/utils.rb +3 -3
- data/lib/natty-ui/vbars_renderer.rb +1 -0
- data/lib/natty-ui/version.rb +1 -1
- data/lib/natty-ui.rb +3 -1
- metadata +4 -2
data/lib/natty-ui/utils.rb
CHANGED
@@ -80,7 +80,7 @@ module NattyUI
|
|
80
80
|
|
81
81
|
def width
|
82
82
|
return @width if @width
|
83
|
-
@width = Text.width(
|
83
|
+
@width = Text.width(@to_s)
|
84
84
|
freeze
|
85
85
|
@width
|
86
86
|
end
|
@@ -94,14 +94,14 @@ module NattyUI
|
|
94
94
|
def initialize(str, width = nil)
|
95
95
|
@to_s = Ansi.bbcode(str).freeze
|
96
96
|
return unless width
|
97
|
-
@width = @width.is_a?(Integer) ? width : Text.width(
|
97
|
+
@width = @width.is_a?(Integer) ? width : Text.width(@to_s)
|
98
98
|
freeze
|
99
99
|
end
|
100
100
|
else
|
101
101
|
def initialize(str, width = nil)
|
102
102
|
@to_s = Ansi.plain(str).freeze
|
103
103
|
return unless width
|
104
|
-
@width = @width.is_a?(Integer) ? width : Text.width(
|
104
|
+
@width = @width.is_a?(Integer) ? width : Text.width(@to_s)
|
105
105
|
freeze
|
106
106
|
end
|
107
107
|
end
|
data/lib/natty-ui/version.rb
CHANGED
data/lib/natty-ui.rb
CHANGED
@@ -75,8 +75,10 @@ module NattyUI
|
|
75
75
|
_write(
|
76
76
|
if erase == :all
|
77
77
|
Ansi.cursor_prev_line(c) + Ansi::SCREEN_ERASE_BELOW
|
78
|
+
elsif erase
|
79
|
+
Ansi::LINE_ERASE_PREV * c
|
78
80
|
else
|
79
|
-
|
81
|
+
Ansi.cursor_prev_line(c)
|
80
82
|
end
|
81
83
|
)
|
82
84
|
end
|
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.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Blumtritt
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- examples/sections.rb
|
55
55
|
- examples/tables.rb
|
56
56
|
- examples/tasks.rb
|
57
|
+
- examples/themes.rb
|
57
58
|
- examples/vbars.rb
|
58
59
|
- lib/natty-ui.rb
|
59
60
|
- lib/natty-ui/attributes.rb
|
@@ -68,6 +69,7 @@ files:
|
|
68
69
|
- lib/natty-ui/options.rb
|
69
70
|
- lib/natty-ui/progress.rb
|
70
71
|
- lib/natty-ui/section.rb
|
72
|
+
- lib/natty-ui/shell_command.rb
|
71
73
|
- lib/natty-ui/table.rb
|
72
74
|
- lib/natty-ui/table_renderer.rb
|
73
75
|
- lib/natty-ui/task.rb
|
@@ -101,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
103
|
- !ruby/object:Gem::Version
|
102
104
|
version: '0'
|
103
105
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.6.9
|
105
107
|
specification_version: 4
|
106
108
|
summary: This is the beautiful, nice, nifty, fancy, neat, pretty, cool, rich, lovely,
|
107
109
|
natty user interface you like to have for your CLI.
|