terminal-table-unicode 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -9
- data/.rubocop.yml +2 -0
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/bin/console +3 -3
- data/lib/terminal-table-unicode.rb +1 -1
- data/lib/terminal/table/table.rb +19 -19
- data/lib/terminal/table/unicode.rb +6 -6
- data/lib/terminal/table/unicode/version.rb +1 -1
- data/terminal-table-unicode.gemspec +15 -15
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56c874a91edf66e278766c7fa5345acf621480bd
|
4
|
+
data.tar.gz: 7d57efc73a77e49340ed3d6d1981b06c649d4db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43e271493e01e7e81efb903fd5e426e10715231a4682ba1fd07995359ec38e55f65e59590f0919e607892da0adfb2127bf736ac358ec4b796eec625bbeb95ecc
|
7
|
+
data.tar.gz: 2f465cf58832b9287aebe8d259e014d5ccd5c38c2742d058e050049f863a889143bd83da4cb62f18db5f21d78ccba5c1b41fa227020a17b2df98908847300e6e
|
data/.gitignore
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
/
|
6
|
-
/
|
7
|
-
/
|
8
|
-
/
|
9
|
-
/
|
1
|
+
.bundle/
|
2
|
+
.rubocop-*
|
3
|
+
.yardoc
|
4
|
+
Gemfile.lock
|
5
|
+
_yardoc/
|
6
|
+
coverage/
|
7
|
+
doc/
|
8
|
+
pkg/
|
9
|
+
spec/reports/
|
10
|
+
tmp/
|
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "bundler/setup"
|
4
|
+
require "terminal/table/unicode"
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require 'terminal/table/unicode'
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require "irb"
|
14
14
|
IRB.start
|
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require "terminal/table/unicode"
|
data/lib/terminal/table/table.rb
CHANGED
@@ -2,27 +2,27 @@ module Terminal
|
|
2
2
|
class Table
|
3
3
|
private
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
undef :recalc_column_widths
|
6
|
+
def recalc_column_widths(row)
|
7
|
+
return if row.is_a? Separator
|
8
|
+
i = 0
|
9
|
+
row.cells.each do |cell|
|
10
|
+
colspan = cell.colspan
|
11
|
+
cell_value = cell.value_for_column_width_recalc
|
12
|
+
colspan.downto(1) do |_j|
|
13
|
+
# cell_length = cell_value.to_s.length
|
14
|
+
cell_length = cell_value.to_s.display_width
|
15
|
+
if colspan > 1
|
16
|
+
spacing_length = cell_spacing * (colspan - 1)
|
17
|
+
length_in_columns = (cell_length - spacing_length)
|
18
|
+
cell_length = (length_in_columns.to_f / colspan).ceil
|
19
|
+
end
|
20
|
+
if @column_widths[i].to_i < cell_length
|
21
|
+
@column_widths[i] = cell_length
|
22
|
+
end
|
23
|
+
i += 1
|
19
24
|
end
|
20
|
-
if @column_widths[i].to_i < cell_length
|
21
|
-
@column_widths[i] = cell_length
|
22
|
-
end
|
23
|
-
i += 1
|
24
25
|
end
|
25
26
|
end
|
26
|
-
end
|
27
27
|
end
|
28
28
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "unicode/display_width"
|
2
|
+
require "mb_string"
|
3
|
+
require "terminal-table"
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
5
|
+
require "terminal/table/cell"
|
6
|
+
require "terminal/table/table"
|
7
|
+
require "terminal/table/unicode/version"
|
@@ -1,28 +1,28 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "terminal/table/unicode/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = "terminal-table-unicode"
|
8
8
|
spec.version = Terminal::Table::Unicode::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ["rochefort"]
|
10
|
+
spec.email = ["terasawan@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary =
|
12
|
+
spec.summary = "Simple, feature rich ascii table generation library with full-width unicode characters"
|
13
13
|
spec.description = spec.summary
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
14
|
+
spec.homepage = "https://github.com/rochefort/terminal-table-unicode"
|
15
|
+
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir =
|
18
|
+
spec.bindir = "exe"
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency
|
23
|
-
spec.add_dependency
|
24
|
-
spec.add_dependency
|
22
|
+
spec.add_dependency "mb_string", "~> 0.1.7"
|
23
|
+
spec.add_dependency "terminal-table", "~> 1.5"
|
24
|
+
spec.add_dependency "unicode-display_width", "~> 1.1.1"
|
25
25
|
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.12.2"
|
27
|
+
spec.add_development_dependency "rake", "~> 11.3.0"
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminal-table-unicode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mb_string
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.7
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: terminal-table
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,42 +44,42 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.1.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.1.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.12.2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.12.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 11.
|
75
|
+
version: 11.3.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 11.
|
82
|
+
version: 11.3.0
|
83
83
|
description: Simple, feature rich ascii table generation library with full-width unicode
|
84
84
|
characters
|
85
85
|
email:
|
@@ -89,6 +89,7 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- ".gitignore"
|
92
|
+
- ".rubocop.yml"
|
92
93
|
- ".travis.yml"
|
93
94
|
- Gemfile
|
94
95
|
- README.md
|
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
122
|
version: '0'
|
122
123
|
requirements: []
|
123
124
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.6.6
|
125
126
|
signing_key:
|
126
127
|
specification_version: 4
|
127
128
|
summary: Simple, feature rich ascii table generation library with full-width unicode
|