Class: Ronin::CLI::Commands::PublicSuffixList Private
- Inherits:
-
Ronin::CLI::Command
- Object
- Core::CLI::Command
- Ronin::CLI::Command
- Ronin::CLI::Commands::PublicSuffixList
- Includes:
- CommandKit::Options::Verbose, Core::CLI::Logging, Support::Network::PublicSuffix
- Defined in:
- lib/ronin/cli/commands/public_suffix_list.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Updates and parses the public suffix list file.
Usage
ronin public-suffix-list [options]
Options
-v, --verbose Enables verbose output
-u, --update Updates the public suffix list file
-U, --url URL URL to the public suffix list (Default: https://publicsuffix.org/list/public_suffix_list.dat)
-p, --path FILE Path to the public suffix list file (Default: /home/postmodern/.local/share/ronin/ronin-support/public_suffix_list.dat)
-h, --help Print help information
Instance Method Summary collapse
-
#download ⇒ Object
private
Downloads the public suffix list file.
-
#downloaded? ⇒ Boolean
private
Determines if the public suffix list file has been downloaded yet.
-
#run ⇒ Object
private
Runs the
ronin public-suffix-list
command. -
#stale? ⇒ Boolean
private
Determines if the public suffix list file is stale.
-
#update ⇒ Object
private
Updates the public suffix list file.
Instance Method Details
#download ⇒ 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.
Downloads the public suffix list file.
112 113 114 115 116 117 118 |
# File 'lib/ronin/cli/commands/public_suffix_list.rb', line 112 def download if verbose? log_info "Downloading public suffix list from #{[:url]} to #{[:path]} ..." end List.download(url: [:url], path: [:path]) end |
#downloaded? ⇒ Boolean
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.
Determines if the public suffix list file has been downloaded yet.
96 97 98 |
# File 'lib/ronin/cli/commands/public_suffix_list.rb', line 96 def downloaded? List.downloaded?([:path]) end |
#run ⇒ 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.
Runs the ronin public-suffix-list
command.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/ronin/cli/commands/public_suffix_list.rb', line 77 def run if !downloaded? download elsif [:update] || stale? update end list_file = List.load_file([:path]) list_file.each do |suffix| puts suffix end end |
#stale? ⇒ Boolean
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.
Determines if the public suffix list file is stale.
105 106 107 |
# File 'lib/ronin/cli/commands/public_suffix_list.rb', line 105 def stale? List.stale?([:path]) end |
#update ⇒ 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.
Updates the public suffix list file.
123 124 125 126 127 128 129 |
# File 'lib/ronin/cli/commands/public_suffix_list.rb', line 123 def update if verbose? log_info "Updating public suffix list file #{[:path]} ..." end List.update(path: [:path]) end |