Sha256: 0c11d4380ba8de277e9175535e221f37e457f84b77c2445461b8ea31ca6d065a

Contents?: true

Size: 512 Bytes

Versions: 59

Compression:

Stored size: 512 Bytes

Contents

module ForemanTasks
  class Task::StatusExplicator
    ANY = 1
    ERRONEOUS_STATUSES = [
      { :state => 'paused', :result => ANY },
      { :state => ANY, :result => 'error' },
      { :state => ANY, :result => 'warning' },
    ].freeze
    def is_erroneous(task)
      remainder = ERRONEOUS_STATUSES.select do |status|
        (status[:state] == ANY || status[:state] == task.state) &&
          (status[:result] == ANY || status[:result] == task.result)
      end
      !remainder.empty?
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman-tasks-5.2.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-5.1.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-5.1.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.1.5 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.1.4 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.1.3 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.6 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-5.0.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.1.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.1.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.0.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.1.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.5 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-4.0.0 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.4 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.3 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.2 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.1 app/models/foreman_tasks/task/status_explicator.rb
foreman-tasks-3.0.0 app/models/foreman_tasks/task/status_explicator.rb