Class: NmapTasks

Inherits:
Thor
  • Object
show all
Defined in:
lib/tasks/thorfile.rb

Instance Method Summary collapse

Instance Method Details

#upload(file_path) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tasks/thorfile.rb', line 10

def upload(file_path)
  require 'config/environment'

  unless File.exists?(file_path)
    $stderr.puts "** the file [#{file_path}] does not exist"
    exit(-1)
  end

  detect_and_set_project_scope

  importer = Dradis::Plugins::Nmap::Importer.new(task_options)
  importer.import(file: file_path)
end