Class: Proxy::OpenSCAP::ContentParser

Inherits:
ShellWrapper show all
Defined in:
lib/smart_proxy_openscap/content_parser.rb

Instance Attribute Summary

Attributes inherited from ShellWrapper

#script_name

Instance Method Summary collapse

Methods inherited from ShellWrapper

#close_unlink, #exception_message, #execute_shell_command, #prepare_in_file, #script_location, #unique_filename

Constructor Details

#initialize(type) ⇒ ContentParser

Returns a new instance of ContentParser.



5
6
7
8
# File 'lib/smart_proxy_openscap/content_parser.rb', line 5

def initialize(type)
  @type = type
  @script_name = 'smart-proxy-scap-validation'
end

Instance Method Details

#command(in_file, out_file) ⇒ Object



26
27
28
# File 'lib/smart_proxy_openscap/content_parser.rb', line 26

def command(in_file, out_file)
  "#{script_location} #{in_file.path} #{out_file.path} #{@type}"
end

#failure_messageObject



22
23
24
# File 'lib/smart_proxy_openscap/content_parser.rb', line 22

def failure_message
  "Failure when running script which validates scap files"
end

#in_filenameObject



18
19
20
# File 'lib/smart_proxy_openscap/content_parser.rb', line 18

def in_filename
  "#{super}-#{@type}-validate-"
end

#out_filenameObject



14
15
16
# File 'lib/smart_proxy_openscap/content_parser.rb', line 14

def out_filename
  "#{in_filename}json-"
end

#validate(scap_file) ⇒ Object



10
11
12
# File 'lib/smart_proxy_openscap/content_parser.rb', line 10

def validate(scap_file)
  execute_shell_command scap_file
end