Class: InspecTools::CSVTool
Overview
Methods for converting from CSV to various formats
Instance Method Summary collapse
-
#initialize(csv, mapping, name, verbose = false) ⇒ CSVTool
constructor
A new instance of CSVTool.
- #to_ckl ⇒ Object
- #to_inspec ⇒ Object
- #to_xccdf ⇒ Object
Constructor Details
#initialize(csv, mapping, name, verbose = false) ⇒ CSVTool
Returns a new instance of CSVTool.
16 17 18 19 20 21 22 |
# File 'lib/inspec_tools/csv.rb', line 16 def initialize(csv, mapping, name, verbose = false) @name = name @csv = csv @mapping = mapping @verbose = verbose @csv.shift if @mapping['skip_csv_header'] end |
Instance Method Details
#to_ckl ⇒ Object
24 25 26 |
# File 'lib/inspec_tools/csv.rb', line 24 def to_ckl # TODO end |
#to_inspec ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/inspec_tools/csv.rb', line 32 def to_inspec @controls = [] @cci_xml = nil @profile = {} read_cci_xml parse_controls @profile['controls'] = @controls @profile['sha256'] = Digest::SHA256.hexdigest @profile.to_s @profile end |
#to_xccdf ⇒ Object
28 29 30 |
# File 'lib/inspec_tools/csv.rb', line 28 def to_xccdf # TODO end |