Class: Ronin::Repos::CLI::Commands::Show Private
- Inherits:
-
Ronin::Repos::CLI::Command
- Object
- Core::CLI::Command
- Ronin::Repos::CLI::Command
- Ronin::Repos::CLI::Commands::Show
- Includes:
- CommandKit::Printing::Fields, CommandKit::Printing::Lists
- Defined in:
- lib/ronin/repos/cli/commands/show.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.
Prints information about a specific repository in the cache directory.
Usage
ronin-repos show [options] REPO
Options
-C, --cache-dir DIR Overrides the default cache directory
-h, --help Print help information
Arguments
REPO The repository to display
Instance Attribute Summary
Attributes inherited from Ronin::Repos::CLI::Command
Instance Method Summary collapse
-
#run(name = nil) ⇒ Object
private
Runs the
ronin-repos show
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 show
command.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/ronin/repos/cli/commands/show.rb', line 67 def run(name=nil) repo = cache_dir[name] puts "[ #{repo} ]" puts indent do print_fields( 'Name' => repo.name, 'URI' => repo.url, 'Files' => nil ) indent do print_list(repo.list_files) end end rescue RepositoryNotFound => error print_error(error.) exit(-1) end |