Sha256: d2f174c877132ce77f1fc8d879ddc8dc4684be297d6487e912b541cedf4e2867

Contents?: true

Size: 707 Bytes

Versions: 16

Compression:

Stored size: 707 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} tasks, %{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

16 entries across 16 versions & 1 rubygems

Version Path
foreman-tasks-0.7.12 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.11 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.10 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.9 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.8 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.7 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.6 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.5 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.4 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.3 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.7.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.6.15 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.6.14 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-0.6.13 app/lib/actions/action_with_sub_plans.rb