Module: Ronin::Core::CLI::Printing::Metadata
- Includes:
- CommandKit::Printing::Indent, CommandKit::Printing::Lists
- Defined in:
- lib/ronin/core/cli/printing/metadata.rb
Overview
Common methods for printing Metadata data.
Class Method Summary collapse
-
.included(command) ⇒ Object
Adds a
-v,--verbose
option to the command class.
Instance Method Summary collapse
-
#print_authors(klass) ⇒ Object
The class which defines the authors.
-
#print_description(klass) ⇒ Object
The class which defines a description.
-
#print_references(klass) ⇒ Object
The class that defines references.
Class Method Details
.included(command) ⇒ Object
Adds a -v,--verbose
option to the command class.
40 41 42 |
# File 'lib/ronin/core/cli/printing/metadata.rb', line 40 def self.included(command) command.include CommandKit::Options::Verbose end |
Instance Method Details
#print_authors(klass) ⇒ Object
The class which defines the authors.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/ronin/core/cli/printing/metadata.rb', line 49 def (klass) unless klass..empty? puts "Authors:" puts if verbose? indent do klass..each do || puts "* #{}" puts " * PGP: #{.pgp}" if .pgp? puts " * Website: #{.website}" if .website? puts " * Blog: #{.blog}" if .blog? puts " * GitHub: #{.github_url}" if .github? puts " * GitLab: #{.gitlab_url}" if .gitlab? puts " * Twitter: #{.twitter_url}" if .twitter? puts " * Discord: #{.discord}" if .discord? end end else indent { print_list(klass.) } end puts end end |
#print_description(klass) ⇒ Object
The class which defines a description.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/ronin/core/cli/printing/metadata.rb', line 80 def print_description(klass) if klass.description puts 'Description:' puts indent do klass.description.each_line do |line| puts line end end puts end end |
#print_references(klass) ⇒ Object
The class that defines references.
100 101 102 103 104 105 106 107 108 |
# File 'lib/ronin/core/cli/printing/metadata.rb', line 100 def print_references(klass) unless klass.references.empty? puts "References:" puts indent { print_list(klass.references) } puts end end |