Sha256: 17bc08e02ec38b19d193d7412de18607afc834de7a5286314e951939b75ea733

Contents?: true

Size: 558 Bytes

Versions: 17

Compression:

Stored size: 558 Bytes

Contents

require 'openscap'
require 'openscap/ds/arf'

module Proxy
  module OpenSCAP
    class ArfHtml
      def generate_html(file_in, file_out)
        ::OpenSCAP.oscap_init
        File.write file_out, get_arf_html(file_in)
      ensure
        ::OpenSCAP.oscap_cleanup
      end

      def get_arf_html(file_in)
        arf_object = ::OpenSCAP::DS::Arf.new(file_in)
        # @TODO: Drop this when support for 1.8.7 ends
        return arf_object.html if RUBY_VERSION.start_with? '1.8'
        arf_object.html.force_encoding('UTF-8')
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
smart_proxy_openscap-0.11.1 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.11.0 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.9.2 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.9.1 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.9.0 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.7.5 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.8.1 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.8.0 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.7.4 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.7.3 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.7.2 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.7.1 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.7.0 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.6.11 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.6.10 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.6.9 lib/smart_proxy_openscap/arf_html.rb
smart_proxy_openscap-0.6.8 lib/smart_proxy_openscap/arf_html.rb