rbbt-util 5.17.25 → 5.17.26

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/tsv/util.rb +7 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 771dbe9c3e25ad61e97b4f8f32de63f4ace5db76
4
- data.tar.gz: 61ba0a0b3add2d4495b9415b127392a48ca8c62c
3
+ metadata.gz: f62636918aa61cd6f5ceb8b90706a41c027f8966
4
+ data.tar.gz: 6d1fc342a4f1b16820997d259df7ccb9ead7aca6
5
5
  SHA512:
6
- metadata.gz: e4ebc65f9f75ee5b910b9eee985a8df3e1a7830faa3dc2a65eb3fa8ff878d61497f08f046da247cd5486b0c5d63dd0b032399f7670c525824d7ae6741d45372c
7
- data.tar.gz: 7f7e8ca9423379008a6facb6abe40c788336499216f9fea11f5011893a8a9f4ccf05d6648f78b1c213a47d32624b7b69d2dd22cbfdfb6391b36989346f0c22a7
6
+ metadata.gz: 58bfb49d811b4509fcfe8f213a7a6692b415c3d653095e3eb2d1584ed873a4139b4d8b1bb8eeaee422f707c515b61f870dceca1d802b427d04deb3a731be1773
7
+ data.tar.gz: c91c2e84ed2ff38f067b91a2e74147df24cc91685bb73c5cad65d63cfd886d58a978b220a0fccd448d60a661a2243f5e1f0155ddb4bcfab6f592ea7b844eb6e7
data/lib/rbbt/tsv/util.rb CHANGED
@@ -5,11 +5,13 @@ module TSV
5
5
  Misc.open_pipe do |sin|
6
6
  line = stream.gets
7
7
  line.strip! unless line.nil?
8
+
8
9
  while line =~ /^#\:/
9
10
  sin.puts line
10
11
  line = stream.gets
11
12
  line.strip! unless line.nil?
12
13
  end
14
+
13
15
  while line =~ /^#/
14
16
  if Hash === positions
15
17
  new = (0..line.split(sep).length-1).to_a
@@ -19,10 +21,11 @@ module TSV
19
21
  end
20
22
  positions = new
21
23
  end
22
- sin.puts "#" + line.sub!(/^#/,'').strip.split(sep).values_at(*positions).compact * sep
24
+ sin.puts "#" + line.sub(/^#/,'').strip.split(sep).values_at(*positions).compact * sep
23
25
  line = stream.gets
24
26
  line.strip! unless line.nil?
25
27
  end
28
+
26
29
  while line
27
30
  if Hash === positions
28
31
  new = (0..line.split(sep).length-1).to_a
@@ -32,7 +35,9 @@ module TSV
32
35
  end
33
36
  positions = new
34
37
  end
35
- sin.puts line.strip.split(sep).values_at(*positions) * sep
38
+ values = line.split(sep)
39
+ new_values = values.values_at(*positions)
40
+ sin.puts new_values * sep
36
41
  line = stream.gets
37
42
  line.strip! unless line.nil?
38
43
  end
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.17.25
4
+ version: 5.17.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-19 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake