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-10.0.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-10.0.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.2.3 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.2.2 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.2.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.2.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.1.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.0.4 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.1.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.0.2 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.0.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.3.3 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-9.0.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.2.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.1.4 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.3.2 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.3.1 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.1.3 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.3.0 app/lib/actions/middleware/inherit_task_groups.rb
foreman-tasks-8.2.0 app/lib/actions/middleware/inherit_task_groups.rb