aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/man.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-05 21:46:40 +0100
committerMike McQuaid2016-09-08 20:46:51 +0100
commit71881fd7a66227738a654d98f04647d412c11980 (patch)
tree740711d3a8733580c3197711d5062a11b2513d68 /Library/Homebrew/dev-cmd/man.rb
parent86bfd36af27d4539ff4ac6247942856cb5015b2b (diff)
downloadbrew-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.rb14
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