rscript 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rscript.rb +5 -5
- metadata +1 -1
data/lib/rscript.rb
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
# http://www.opensource.org/licenses/mit-license.php
|
22
22
|
|
23
23
|
|
24
|
-
require '
|
24
|
+
require 'rscript_base'
|
25
25
|
|
26
26
|
class RScript < RScriptBase
|
27
27
|
|
@@ -42,14 +42,14 @@ class RScript < RScriptBase
|
|
42
42
|
|
43
43
|
args.compact!
|
44
44
|
|
45
|
-
out =
|
45
|
+
out = read_rsf(args) do |doc|
|
46
46
|
doc.root.elements.to_a("//job[#{ajob.join(' or ')}]").map do |job|
|
47
|
-
job.elements.to_a('script').map {|s|
|
47
|
+
job.elements.to_a('script').map {|s| read_script(s)}.join("\n")
|
48
48
|
end.join("\n")
|
49
49
|
end
|
50
50
|
|
51
51
|
else
|
52
|
-
out = run_rsf(args) {|doc| doc.root.elements.to_a('//script').map {|s|
|
52
|
+
out = run_rsf(args) {|doc| doc.root.elements.to_a('//script').map {|s| read_script(s)}}
|
53
53
|
end
|
54
54
|
|
55
55
|
[out, args]
|
@@ -70,6 +70,6 @@ end
|
|
70
70
|
if __FILE__ == $0 then
|
71
71
|
raw_args = ARGV
|
72
72
|
rs = RScript.new()
|
73
|
-
code, args = rs.
|
73
|
+
code, args = rs.read(raw_args)
|
74
74
|
puts eval(code).join("\n")
|
75
75
|
end
|