kosi 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile +0 -9
- data/README.md +31 -35
- data/kosi.gemspec +2 -2
- data/lib/kosi/version.rb +1 -1
- data/lib/table.rb +2 -10
- data/spec/kosi/validators/each_array_length_validator_spec.rb +56 -56
- data/spec/kosi/validators/row_type_validator_spec.rb +51 -51
- data/spec/table_spec.rb +14 -2
- metadata +24 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7bd11fbbc42a3e1736ca1f487762ef1286d0dce
|
4
|
+
data.tar.gz: ae9dbb560f01a3ae57ae250e7663f8ecc611cfa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92598c5a088961200f617bee9f3a2029ada393c75569d4b2e5bbe0f27fb575711fe34864cd4dddfa46d7beaf41fdfce89bdca82cc814b5443a7b2485fe4279b
|
7
|
+
data.tar.gz: 85c639c7aa8380990da72353d31e815e71131a6e8ebb6393c4ea7531a360c11bde332228797a28a63fbd4f96c9edd61e918f15798631095c4bc871dc559b2e1d
|
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
@@ -1,12 +1,3 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
|
-
gem "rspec", "~> 2.14.1"
|
5
|
-
gem "thor", "~> 0.18.1"
|
6
|
-
gem "simplecov", "~> 0.8.2"
|
7
|
-
gem "activesupport", "~> 4.0.1"
|
8
|
-
gem "activemodel", "~> 4.0.2"
|
9
|
-
gem "tudu", "~> 0.0.4"
|
10
|
-
group :test do
|
11
|
-
gem 'coveralls', require: false
|
12
|
-
end
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# Kosi
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/kosi.svg)](http://badge.fury.io/rb/kosi)
|
3
4
|
[![Build Status](https://travis-ci.org/tbpgr/kosi.png?branch=master)](https://travis-ci.org/tbpgr/kosi)
|
4
5
|
[![Coverage Status](https://coveralls.io/repos/tbpgr/kosi/badge.png)](https://coveralls.io/r/tbpgr/kosi)
|
5
6
|
[![Code Climate](https://codeclimate.com/github/tbpgr/kosi.png)](https://codeclimate.com/github/tbpgr/kosi)
|
6
7
|
|
7
8
|
ターミナルアプリケーション用表フォーマットサポートツール。格子。
|
8
9
|
|
9
|
-
## Installation
|
10
|
+
## :cloud::arrow_down: Installation
|
10
11
|
|
11
12
|
Add this line to your application's Gemfile:
|
12
13
|
|
@@ -20,9 +21,9 @@ Or install it yourself as:
|
|
20
21
|
|
21
22
|
$ gem install kosi
|
22
23
|
|
23
|
-
## Description
|
24
|
+
## :man: Description
|
24
25
|
2次元配列をテーブルフォーマットにして出力します。
|
25
|
-
terminal-table gemの日本語対応版にあたります。
|
26
|
+
:link: [terminal-table gem](https://github.com/tj/terminal-table) の日本語対応版にあたります。
|
26
27
|
(terminal-tableはASCII対応のみなので全角文字が混ざるとテーブルレイアウトが崩れる)
|
27
28
|
|
28
29
|
具体的には
|
@@ -31,8 +32,8 @@ terminal-table gemの日本語対応版にあたります。
|
|
31
32
|
* Unicode 65377(0xff61)..65439(0xff9f) => 半角カナ。1文字分として計算
|
32
33
|
* その他 => 全角として扱う。2文字分として計算
|
33
34
|
|
34
|
-
## Options
|
35
|
-
### Align
|
35
|
+
## :o2: Options
|
36
|
+
### :icecream: Align
|
36
37
|
配置指定。右寄せ、左寄せ、中央を選択可能。
|
37
38
|
|
38
39
|
| 設定可能パラメータ | 説明 |
|
@@ -41,7 +42,7 @@ terminal-table gemの日本語対応版にあたります。
|
|
41
42
|
|Kosi::Align::TYPE::LEFT|左寄せ。デフォルト|
|
42
43
|
|Kosi::Align::TYPE::CENTER|中央|
|
43
44
|
|
44
|
-
### ConnectorChar
|
45
|
+
### :icecream: ConnectorChar
|
45
46
|
表の結合部に表示するテキスト。1文字で指定。
|
46
47
|
下記で言うところの 「+」がConnectorChar。
|
47
48
|
|
@@ -51,24 +52,24 @@ terminal-table gemの日本語対応版にあたります。
|
|
51
52
|
+-----+------+-------+
|
52
53
|
~~~
|
53
54
|
|
54
|
-
### Header
|
55
|
+
### :icecream: Header
|
55
56
|
表のヘッダー。配列で指定。
|
56
57
|
デフォルトはヘッダーなし。
|
57
58
|
|
58
|
-
### HorizontalBorderChar
|
59
|
+
### :icecream: HorizontalBorderChar
|
59
60
|
水平線を1文字で設定。
|
60
|
-
デフォルトは「-」
|
61
|
+
デフォルトは「-」(半角ハイフン)
|
61
62
|
|
62
|
-
### SeparateEachRow
|
63
|
+
### :icecream: SeparateEachRow
|
63
64
|
各行に区切り線を入れるかどうか。
|
64
65
|
デフォルトは「false」
|
65
66
|
|
66
|
-
### VerticalBorderChar
|
67
|
+
### :icecream: VerticalBorderChar
|
67
68
|
垂直線を1文字で設定。
|
68
|
-
|
69
|
+
デフォルトは「|」(パイプ)
|
69
70
|
|
70
|
-
## Usage
|
71
|
-
### オプション指定なし
|
71
|
+
## :scroll: Usage
|
72
|
+
### :shaved_ice: オプション指定なし
|
72
73
|
~~~ruby
|
73
74
|
require 'kosi'
|
74
75
|
|
@@ -76,7 +77,7 @@ kosi = Kosi::Table.new
|
|
76
77
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
77
78
|
~~~
|
78
79
|
|
79
|
-
出力
|
80
|
+
* 出力
|
80
81
|
※GitHubの表示上ずれているかもしれませんが、等幅フォント利用時にそろいます。
|
81
82
|
|
82
83
|
~~~
|
@@ -86,7 +87,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
|
86
87
|
+-----+------+-------+
|
87
88
|
~~~
|
88
89
|
|
89
|
-
### Align指定
|
90
|
+
### :shaved_ice: Align指定
|
90
91
|
~~~ruby
|
91
92
|
require 'kosi'
|
92
93
|
|
@@ -98,7 +99,7 @@ kosi = Kosi::Table.new({align: Kosi::Align::TYPE::LEFT})
|
|
98
99
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
99
100
|
~~~
|
100
101
|
|
101
|
-
出力
|
102
|
+
* 出力
|
102
103
|
|
103
104
|
~~~
|
104
105
|
+-----+------+-------+
|
@@ -115,7 +116,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
|
115
116
|
+-----+------+-------+
|
116
117
|
~~~
|
117
118
|
|
118
|
-
### ConnectorChar指定
|
119
|
+
### :shaved_ice: ConnectorChar指定
|
119
120
|
~~~ruby
|
120
121
|
require 'kosi'
|
121
122
|
|
@@ -127,7 +128,7 @@ kosi = Kosi::Table.new({connector_char: '$'})
|
|
127
128
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
128
129
|
~~~
|
129
130
|
|
130
|
-
出力
|
131
|
+
* 出力
|
131
132
|
|
132
133
|
~~~
|
133
134
|
+-----+------+-------+
|
@@ -145,7 +146,7 @@ $-----$------$-------$
|
|
145
146
|
~~~
|
146
147
|
|
147
148
|
|
148
|
-
### Header指定
|
149
|
+
### :shaved_ice: Header指定
|
149
150
|
~~~ruby
|
150
151
|
require 'kosi'
|
151
152
|
|
@@ -156,7 +157,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
|
156
157
|
~~~
|
157
158
|
|
158
159
|
|
159
|
-
出力
|
160
|
+
* 出力
|
160
161
|
|
161
162
|
~~~
|
162
163
|
+-----+------+-------+
|
@@ -171,7 +172,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
|
171
172
|
+-------+-------+-------+
|
172
173
|
~~~
|
173
174
|
|
174
|
-
### HorizontalBorderChar指定
|
175
|
+
### :shaved_ice: HorizontalBorderChar指定
|
175
176
|
~~~ruby
|
176
177
|
require 'kosi'
|
177
178
|
|
@@ -181,7 +182,7 @@ kosi = Kosi::Table.new({horizontal_border_char: '*'})
|
|
181
182
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
182
183
|
~~~
|
183
184
|
|
184
|
-
出力
|
185
|
+
* 出力
|
185
186
|
|
186
187
|
~~~
|
187
188
|
+-----+------+-------+
|
@@ -194,7 +195,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
|
194
195
|
+*****+******+*******+
|
195
196
|
~~~
|
196
197
|
|
197
|
-
### SeparateEachRow指定
|
198
|
+
### :shaved_ice: SeparateEachRow指定
|
198
199
|
~~~ruby
|
199
200
|
require 'kosi'
|
200
201
|
|
@@ -204,7 +205,7 @@ kosi = Kosi::Table.new({separate_each_row: true})
|
|
204
205
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333'], [*'a'..'c']])
|
205
206
|
~~~
|
206
207
|
|
207
|
-
出力
|
208
|
+
* 出力
|
208
209
|
|
209
210
|
~~~
|
210
211
|
+-----+------+-------+
|
@@ -221,7 +222,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333'], [
|
|
221
222
|
+-----+------+-------+
|
222
223
|
~~~
|
223
224
|
|
224
|
-
### VerticalBorderChar指定
|
225
|
+
### :shaved_ice: VerticalBorderChar指定
|
225
226
|
~~~ruby
|
226
227
|
require 'kosi'
|
227
228
|
|
@@ -231,7 +232,7 @@ kosi = Kosi::Table.new({vertical_border_char: '#'})
|
|
231
232
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
232
233
|
~~~
|
233
234
|
|
234
|
-
出力
|
235
|
+
* 出力
|
235
236
|
|
236
237
|
~~~
|
237
238
|
+-----+------+-------+
|
@@ -244,7 +245,7 @@ print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333']])
|
|
244
245
|
+-----+------+-------+
|
245
246
|
~~~
|
246
247
|
|
247
|
-
### 複合オプション
|
248
|
+
### :shaved_ice: 複合オプション
|
248
249
|
様々なオプションを一気に指定してみます
|
249
250
|
|
250
251
|
~~~ruby
|
@@ -263,7 +264,7 @@ kosi = Kosi::Table.new(
|
|
263
264
|
print kosi.render([[*'a'..'c'], ['ほゲ1', 'ひゲ22', 'へゲ333'], [*'a'..'c']])
|
264
265
|
~~~
|
265
266
|
|
266
|
-
出力
|
267
|
+
* 出力
|
267
268
|
|
268
269
|
~~~
|
269
270
|
x*******x*******x*******x
|
@@ -277,12 +278,7 @@ x*******x*******x*******x
|
|
277
278
|
x*******x*******x*******x
|
278
279
|
~~~
|
279
280
|
|
280
|
-
##
|
281
|
-
|
282
|
-
* version 0.0.2 : ANSI Escape Sequence利用時にフォーマットが崩れないように変更
|
283
|
-
* version 0.0.1 : first release
|
284
|
-
|
285
|
-
## Contributing
|
281
|
+
## :two_men_holding_hands: Contributing :two_women_holding_hands:
|
286
282
|
|
287
283
|
1. Fork it ( https://github.com/tbpgr/kosi/fork )
|
288
284
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
data/kosi.gemspec
CHANGED
@@ -18,11 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_runtime_dependency '
|
22
|
-
spec.add_runtime_dependency 'activemodel', '~> 4.0.2'
|
21
|
+
spec.add_runtime_dependency 'unicode', '>= 0.4.4'
|
23
22
|
|
24
23
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
24
|
spec.add_development_dependency 'rake'
|
26
25
|
spec.add_development_dependency 'rspec', '~> 2.14.1'
|
27
26
|
spec.add_development_dependency 'simplecov', '~> 0.8.2'
|
27
|
+
spec.add_development_dependency 'coveralls'
|
28
28
|
end
|
data/lib/kosi/version.rb
CHANGED
data/lib/table.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'kosi'
|
3
3
|
require 'kosi/validators'
|
4
|
+
require 'unicode'
|
4
5
|
|
5
6
|
# TableFormat for Terminal(Use Japanese Charactors)
|
6
7
|
module Kosi
|
@@ -59,20 +60,11 @@ module Kosi
|
|
59
60
|
|
60
61
|
def ascii1_other2_size(column)
|
61
62
|
column.split('').reduce(0) do |a, e|
|
62
|
-
a +=
|
63
|
+
a += Unicode.width(e)
|
63
64
|
a
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
67
|
-
def half?(char)
|
68
|
-
case char.ord
|
69
|
-
when 1..127, 65_377..65_439
|
70
|
-
true
|
71
|
-
else
|
72
|
-
false
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
68
|
def get_table_format_rows(rows, max_lengths, header)
|
77
69
|
top_bottom_line = top_bottom(max_lengths)
|
78
70
|
results = [top_bottom_line]
|
@@ -1,56 +1,56 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'kosi/validators/each_array_length_validator'
|
4
|
-
|
5
|
-
describe Kosi::Validators::EachArrayLength do
|
6
|
-
context :validate do
|
7
|
-
cases = [
|
8
|
-
{
|
9
|
-
case_no: 1,
|
10
|
-
case_title: 'Same Length Array case',
|
11
|
-
inputs: [[*1..5], [*6..10]],
|
12
|
-
},
|
13
|
-
{
|
14
|
-
case_no: 2,
|
15
|
-
case_title: 'Zero Length Array case',
|
16
|
-
inputs: [[], []],
|
17
|
-
},
|
18
|
-
{
|
19
|
-
case_no: 3,
|
20
|
-
case_title: 'Different Length Array case',
|
21
|
-
inputs: [[*1..5], [*6..11]],
|
22
|
-
expect_error: true,
|
23
|
-
error_class: ArgumentError
|
24
|
-
},
|
25
|
-
]
|
26
|
-
|
27
|
-
cases.each do |c|
|
28
|
-
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
29
|
-
begin
|
30
|
-
case_before c
|
31
|
-
|
32
|
-
# -- given --
|
33
|
-
# nothing
|
34
|
-
|
35
|
-
# -- when/then --
|
36
|
-
if c[:expect_error]
|
37
|
-
expect{ Kosi::Validators::EachArrayLength.validate(c[:inputs]) }.to raise_error(c[:error_class])
|
38
|
-
next
|
39
|
-
else
|
40
|
-
expect{ Kosi::Validators::EachArrayLength.validate(c[:inputs]) }.not_to raise_error
|
41
|
-
end
|
42
|
-
ensure
|
43
|
-
case_after c
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def case_before(c)
|
48
|
-
# implement each case before
|
49
|
-
end
|
50
|
-
|
51
|
-
def case_after(c)
|
52
|
-
# implement each case after
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'kosi/validators/each_array_length_validator'
|
4
|
+
|
5
|
+
describe Kosi::Validators::EachArrayLength do
|
6
|
+
context :validate do
|
7
|
+
cases = [
|
8
|
+
{
|
9
|
+
case_no: 1,
|
10
|
+
case_title: 'Same Length Array case',
|
11
|
+
inputs: [[*1..5], [*6..10]],
|
12
|
+
},
|
13
|
+
{
|
14
|
+
case_no: 2,
|
15
|
+
case_title: 'Zero Length Array case',
|
16
|
+
inputs: [[], []],
|
17
|
+
},
|
18
|
+
{
|
19
|
+
case_no: 3,
|
20
|
+
case_title: 'Different Length Array case',
|
21
|
+
inputs: [[*1..5], [*6..11]],
|
22
|
+
expect_error: true,
|
23
|
+
error_class: ArgumentError
|
24
|
+
},
|
25
|
+
]
|
26
|
+
|
27
|
+
cases.each do |c|
|
28
|
+
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
29
|
+
begin
|
30
|
+
case_before c
|
31
|
+
|
32
|
+
# -- given --
|
33
|
+
# nothing
|
34
|
+
|
35
|
+
# -- when/then --
|
36
|
+
if c[:expect_error]
|
37
|
+
expect { Kosi::Validators::EachArrayLength.validate(c[:inputs]) }.to raise_error(c[:error_class])
|
38
|
+
next
|
39
|
+
else
|
40
|
+
expect { Kosi::Validators::EachArrayLength.validate(c[:inputs]) }.not_to raise_error
|
41
|
+
end
|
42
|
+
ensure
|
43
|
+
case_after c
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def case_before(c)
|
48
|
+
# implement each case before
|
49
|
+
end
|
50
|
+
|
51
|
+
def case_after(c)
|
52
|
+
# implement each case after
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -1,51 +1,51 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'kosi/validators/row_type_validator'
|
4
|
-
|
5
|
-
describe Kosi::Validators::RowType do
|
6
|
-
context :validate do
|
7
|
-
cases = [
|
8
|
-
{
|
9
|
-
case_no: 1,
|
10
|
-
case_title: 'Array case',
|
11
|
-
inputs: ['Array'],
|
12
|
-
},
|
13
|
-
{
|
14
|
-
case_no: 2,
|
15
|
-
case_title: 'Not Array case',
|
16
|
-
inputs:
|
17
|
-
expect_error: true,
|
18
|
-
error_class: ArgumentError
|
19
|
-
},
|
20
|
-
]
|
21
|
-
|
22
|
-
cases.each do |c|
|
23
|
-
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
24
|
-
begin
|
25
|
-
case_before c
|
26
|
-
|
27
|
-
# -- given --
|
28
|
-
# nothing
|
29
|
-
|
30
|
-
# -- when/then --
|
31
|
-
if c[:expect_error]
|
32
|
-
expect{ Kosi::Validators::RowType.validate(c[:inputs]) }.to raise_error(c[:error_class])
|
33
|
-
next
|
34
|
-
else
|
35
|
-
expect{ Kosi::Validators::RowType.validate(c[:inputs]) }.not_to raise_error
|
36
|
-
end
|
37
|
-
ensure
|
38
|
-
case_after c
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def case_before(c)
|
43
|
-
# implement each case before
|
44
|
-
end
|
45
|
-
|
46
|
-
def case_after(c)
|
47
|
-
# implement each case after
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'kosi/validators/row_type_validator'
|
4
|
+
|
5
|
+
describe Kosi::Validators::RowType do
|
6
|
+
context :validate do
|
7
|
+
cases = [
|
8
|
+
{
|
9
|
+
case_no: 1,
|
10
|
+
case_title: 'Array case',
|
11
|
+
inputs: ['Array'],
|
12
|
+
},
|
13
|
+
{
|
14
|
+
case_no: 2,
|
15
|
+
case_title: 'Not Array case',
|
16
|
+
inputs: 'not Array',
|
17
|
+
expect_error: true,
|
18
|
+
error_class: ArgumentError
|
19
|
+
},
|
20
|
+
]
|
21
|
+
|
22
|
+
cases.each do |c|
|
23
|
+
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
24
|
+
begin
|
25
|
+
case_before c
|
26
|
+
|
27
|
+
# -- given --
|
28
|
+
# nothing
|
29
|
+
|
30
|
+
# -- when/then --
|
31
|
+
if c[:expect_error]
|
32
|
+
expect { Kosi::Validators::RowType.validate(c[:inputs]) }.to raise_error(c[:error_class])
|
33
|
+
next
|
34
|
+
else
|
35
|
+
expect { Kosi::Validators::RowType.validate(c[:inputs]) }.not_to raise_error
|
36
|
+
end
|
37
|
+
ensure
|
38
|
+
case_after c
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def case_before(c)
|
43
|
+
# implement each case before
|
44
|
+
end
|
45
|
+
|
46
|
+
def case_after(c)
|
47
|
+
# implement each case after
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/spec/table_spec.rb
CHANGED
@@ -71,7 +71,7 @@ describe Kosi::Table do
|
|
71
71
|
{
|
72
72
|
case_no: 2,
|
73
73
|
case_title: 'use header case',
|
74
|
-
options: {header: %w
|
74
|
+
options: { header: %w(header1 header2 header3) },
|
75
75
|
inputs: [[1, 2, 3], [1111, '222アア', '33イイ']],
|
76
76
|
expected: <<-EOS
|
77
77
|
+-------+-------+-------+
|
@@ -85,7 +85,7 @@ describe Kosi::Table do
|
|
85
85
|
{
|
86
86
|
case_no: 3,
|
87
87
|
case_title: 'Enable SeparateEachRow case',
|
88
|
-
options: {separate_each_row: true},
|
88
|
+
options: { separate_each_row: true },
|
89
89
|
inputs: [[1, 2, 3], [1111, '222アア', '33イイ'], [1, 2, 3]],
|
90
90
|
expected: <<-EOS
|
91
91
|
+----+-------+------+
|
@@ -108,6 +108,18 @@ describe Kosi::Table do
|
|
108
108
|
+-----+
|
109
109
|
EOS
|
110
110
|
},
|
111
|
+
{
|
112
|
+
case_no: 5,
|
113
|
+
case_title: 'Unicode width case',
|
114
|
+
options: nil,
|
115
|
+
inputs: [['$100'], ['¥100']],
|
116
|
+
expected: <<-EOS
|
117
|
+
+----+
|
118
|
+
|$100|
|
119
|
+
|¥100|
|
120
|
+
+----+
|
121
|
+
EOS
|
122
|
+
},
|
111
123
|
]
|
112
124
|
|
113
125
|
cases.each do |c|
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kosi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tbpgr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: unicode
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.1
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0.1
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activemodel
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
17
|
+
- - '>='
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
19
|
+
version: 0.4.4
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- -
|
24
|
+
- - '>='
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
26
|
+
version: 0.4.4
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +80,20 @@ dependencies:
|
|
94
80
|
- - ~>
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: 0.8.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
97
|
description: terminal table format for japanese
|
98
98
|
email:
|
99
99
|
- tbpgr@tbpgr.jp
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- .rspec
|
107
107
|
- .rubocop.yml
|
108
108
|
- .travis.yml
|
109
|
+
- CHANGELOG.md
|
109
110
|
- Gemfile
|
110
111
|
- LICENSE.txt
|
111
112
|
- README.md
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
version: '0'
|
156
157
|
requirements: []
|
157
158
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.0
|
159
|
+
rubygems_version: 2.3.0
|
159
160
|
signing_key:
|
160
161
|
specification_version: 4
|
161
162
|
summary: terminal table format for japanese
|
@@ -170,3 +171,4 @@ test_files:
|
|
170
171
|
- spec/kosi/vertical_border_char_spec.rb
|
171
172
|
- spec/spec_helper.rb
|
172
173
|
- spec/table_spec.rb
|
174
|
+
has_rdoc:
|