rbbt-util 5.9.8 → 5.9.10
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/attach/util.rb +4 -1
- data/lib/rbbt/tsv/parallel/traverse.rb +1 -0
- data/lib/rbbt/tsv/util.rb +15 -1
- data/lib/rbbt/workflow/step.rb +6 -8
- data/share/rbbt_commands/stat/abs +1 -1
- data/share/rbbt_commands/stat/density +1 -1
- data/share/rbbt_commands/stat/log +1 -1
- data/share/rbbt_commands/tsv/info +1 -1
- data/share/rbbt_commands/tsv/slice +1 -1
- data/share/rbbt_commands/tsv/subset +1 -1
- data/share/rbbt_commands/workflow/task +0 -2
- 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: 1b01c7fe766ec84aa4005a1454ba37c116cdab5e
|
4
|
+
data.tar.gz: fbdc4ffcdc4eecde849214ebbb2cb34c5707a133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb43c51791fba21ac08a2c446a5a8058b9bdae2af20bc9e2e33fb4ec243e4fb389ea4feda385bbc9073a6a981083609efed8263a40f673cf4490baa39c8d933c
|
7
|
+
data.tar.gz: eae2392ac690150d68bbc3a2d8b0f9d1bc64f4956f32016feede48833cad7e72c0cefff1a91e08b5329b32e6f75a3ed251f193a4a40b6b2d8af0c8113e447faa
|
data/lib/rbbt/tsv/attach/util.rb
CHANGED
@@ -23,7 +23,10 @@ module TSV
|
|
23
23
|
when other.type == :single
|
24
24
|
new_values = [other[key]]
|
25
25
|
else
|
26
|
-
|
26
|
+
other_values = other[key]
|
27
|
+
new_values = field_positions.collect do |pos|
|
28
|
+
pos == :key ? key : other_values[pos]
|
29
|
+
end
|
27
30
|
end
|
28
31
|
|
29
32
|
new_values.collect!{|v| [v]} if type == :double and not other.type == :double
|
data/lib/rbbt/tsv/util.rb
CHANGED
@@ -83,11 +83,25 @@ module TSV
|
|
83
83
|
case
|
84
84
|
when Path === file
|
85
85
|
file.open(open_options)
|
86
|
+
when file.respond_to?(:gets)
|
87
|
+
file.rewind if file.respond_to?(:rewind) and file.eof?
|
88
|
+
file
|
86
89
|
when String === file
|
87
90
|
Open.open(file, open_options)
|
88
|
-
|
91
|
+
else
|
92
|
+
raise "Cannot get stream from: #{file.inspect}"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
def self.get_stream(file, open_options = {})
|
96
|
+
case file
|
97
|
+
when Path
|
98
|
+
file.open(open_options)
|
99
|
+
when IO, StringIO
|
89
100
|
file.rewind if file.respond_to?(:rewind) and file.eof?
|
90
101
|
file
|
102
|
+
when String
|
103
|
+
raise "Could not open file given by String: #{Misc.fingerprint file}" unless File.exists? file
|
104
|
+
Open.open(file, open_options)
|
91
105
|
else
|
92
106
|
raise "Cannot get stream from: #{file.inspect}"
|
93
107
|
end
|
data/lib/rbbt/workflow/step.rb
CHANGED
@@ -123,14 +123,13 @@ class Step
|
|
123
123
|
raise $!
|
124
124
|
end
|
125
125
|
}
|
126
|
-
|
127
|
-
Log.info{"#{Log.color :magenta, "Starting task"} #{Log.color :yellow, task.name.to_s || ""} [#{Process.pid}]: #{ Log.color :blue, path }"}
|
128
|
-
set_info :status, :started
|
129
126
|
|
130
|
-
set_info :started, (start_time = Time.now)
|
131
|
-
|
132
127
|
set_info :inputs, Misc.remove_long_items(Misc.zip2hash(task.inputs, @inputs)) unless task.inputs.nil?
|
133
128
|
|
129
|
+
#Log.info{"#{Log.color :magenta, "Starting task"} #{Log.color :yellow, task.name.to_s || ""} [#{Process.pid}]: #{ Log.color :blue, path }"}
|
130
|
+
set_info :started, (start_time = Time.now)
|
131
|
+
log :started, "#{Log.color :magenta, "Starting task"} #{Log.color :yellow, task.name.to_s || ""} [#{Process.pid}]"
|
132
|
+
|
134
133
|
res = begin
|
135
134
|
exec
|
136
135
|
rescue Aborted
|
@@ -162,10 +161,9 @@ class Step
|
|
162
161
|
raise $!
|
163
162
|
end
|
164
163
|
|
165
|
-
set_info :status, :done
|
166
164
|
set_info :done, (done_time = Time.now)
|
167
|
-
set_info :time_elapsed, done_time - start_time
|
168
|
-
|
165
|
+
set_info :time_elapsed, (time_elapsed = done_time - start_time)
|
166
|
+
log :done, "#{Log.color :magenta, "Completed task"} #{Log.color :yellow, task.name.to_s || ""} [#{Process.pid}] +#{time_elapsed.to_i}"
|
169
167
|
|
170
168
|
res
|
171
169
|
end
|
@@ -12,7 +12,7 @@ Take absolute value
|
|
12
12
|
|
13
13
|
$ rbbt stat density <file>
|
14
14
|
|
15
|
-
Display summary information. Works with Tokyocabinet HDB and
|
15
|
+
Display summary information. Works with Tokyocabinet HDB and BDB as well.
|
16
16
|
|
17
17
|
-tch--tokyocabinet File is a TC HDB
|
18
18
|
-tcb--tokyocabinet_bd File is a TC BDB
|
@@ -12,7 +12,7 @@ Calculate density
|
|
12
12
|
|
13
13
|
$ rbbt stat density <file>
|
14
14
|
|
15
|
-
Display summary information. Works with Tokyocabinet HDB and
|
15
|
+
Display summary information. Works with Tokyocabinet HDB and BDB as well.
|
16
16
|
|
17
17
|
-tch--tokyocabinet File is a TC HDB
|
18
18
|
-tcb--tokyocabinet_bd File is a TC BDB
|
@@ -12,7 +12,7 @@ Take logs
|
|
12
12
|
|
13
13
|
$ rbbt stat density <file>
|
14
14
|
|
15
|
-
Display summary information. Works with Tokyocabinet HDB and
|
15
|
+
Display summary information. Works with Tokyocabinet HDB and BDB as well.
|
16
16
|
|
17
17
|
-tch--tokyocabinet File is a TC HDB
|
18
18
|
-tcb--tokyocabinet_bd File is a TC BDB
|
@@ -10,7 +10,7 @@ Inspect a TSV file
|
|
10
10
|
|
11
11
|
$ rbbt tsv info [options] file.tsv
|
12
12
|
|
13
|
-
Display summary information. Works with Tokyocabinet HDB and
|
13
|
+
Display summary information. Works with Tokyocabinet HDB and BDB as well.
|
14
14
|
|
15
15
|
-tch--tokyocabinet File is a TC HDB
|
16
16
|
-tcb--tokyocabinet_bd File is a TC BDB
|
@@ -10,7 +10,7 @@ Slice column from tsv
|
|
10
10
|
|
11
11
|
$ rbbt tsv slice [options] file.tsv -f "Field 1"
|
12
12
|
|
13
|
-
Display summary informations. Works with Tokyocabinet HDB and
|
13
|
+
Display summary informations. Works with Tokyocabinet HDB and BDB as well.
|
14
14
|
|
15
15
|
-tch--tokyocabinet File is a TC HDB
|
16
16
|
-tcb--tokyocabinet_bd File is a TC BDB
|
@@ -10,7 +10,7 @@ Subset entries in a tsv
|
|
10
10
|
|
11
11
|
$ rbbt tsv subset [options] file.tsv --subset key1,key2,key3
|
12
12
|
|
13
|
-
Subsets entries from a TSV file from a given list. Works with Tokyocabinet HDB and
|
13
|
+
Subsets entries from a TSV file from a given list. Works with Tokyocabinet HDB and BDB as well.
|
14
14
|
|
15
15
|
-tch--tokyocabinet File is a TC HDB
|
16
16
|
-tcb--tokyocabinet_bd File is a TC BDB
|
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.9.
|
4
|
+
version: 5.9.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|