class Ronin::CLI::Commands::PublicSuffixList

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

Public Instance Methods

download() click to toggle source

Downloads the public suffix list file.

# File lib/ronin/cli/commands/public_suffix_list.rb, line 112
def download
  if verbose?
    log_info "Downloading public suffix list from #{options[:url]} to #{options[:path]} ..."
  end

  List.download(url: options[:url], path: options[:path])
end
downloaded?() click to toggle source

Determines if the public suffix list file has been downloaded yet.

@return [Boolean]

# File lib/ronin/cli/commands/public_suffix_list.rb, line 96
def downloaded?
  List.downloaded?(options[:path])
end
run() click to toggle source

Runs the ‘ronin public-suffix-list` command.

# File lib/ronin/cli/commands/public_suffix_list.rb, line 77
def run
  if !downloaded?
    download
  elsif options[:update] || stale?
    update
  end

  list_file = List.load_file(options[:path])

  list_file.each do |suffix|
    puts suffix
  end
end
stale?() click to toggle source

Determines if the public suffix list file is stale.

@return [Boolean]

# File lib/ronin/cli/commands/public_suffix_list.rb, line 105
def stale?
  List.stale?(options[:path])
end
update() click to toggle source

Updates the public suffix list file.

# File lib/ronin/cli/commands/public_suffix_list.rb, line 123
def update
  if verbose?
    log_info "Updating public suffix list file #{options[:path]} ..."
  end

  List.update(path: options[:path])
end