diff options
Diffstat (limited to 'Library/Homebrew/dev-cmd/man.rb')
-rw-r--r-- | Library/Homebrew/dev-cmd/man.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index 9b2d60147..fdd4bf33d 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -33,11 +33,8 @@ module Homebrew convert_man_page(cask_markup, TARGET_MAN_PATH/"brew-cask.1") end - def build_man_page - template = (SOURCE_PATH/"brew.1.md.erb").read - variables = OpenStruct.new - - variables[:commands] = Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}"). + def path_glob_commands(glob) + Pathname.glob(glob). sort_by { |source_file| sort_key_for_path(source_file) }. map { |source_file| source_file.read.lines. @@ -46,7 +43,14 @@ module Homebrew join }. reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") } + end + + def build_man_page + template = (SOURCE_PATH/"brew.1.md.erb").read + variables = OpenStruct.new + variables[:commands] = path_glob_commands("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}") + variables[:developer_commands] = path_glob_commands("#{HOMEBREW_LIBRARY_PATH}/dev-cmd/*.{rb,sh}") variables[:maintainers] = (HOMEBREW_REPOSITORY/"README.md"). read[/Homebrew's current maintainers are (.*)\./, 1]. scan(/\[([^\]]*)\]/).flatten |