# File lib/mcollective/ddl.rb, line 69 def self.load_and_cache(*args) Cache.setup(:ddl, 300) plugin = args.first args.size > 1 ? type = args[1].to_s : type = "agent" path = "%s/%s" % [type, plugin] begin ddl = Cache.read(:ddl, path) rescue begin klass = DDL.const_get("%sDDL" % type.capitalize) rescue NameError klass = Base end ddl = Cache.write(:ddl, path, klass.new(*args)) end return ddl end