org_tp 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 +4 -4
- data/examples/0100_example.rb +3 -3
- data/lib/org_tp/version.rb +1 -1
- data/spec/org_tp_spec.rb +9 -9
- 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: 6796f82f609344f8350cae3affcea39fe0ca381e
|
4
|
+
data.tar.gz: 2e42598320d8acfd1e610e8049339667180b2814
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 155d799a55773f4bbb7cf6786695aa273f38d98ec5f2f962d5603d2042d0d19613eea54becb5760ec5a7550181cb330b9a8a2903ba8514bc20bf176acd9b7018
|
7
|
+
data.tar.gz: b36fd6df4820820e44a19916569d526adfb7a19d768abfe9969287f152f293f742135c5ef778ec658813e58735bd9f82e7bb4553239a0138482b1069c22d9d27
|
data/examples/0100_example.rb
CHANGED
@@ -5,9 +5,9 @@ tp 1
|
|
5
5
|
tp "foo"
|
6
6
|
tp :foo
|
7
7
|
tp [:a, :b]
|
8
|
-
tp({:
|
9
|
-
tp [{:
|
10
|
-
puts [{:
|
8
|
+
tp({id: 1, name: "alice"})
|
9
|
+
tp [{id: 1, name: "alice"}, {id: 2, name: "bob"}]
|
10
|
+
puts [{id: 1, name: "alice"}, {id: 2, name: "bob"}].to_t
|
11
11
|
puts [{"a" => ["a"]}].to_t
|
12
12
|
puts [{"a" => {"a" => 1}}].to_t
|
13
13
|
# >> |---|
|
data/lib/org_tp/version.rb
CHANGED
data/spec/org_tp_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe OrgTp do
|
|
9
9
|
]
|
10
10
|
end
|
11
11
|
|
12
|
-
it "
|
12
|
+
it "empty array" do
|
13
13
|
OrgTp.generate([]).should == ""
|
14
14
|
end
|
15
15
|
|
@@ -25,7 +25,7 @@ describe OrgTp do
|
|
25
25
|
EOT
|
26
26
|
end
|
27
27
|
|
28
|
-
it "
|
28
|
+
it "header: false" do
|
29
29
|
OrgTp.generate(@rows, header: false).should == <<~EOT
|
30
30
|
|---+-------+------------|
|
31
31
|
| 1 | alice | 0123456789 |
|
@@ -35,7 +35,7 @@ EOT
|
|
35
35
|
EOT
|
36
36
|
end
|
37
37
|
|
38
|
-
it "
|
38
|
+
it "padding disable" do
|
39
39
|
OrgTp.generate(@rows, padding: "").should == <<~EOT
|
40
40
|
|--+-----+-----------|
|
41
41
|
|id|name |description|
|
@@ -47,8 +47,8 @@ EOT
|
|
47
47
|
EOT
|
48
48
|
end
|
49
49
|
|
50
|
-
describe "
|
51
|
-
it "
|
50
|
+
describe "various to_t" do
|
51
|
+
it "hash array" do
|
52
52
|
[{a: 1}].to_t.should == <<~EOT
|
53
53
|
|---|
|
54
54
|
| a |
|
@@ -58,7 +58,7 @@ EOT
|
|
58
58
|
EOT
|
59
59
|
end
|
60
60
|
|
61
|
-
it "
|
61
|
+
it "Hash" do
|
62
62
|
{a: 1}.to_t.should == <<~EOT
|
63
63
|
|---+---|
|
64
64
|
| a | 1 |
|
@@ -66,7 +66,7 @@ EOT
|
|
66
66
|
EOT
|
67
67
|
end
|
68
68
|
|
69
|
-
it "
|
69
|
+
it "String Array" do
|
70
70
|
["a", "b"].to_t.should == <<~EOT
|
71
71
|
|---|
|
72
72
|
| a |
|
@@ -75,7 +75,7 @@ EOT
|
|
75
75
|
EOT
|
76
76
|
end
|
77
77
|
|
78
|
-
it "
|
78
|
+
it "Others" do
|
79
79
|
1.to_t.should be_present
|
80
80
|
"1".to_t.should be_present
|
81
81
|
Module.new.should be_present
|
@@ -86,7 +86,7 @@ EOT
|
|
86
86
|
EOT
|
87
87
|
end
|
88
88
|
|
89
|
-
it "
|
89
|
+
it "Array of hashes and width is correct even when value is array" do
|
90
90
|
OrgTp.generate([{"a" => ["a"]}]).should == <<~EOT
|
91
91
|
|-------|
|
92
92
|
| a |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: org_tp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akicho8
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|