table_format 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/README.org +0 -1
- data/examples/0100_basic.rb +0 -3
- data/examples/0140_markdown_format.rb +3 -1
- data/lib/table_format/generator.rb +0 -5
- data/lib/table_format/version.rb +1 -1
- data/spec/table_format_spec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a86c63ac0f5f0dc4e3b9a03deb6be638b38a27775452cc7471bbc60fb68ca72
|
4
|
+
data.tar.gz: 3560e586267ddd3d5f6718ba623008b5bcebc5430f9f5b165d03d6553481bcd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ffbc2bb7690dbaf1e785fee2801cd6326da3add0b14133b03cabc77f221943e223cd240457ed2c3993673671068e4c903be28191a0e2b28173147d669672976
|
7
|
+
data.tar.gz: 4772e4975a09975ea1a953ea7302e119ce2da3539cd19e38b88c6cb39819cc11a11c632fff820fad0409bf90649ce0ec02ea92c4c02ffdfcb8a80f3b73f3c1a6
|
data/README.org
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
|
9
9
|
#+BEGIN_SRC ruby
|
10
10
|
tp Object.constants.grep(/RUBY_/).map { |e| [e, Object.const_get(e)] }.to_h
|
11
|
-
|
12
11
|
# >> |---------------------+------------------------------------------------------------|
|
13
12
|
# >> | RUBY_VERSION | 2.5.0 |
|
14
13
|
# >> | RUBY_RELEASE_DATE | 2017-12-25 |
|
data/examples/0100_basic.rb
CHANGED
@@ -31,10 +31,12 @@ puts
|
|
31
31
|
# set global options
|
32
32
|
TableFormat.default_options.update(markdown: true)
|
33
33
|
tp array
|
34
|
+
# >> |----+-------|
|
34
35
|
# >> | id | name |
|
35
|
-
# >>
|
36
|
+
# >> |----+-------|
|
36
37
|
# >> | 1 | alice |
|
37
38
|
# >> | 2 | bob |
|
39
|
+
# >> |----+-------|
|
38
40
|
# >>
|
39
41
|
# >> | id | name |
|
40
42
|
# >> |----|-------|
|
@@ -23,11 +23,6 @@ module TableFormat
|
|
23
23
|
end
|
24
24
|
|
25
25
|
class Generator
|
26
|
-
def self.default_options
|
27
|
-
warn "[DEPRECATED] `TableFormat::Generator.default_options' is deprecated. Use `TableFormat.default_options' instead."
|
28
|
-
TableFormat.default_options
|
29
|
-
end
|
30
|
-
|
31
26
|
def initialize(rows, **options)
|
32
27
|
@options = TableFormat.default_options.merge(options)
|
33
28
|
|
data/lib/table_format/version.rb
CHANGED
data/spec/table_format_spec.rb
CHANGED
@@ -93,6 +93,15 @@ EOT
|
|
93
93
|
EOT
|
94
94
|
end
|
95
95
|
|
96
|
+
it 'Struct' do
|
97
|
+
Struct.new(:a, :b).new(1, 2).to_h.to_t.should == <<~EOT
|
98
|
+
|---+---|
|
99
|
+
| a | 1 |
|
100
|
+
| b | 2 |
|
101
|
+
|---+---|
|
102
|
+
EOT
|
103
|
+
end
|
104
|
+
|
96
105
|
it 'Others' do
|
97
106
|
1.to_t.should be_present
|
98
107
|
'1'.to_t.should be_present
|