texttable 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/texttable.rb +9 -8
- data/texttable.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f9b989789bcfe00d1c8ead3a7079c9156ac5bc7227324a34b79f82baa915bd3
|
4
|
+
data.tar.gz: 4de414dc3664abba7a8cb089fa93bf5e059c779dcb9665314feb8b4c0588bc9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28c2cb92bbe3354f26776666c55a56ee177ff2969eea1fcf7b0fd0ee42bfe16dd1732315ee7328f8792f3e0e893f71af03f8fad5211091b176c23dee441f4f93
|
7
|
+
data.tar.gz: 6869f42df077bc4d038d679114ec0a647b92c51ebc5e3623247c82cf8eedfbcd60e36bdd8f9144a61c6f722bb233a12e6f09c90c7b9531d8e8bebe01c9cde0ba
|
data/lib/texttable.rb
CHANGED
@@ -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
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
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 ? '`' : ''
|
data/texttable.gemspec
CHANGED
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
|
+
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-
|
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
|