mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Minor YARD improvements
This commit is contained in:
parent
61efc7076d
commit
200b5cad6a
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@ -64,4 +64,4 @@ jobs:
|
||||
|
||||
- name: Process rubydoc comments
|
||||
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/Library/Homebrew
|
||||
run: bundle exec yard doc --plugin sorbet --no-output --fail-on-warning
|
||||
run: bundle exec yard doc --no-output --fail-on-warning
|
||||
|
@ -2,6 +2,7 @@
|
||||
--main README.md
|
||||
--markup markdown
|
||||
--no-private
|
||||
--plugin sorbet
|
||||
--load yard/ignore_directives.rb
|
||||
--template-path yard/templates
|
||||
--exclude test/
|
||||
|
@ -29,14 +29,13 @@ module Utils
|
||||
# defined by the formula, as only `HOMEBREW_PREFIX` is available
|
||||
# in the {DATAPatch embedded patch}.
|
||||
#
|
||||
# `inreplace` supports regular expressions:
|
||||
# <pre>inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool"</pre>
|
||||
# @example `inreplace` supports regular expressions:
|
||||
# inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool"
|
||||
#
|
||||
# `inreplace` supports blocks:
|
||||
# <pre>inreplace "Makefile" do |s|
|
||||
# s.gsub! "/usr/local", HOMEBREW_PREFIX.to_s
|
||||
# end
|
||||
# </pre>
|
||||
# @example `inreplace` supports blocks:
|
||||
# inreplace "Makefile" do |s|
|
||||
# s.gsub! "/usr/local", HOMEBREW_PREFIX.to_s
|
||||
# end
|
||||
#
|
||||
# @see StringInreplaceExtension
|
||||
# @api public
|
||||
|
@ -1,7 +1,10 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
def init
|
||||
# `sorbet` is available transitively through the `yard-sorbet` plugin, but we're
|
||||
# outside of the standalone sorbet config, so `checked` is enabled by default
|
||||
T.bind(self, YARD::Templates::Template, checked: false)
|
||||
super
|
||||
|
||||
return if sections.empty?
|
||||
@ -10,5 +13,6 @@ def init
|
||||
end
|
||||
|
||||
def internal
|
||||
T.bind(self, YARD::Templates::Template, checked: false)
|
||||
erb(:internal) if object.has_tag?(:api) && object.tag(:api).text == "internal"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user