rbbt-util 5.21.131 → 5.21.132
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/tsv/parser.rb +1 -0
- data/share/install/software/lib/install_helpers +1 -1
- data/share/rbbt_commands/workflow/task +1 -1
- data/test/rbbt/test_tsv.rb +13 -0
- data/test/rbbt/tsv/test_parser.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d87c122f2c6434f71705d01b2ca0244288de9f2
|
4
|
+
data.tar.gz: d74204053afa22ffe1c51491c771c50bd6fee793
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07aef5902630d2f53c8156407fbf5e16e9a460f0da45f1f9762b10529f40103e0936941226df2e3a1de1e78c8df02e1855c2f5a4bce61b6f3a17c50e000000ea
|
7
|
+
data.tar.gz: 8b426c640fe68261450a6ab12895cabdf548737de2ad196677d271116770f69dcb9e797c44625aa9129dd6b4884180cba3cfa3989a60afa4cab9e3ae9cb1be75
|
data/lib/rbbt/tsv/parser.rb
CHANGED
@@ -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
|
@@ -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
|
data/test/rbbt/test_tsv.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2018-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|