texttable 1.1.6 → 1.1.7

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 +3 -2
  3. data/texttable.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 926d3d58ed1350f3e78c718e4064b1200fb214bedad5227ef477971248e2a358
4
- data.tar.gz: dc52ecae113f0385042fbf1fa1aee9b4f7ba92a2ae1d9f1e07d7706b05cf9a45
3
+ metadata.gz: 7e00f8d89b3eda372e1d263c439bde89c2a49fc514733c03d9d173c27d88a21b
4
+ data.tar.gz: bd3e7c03b5baa30ad80517ed68ed2cf14937ac037119a49af90e97bc99fe9cf0
5
5
  SHA512:
6
- metadata.gz: 7c618a01e4a46eca7bb4b2bec56921c0ada77d1ba6570510e1b968b576d8c914cf9d4322ea3ca2c1351a6521ced8b9868cd76a7db332b4e56b2a9d9cebdeb097
7
- data.tar.gz: 1368fb476f90884563b4ac0abdd89b014bfdb3c32a4613b1801d32eb3eabd23643ebb92f574670ed7c1820235a097a8f65fb0da28efccf9af4f4cbfe78dc0b12
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
- csv = CSV.new($stdout, {
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
- nil
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "texttable"
5
- s.version = "1.1.6"
5
+ s.version = "1.1.7"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texttable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve