From 0514e2dbbac92f4fca169af907c30d30e7c07cdf Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 24 Aug 2020 00:45:14 +0200 Subject: [PATCH] Move `command_help_lines` into `Help` module. --- Library/Homebrew/help.rb | 8 ++++++++ Library/Homebrew/utils.rb | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index 12283523d8..97b29d94b2 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -100,6 +100,14 @@ module Homebrew cmd_parser.generate_help_text 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) # Otherwise read #: lines from the file. help_lines = command_help_lines(path) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 87d94100d5..42e4c6667a 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -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, "******" }