Class: InspecTools::PDF
Instance Method Summary collapse
-
#initialize(pdf, profile_name, debug = false) ⇒ PDF
constructor
A new instance of PDF.
- #to_ckl ⇒ Object
- #to_csv ⇒ Object
- #to_inspec ⇒ Object
- #to_xccdf ⇒ Object
Constructor Details
#initialize(pdf, profile_name, debug = false) ⇒ PDF
Returns a new instance of PDF.
11 12 13 14 15 16 17 |
# File 'lib/inspec_tools/pdf.rb', line 11 def initialize(pdf, profile_name, debug = false) raise ArgumentError if pdf.nil? @pdf = pdf @name = profile_name @debug = debug end |
Instance Method Details
#to_ckl ⇒ Object
46 47 48 |
# File 'lib/inspec_tools/pdf.rb', line 46 def to_ckl # TODO: to_ckl end |
#to_csv ⇒ Object
38 39 40 |
# File 'lib/inspec_tools/pdf.rb', line 38 def to_csv # TODO: to_csv end |
#to_inspec ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/inspec_tools/pdf.rb', line 19 def to_inspec @controls = [] @csv_handle = nil @cci_xml = nil @nist_mapping = Utils::CisToNist.get_mapping('cis_to_nist_critical_controls') @pdf_text = '' @clean_text = '' @transformed_data = '' @profile = {} read_pdf @title ||= extract_title clean_pdf_text transform_data @profile['controls'] = parse_controls @profile['sha256'] = Digest::SHA256.hexdigest @profile.to_s @profile end |
#to_xccdf ⇒ Object
42 43 44 |
# File 'lib/inspec_tools/pdf.rb', line 42 def to_xccdf # TODO: to_xccdf end |