Class: Proxy::OpenSCAP::OpenscapHtmlGenerator
Instance Attribute Summary
Attributes inherited from ShellWrapper
#script_name
Instance Method Summary
collapse
#close_unlink, #exception_message, #execute_shell_command, #in_filename, #prepare_in_file, #script_location, #unique_filename
Constructor Details
Returns a new instance of OpenscapHtmlGenerator.
7
8
9
10
11
12
13
|
# File 'lib/smart_proxy_openscap/openscap_html_generator.rb', line 7
def initialize(cname, id, date, digest)
@cname = cname
@id = id
@date = date
@digest = digest
@script_name = 'smart-proxy-arf-html'
end
|
Instance Method Details
#command(in_file, out_file) ⇒ Object
23
24
25
|
# File 'lib/smart_proxy_openscap/openscap_html_generator.rb', line 23
def command(in_file, out_file)
"#{script_location} #{file_path_in_storage} #{out_file.path}"
end
|
#failure_message ⇒ Object
27
28
29
|
# File 'lib/smart_proxy_openscap/openscap_html_generator.rb', line 27
def failure_message
"Failure when running script which generates html reports"
end
|
#file_path_in_storage ⇒ Object
31
32
33
34
35
|
# File 'lib/smart_proxy_openscap/openscap_html_generator.rb', line 31
def file_path_in_storage
path_to_dir = Proxy::OpenSCAP::Plugin.settings.reportsdir
storage = Proxy::OpenSCAP::StorageFs.new(path_to_dir, @cname, @id, @date)
storage.get_path(@digest)
end
|
#get_html ⇒ Object
15
16
17
|
# File 'lib/smart_proxy_openscap/openscap_html_generator.rb', line 15
def get_html
execute_shell_command
end
|
#out_filename ⇒ Object
19
20
21
|
# File 'lib/smart_proxy_openscap/openscap_html_generator.rb', line 19
def out_filename
"#{super}-#{@cname}-#{@id}-#{@date}-#{@digest}-"
end
|