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-10.1.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-10.0.3 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-10.0.2 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-10.0.1 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-10.0.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-9.0.4 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-9.0.3 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-9.0.2 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-9.0.1 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-9.0.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-8.0.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-7.1.1 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-7.1.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-7.0.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-6.0.0 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-5.2.3 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-5.2.2 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-5.1.1 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-5.2.1 app/models/concerns/foreman_openscap/log_extensions.rb
foreman_openscap-5.2.0 app/models/concerns/foreman_openscap/log_extensions.rb