Merge pull request #8462 from reitermarkus/refactor-utils
Move `command_help_lines` into `Help` module.
This commit is contained in:
commit
86bd7bddbe
@ -104,6 +104,14 @@ module Homebrew
|
||||
end
|
||||
private_class_method :parser_help
|
||||
|
||||
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)
|
||||
# Otherwise read #: lines from the file.
|
||||
help_lines = command_help_lines(path)
|
||||
|
@ -511,13 +511,6 @@ module Kernel
|
||||
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)
|
||||
secrets.compact
|
||||
.reduce(input) { |str, secret| str.gsub secret, "******" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user