Class: Proxy::OpenSCAP::PolicyParser

Inherits:
ShellWrapper show all
Defined in:
lib/smart_proxy_openscap/policy_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(policy) ⇒ PolicyParser

Returns a new instance of PolicyParser.



7
8
9
10
# File 'lib/smart_proxy_openscap/policy_parser.rb', line 7

def initialize(policy)
  @script_name = "smart-proxy-policy-guide"
  @policy = policy
end

Instance Method Details

#command(in_file, out_file) ⇒ Object



28
29
30
# File 'lib/smart_proxy_openscap/policy_parser.rb', line 28

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

#failure_messageObject



24
25
26
# File 'lib/smart_proxy_openscap/policy_parser.rb', line 24

def failure_message
  "Failure when running script which renders policy guide"
end

#guide(scap_file) ⇒ Object



12
13
14
# File 'lib/smart_proxy_openscap/policy_parser.rb', line 12

def guide(scap_file)
  execute_shell_command scap_file
end

#in_filenameObject



16
17
18
# File 'lib/smart_proxy_openscap/policy_parser.rb', line 16

def in_filename
  super
end

#out_filenameObject



20
21
22
# File 'lib/smart_proxy_openscap/policy_parser.rb', line 20

def out_filename
  "#{in_filename}json-"
end