ix-cli 0.0.23 → 0.0.25

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
  SHA256:
3
- metadata.gz: 710d6adea721d5d968afcbd10b0ccec144106320bf3b1aa80adfc6ba785e7626
4
- data.tar.gz: e6f7c467e70d58e3f81fd9daf5822707379ffb9a4daac60440f53eceee4dd39a
3
+ metadata.gz: f91aade16c9caf38a86cbb707cb450d7a8fc9b7f4c6c1b66f2b11c6cc1e1fd5c
4
+ data.tar.gz: 02f508ac05321cc4154d34070e0c7d78bf06fec9a8206fcdbe56b4f2d3e78826
5
5
  SHA512:
6
- metadata.gz: 183eaf434866fd17fa8d72c3a02bd8df8fb9b62277a1ab582d2ebad74592376368ed68b604d01d1980b40b324bb8ed78fad8f1cb201666d8ddcf19aa38bf3bdd
7
- data.tar.gz: 890df17fbfbfe03773aa9b456c4ca3d3603cca13db3a0b49fc5ab1d50d42506dd6ba4babe241285dc0ab67c7e30565561f5293302473e54b322a57198ae29bda
6
+ metadata.gz: 3ae606dcb64a65ede528f1751f7ed990d512c59c9aac7ed0a38ead30664d93deb58c01cdee5ba7d330babd69180b76f82becbc290c83d1eda53439d8eceb6e01
7
+ data.tar.gz: c02fc0ffdcb1943467d74400542bec8d9b836fb80f202dfe747796714560de7f5970bc37af32af58997f163ec88184520030f1f8f4fb2686950c8803a8960678
data/bin/ix-json-to-csv CHANGED
@@ -12,7 +12,7 @@ STDIN.each_line do |line|
12
12
  puts hash.keys * "\t"
13
13
  headers = hash.keys
14
14
  end
15
- puts hash.values * "\t"
15
+ puts hash.values.map { |v| v.to_s.gsub(/\t/, ' ') } * "\t"
16
16
  rescue => error
17
17
  end
18
18
  end
data/bin/ix-json-to-table CHANGED
@@ -30,10 +30,14 @@ OptionParser.new do |opts|
30
30
  options[:adjust] = value
31
31
  end
32
32
 
33
- opts.on('-i', '--skin [NAME]', 'Change the skin, can be: [round, none, ascii].') do |value|
33
+ opts.on('-i', '--skin [NAME]', 'Change the skin, can be: [round, square, none, ascii, double].') do |value|
34
34
  options[:skin] = value
35
35
  end
36
36
 
37
+ opts.on('-c', '--count', 'Count, weather if you want a total count of items to be added at the end.') do |value|
38
+ options[:count] = value
39
+ end
40
+
37
41
  end.parse!
38
42
 
39
43
  required_options = [:orient]
@@ -166,9 +170,13 @@ def print_table(data, options)
166
170
  puts middle_ruler
167
171
  puts headers
168
172
  end
173
+
169
174
  puts bottom_ruler
170
175
 
171
- puts "Total: #{data.size} rows"
176
+ if options[:count]
177
+ puts "Total: #{data.size} rows"
178
+ end
179
+
172
180
  end
173
181
 
174
182
  def transpose(hash)
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.23
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuyoshi Tlacaelel