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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/ix-json-to-table +66 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6201f592feb8666f1617290e1475d0c2c2763f3d9e9fffdc6fe22b764c54602
4
- data.tar.gz: 351cd99558c3e85c47599dea7bb938d6c19c07b1a39eedcd079549772ba53b26
3
+ metadata.gz: 710d6adea721d5d968afcbd10b0ccec144106320bf3b1aa80adfc6ba785e7626
4
+ data.tar.gz: e6f7c467e70d58e3f81fd9daf5822707379ffb9a4daac60440f53eceee4dd39a
5
5
  SHA512:
6
- metadata.gz: 59aaabd4241f214b5f95152b69075cf78cb6b6f7c57c3a2a44960cd245d3343f240078c341a11143716e401b33fccdcc4640b708190b3be419410fcf641a6548
7
- data.tar.gz: ea63c41c3955f956af5df4122a1e93d0853ce6e4eff83aa90050addbad2f67497163f0872c45b1805ff20ffe9daf3b9aac23bec2e519f32c1e03b37f6624c4f9
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
- config = {
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ix-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuyoshi Tlacaelel