lib/tasks/thorfile.rb in dradis-nessus-3.3.0 vs lib/tasks/thorfile.rb in dradis-nessus-3.6.0

- old
+ new

@@ -1,7 +1,7 @@ class NessusTasks < Thor - include Core::Pro::ProjectScopedTask if defined?(::Core::Pro) + include Rails.application.config.dradis.thor_helper_module namespace "dradis:plugins:nessus" desc "upload FILE", "upload Nessus v2 results (.nessus file)" def upload(file_path) @@ -13,26 +13,11 @@ unless File.exists?(file_path) $stderr.puts "** the file [#{file_path}] does not exist" exit(-1) end - content_service = nil - template_service = nil - - template_service = Dradis::Plugins::TemplateService.new(plugin: Dradis::Plugins::Nessus) - if defined?(Dradis::Pro) - detect_and_set_project_scope - content_service = Dradis::Pro::Plugins::ContentService.new(plugin: Dradis::Plugins::Nessus) - else - content_service = Dradis::Plugins::ContentService.new(plugin: Dradis::Plugins::Nessus) - end - - importer = Dradis::Plugins::Nessus::Importer.new( - logger: logger, - content_service: content_service, - template_service: template_service - ) - + detect_and_set_project_scope + importer = Dradis::Plugins::Nessus::Importer.new(logger: logger) importer.import(file: file_path) logger.close end