texttable 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/texttable.rb +9 -8
  3. data/texttable.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c4dbf7e3ed3836d1f3e61665700ca6dc7aaf94c95a1a026b3a84cd613c89ee7
4
- data.tar.gz: fc17d9a066c413f3c887889ad488ce703381470f6c53992e10f3ff54d47c7b51
3
+ metadata.gz: 3f9b989789bcfe00d1c8ead3a7079c9156ac5bc7227324a34b79f82baa915bd3
4
+ data.tar.gz: 4de414dc3664abba7a8cb089fa93bf5e059c779dcb9665314feb8b4c0588bc9b
5
5
  SHA512:
6
- metadata.gz: 11639822bf41842b1ee7e8817e53f724ce22cc7fa128391675700a8aa4048e975fe00679bf73d534c276991dcfab242205043d5d20f749b3de0439ab262de300
7
- data.tar.gz: 42519909f0df28de90b93744fb985e99ae3662395cdc2815767d4a0510108154a632e791b295537ee12efd862a5010f3b2af5165ce351b264e512caacd8c528d
6
+ metadata.gz: 28c2cb92bbe3354f26776666c55a56ee177ff2969eea1fcf7b0fd0ee42bfe16dd1732315ee7328f8792f3e0e893f71af03f8fad5211091b176c23dee441f4f93
7
+ data.tar.gz: 6869f42df077bc4d038d679114ec0a647b92c51ebc5e3623247c82cf8eedfbcd60e36bdd8f9144a61c6f722bb233a12e6f09c90c7b9531d8e8bebe01c9cde0ba
@@ -162,19 +162,20 @@ class TextTable
162
162
  lookup
163
163
  end
164
164
 
165
- def csv(sep=',', encoding: nil)
165
+ def csv(sep=',', encoding: nil, **kw)
166
166
  require 'csv'
167
- csv = {}
168
- csv[:encoding ] = encoding + ":UTF-8" if encoding
169
- csv[:col_sep ] = sep
170
- csv[:quote_empty] = false #!# TODO: make this an option
171
- csv = CSV.new($stdout, csv)
167
+ csv = CSV.new($stdout, {
168
+ col_sep: sep,
169
+ encoding: encoding ? encoding + ":UTF-8" : nil,
170
+ quote_empty: false, #!# TODO: make this an option
171
+ **kw
172
+ })
172
173
  csv << @cols.keys
173
174
  @rows.each {|vals| csv << vals}
174
175
  nil
175
176
  end
176
- def tsv; csv("\t"); end
177
- def psv; csv("|" ); end
177
+ def tsv(**kw); csv("\t", **kw); end
178
+ def psv(**kw); csv("|" , **kw); end
178
179
 
179
180
  def sql(table='table', quote: false, timestamps: false, verb: 'insert')
180
181
  q = quote ? '`' : ''
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "texttable"
5
- s.version = "1.1.4"
5
+ s.version = "1.1.5"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary = "An easy way to work with rows and columns as simple tables"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texttable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem will auto-size based on column widths.
14
14
  email: steve.shreeve@gmail.com