lib/cpee/implementation.rb in cpee-1.3.134 vs lib/cpee/implementation.rb in cpee-1.3.136

- old
+ new

@@ -23,23 +23,27 @@ SERVER = File.expand_path(File.dirname(__FILE__) + '/../cpee.xml') def self::implementation(opts) opts[:instances] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/instances') - opts[:handlerwrappers] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/handlerwrappers') + opts[:global_handlerwrappers] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/handlerwrappers') + opts[:handlerwrappers] ||= '' opts[:topics] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/topics.xml') opts[:properties_init] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/properties.init') opts[:properties_schema_active] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/properties.schema.active') opts[:properties_schema_finished] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/properties.schema.finished') opts[:properties_schema_inactive] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/properties.schema.inactive') opts[:transformation_dslx] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/transformation_dslx.xsl') opts[:transformation_service] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/transformation.xml') opts[:empty_dslx] ||= File.expand_path(File.dirname(__FILE__) + '/../../server/resources/empty_dslx.xml') Proc.new do + Dir[opts[:global_handlerwrappers] + "/*.rb"].each do |h| + require h + end unless opts[:global_handlerwrappers].strip == '' Dir[opts[:handlerwrappers] + "/*.rb"].each do |h| require h - end + end unless opts[:handlerwrappers].strip == '' controller = {} Dir[opts[:instances] + '/*/properties.xml'].map{|e|::File::basename(::File::dirname(e))}.each do |id| controller[id.to_i] = Controller.new(id,opts) end