lib/pwn/reports/phone.rb in pwn-0.4.812 vs lib/pwn/reports/phone.rb in pwn-0.4.813

- old
+ new

@@ -15,13 +15,14 @@ public_class_method def self.generate(opts = {}) dir_path = opts[:dir_path].to_s if File.directory?(opts[:dir_path].to_s) raise "PWN Error: Invalid Directory #{dir_path}" if dir_path.nil? results_hash = opts[:results_hash] + report_name = results_hash[:report_name] File.write( - "#{dir_path}/pwn_phone.json", + "#{dir_path}/#{report_name}.json", JSON.pretty_generate(results_hash) ) html_report = %q{<!DOCTYPE HTML> <html> @@ -278,10 +279,10 @@ </script> </body> </html> } - File.open("#{dir_path}/pwn_phone.html", 'w') do |f| + File.open("#{dir_path}/#{report_name}.html", 'w') do |f| f.print(html_report) end rescue StandardError => e raise e end