table_formatter_simple 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8969cfafcf688e638aa96f324816e8fb9ae5f414
4
- data.tar.gz: c47971fcdbef331f3bf12a71610c9cec2d46cba1
3
+ metadata.gz: 4c0aef8f62752a3d2ce7b2964068dc157e861173
4
+ data.tar.gz: 6c04d44d57184b096208d796556eb38615920b30
5
5
  SHA512:
6
- metadata.gz: 06ef740a0955ce973d541555aeebfd12346ae3c238b4beaba4049111a7117882dd71ed1d89b2d3e35b01d9fbd36d90dc76d1890793e9977bf69b4536ec7ff540
7
- data.tar.gz: 8f41eb368525aeb6d1f31a40fbdf9212882f244721c1c00fcb510d5a02e7be9c9250c744ed584113fe3f0bb0712dee224dab5a08f08244277f5bbe8dbb578825
6
+ metadata.gz: 349771191423947b564e97c2c237b263b9e88f46ba52d8d10cef5cfeb74d0373d4bee925ee3b5ad56115741dcd5679e379b873f6906866f281f7fd8fd4dff6cd
7
+ data.tar.gz: 41b8f6c392886583832a82a9572872a6a3129c7b1b872e40ee5bb89a1a0735efaa3af98b69eae648a1d2f435c8ef78d08a58595b561fd8f2e4a9e141887ee1bc
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
5
+ - 2.1.0
6
6
  matrix:
7
7
  allow_failures:
8
- - rvm: 2.0.0
8
+ - rvm: 1.9.3
9
9
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # TableFormatterSimple [![Build Status](https://travis-ci.org/SpringMT/table_formatter_simple)](https://travis-ci.org/SpringMT/table_formatter_simple)
1
+ # TableFormatterSimple [![Build Status](https://travis-ci.org/SpringMT/table_formatter_simple.png)](https://travis-ci.org/SpringMT/table_formatter_simple)
2
2
 
3
3
  Format a table in Teminal.
4
4
 
@@ -13,7 +13,7 @@ class TableFormatterSimple
13
13
 
14
14
  data.each do |d|
15
15
  d.keys.each do |k|
16
- data2hash[k] ||= []
16
+ data2hash[k] ||= [k]
17
17
  data2hash[k] << d[k]
18
18
  end
19
19
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  require 'rubygems'
4
2
  require 'bundler'
5
3
  Bundler.setup(:default, :test)
@@ -47,6 +47,37 @@ TABLE
47
47
  end
48
48
  end
49
49
 
50
+ context 'valid all' do
51
+ subject { TableFormatterSimple.new.to_table([{foo: 1, bar: 1}, {foo: 2, bar: 2}]) }
52
+ it do
53
+ should eql(<<"TABLE")
54
+ +-----+-----+
55
+ | foo | bar |
56
+ +-----+-----+
57
+ | 1 | 1 |
58
+ | 2 | 2 |
59
+ +-----+-----+
60
+ TABLE
61
+ end
62
+ end
63
+
64
+ context 'valid Japanese' do
65
+ pending do
66
+ subject { TableFormatterSimple.new.to_table([{foo: 'あああ', bar: 'bbbb'}, {foo: 'ccc', bar: 'dddd'}]) }
67
+ it do
68
+ should eql(<<"TABLE")
69
+ +--------+------+
70
+ | foo | bar |
71
+ +--------+------+
72
+ | あああ | bbbb |
73
+ | ccc | dddd |
74
+ +--------+------+
75
+ TABLE
76
+ end
77
+ end
78
+ end
79
+
80
+
50
81
  end
51
82
  end
52
83
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "table_formatter_simple"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["SpringMT"]
9
9
  spec.email = ["today.is.sky.blue.sky@gmail.com"]
10
10
  spec.summary = %q{Format a table in Teminal}
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_formatter_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SpringMT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-19 00:00:00.000000000 Z
11
+ date: 2014-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: |
@@ -46,8 +46,8 @@ executables: []
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - .gitignore
50
- - .travis.yml
49
+ - ".gitignore"
50
+ - ".travis.yml"
51
51
  - Gemfile
52
52
  - LICENSE.txt
53
53
  - README.md
@@ -66,17 +66,17 @@ require_paths:
66
66
  - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.0.2
79
+ rubygems_version: 2.2.0
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Format a table in Teminal