ix-cli 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ix-json-to-table +66 -1
- 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: 710d6adea721d5d968afcbd10b0ccec144106320bf3b1aa80adfc6ba785e7626
|
4
|
+
data.tar.gz: e6f7c467e70d58e3f81fd9daf5822707379ffb9a4daac60440f53eceee4dd39a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 183eaf434866fd17fa8d72c3a02bd8df8fb9b62277a1ab582d2ebad74592376368ed68b604d01d1980b40b324bb8ed78fad8f1cb201666d8ddcf19aa38bf3bdd
|
7
|
+
data.tar.gz: 890df17fbfbfe03773aa9b456c4ca3d3603cca13db3a0b49fc5ab1d50d42506dd6ba4babe241285dc0ab67c7e30565561f5293302473e54b322a57198ae29bda
|
data/bin/ix-json-to-table
CHANGED
@@ -8,6 +8,7 @@ options = {}
|
|
8
8
|
options[:orient] = 'top'
|
9
9
|
options[:transpose] = false
|
10
10
|
options[:adjust] = false
|
11
|
+
options[:skin] = 'round'
|
11
12
|
|
12
13
|
OptionParser.new do |opts|
|
13
14
|
|
@@ -29,6 +30,10 @@ OptionParser.new do |opts|
|
|
29
30
|
options[:adjust] = value
|
30
31
|
end
|
31
32
|
|
33
|
+
opts.on('-i', '--skin [NAME]', 'Change the skin, can be: [round, none, ascii].') do |value|
|
34
|
+
options[:skin] = value
|
35
|
+
end
|
36
|
+
|
32
37
|
end.parse!
|
33
38
|
|
34
39
|
required_options = [:orient]
|
@@ -49,7 +54,9 @@ def print_table(data, options)
|
|
49
54
|
end
|
50
55
|
end
|
51
56
|
|
52
|
-
|
57
|
+
skin = {}
|
58
|
+
|
59
|
+
skin['round'] = {
|
53
60
|
:top_left => '╭',
|
54
61
|
:top_right => '╮',
|
55
62
|
:bottom_left => '╰',
|
@@ -63,6 +70,64 @@ def print_table(data, options)
|
|
63
70
|
:right => '┤'
|
64
71
|
}
|
65
72
|
|
73
|
+
skin['none'] = {
|
74
|
+
:top_left => ' ',
|
75
|
+
:top_right => ' ',
|
76
|
+
:bottom_left => ' ',
|
77
|
+
:bottom_right => ' ',
|
78
|
+
:vertical => ' ',
|
79
|
+
:horizontal => ' ',
|
80
|
+
:cross => ' ',
|
81
|
+
:top => ' ',
|
82
|
+
:bottom => ' ',
|
83
|
+
:left => ' ',
|
84
|
+
:right => ' '
|
85
|
+
}
|
86
|
+
|
87
|
+
skin['ascii'] = {
|
88
|
+
:top_left => '+',
|
89
|
+
:top_right => '+',
|
90
|
+
:bottom_left => '+',
|
91
|
+
:bottom_right => '+',
|
92
|
+
:vertical => '|',
|
93
|
+
:horizontal => '-',
|
94
|
+
:cross => '+',
|
95
|
+
:top => '+',
|
96
|
+
:bottom => '+',
|
97
|
+
:left => '+',
|
98
|
+
:right => '+'
|
99
|
+
}
|
100
|
+
|
101
|
+
skin['square'] = {
|
102
|
+
:top_left => '┌',
|
103
|
+
:top_right => '┐',
|
104
|
+
:bottom_left => '└',
|
105
|
+
:bottom_right => '┘',
|
106
|
+
:vertical => '│',
|
107
|
+
:horizontal => '─',
|
108
|
+
:cross => '┼',
|
109
|
+
:top => '┬',
|
110
|
+
:bottom => '┴',
|
111
|
+
:left => '├',
|
112
|
+
:right => '┤'
|
113
|
+
}
|
114
|
+
|
115
|
+
skin['double'] = {
|
116
|
+
:top_left => '╔',
|
117
|
+
:top_right => '╗',
|
118
|
+
:bottom_left => '╚',
|
119
|
+
:bottom_right => '╝',
|
120
|
+
:vertical => '║',
|
121
|
+
:horizontal => '═',
|
122
|
+
:cross => '╬',
|
123
|
+
:top => '╦',
|
124
|
+
:bottom => '╩',
|
125
|
+
:left => '╠',
|
126
|
+
:right => '╣'
|
127
|
+
}
|
128
|
+
|
129
|
+
config = skin[options[:skin]]
|
130
|
+
|
66
131
|
cm = columns.keys.sort.map do |key|
|
67
132
|
s = ''
|
68
133
|
value = columns[key]
|