Class: Proxy::OpenSCAP::ProfilesParser

Inherits:
ShellWrapper show all
Defined in:
lib/smart_proxy_openscap/profiles_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) ⇒ ProfilesParser

Returns a new instance of ProfilesParser.



6
7
8
9
# File 'lib/smart_proxy_openscap/profiles_parser.rb', line 6

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

Instance Method Details

#command(in_file, out_file) ⇒ Object



27
28
29
# File 'lib/smart_proxy_openscap/profiles_parser.rb', line 27

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

#failure_messageObject



23
24
25
# File 'lib/smart_proxy_openscap/profiles_parser.rb', line 23

def failure_message
  "Failure when running script which extracts profiles from scap file"
end

#in_filenameObject



19
20
21
# File 'lib/smart_proxy_openscap/profiles_parser.rb', line 19

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

#out_filenameObject



15
16
17
# File 'lib/smart_proxy_openscap/profiles_parser.rb', line 15

def out_filename
  "#{in_filename}json-"
end

#profiles(scap_file) ⇒ Object



11
12
13
# File 'lib/smart_proxy_openscap/profiles_parser.rb', line 11

def profiles(scap_file)
  execute_shell_command scap_file
end