Sha256: 48f6bd83f1f24c42c6df819eae049ab3f1db721a7a1b21e664d2f8f01f461a7e

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

require 'smart_proxy_openscap/openscap_exception'
require 'openscap'
require 'openscap/ds/arf'

module Proxy::OpenSCAP
  class Storage
    include ::Proxy::Log

    def initialize(path_to_dir, cname, id, date)
      @namespace = 'arf'
      @cname = cname
      @id = id
      @date = date
      validate_id(@id)
      @path_to_dir = path_to_dir
      @path = "#{@path_to_dir}/#{@namespace}/#{@cname}/#{@id}/#{@date}/"
    end

    def store_archive(full_path, data)
      raise NotImplementedError
    end

    def store_spool(full_path, data)
      raise NotImplementedError
    end

    def store_failed(full_path, data)
      raise NotImplementedError
    end

    def get_arf_xml(full_path, digest)
      raise NotImplementedError
    end

    def get_arf_html(full_path, digest)
      raise NotImplementedError
    end

    def delete_arf_file
      raise NotImplementedError
    end

    private

    def validate_id(id)
      raise Proxy::OpenSCAP::OpenSCAPException, 'Malformed ARF ID' unless /\A\d+\Z/ =~ id
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
smart_proxy_openscap-0.6.5 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.6.4 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.6.3 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.6.2 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.6.1 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.6.0 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.5.4 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.5.3 lib/smart_proxy_openscap/storage.rb
smart_proxy_openscap-0.5.1 lib/smart_proxy_openscap/storage.rb