Class: InspecTools::PDF
- Inherits:
-
Object
- Object
- InspecTools::PDF
- Defined in:
- lib/inspec_tools/pdf.rb
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.
16 17 18 19 20 21 22 |
# File 'lib/inspec_tools/pdf.rb', line 16 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
52 53 54 |
# File 'lib/inspec_tools/pdf.rb', line 52 def to_ckl # TODO: to_ckl end |
#to_csv ⇒ Object
44 45 46 |
# File 'lib/inspec_tools/pdf.rb', line 44 def to_csv # TODO: to_csv end |
#to_inspec ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/inspec_tools/pdf.rb', line 24 def to_inspec @controls = [] @csv_handle = nil @cci_xml = nil @nist_mapping = nil @pdf_text = '' @clean_text = '' @transformed_data = '' @profile = {} read_pdf @title ||= extract_title clean_pdf_text transform_data read_excl @profile['controls'] = parse_controls @profile['sha256'] = Digest::SHA256.hexdigest @profile.to_s @profile end |
#to_xccdf ⇒ Object
48 49 50 |
# File 'lib/inspec_tools/pdf.rb', line 48 def to_xccdf # TODO: to_xccdf end |