diff options
Diffstat (limited to 'Library/Homebrew/dev-cmd/man.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/man.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index d34d559f7..8e645d401 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -12,6 +12,8 @@ require "erb" require "ostruct" module Homebrew + module_function + SOURCE_PATH = HOMEBREW_LIBRARY_PATH/"manpages" TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages" TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs" @@ -32,8 +34,6 @@ module Homebrew end end - private - def regenerate_man_pages Homebrew.install_gem_setup_path! "ronn" @@ -44,6 +44,7 @@ module Homebrew cask_markup = (HOMEBREW_LIBRARY/"Homebrew/manpages/brew-cask.1.md").read convert_man_page(cask_markup, TARGET_MAN_PATH/"brew-cask.1") end + private_class_method :regenerate_man_pages def path_glob_commands(glob) Pathname.glob(glob) @@ -56,6 +57,7 @@ module Homebrew end .reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") } end + private_class_method :path_glob_commands def build_man_page template = (SOURCE_PATH/"brew.1.md.erb").read @@ -73,11 +75,13 @@ module Homebrew ERB.new(template, nil, ">").result(variables.instance_eval { binding }) end + private_class_method :build_man_page def sort_key_for_path(path) # Options after regular commands (`~` comes after `z` in ASCII table). path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~") end + private_class_method :sort_key_for_path def convert_man_page(markup, target) manual = target.basename(".1") @@ -110,6 +114,7 @@ module Homebrew target.atomic_write ronn.read end end + private_class_method :convert_man_page def target_path_to_format(target) case target.basename @@ -119,4 +124,5 @@ module Homebrew odie "Failed to infer output format from '#{target.basename}'." end end + private_class_method :target_path_to_format end |
