rbbt-util 5.21.131 → 5.21.132

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: 30f68eea441653388fb59fd05ae206e5b120b8eb
4
- data.tar.gz: 88a93f9598386c6605e086ce575c2d0ff31a3146
3
+ metadata.gz: 6d87c122f2c6434f71705d01b2ca0244288de9f2
4
+ data.tar.gz: d74204053afa22ffe1c51491c771c50bd6fee793
5
5
  SHA512:
6
- metadata.gz: 2d21f9912e46073ec0c7593e15702be44445f9928405d70a5dd9c2d92c53d42cd0f04be8c9a33f9dd6dd29229ca4ec39a902cf3dc55682b15b7c9c081a5092c0
7
- data.tar.gz: 22a459d7ed570054f06d3d33b9202ac577bded51a21c105669afa7e1d3cff160973a9f03bf3252f88518ade85418ba087430426f9fc5ecb3f3b7bcbdc9539c26
6
+ metadata.gz: 07aef5902630d2f53c8156407fbf5e16e9a460f0da45f1f9762b10529f40103e0936941226df2e3a1de1e78c8df02e1855c2f5a4bce61b6f3a17c50e000000ea
7
+ data.tar.gz: 8b426c640fe68261450a6ab12895cabdf548737de2ad196677d271116770f69dcb9e797c44625aa9129dd6b4884180cba3cfa3989a60afa4cab9e3ae9cb1be75
@@ -408,6 +408,7 @@ module TSV
408
408
  @header_options = parse_header(stream)
409
409
 
410
410
  options = @header_options.merge options
411
+ options = Misc.add_defaults options, :fields => [1] if options[:type] == :single and options[:fields].nil?
411
412
 
412
413
  @type ||= Misc.process_options(options, :type) || :double
413
414
  @type ||= :double
@@ -140,7 +140,7 @@ build(){
140
140
  echo `pwd`
141
141
  ls
142
142
 
143
- if [ -f Makefile.am -a -n -f configure ]; then
143
+ if [ -f Makefile.am -a ! -f configure ]; then
144
144
  autoreconf
145
145
  fi
146
146
 
@@ -119,7 +119,7 @@ def fix_options(workflow, task, job_options)
119
119
  when value == '-'
120
120
  array_separator ||= "\n"
121
121
  STDIN.read
122
- when (String === value and File.exist?(value) and not input_options[name][:nofile])
122
+ when (String === value and File.exist?(value) and not (input_options[name] && input_options[name][:nofile]))
123
123
  array_separator ||= "\n"
124
124
  Open.read(value)
125
125
  else
@@ -92,6 +92,19 @@ row1 a|aa|aaa b Id1|Id2
92
92
  row2 A B Id3
93
93
  EOF
94
94
 
95
+ TmpFile.with_file(content) do |filename|
96
+ tsv = TSV.open(filename, :sep => /\s+/, :type => :single)
97
+ assert_equal tsv.fields, ["ValueA"]
98
+ end
99
+ end
100
+
101
+ def test_tsv_field_selection
102
+ content =<<-EOF
103
+ #Id ValueA ValueB OtherID
104
+ row1 a|aa|aaa b Id1|Id2
105
+ row2 A B Id3
106
+ EOF
107
+
95
108
  TmpFile.with_file(content) do |filename|
96
109
  tsv = TSV.open(filename, :sep => /\s+/, :key_field => 0)
97
110
  assert_equal ["a", "aa", "aaa"], tsv["row1"][0]
@@ -25,10 +25,11 @@ row1 a|aa|aaa b Id1|Id2
25
25
  end
26
26
 
27
27
  TSV::Parser.traverse(Open.open(filename), :sep => /\s+/, :fields => [1], :type => :flat) do |k,v|
28
- assert_equal "row1", k
28
+ assert_equal ["row1"], k
29
29
  assert_equal %w(a aa aaa), v
30
30
  end
31
31
  end
32
32
  end
33
+
33
34
  end
34
35
 
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.21.131
4
+ version: 5.21.132
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-15 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake