Sha256: 46a4dd2fc23730c0eda1400c2c8157ce61d431781f5af7a37159ddacf3ad3406
Contents?: true
Size: 831 Bytes
Versions: 1
Compression:
Stored size: 831 Bytes
Contents
require 'openscap' require 'openscap/ds/sds' module Scaptimony class Policy < ActiveRecord::Base belongs_to :scap_content belongs_to :scap_content_profile has_many :arf_reports, dependent: :destroy validates :name, :presence => true end class GuideGenerator def initialize(p) case p when Scaptimony::Policy @scap_content = p.scap_content @profile = p.scap_content_profile end if @scap_content.nil? or @scap_content.source.nil? OpenSCAP.raise! "Cannot generate HTML Guide for #{@scap_content}/#{@profile}" end end def each sds = OpenSCAP::DS::Sds.new @scap_content.source sds.select_checklist profile_id = @profile.nil? ? nil : @profile.profile_id yield sds.html_guide profile_id sds.destroy end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scaptimony-0.2.0 | app/models/scaptimony/policy.rb |