Sha256: 727a2b86febf7dd3a95b37904744b135516bafe360c4ee1d5e6ad9ab543388ee

Contents?: true

Size: 697 Bytes

Versions: 128

Compression:

Stored size: 697 Bytes

Contents

module Actions
  module Middleware
    class InheritTaskGroups < Dynflow::Middleware
      def delay(*args)
        pass(*args)
      end

      def plan(*args)
        inherit_task_groups
        pass(*args)
      end

      def run(*args)
        pass(*args)
        collect_children_task_groups
      end

      def finalize
        pass
      end

      private

      def inherit_task_groups
        task.add_missing_task_groups(task.parent_task.task_groups) if task.parent_task
      end

      def collect_children_task_groups
        task.add_missing_task_groups task.sub_tasks.map(&:task_groups).flatten
      end

      def task
        @task ||= action.task
      end
    end
  end
end

Version data entries

128 entries across 128 versions & 1 rubygems

Version Path
foreman-tasks-5.2.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-5.1.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-5.1.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.1.5 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.1.4 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.1.3 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.6 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-5.0.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.1.2 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.1.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.0.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.1.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.5 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-4.0.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.4 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-2.0.3 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.3 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.2 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-3.0.0 app/lib/actions/middleware/inherit_task_groups.rb