Sha256: 88c8914d7b1be8609544b34aeb1e106d7203fcb9e606552223ac69406c402123

Contents?: true

Size: 644 Bytes

Versions: 81

Compression:

Stored size: 644 Bytes

Contents

module Actions
  class Actions::ActionWithSubPlans < Actions::EntryAction
    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

81 entries across 81 versions & 1 rubygems

Version Path
foreman-tasks-8.1.4 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.1.3 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.1.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.1.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.1.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.0.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.0.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-8.0.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-7.2.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-7.1.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-7.2.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-7.1.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-6.0.3 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-7.0.0 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-6.0.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-4.1.6 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-5.2.3 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-6.0.1 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-5.2.2 app/lib/actions/action_with_sub_plans.rb
foreman-tasks-6.0.0 app/lib/actions/action_with_sub_plans.rb