lib/docman/deployers/deployer.rb in docman-0.0.16 vs lib/docman/deployers/deployer.rb in docman-0.0.17

- old
+ new

@@ -10,12 +10,10 @@ define_hooks :before_push, :after_push, :before_build, :after_build, :before_deploy, :after_deploy @@deployers = {} - #todo: docroot config in separate repos for projects - def self.create(params, context = nil, caller = nil) c = @@deployers[params['handler']] if c c.new(params, context, caller, 'deployer') else @@ -148,28 +146,27 @@ build_dir(item) end end end + def build_recursive(info = nil) + info = info ? info : @docroot_config.structure + build_dir(info) + info['children'].each do |child| + build_recursive(child) + end + end + def build_dir(info) return if @builded.include? info['name'] info.state_name = self['state'] builder = Docman::Builders::Builder.create(self['builders'][info['type']], info, self) build_result = builder.perform logger.info '-------------------------------------------------------' @changed = true if build_result @build_results[info['name']] = build_result ? build_result : 'Not builded' @versions[info['name']] = builder.version @builded << info['name'] - end - - def build_recursive(info = nil) - info = info ? info : @docroot_config.structure - build_dir(info) - - info['children'].each do |child| - build_recursive(child) - end end # TODO: need to refactor. def describe(type = 'short') properties_info(['handler']) \ No newline at end of file