Sha256: 71da0bda9f1b39076ec404af2dfc0d873b3df8350bc4a0bab364fa9f5a2dfba4

Contents?: true

Size: 701 Bytes

Versions: 28

Compression:

Stored size: 701 Bytes

Contents

module Actions
  class Actions::ActionWithSubPlans < Actions::EntryAction
    middleware.use Actions::Middleware::KeepCurrentUser

    include Dynflow::Action::WithSubPlans

    def plan(*_args)
      raise NotImplementedError
    end

    def humanized_output
      return unless counts_set?
      _('%{total} task(s), %{success} success, %{failed} fail') %
        { total:   output[:total_count],
          success: output[:success_count],
          failed:  output[:failed_count] }
    end

    def run_progress
      if counts_set? && output[:total_count] > 0
        (output[:success_count] + output[:failed_count]).to_f / output[:total_count]
      else
        0.1
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
foreman-tasks-0.11.3 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.14.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.13.4 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.13.3 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.13.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.13.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.13.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.12.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.11.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.12.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.12.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.11.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.10.9 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.11.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.10.8 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.10.7 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.10.6 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.10.4 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.9.6 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.10.3 app/lib/actions/action_with_sub_plans.rb