lib/ronin/ui/cli/commands/urls.rb in ronin-1.2.0 vs lib/ronin/ui/cli/commands/urls.rb in ronin-1.3.0
- old
+ new
@@ -60,51 +60,13 @@
class_option :import, :type => :string,
:aliases => '-i',
:banner => 'FILE'
- #
- # Queries the {Ronin::URL} model.
- #
- # @since 1.0.0
- #
- def execute
- if options[:import]
- import options[:import]
- elsif options.list?
- super
- end
- end
-
protected
#
- # Imports URLs from a file.
- #
- # @param [String] path
- # The path to the file.
- #
- # @since 1.0.0
- #
- def import(path)
- File.open(path) do |file|
- file.each_line do |line|
- line.strip!
- next if line.empty?
-
- url = URL.parse(line)
-
- if url.save
- print_info "Imported #{url}"
- else
- print_error "Could not import #{line.dump}."
- end
- end
- end
- end
-
- #
# Prints a URL.
#
# @param [Ronin::URL] url
# The URL to print.
#
@@ -114,16 +76,14 @@
return super(url) unless options.verbose?
print_title url
indent do
- print_hash(
- 'Host' => url.host_name,
- 'Port' => url.port.number,
- 'Path' => url.path,
- 'Fragment' => url.fragment,
- 'Last Scanned' => url.last_scanned_at
- )
+ print_hash 'Host' => url.host_name,
+ 'Port' => url.port.number,
+ 'Path' => url.path,
+ 'Fragment' => url.fragment,
+ 'Last Scanned' => url.last_scanned_at
unless url.query_params.empty?
params = {}
url.query_params.each do |param|