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.
@@ -80,7 +80,7 @@ module NattyUI
80
80
 
81
81
  def width
82
82
  return @width if @width
83
- @width = Text.width(self)
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(self)
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(self)
104
+ @width = @width.is_a?(Integer) ? width : Text.width(@to_s)
105
105
  freeze
106
106
  end
107
107
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NattyUI
4
+ # TODO: see HBarsRenderer - support min, max
4
5
  module VBarsRenderer
5
6
  class << self
6
7
  def lines(vals, width, height, normalize, bar_width, style)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module NattyUI
4
4
  # The version number of the gem.
5
- VERSION = '0.30.0'
5
+ VERSION = '0.31.0'
6
6
  end
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
- erase ? (Ansi::LINE_ERASE_PREV * c) : Ansi.cursor_prev_line(c)
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.30.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.7.1
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.