diff options
| author | Mike McQuaid | 2016-09-11 17:41:51 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-11 19:14:55 +0100 |
| commit | 71fd2bb4b0b30b03fbb7b19c53d008b1780006bb (patch) | |
| tree | 6392861776ee5e8028f0594ea3f0b384c528cc9d /Library/Homebrew/dev-cmd/man.rb | |
| parent | e6b057ea76756fa02ee059febf779aec7759f3e3 (diff) | |
| download | brew-71fd2bb4b0b30b03fbb7b19c53d008b1780006bb.tar.bz2 | |
dev-cmd/man: fix Rubocop warnings.
Diffstat (limited to 'Library/Homebrew/dev-cmd/man.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/man.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index fdd4bf33d..8b20158ef 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -34,15 +34,15 @@ module Homebrew end 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. - grep(/^#:/). - map { |line| line.slice(2..-1) }. - join - }. - reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") } + Pathname.glob(glob) + .sort_by { |source_file| sort_key_for_path(source_file) } + .map do |source_file| + source_file.read.lines + .grep(/^#:/) + .map { |line| line.slice(2..-1) } + .join + end + .reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") } end def build_man_page @@ -51,11 +51,11 @@ module Homebrew 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 + variables[:maintainers] = (HOMEBREW_REPOSITORY/"README.md") + .read[/Homebrew's current maintainers are (.*)\./, 1] + .scan(/\[([^\]]*)\]/).flatten - ERB.new(template, nil, ">").result(variables.instance_eval{ binding }) + ERB.new(template, nil, ">").result(variables.instance_eval { binding }) end def sort_key_for_path(path) |
