Class: InspecTools::CSVTool
- Inherits:
-
Object
- Object
- InspecTools::CSVTool
- Defined in:
- lib/inspec_tools/csv.rb
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.
17 18 19 20 21 22 23 |
# File 'lib/inspec_tools/csv.rb', line 17 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
25 26 27 |
# File 'lib/inspec_tools/csv.rb', line 25 def to_ckl # TODO end |
#to_inspec ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/inspec_tools/csv.rb', line 33 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
29 30 31 |
# File 'lib/inspec_tools/csv.rb', line 29 def to_xccdf # TODO end |