Class: Ronin::Repos::CLI::Commands::Show Private

Inherits:
Ronin::Repos::CLI::Command show all
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

Since:

  • 0.2.0

Instance Attribute Summary

Attributes inherited from Ronin::Repos::CLI::Command

#cache_dir

Instance Method Summary collapse

Methods inherited from Ronin::Repos::CLI::Command

#initialize

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.

Parameters:

  • name (String) (defaults to: nil)

    The repo name to display.

Since:

  • 0.2.0



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.message)
  exit(-1)
end