Class: CPEE::ExecutionHandlers

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee/implementation.rb

Overview

{{{

Instance Method Summary collapse

Instance Method Details

#responseObject



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/cpee/implementation.rb', line 274

def response
  opts = @a[0]
  doc = XML::Smart::string('<handlers/>')
  list = []
  Dir[File.join(opts[:global_executionhandlers],'*','execution.rb')].each do |h|
    list << File.basename(File.dirname(h))
  end unless opts[:global_executionhandlers].nil? || opts[:global_executionhandlers].strip == ''
  Dir[File.join(opts[:executionhandlers],'*','execution.rb')].each do |h|
    list << File.basename(File.dirname(h))
  end unless opts[:executionhandlers].nil? || opts[:executionhandlers].strip == ''
  list.uniq.each do |e|
    doc.root.add('handler',e)
  end
  Riddl::Parameter::Complex.new('wis','text/xml',doc.to_s)
end