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.
18 19 20 21 22 23 24 |
# File 'lib/inspec_tools/csv.rb', line 18 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
26 27 28 |
# File 'lib/inspec_tools/csv.rb', line 26 def to_ckl # TODO end |
#to_inspec ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/inspec_tools/csv.rb', line 34 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
30 31 32 |
# File 'lib/inspec_tools/csv.rb', line 30 def to_xccdf # TODO end |