ronin-core 0.1.3 → 0.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/ChangeLog.md +25 -0
  4. data/Gemfile +1 -1
  5. data/README.md +2 -2
  6. data/gemspec.yml +1 -1
  7. data/lib/ronin/core/class_registry.rb +1 -1
  8. data/lib/ronin/core/cli/banner.rb +60 -0
  9. data/lib/ronin/core/cli/command.rb +1 -1
  10. data/lib/ronin/core/cli/command_shell/command.rb +1 -1
  11. data/lib/ronin/core/cli/command_shell.rb +12 -1
  12. data/lib/ronin/core/cli/completion_command.rb +204 -0
  13. data/lib/ronin/core/cli/generator/options/author.rb +1 -1
  14. data/lib/ronin/core/cli/generator/options/description.rb +1 -1
  15. data/lib/ronin/core/cli/generator/options/reference.rb +1 -1
  16. data/lib/ronin/core/cli/generator/options/summary.rb +1 -1
  17. data/lib/ronin/core/cli/generator.rb +1 -1
  18. data/lib/ronin/core/cli/help/banner.rb +49 -0
  19. data/lib/ronin/core/cli/logging.rb +3 -3
  20. data/lib/ronin/core/cli/options/param.rb +1 -1
  21. data/lib/ronin/core/cli/options/values/arches.rb +1 -1
  22. data/lib/ronin/core/cli/options/values/oses.rb +1 -1
  23. data/lib/ronin/core/cli/printing/arch.rb +1 -1
  24. data/lib/ronin/core/cli/printing/metadata.rb +33 -8
  25. data/lib/ronin/core/cli/printing/os.rb +1 -1
  26. data/lib/ronin/core/cli/printing/params.rb +30 -1
  27. data/lib/ronin/core/cli/ruby_shell.rb +6 -2
  28. data/lib/ronin/core/cli/shell.rb +6 -1
  29. data/lib/ronin/core/git.rb +1 -1
  30. data/lib/ronin/core/home.rb +1 -1
  31. data/lib/ronin/core/metadata/authors/author.rb +55 -15
  32. data/lib/ronin/core/metadata/authors.rb +4 -1
  33. data/lib/ronin/core/metadata/description.rb +1 -1
  34. data/lib/ronin/core/metadata/id.rb +1 -1
  35. data/lib/ronin/core/metadata/references.rb +1 -1
  36. data/lib/ronin/core/metadata/summary.rb +1 -1
  37. data/lib/ronin/core/metadata/version.rb +1 -1
  38. data/lib/ronin/core/output_formats/csv.rb +58 -0
  39. data/lib/ronin/core/output_formats/json.rb +90 -0
  40. data/lib/ronin/core/output_formats/ndjson.rb +55 -0
  41. data/lib/ronin/core/output_formats/output_dir.rb +93 -0
  42. data/lib/ronin/core/output_formats/output_file.rb +89 -0
  43. data/lib/ronin/core/output_formats/output_format.rb +48 -0
  44. data/lib/ronin/core/output_formats/txt.rb +50 -0
  45. data/lib/ronin/core/output_formats.rb +89 -0
  46. data/lib/ronin/core/params/exceptions.rb +1 -1
  47. data/lib/ronin/core/params/mixin.rb +1 -1
  48. data/lib/ronin/core/params/param.rb +1 -1
  49. data/lib/ronin/core/params/types/boolean.rb +1 -1
  50. data/lib/ronin/core/params/types/enum.rb +1 -1
  51. data/lib/ronin/core/params/types/float.rb +1 -1
  52. data/lib/ronin/core/params/types/integer.rb +1 -1
  53. data/lib/ronin/core/params/types/numeric.rb +1 -1
  54. data/lib/ronin/core/params/types/regexp.rb +1 -1
  55. data/lib/ronin/core/params/types/string.rb +1 -1
  56. data/lib/ronin/core/params/types/type.rb +1 -1
  57. data/lib/ronin/core/params/types/uri.rb +1 -1
  58. data/lib/ronin/core/params/types.rb +1 -1
  59. data/lib/ronin/core/params.rb +1 -1
  60. data/lib/ronin/core/system.rb +144 -0
  61. data/lib/ronin/core/version.rb +2 -2
  62. metadata +16 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e61fdc08b8e215624863cd59c443f5b5e41c25d8cf6427df9b903aa2458fcb3
4
- data.tar.gz: b2598fe308eeb283bbcfd6ec817bfb3c3c94f34e3d1fb93aac98d345078c1129
3
+ metadata.gz: 1cf7fd888aed1c83850fa7dcb18a6122de9e192272f111ce2fdc933fd463a4bb
4
+ data.tar.gz: 5b8cc281734f00f55be809eb46588233356e9209181981d6790fe2d028dfa144
5
5
  SHA512:
6
- metadata.gz: 73d16460be02608e46d22de62311f45d1fc4b01c40fac304222fc90ae321a7cf57ff5a29663eee49ae0ea84c8106e3fd548db65d3b48b9879f445e7aaf597094
7
- data.tar.gz: 8c6f88d8caac5a0f6af9a2838cae33a97a7796b66872c17dde4a225e9e2195451637d553db349a3eab3a16c238621b7c069f5a4f7cd1ce092250490785f2bdc6
6
+ metadata.gz: fb0eb0cfc052476dae0931b2a0860b6dfd68938a8d2ca7bbe73d62f77fdec3d13322a75f3d59a3fe2723554508e26af779dc3eb6e8c6a39c98adee6f65c78cfa
7
+ data.tar.gz: 619061f0b74ad0e03352d0d6a4b84081334f01cf100037b2366a7dad1f6d056a353dd4104bc9e2a90adb56b356751bbd7a67a577607f4ab9a70bbd04fdffa185
data/.rubocop.yml CHANGED
@@ -21,3 +21,5 @@ Style/GlobalStdStream:
21
21
  - 'lib/ronin/core/cli/ruby_shell.rb'
22
22
  - 'spec/cli/ruby_shell_spec.rb'
23
23
 
24
+ Layout/HeredocIndentation: { Exclude: ['lib/ronin/core/cli/banner.rb'] }
25
+ Layout/ClosingHeredocIndentation: { Exclude: ['lib/ronin/core/cli/banner.rb'] }
data/ChangeLog.md CHANGED
@@ -1,3 +1,27 @@
1
+ ### 0.2.0 / 2024-XX-XX
2
+
3
+ * Require [command_kit] ~> 0.5.
4
+ * Added the `mastodon:` keyword argument to {Ronin::Core::Metadata::Authors::ClassMethods#author}.
5
+ * Added {Ronin::Core::Metadata::Authors::Author#mastodon}.
6
+ * Added {Ronin::Core::Metadata::Authors::Author#mastodon_url}.
7
+ * Added {Ronin::Core::OutputFormats}.
8
+ * Added {Ronin::Core::OutputFormats::OutputFile}.
9
+ * Added {Ronin::Core::OutputFormats::OutputDir}.
10
+ * Added {Ronin::Core::System}.
11
+ * Added {Ronin::Core::CLI::Banner}.
12
+ * Added {Ronin::Core::CLI::Help::Banner}.
13
+ * Added {Ronin::Core::CLI::CompletionCommand}.
14
+ * Added {Ronin::Core::CLI::Printing::Params#param_usage}.
15
+ * Print the new ASCII art banner in {Ronin::Core::CLI::RubyShell#start} and
16
+ {Ronin::Core::CLI::Shell.start}.
17
+ * Added a default `quit` command to {Ronin::Core::CLI::CommandShell}.
18
+ * Print the author's Mastodon profile URL in
19
+ {Ronin::Core::CLI::Printing::Metadata}.
20
+ * Change the formatting of {Ronin::Core::CLI::Logging#log_warn} to output
21
+ ANSI bold-bright-yellow.
22
+ * Change the formatting of {Ronin::Core::CLI::Logging#log_error} to output
23
+ ANSI bold-bright-red.
24
+
1
25
  ### 0.1.3 / 2024-06-19
2
26
 
3
27
  * Improved {Ronin::Core::ClassRegistry::ClassMethods#load_class_from_file}
@@ -31,3 +55,4 @@
31
55
  shells.
32
56
  * Provides a `Params` API for adding user configurable parameters to classes.
33
57
 
58
+ [command_kit]: https://github.com/postmodern/command_kit.rb#readme
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ platform :jruby do
7
7
  gem 'jruby-openssl', '~> 0.7'
8
8
  end
9
9
 
10
- # gem 'command_kit', '~> 0.4', github: 'postmodern/command_kit.rb',
10
+ # gem 'command_kit', '~> 0.5', github: 'postmodern/command_kit.rb',
11
11
  # branch: 'main'
12
12
 
13
13
  group :development do
data/README.md CHANGED
@@ -35,7 +35,7 @@ and development.
35
35
 
36
36
  * [Ruby] >= 3.0.0
37
37
  * [reline] ~> 0.1
38
- * [command_kit] ~> 0.4
38
+ * [command_kit] ~> 0.5
39
39
  * [irb] ~> 1.0
40
40
 
41
41
  ## Install
@@ -274,7 +274,7 @@ http> post /foo var=bar
274
274
 
275
275
  ## License
276
276
 
277
- Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3@gmail.com)
277
+ Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3@gmail.com)
278
278
 
279
279
  ronin-core is free software: you can redistribute it and/or modify
280
280
  it under the terms of the GNU Lesser General Public License as published
data/gemspec.yml CHANGED
@@ -21,7 +21,7 @@ required_ruby_version: ">= 3.0.0"
21
21
 
22
22
  dependencies:
23
23
  reline: ~> 0.1
24
- command_kit: ~> 0.4
24
+ command_kit: ~> 0.5
25
25
  irb: ~> 1.0
26
26
 
27
27
  development_dependencies:
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ #
5
+ # ronin-core is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU Lesser General Public License as published
7
+ # by the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # ronin-core is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License
16
+ # along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
17
+ #
18
+
19
+ module Ronin
20
+ module Core
21
+ module CLI
22
+ #
23
+ # Adds a Ronin ASCII art banner to the `--help` output.
24
+ #
25
+ # @since 0.2.0
26
+ #
27
+ module Banner
28
+ # Ronin ASCII art banner.
29
+ BANNER = <<~ASCII
30
+ , Jµ ▓▓█▓
31
+ J▌ ▐▓██▌ ████ ██ ▐███D
32
+ ╓▄▓▓█████▌ ██µ ████ ▄███ÖJ██▌ ███▌
33
+ ,╓µ▄▄▄▄▄▄▄▄µ;, ,▄▓██████████ ▐███ ▐███▀ ███▌ ████µ ▄███
34
+ ¬∞MÆ▓███████████████████████▓M ▄██████▀▀╙████▌ ████▌ ████ ▄███ J█████ ███▌
35
+ `█████▀▀▀▀▀███████ -████▀└ ████ ▐█████n ▄███O ███▌ ██████████
36
+ ▓████L ████▀ ▓████ ▓███Ö ███████ ███▌ ▓███ ▐█████████▀
37
+ ▄████▀ ,╓▄▄▄█████ J████Ü ,███▌ ▄███████████ J███▀ ████ █████
38
+ J█████████████████─ ████▌ ████ ████`██████▌ ████ ▐███Ü ▐███Ü
39
+ ███████████▀▀▀╙└ ▐████ J███▌ ▓███▌ ²█████ J███Ü ███▌ ▀█▌
40
+ ▓██████████▌ ████▌ ████ ;████ ▀███▀ ███▌ J▀▀▀- █
41
+ ▄█████▀ ▀█████µ ▐████ ,▄▓████▀ ████▀ ███ J███ `
42
+ J█████- ╙▀███▄ ████████████▀╙ J█▀▀▀ █U ▀█▌
43
+ ████▀ ▀███ ▄████████▀▀ ╨ █
44
+ ▓██▀ ²▀█▄ █▀▀▀╙└
45
+ ▄██╜ ╙W
46
+ J█▀
47
+ ▌└
48
+
49
+ ASCII
50
+
51
+ #
52
+ # Prints the Ronin banner.
53
+ #
54
+ def print_banner
55
+ print "#{BANNER}#{$/}"
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -246,6 +246,17 @@ module Ronin
246
246
  end
247
247
  end
248
248
 
249
+ command :quit, summary: 'Exits the shell'
250
+
251
+ #
252
+ # Quits the shell.
253
+ #
254
+ # @since 0.2.0
255
+ #
256
+ def quit
257
+ exit
258
+ end
259
+
249
260
  private
250
261
 
251
262
  #
@@ -0,0 +1,204 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ #
5
+ # ronin-core is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU Lesser General Public License as published
7
+ # by the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # ronin-core is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License
16
+ # along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
17
+ #
18
+
19
+ require 'ronin/core/cli/command'
20
+
21
+ require 'command_kit/completion/install'
22
+
23
+ module Ronin
24
+ module Core
25
+ module CLI
26
+ #
27
+ # Common base class for all `ronin-* completion` commands.
28
+ #
29
+ # ## Example
30
+ #
31
+ # # lib/ronin/foo/cli/commands/completion.rb
32
+ # require 'ronin/foo/root'
33
+ # require 'ronin/core/cli/completion_command'
34
+ #
35
+ # module Ronin
36
+ # module Foo
37
+ # class CLI
38
+ # class Command < Core::CLI::CompletionCommand
39
+ #
40
+ # man_dir File.join(ROOT,'man')
41
+ # man_page 'ronin-foo-completion.1'
42
+ #
43
+ # completion_file File.join(ROOT,'data','completions','ronin-foo')
44
+ #
45
+ # end
46
+ # end
47
+ # end
48
+ # end
49
+ #
50
+ # @api semipublic
51
+ #
52
+ # @since 0.2.0
53
+ #
54
+ class CompletionCommand < Command
55
+
56
+ include CommandKit::Completion::Install
57
+
58
+ #
59
+ # Gets or sets the completion file for the `completion` command.
60
+ #
61
+ # @param [String, nil] new_completion_file
62
+ # The optional path to the completion file.
63
+ #
64
+ # @return [String]
65
+ # The completion file path.
66
+ #
67
+ # @raise [NotImplementedError]
68
+ # The command did not set the `completion_file`.
69
+ #
70
+ # @example
71
+ # completion_file File.join(ROOT,'data','completions','ronin-foo')
72
+ #
73
+ def self.completion_file(new_completion_file=nil)
74
+ if new_completion_file
75
+ @completion_file = new_completion_file
76
+ else
77
+ @completion_file || raise(NotImplementedError,"#{self} did not set completion_file")
78
+ end
79
+ end
80
+
81
+ command_name 'completion'
82
+
83
+ option :print, desc: 'Prints the shell completion file' do
84
+ @mode = :print
85
+ end
86
+
87
+ option :install, desc: 'Installs the shell completion file' do
88
+ @mode = :install
89
+ end
90
+
91
+ option :uninstall, desc: 'Uninstalls the shell completion file' do
92
+ @mode = :uninstall
93
+ end
94
+
95
+ examples [
96
+ '--print',
97
+ '--install',
98
+ '--uninstall'
99
+ ]
100
+
101
+ bug_report_url 'https://github.com/ronin-rb/ronin-core/issues/new'
102
+
103
+ # The command mode.
104
+ #
105
+ # @return [:print, :install, :uninstall]
106
+ attr_reader :mode
107
+
108
+ #
109
+ # Initializes the `completion` command.
110
+ #
111
+ # @param [Hash{Symbol => Object}] kwargs
112
+ # Additional keyword arguments for the command.
113
+ #
114
+ def initialize(**kwargs)
115
+ super(**kwargs)
116
+
117
+ @mode = :print
118
+ end
119
+
120
+ #
121
+ # The `completion` commands registered completion file.
122
+ #
123
+ # @return [String]
124
+ # The completion file path.
125
+ #
126
+ # @raise [NotImplementedError]
127
+ # The command did not set the `completion_file`.
128
+ #
129
+ def completion_file
130
+ self.class.completion_file
131
+ end
132
+
133
+ #
134
+ # Runs the `completion` command.
135
+ #
136
+ def run
137
+ if shell_type == :fish
138
+ print_error "shell completions for the fish shell are not currently supported"
139
+ exit(-1)
140
+ end
141
+
142
+ case @mode
143
+ when :print
144
+ print_completion_file
145
+ when :install
146
+ install_completion_file
147
+
148
+ if shell_type == :zsh
149
+ puts "Ensure that you have the following lines added to your ~/.zshrc:"
150
+ puts
151
+ puts " autoload -Uz +X compinit && compinit"
152
+ puts " autoload -Uz +X bashcompinit && bashcompinit"
153
+ puts
154
+ end
155
+ when :uninstall
156
+ uninstall_completion_file
157
+
158
+ puts "Completion rules successfully uninstalled. Please restart your shell."
159
+ else
160
+ raise(NotImplementedError,"mode not implemented: #{@mode.inspect}")
161
+ end
162
+ end
163
+
164
+ #
165
+ # Prints the `completion` command's {completion_file} to stdout.
166
+ #
167
+ # @param [String] completion_file
168
+ # The path to the completion file to print.
169
+ #
170
+ # @api private
171
+ #
172
+ def print_completion_file(completion_file=self.completion_file)
173
+ super(completion_file)
174
+ end
175
+
176
+ #
177
+ # Installs the `completion` command's {completion_file} for the current
178
+ # `SHELL`.
179
+ #
180
+ # @param [String] completion_file
181
+ # The path to the completion file to install.
182
+ #
183
+ # @api private
184
+ #
185
+ def install_completion_file(completion_file=self.completion_file)
186
+ super(completion_file)
187
+ end
188
+
189
+ #
190
+ # Uninstalls the `completion` command's {completion_file}.
191
+ #
192
+ # @param [String] completion_file
193
+ # The path to the completion file to uninstall.
194
+ #
195
+ # @api private
196
+ #
197
+ def uninstall_completion_file(completion_file=self.completion_file)
198
+ uninstall_completion_file_for(File.basename(completion_file))
199
+ end
200
+
201
+ end
202
+ end
203
+ end
204
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ #
5
+ # ronin-core is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU Lesser General Public License as published
7
+ # by the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # ronin-core is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License
16
+ # along with ronin-core. If not, see <https://www.gnu.org/licenses/>.
17
+ #
18
+
19
+ require 'ronin/core/cli/banner'
20
+
21
+ module Ronin
22
+ module Core
23
+ module CLI
24
+ module Help
25
+ #
26
+ # Adds the Ronin ASCII art banner to the `--help` output.
27
+ #
28
+ # @since 0.2.0
29
+ #
30
+ module Banner
31
+ include CLI::Banner
32
+
33
+ #
34
+ # Prints the Ronin ASCII art banner and the `--help` output.
35
+ #
36
+ # @note
37
+ # If `stdout` is not a TTY, the Ronin ASCII art banner will be
38
+ # omitted.
39
+ #
40
+ def help
41
+ print_banner if stdout.tty?
42
+
43
+ super
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -44,7 +44,7 @@ module Ronin
44
44
  # The message to print.
45
45
  #
46
46
  def log_warn(message)
47
- puts("#{colors.bold(colors.bright_yellow('***'))} #{colors.bold(colors.white(message))}")
47
+ puts("#{colors.bold(colors.bright_red('/!\\'))} #{colors.bold(colors.bright_yellow(message))}")
48
48
  end
49
49
 
50
50
  #
@@ -54,7 +54,7 @@ module Ronin
54
54
  # The message to print.
55
55
  #
56
56
  def log_error(message)
57
- stderr.puts("#{colors(stderr).bold(colors(stderr).bright_red('!!!'))} #{colors(stderr).bold(colors(stderr).white(message))}")
57
+ stderr.puts("#{colors(stderr).bold(colors(stderr).bright_red('!!!'))} #{colors(stderr).bold(colors(stderr).red(message))}")
58
58
  end
59
59
  end
60
60
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # This file is part of ronin-core.
6
6
  #
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -55,13 +55,38 @@ module Ronin
55
55
  indent do
56
56
  klass.authors.each do |author|
57
57
  puts "* #{author}"
58
- puts " * PGP: #{author.pgp}" if author.pgp?
59
- puts " * Website: #{author.website}" if author.website?
60
- puts " * Blog: #{author.blog}" if author.blog?
61
- puts " * GitHub: #{author.github_url}" if author.github?
62
- puts " * GitLab: #{author.gitlab_url}" if author.gitlab?
63
- puts " * Twitter: #{author.twitter_url}" if author.twitter?
64
- puts " * Discord: #{author.discord}" if author.discord?
58
+
59
+ if author.pgp?
60
+ puts " * PGP: #{author.pgp}"
61
+ end
62
+
63
+ if author.website?
64
+ puts " * Website: #{author.website}"
65
+ end
66
+
67
+ if author.blog?
68
+ puts " * Blog: #{author.blog}"
69
+ end
70
+
71
+ if author.github?
72
+ puts " * GitHub: #{author.github_url}"
73
+ end
74
+
75
+ if author.gitlab?
76
+ puts " * GitLab: #{author.gitlab_url}"
77
+ end
78
+
79
+ if author.twitter?
80
+ puts " * Twitter: #{author.twitter_url}"
81
+ end
82
+
83
+ if author.mastodon?
84
+ puts " * Mastodon: #{author.mastodon_url}"
85
+ end
86
+
87
+ if author.discord?
88
+ puts " * Discord: #{author.discord}"
89
+ end
65
90
  end
66
91
  end
67
92
  else
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-core is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published