Class: InspecTools::XLSXTool

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec_tools/xlsx_tool.rb

Overview

Methods for converting from XLS to various formats

Constant Summary collapse

LATEST_NIST_REV =
'Rev_4'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(xlsx, mapping, name, verbose = false) ⇒ XLSXTool

Returns a new instance of XLSXTool.



16
17
18
19
20
21
22
# File 'lib/inspec_tools/xlsx_tool.rb', line 16

def initialize(xlsx, mapping, name, verbose = false)
  @name = name
  @xlsx = xlsx
  @mapping = Utils::MappingValidator.validate(mapping)
  @verbose = verbose
  @cis_to_nist = Utils::CisToNist.get_mapping('cis_to_nist_mapping')
end

Instance Method Details

#to_cklObject



24
25
26
# File 'lib/inspec_tools/xlsx_tool.rb', line 24

def to_ckl
  # TODO
end

#to_inspec(control_prefix) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/inspec_tools/xlsx_tool.rb', line 32

def to_inspec(control_prefix)
  @controls = []
  @cci_xml = nil
  @profile = {}
  
  parse_cis_controls(control_prefix)
  @profile['controls'] = @controls
  @profile['sha256'] = Digest::SHA256.hexdigest @profile.to_s
  @profile
end

#to_xccdfObject



28
29
30
# File 'lib/inspec_tools/xlsx_tool.rb', line 28

def to_xccdf
  # TODO
end