ttable 0.0.5 → 0.0.6
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/lib/terminal/table.rb +2 -2
- data/lib/terminal/table/version.rb +1 -1
- data/spec/terminal/table_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0593100cc29009bbec61da7f47c925cf1c5f1043
|
4
|
+
data.tar.gz: 5d20aca2ee528e308a96ac0f27584f5cd5e8e848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef944c97c37bd45bbef0831fad22652e9c3d8127f6a00a394a0ec8c5f265196b7efb79408826abde3217a37019f32901c968defeee96ae3f07f1e0d4d809b1b0
|
7
|
+
data.tar.gz: 88eefbdc9c9ba2fbc2bccac1691d965d4ae78262279af3c56ac70a6e7d109e91b9f472fb411a9168a6a28601c5c87c59451e772d7d6dde84ad8d79e2030dc47c
|
data/lib/terminal/table.rb
CHANGED
@@ -6,7 +6,7 @@ class String
|
|
6
6
|
def twidth
|
7
7
|
result = 0
|
8
8
|
|
9
|
-
%w{ ☺️ ❤️ ♍️ }.each do |c|
|
9
|
+
%w{ ☺️ ❤️ ♍️ ☔️ }.each do |c|
|
10
10
|
if include?(c)
|
11
11
|
result += 1 * scan(c).size
|
12
12
|
gsub!(c, '')
|
@@ -19,7 +19,7 @@ class String
|
|
19
19
|
elsif %w{ ͡ ͜ }.include?(c)
|
20
20
|
# zero width
|
21
21
|
result += 0
|
22
|
-
elsif %w{ ě ì • é · ♪ … ω ˊ ˋ √ “ ” ☻ ※ ◎ ◆ ‘ ★ ’ — ° ʖ ¯ ≥ ≤ ≧ ∇ ≦ ❤ ☺ ╭ ╯ ε ╰ ╮ з ∠ → }.include?(c)
|
22
|
+
elsif %w{ ě ì • é · ♪ … ω ˊ ˋ √ “ ” ☻ ※ ◎ ◆ ‘ ★ ’ — ° ʖ ¯ ≥ ≤ ≧ ∇ ≦ ❤ ☺ ╭ ╯ ε ╰ ╮ з ∠ → ☞ ë ϵ Θ ϶ }.include?(c)
|
23
23
|
result += 1
|
24
24
|
elsif c == ' ' # ord == 8198
|
25
25
|
result += 1
|
data/spec/terminal/table_spec.rb
CHANGED
@@ -337,5 +337,25 @@ describe String do
|
|
337
337
|
subject { '→_→' }
|
338
338
|
its(:twidth) { should == 3 }
|
339
339
|
end
|
340
|
+
|
341
|
+
context '☞' do
|
342
|
+
subject { '☞' }
|
343
|
+
its(:twidth) { should == 1 }
|
344
|
+
end
|
345
|
+
|
346
|
+
context 'ë' do
|
347
|
+
subject { 'ë' }
|
348
|
+
its(:twidth) { should == 1 }
|
349
|
+
end
|
350
|
+
|
351
|
+
context '☔️' do
|
352
|
+
subject { '☔️' }
|
353
|
+
its(:twidth) { should == 1 }
|
354
|
+
end
|
355
|
+
|
356
|
+
context "ϵ( 'Θ' )϶" do
|
357
|
+
subject { "ϵ( 'Θ' )϶" }
|
358
|
+
its(:twidth) { should == 9 }
|
359
|
+
end
|
340
360
|
end
|
341
361
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ttable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Forrest Ye
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|