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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# 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 "* #{}" if .pgp? puts " * PGP: #{.pgp}" end if .website? puts " * Website: #{.website}" end if .blog? puts " * Blog: #{.blog}" end if .github? puts " * GitHub: #{.github_url}" end if .gitlab? puts " * GitLab: #{.gitlab_url}" end if .twitter? puts " * Twitter: #{.twitter_url}" end if .mastodon? puts " * Mastodon: #{.mastodon_url}" end if .discord? puts " * Discord: #{.discord}" end end end else indent { print_list(klass.) } end puts end end |
#print_description(klass) ⇒ Object
The class which defines a description.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/ronin/core/cli/printing/metadata.rb', line 105 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.
125 126 127 128 129 130 131 132 133 |
# File 'lib/ronin/core/cli/printing/metadata.rb', line 125 def print_references(klass) unless klass.references.empty? puts "References:" puts indent { print_list(klass.references) } puts end end |