Sha256: 8b6aa77c81615748fce7752f28bea8a25ea1b95a98d93c935388a10ec62da0d3

Contents?: true

Size: 571 Bytes

Versions: 64

Compression:

Stored size: 571 Bytes

Contents

module ForemanOpenscap
  module LogExtensions
    extend ActiveSupport::Concern
    included do
      SCAP_RESULT = %w[pass fail error unknown notapplicable notchecked notselected informational fixed].freeze
      validate :scap_result
    end

    def self.othered_result_constants
      SCAP_RESULT.reject { |item| item == "pass" || item == "fail" }
    end

    private

    def scap_result
      if report.is_a? ForemanOpenscap::ArfReport
        errors.add(:result, _('is not included in SCAP_RESULT')) unless SCAP_RESULT.include? result
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
foreman_openscap-0.11.3 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-0.11.2 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-0.11.1 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-0.11.0 app/models/concerns/foreman_openscap/log_extensions.rb