diff options
| author | Mike McQuaid | 2016-09-05 21:46:40 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-08 20:46:51 +0100 |
| commit | 71881fd7a66227738a654d98f04647d412c11980 (patch) | |
| tree | 740711d3a8733580c3197711d5062a11b2513d68 /Library/Homebrew/dev-cmd/man.rb | |
| parent | 86bfd36af27d4539ff4ac6247942856cb5015b2b (diff) | |
| download | brew-71881fd7a66227738a654d98f04647d412c11980.tar.bz2 | |
Add DEVELOPER COMMANDS to manpage.
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 |
