Class: Ronin::Wordlists::CLI::Commands::Update Private
- Inherits:
-
Ronin::Wordlists::CLI::Command
- Object
- Core::CLI::Command
- Ronin::Wordlists::CLI::Command
- Ronin::Wordlists::CLI::Commands::Update
- Includes:
- Core::CLI::Logging
- Defined in:
- lib/ronin/wordlists/cli/commands/update.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 a wordlist or all wordlists.
Usage
ronin-wordlists update [options] [WORDLISt]
Options
-h, --help Print help information
Arguments
[WORDLIST] The optional wordlist to update
Instance Method Summary collapse
-
#run(name = nil) ⇒ Object
private
Runs the
ronin-wordlists update
command. -
#update(wordlist) ⇒ Object
private
Updates a wordlist.
Instance Method Details
#run(name = nil) ⇒ 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-wordlists update
command.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/ronin/wordlists/cli/commands/update.rb', line 64 def run(name=nil) cache_dir = CacheDir.new if name begin update(cache_dir[name]) rescue WordlistNotFound print_error "no such wordlist: #{name}" exit(1) end else cache_dir.each(&method(:update)) end end |
#update(wordlist) ⇒ 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 a wordlist.
85 86 87 88 89 90 91 92 |
# File 'lib/ronin/wordlists/cli/commands/update.rb', line 85 def update(wordlist) log_info "Updating wordlist #{wordlist.name} from #{wordlist.url} ..." begin wordlist.update rescue DownloadFailed => error log_error error. end end |