Skip to content
Snippets Groups Projects
Commit 0514e2db authored by Markus Reiter's avatar Markus Reiter
Browse files

Move `command_help_lines` into `Help` module.

parent 8e789901
No related branches found
No related tags found
No related merge requests found
...@@ -100,6 +100,14 @@ module Homebrew ...@@ -100,6 +100,14 @@ module Homebrew
cmd_parser.generate_help_text cmd_parser.generate_help_text
end end
def command_help_lines(path)
path.read
.lines
.grep(/^#:/)
.map { |line| line.slice(2..-1).delete_prefix(" ") }
end
private_class_method :command_help_lines
def comment_help(path) def comment_help(path)
# Otherwise read #: lines from the file. # Otherwise read #: lines from the file.
help_lines = command_help_lines(path) help_lines = command_help_lines(path)
......
...@@ -511,13 +511,6 @@ module Kernel ...@@ -511,13 +511,6 @@ module Kernel
end end
end end
def command_help_lines(path)
path.read
.lines
.grep(/^#:/)
.map { |line| line.slice(2..-1).delete_prefix(" ") }
end
def redact_secrets(input, secrets) def redact_secrets(input, secrets)
secrets.compact secrets.compact
.reduce(input) { |str, secret| str.gsub secret, "******" } .reduce(input) { |str, secret| str.gsub secret, "******" }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment