text-ui 0.2.0 → 0.2.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tui/format.rb +4 -4
  3. data/lib/tui/tools.rb +2 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53c472908d1c2de61f32484c61acfe607e0014c5fa911beb4ec1f1337db1e26c
4
- data.tar.gz: 62299d99d131f805ee761c2cd05f6dcfa0bd20f0c237c03eb0f34a9604e381bc
3
+ metadata.gz: e9aa7470ce1e80b3fa0c6d0de7c3c5dacd67d51e8a75b9d1609a83f63012cd09
4
+ data.tar.gz: 873b51cbc60dfdb196d50a88c6e6e457a2bd6e3f4c9b8d25e0a5db1cd1ddc57d
5
5
  SHA512:
6
- metadata.gz: 89e95aaaff98c935aacabafe43786b500c04a5c89c4b273bdb9bc2ca17697bd5fb229f44d6dffbaca23da363748ce682b530c201f492533e875a227c4a361c1e
7
- data.tar.gz: 1d0541d70ea1d118e95a2148f0fff536fbce42c4b22370ab96ab24b1dc92bbf0660457f61a78802d6fb9ddd1e4658db47d0b9d4fef278a152676a8df91a005e7
6
+ metadata.gz: 84b46fe510be54628e3b8fa1ab307b7d7768c52e7fb12ddfd9491fea60a45cb5d61dcf0f8bd62a0b65d90b7a5f14e7656146735a7241a1040e27b07ba839f000
7
+ data.tar.gz: 40930a3359b7583e6dfd49776866a3c87cf80f6230c0ccdb13745fbc7e63fe1a4bb8ac300ea4129cf32439799784459f1f9f3ddf72a22f1a1e6b7f76a0dcd82a
data/lib/tui/format.rb CHANGED
@@ -74,12 +74,12 @@ module Tui
74
74
  extra_lines_count = height - @array.size
75
75
  case type
76
76
  when :center
77
- (extra_lines_count/2).times { @array.prepend ' ' * @width }
78
- (extra_lines_count/2 + (extra_lines_count.odd? ? 1 : 0)).times { @array.append ' ' * @width }
77
+ (extra_lines_count/2).times { @array.prepend ' ' }
78
+ (extra_lines_count/2 + (extra_lines_count.odd? ? 1 : 0)).times { @array.append ' ' }
79
79
  when :top
80
- (extra_lines_count).times { @array.append ' ' * @width }
80
+ (extra_lines_count).times { @array.append ' ' }
81
81
  else # :bottom
82
- (extra_lines_count).times { @array.prepend ' ' * @width }
82
+ (extra_lines_count).times { @array.prepend ' ' }
83
83
  end
84
84
 
85
85
  self
data/lib/tui/tools.rb CHANGED
@@ -8,8 +8,8 @@ module Tui::Tools
8
8
  # but sometimes it needs re-calculating it from scratch
9
9
  def self.calc_width value
10
10
  case value
11
- when Array then val.collect { |row| Unicode::DisplayWidth.of(row) }.max
12
- when String then Unicode::DisplayWidth.of(val)
11
+ when Array then value.collect { |row| Unicode::DisplayWidth.of(row) }.max
12
+ when String then Unicode::DisplayWidth.of(value)
13
13
  end
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skorobogaty Dmitry