rbbt-util 5.25.31 → 5.25.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f68692725942b4b7093433ae6cd3ce2b021e6fcc
4
- data.tar.gz: 76ec7e3c0cc49cbe6f056d5203624a31eb53192f
3
+ metadata.gz: '090b2d7cbaff9c7bbfa64bf7cae5fcb70e542187'
4
+ data.tar.gz: ff563a4afe38bdadbae449268576cf23ba41b011
5
5
  SHA512:
6
- metadata.gz: 26b78cd83316c25d6326664aef707fc777e659c4655de66ddc205830833a8bba73007acbf538aee9c5c465e1e888f73e90e259bec8bc9a1f2b83b2bcdfb74953
7
- data.tar.gz: c93486946a1b6714ecea32026c1d1b5a9d7fa25c4e491024d8b4a34da3542f154320bb47dc7ea62df0a3368264525bac8870455af046d83544a2e1bd9b642eb9
6
+ metadata.gz: ea1e035a6b3389913f1215ef0d804d72ddb4c95320d63f9fe66bf4f596499479a324c505fea962941771808426180cc7a655c9f2c84764c315ab85987df517a1
7
+ data.tar.gz: b06b23ff0dae842f397983f1a9bf6c46112814c34a6804789f4949dd18ebc3a361ca46aae7a734a6518efd8fc628da6b4f42e8d49b0eb97b6c4173ca41bec939
@@ -545,7 +545,7 @@ module TSV
545
545
 
546
546
  # first line
547
547
  line = self.rescue_first_line
548
- line = stream.gets
548
+ line = stream.gets if line.nil?
549
549
 
550
550
  if @tsv_grep
551
551
 
@@ -185,7 +185,6 @@ module Misc
185
185
  when FalseClass === v
186
186
  str << k.to_s << "=>false"
187
187
  when TSV === v
188
- iii :TSV
189
188
  str << k.to_s << "=>" << obj2md5(v)
190
189
  when Hash === v
191
190
  str << k.to_s << "=>" << hash2md5(v)
@@ -57,14 +57,21 @@ else
57
57
  end
58
58
 
59
59
  if String === file and not Open.remote? file and File.exist? file
60
- rows = `wc -l '#{ file }' 2>/dev/null|cut -f 1 -d' '`
60
+ rows = `wc -l '#{ file }' 2> /dev/null|cut -f 1 -d' '`.strip
61
+ header_rows = `(head '#{ file }' |grep "#" | wc -l) 2> /dev/null|cut -f 1 -d' '`
62
+ if header_rows.to_i <= 2 and header_rows.to_i >= 1
63
+ rows = rows.to_i - header_rows.to_i
64
+ else
65
+ rows << ' (possibly including header)'
66
+ end
61
67
  else
62
68
  rows = "Could not get rows of #{Misc.fingerprint file}"
63
69
  end
64
- puts "Rows: #{Log.color :blue, rows}"
65
- parts = []
66
- header.first_line.split(header.sep, -1).each_with_index{|p,i| parts << (Log.color(:cyan, "(#{i}) ") << p.strip) }
67
- puts parts * "\t"
70
+
71
+ puts "Rows: #{Log.color :blue, rows}"
72
+ parts = []
73
+ header.first_line.split(header.sep, -1).each_with_index{|p,i| parts << (Log.color(:cyan, "(#{i}) ") << p.strip) }
74
+ puts parts * "\t"
68
75
  puts
69
76
  end
70
77
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.25.31
4
+ version: 5.25.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-04 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake