rbbt-util 5.14.24 → 5.14.25
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/util.rb +7 -1
- data/lib/rbbt/util/R.rb +6 -5
- 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: 88885c1c0256441286016e2dcce5064c4bd62c75
|
4
|
+
data.tar.gz: 73044f407bdd1fb7c936841074211291cc13a327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c61172f11902cc5eb070d82a764a469741f9899efbf7fda38c011a18cde6306bbfcfc6e6251372af29f8a5565dd7ffaccf7d091b98cc5ce3715bc6508ef41131
|
7
|
+
data.tar.gz: f34f9a02776870e4dcc253877f953ea48d278a5a60bec8481b04eb084c97d53aa65034133c336ea53e8edfa2c65b20e3cb8de9cb0af3a42d4861ae09771839f5
|
data/lib/rbbt/tsv/util.rb
CHANGED
@@ -90,7 +90,13 @@ module TSV
|
|
90
90
|
file.stream
|
91
91
|
when Path
|
92
92
|
file.open(open_options)
|
93
|
-
when
|
93
|
+
when (defined? Tempfile and Tempfile)
|
94
|
+
begin
|
95
|
+
file.rewind if file.respond_to?(:rewind) and file.eof?
|
96
|
+
rescue
|
97
|
+
end
|
98
|
+
file
|
99
|
+
when IO, StringIO, File
|
94
100
|
begin
|
95
101
|
file.rewind if file.respond_to?(:rewind) and file.eof?
|
96
102
|
rescue
|
data/lib/rbbt/util/R.rb
CHANGED
@@ -26,7 +26,7 @@ source('#{UTIL}');
|
|
26
26
|
Log.debug{"R Script:\n#{ cmd }"}
|
27
27
|
|
28
28
|
if options.delete :monitor
|
29
|
-
io = CMD.cmd('R --vanilla --slave --quiet', options.merge(:in => cmd, :pipe => true))
|
29
|
+
io = CMD.cmd('R --vanilla --slave --quiet', options.merge(:in => cmd, :pipe => true, :log => true))
|
30
30
|
while line = io.gets
|
31
31
|
puts line
|
32
32
|
end
|
@@ -85,8 +85,8 @@ module TSV
|
|
85
85
|
def R(script, open_options = {})
|
86
86
|
TmpFile.with_file do |f|
|
87
87
|
Open.write(f, self.to_s)
|
88
|
-
|
89
|
-
<<-EOF
|
88
|
+
|
89
|
+
script = <<-EOF
|
90
90
|
## Loading tsv into data
|
91
91
|
data = rbbt.tsv('#{f}');
|
92
92
|
|
@@ -95,9 +95,10 @@ data = rbbt.tsv('#{f}');
|
|
95
95
|
## Resaving data
|
96
96
|
if (! is.null(data)){ rbbt.tsv.write('#{f}', data); }
|
97
97
|
EOF
|
98
|
-
)
|
99
98
|
|
100
|
-
|
99
|
+
r_options = Misc.pull_keys open_options, :R
|
100
|
+
io = R.run script, r_options
|
101
|
+
|
101
102
|
|
102
103
|
open_options = Misc.add_defaults open_options, :type => :list
|
103
104
|
if open_options[:raw]
|
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.14.
|
4
|
+
version: 5.14.25
|
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-09-
|
11
|
+
date: 2014-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|