Module: Ronin::Nmap::CLI::Importable Private
- Includes:
- Core::CLI::Logging, DB::CLI::Printing
- Included in:
- Commands::Import, Commands::Scan
- Defined in:
- lib/ronin/nmap/cli/importable.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Mixin module which adds the ability to import nmap XML into the ronin-db database.
Class Method Summary collapse
-
.included(command) ⇒ Object
private
Includes
Ronin::DB::CLI::DatabaseOptions
into the including command class.
Instance Method Summary collapse
-
#import_file(xml_file) ⇒ Object
private
Imports an nmap XML file into the [ronin-db] database.
Class Method Details
.included(command) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Includes Ronin::DB::CLI::DatabaseOptions
into the including command
class.
46 47 48 |
# File 'lib/ronin/nmap/cli/importable.rb', line 46 def self.included(command) command.include DB::CLI::DatabaseOptions end |
Instance Method Details
#import_file(xml_file) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Imports an nmap XML file into the ronin-db database.
58 59 60 61 62 63 64 |
# File 'lib/ronin/nmap/cli/importable.rb', line 58 def import_file(xml_file) Importer.import_file(xml_file) do |record| if (type = record_type(record)) log_info "Imported #{type}: #{record}" end end end |