Class: Ronin::Repos::CLI::Commands::Update Private
- Inherits:
-
Ronin::Repos::CLI::Command
- Object
- Core::CLI::Command
- Ronin::Repos::CLI::Command
- Ronin::Repos::CLI::Commands::Update
- Includes:
- Core::CLI::Logging
- Defined in:
- lib/ronin/repos/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 all or one repository from the cache directory.
Usage
ronin-repos update [options] [REPO]
Options
-C, --cache-dir DIR Overrides the default cache directory
-h, --help Print help information
Arguments
[REPO] The repository to update
Instance Attribute Summary
Attributes inherited from Ronin::Repos::CLI::Command
Instance Method Summary collapse
-
#run(name = nil) ⇒ Object
private
Runs the
ronin-repos update
command.
Methods inherited from Ronin::Repos::CLI::Command
Constructor Details
This class inherits a constructor from Ronin::Repos::CLI::Command
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-repos update
command.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/ronin/repos/cli/commands/update.rb', line 63 def run(name=nil) if name begin repo = cache_dir[name] log_info "Updating repository #{repo} ..." repo.update rescue RepositoryNotFound, CommandFailed => error log_error(error.) exit(-1) end else cache_dir.each do |repo| log_info "Updating repository #{repo} ..." begin repo.update rescue CommandNotInstalled, CommandFailed => error log_error("failed to update repository #{repo}: #{error.}") end end end end |