texttable 1.1.6 → 1.1.7
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 +3 -2
- data/texttable.gemspec +1 -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: 7e00f8d89b3eda372e1d263c439bde89c2a49fc514733c03d9d173c27d88a21b
|
4
|
+
data.tar.gz: bd3e7c03b5baa30ad80517ed68ed2cf14937ac037119a49af90e97bc99fe9cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8983dbf73e36741f53acb51f953e88bfc2a77068ddd79aef042ed74e608e17d186d6c3f245bc6d8bcf548cfdb34bb3c40774af6df9e7375d8b6255a744affa10
|
7
|
+
data.tar.gz: c85f63f6c92c17475860fac370fb64c5990e7de39ebf471fcc722e099f6c3b36329d2309f3ea919851c48f99a2515f54b4ed3319f05c63e287fb5e30b04e8a8a
|
data/lib/texttable.rb
CHANGED
@@ -190,7 +190,8 @@ class TextTable
|
|
190
190
|
|
191
191
|
def csv(sep=',', encoding: nil, **kw)
|
192
192
|
require 'csv'
|
193
|
-
|
193
|
+
out = kw.key?(:out) ? (kw.delete(:out) || "").dup : nil
|
194
|
+
csv = CSV.new(out || $stdout, {
|
194
195
|
col_sep: sep,
|
195
196
|
encoding: encoding ? encoding + ":UTF-8" : nil,
|
196
197
|
quote_empty: false, #!# TODO: make this an option
|
@@ -198,7 +199,7 @@ class TextTable
|
|
198
199
|
})
|
199
200
|
csv << @cols.keys
|
200
201
|
@rows.each {|vals| csv << vals}
|
201
|
-
|
202
|
+
out
|
202
203
|
end
|
203
204
|
def tsv(**kw); csv("\t", **kw); end
|
204
205
|
def psv(**kw); csv("|" , **kw); end
|
data/texttable.gemspec
CHANGED