Class: RScript
- Inherits:
-
RScriptBase
- Object
- RScriptBase
- RScript
- Defined in:
- lib/rcscript.rb
Instance Method Summary collapse
-
#initialize ⇒ RScript
constructor
A new instance of RScript.
- #run(args = []) ⇒ Object
Constructor Details
#initialize ⇒ RScript
Returns a new instance of RScript.
28 29 |
# File 'lib/rcscript.rb', line 28 def initialize() end |
Instance Method Details
#run(args = []) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rcscript.rb', line 31 def run(args=[]) threads = [] if args.to_s[/\/\/job:/] then ajob = [] args.each_index do |i| if args[i][/\/\/job:/] then ajob << "@id='#{$'}'"; args[i] = nil end end args.compact! out = run_rsf(args) do |doc| doc.root.elements.to_a("//job[#{ajob.join(' or ')}]").map do |job| job.elements.to_a('script').map {|s| run_script(s)}.join("\n") end.join("\n") end else out = run_rsf(args) {|doc| doc.root.elements.to_a('//script').map {|s| run_script(s)}} end [out, args] end |