Class: RScriptRW
- Inherits:
-
RScript
- Object
- RScriptBase
- RScript
- RScriptRW
- Defined in:
- lib/rscript.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Methods inherited from RScript
#initialize, #jobs, #reset, #run
Methods inherited from RScriptBase
Constructor Details
This class inherits a constructor from RScript
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
188 189 190 |
# File 'lib/rscript.rb', line 188 def type @type end |
Instance Method Details
#read(args = []) ⇒ Object
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/rscript.rb', line 191 def read(args=[]) puts 'inside read' if @debug @log.info 'RScript/read: args: ' + args.inspect if @log @log.info 'RScript/read: type: ' + type.inspect if @log threads = [] if args.to_s[/\/\/job:/] then ajob = '' args.each_index do |i| if args[i].to_s[/\/\/job:/] then ajob = $'; args[i] = nil end end args.compact! if @debug then puts 'type: ' + self.type.to_s.inspect puts 'self.type: ' + self.type.to_s.inspect end a = read_rsfdoc(args) job = a.find do |xy| name, x = xy name == ajob.to_sym and (x[:attributes][:type] || self.type.to_s) == self.type.to_s end.last out, attr = job[:code], job[:attributes] raise "job not found" unless out.length > 0 out else out = read_rsfdoc(args).map {|x| x.last[:code]}.join("\n") end @log.info 'RScript/read: code: ' + out.inspect if @log [out, args] end |