Skip to content
This repository was archived by the owner on Mar 12, 2019. It is now read-only.

Commit 20167e5

Browse files
Adjust comments to tidy API docs output.
1 parent de9cb69 commit 20167e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+267
-260
lines changed

.yardopts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@
77
--exclude Library/Homebrew/compat/
88
Library/Homebrew/**/*.rb
99
-
10-
share/doc/homebrew/*.html
11-
Library/Homebrew/*.md
12-
share/doc/homebrew/*.md
1310
*.md

Library/Homebrew/cache_store.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#
44
# `CacheStoreDatabase` acts as an interface to a persistent storage mechanism
5-
# residing in the `HOMEBREW_CACHE`
5+
# residing in the `HOMEBREW_CACHE`.
66
#
77
class CacheStoreDatabase
88
# Yields the cache store database.
@@ -107,7 +107,7 @@ def cache_path
107107

108108
#
109109
# `CacheStore` provides methods to mutate and fetch data from a persistent
110-
# storage mechanism
110+
# storage mechanism.
111111
#
112112
class CacheStore
113113
# @param [CacheStoreDatabase] database

Library/Homebrew/cask/cmd/doctor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def check_software_versions
4242
end
4343

4444
# This could be done by calling into Homebrew, but the situation
45-
# where "doctor" is needed is precisely the situation where such
45+
# where `brew doctor` is needed is precisely the situation where such
4646
# things are less dependable.
4747
def check_install_location
4848
ohai "Homebrew Cask Install Location"

Library/Homebrew/cask/installer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ def install_artifacts
221221
end
222222
end
223223

224-
# TODO: move dependencies to a separate class
225-
# dependencies should also apply for "brew cask stage"
226-
# override dependencies with --force or perhaps --force-deps
224+
# TODO: move dependencies to a separate class,
225+
# dependencies should also apply for `brew cask stage`,
226+
# override dependencies with `--force` or perhaps `--force-deps`
227227
def satisfy_dependencies
228228
return unless @cask.depends_on
229229

Library/Homebrew/cleaner.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Cleans a newly installed keg.
22
# By default:
3-
# * removes .la files
4-
# * removes perllocal.pod files
5-
# * removes .packlist files
3+
#
4+
# * removes `.la` files
5+
# * removes `perllocal.pod` files
6+
# * removes `.packlist` files
67
# * removes empty directories
78
# * sets permissions on executables
89
# * removes unresolved symlinks

Library/Homebrew/cmd/upgrade.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def upgrade
9191
def upgrade_formulae(formulae_to_install)
9292
return if formulae_to_install.empty?
9393

94-
# Sort keg_only before non-keg_only formulae to avoid any needless conflicts
95-
# with outdated, non-keg_only versions of formulae being upgraded.
94+
# Sort keg-only before non-keg-only formulae to avoid any needless conflicts
95+
# with outdated, non-keg-only versions of formulae being upgraded.
9696
formulae_to_install.sort! do |a, b|
9797
if !a.keg_only? && b.keg_only?
9898
1

Library/Homebrew/config.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
33
end
44

5-
# Path to `bin/brew` main executable in HOMEBREW_PREFIX
5+
# Path to `bin/brew` main executable in `HOMEBREW_PREFIX`
66
HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
77

88
# Where we link under
99
HOMEBREW_PREFIX = Pathname.new(ENV["HOMEBREW_PREFIX"])
1010

11-
# Where .git is found
11+
# Where `.git` is found
1212
HOMEBREW_REPOSITORY = Pathname.new(ENV["HOMEBREW_REPOSITORY"])
1313

1414
# Where we store most of Homebrew, taps, and various metadata
@@ -38,7 +38,7 @@
3838
# Where build, postinstall, and test logs of formulae are written to
3939
HOMEBREW_LOGS = Pathname.new(ENV["HOMEBREW_LOGS"] || "~/Library/Logs/Homebrew/").expand_path
4040

41-
# Must use /tmp instead of $TMPDIR because long paths break Unix domain sockets
41+
# Must use `/tmp` instead of `TMPDIR` because long paths break Unix domain sockets
4242
HOMEBREW_TEMP = begin
4343
# /tmp fallback is here for people auto-updating from a version where
4444
# HOMEBREW_TEMP isn't set.

Library/Homebrew/cxxstdlib.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def initialize(type, compiler)
4040
@compiler = compiler.to_sym
4141
end
4242

43-
# If either package doesn't use C++, all is well
44-
# libstdc++ and libc++ aren't ever intercompatible
43+
# If either package doesn't use C++, all is well.
44+
# libstdc++ and libc++ aren't ever intercompatible.
4545
# libstdc++ is compatible across Apple compilers, but
46-
# not between Apple and GNU compilers, or between GNU compiler versions
46+
# not between Apple and GNU compilers, or between GNU compiler versions.
4747
def compatible_with?(other)
4848
return true if type.nil? || other.type.nil?
4949

Library/Homebrew/dependable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "options"
22

33
module Dependable
4-
# :run and :linked are no longer used but keep them here to avoid them being
4+
# `:run` and `:linked` are no longer used but keep them here to avoid them being
55
# misused in future.
66
RESERVED_TAGS = [:build, :optional, :recommended, :run, :test, :linked].freeze
77

Library/Homebrew/dependency.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def self._load(marshaled)
7171

7272
class << self
7373
# Expand the dependencies of dependent recursively, optionally yielding
74-
# [dependent, dep] pairs to allow callers to apply arbitrary filters to
74+
# `[dependent, dep]` pairs to allow callers to apply arbitrary filters to
7575
# the list.
7676
# The default filter, which is applied when a block is not given, omits
7777
# optionals and recommendeds based on what the dependent has asked for.

Library/Homebrew/description_cache_store.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44

55
#
66
# `DescriptionCacheStore` provides methods to fetch and mutate linkage-specific data used
7-
# by the `brew linkage` command
7+
# by the `brew linkage` command.
88
#
99
class DescriptionCacheStore < CacheStore
1010
include Searchable
1111

1212
# Inserts a formula description into the cache if it does not exist or
13-
# updates the formula description if it does exist
13+
# updates the formula description if it does exist.
1414
#
15-
# @param [String] formula_name: the name of the formula to set
16-
# @param [String] description: the description from the formula to set
15+
# @param formula_name [String] the name of the formula to set
16+
# @param description [String] the description from the formula to set
1717
# @return [nil]
1818
def update!(formula_name, description)
1919
database.set(formula_name, description)
2020
end
2121

22-
# Delete the formula description from the `DescriptionCacheStore`
22+
# Delete the formula description from the `DescriptionCacheStore`.
2323
#
24-
# @param [String] formula_name: the name of the formula to delete
24+
# @param formula_name [String] the name of the formula to delete
2525
# @return [nil]
2626
def delete!(formula_name)
2727
database.delete(formula_name)
@@ -37,7 +37,7 @@ def populate_if_empty!
3737

3838
# Use an update report to update the `DescriptionCacheStore`.
3939
#
40-
# @param [Report] report: an update report generated by cmd/update.rb
40+
# @param report [Report] an update report generated by cmd/update.rb
4141
# @return [nil]
4242
def update_from_report!(report)
4343
return populate_if_empty! if database.empty?
@@ -55,7 +55,7 @@ def update_from_report!(report)
5555

5656
# Use an array of formulae names to update the `DescriptionCacheStore`.
5757
#
58-
# @param [Array] formula_names: the formulae to update.
58+
# @param formula_names [Array] the formulae to update
5959
# @return [nil]
6060
def update_from_formula_names!(formula_names)
6161
return populate_if_empty! if database.empty?
@@ -71,7 +71,7 @@ def update_from_formula_names!(formula_names)
7171

7272
# Use an array of formulae names to delete them from the `DescriptionCacheStore`.
7373
#
74-
# @param [Array] formula_names: the formulae to delete.
74+
# @param formula_names [Array] the formulae to delete
7575
# @return [nil]
7676
def delete_from_formula_names!(formula_names)
7777
return if database.empty?

Library/Homebrew/dev-cmd/pull.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,9 @@ def files_changed_in_patch(patchfile, tap)
453453
{ files: files, formulae: formulae, others: others }
454454
end
455455

456-
# Get current formula versions without loading formula definition in this process
457-
# Returns info as a hash (type => version), for pull.rb's internal use
458-
# Uses special key :nonexistent => true for nonexistent formulae
456+
# Get current formula versions without loading formula definition in this process.
457+
# Returns info as a hash (type => version), for pull.rb's internal use.
458+
# Uses special key `:nonexistent => true` for nonexistent formulae.
459459
def current_versions_from_info_external(formula_name)
460460
info = FormulaInfoFromJson.lookup(formula_name)
461461
versions = {}
@@ -540,7 +540,7 @@ def publish_bottle_file_on_bintray(f, bintray_org, creds)
540540
false
541541
end
542542

543-
# Formula info drawn from an external "brew info --json" call
543+
# Formula info drawn from an external `brew info --json` call
544544
class FormulaInfoFromJson
545545
# The whole info structure parsed from the JSON
546546
attr_accessor :info
@@ -549,8 +549,8 @@ def initialize(info)
549549
@info = info
550550
end
551551

552-
# Looks up formula on disk and reads its info
553-
# Returns nil if formula is absent or if there was an error reading it
552+
# Looks up formula on disk and reads its info.
553+
# Returns nil if formula is absent or if there was an error reading it.
554554
def self.lookup(name)
555555
json = Utils.popen_read(HOMEBREW_BREW_FILE, "info", "--json=v1", name)
556556

@@ -600,11 +600,11 @@ def revision
600600
end
601601
end
602602

603-
# Bottle info as used internally by pull, with alternate platform support
603+
# Bottle info as used internally by pull, with alternate platform support.
604604
class BottleInfo
605605
# URL of bottle as string
606606
attr_accessor :url
607-
# Expected SHA256 as string
607+
# Expected SHA-256 as string
608608
attr_accessor :sha256
609609

610610
def initialize(url, sha256)

Library/Homebrew/diagnostic.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def get_mounts(path = nil)
5959

6060
class Checks
6161
############# HELPERS
62-
# Finds files in HOMEBREW_PREFIX *and* /usr/local.
63-
# Specify paths relative to a prefix eg. "include/foo.h".
62+
# Finds files in `HOMEBREW_PREFIX` *and* /usr/local.
63+
# Specify paths relative to a prefix e.g. "include/foo.h".
6464
# Sets @found for your convenience.
6565
def find_relative_paths(*relative_paths)
6666
@found = [HOMEBREW_PREFIX, "/usr/local"].uniq.reduce([]) do |found, prefix|

Library/Homebrew/download_strategy.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def chdir
7272
end
7373
private :chdir
7474

75-
# @!attribute [r]
76-
# return most recent modified time for all files in the current working directory after stage.
75+
# @!attribute [r] source_modified_time
76+
# Returns the most recent modified time for all files in the current working directory after stage.
7777
def source_modified_time
7878
Pathname.pwd.to_enum(:find).select(&:file?).map(&:mtime).max
7979
end
@@ -405,7 +405,7 @@ def curl(*args, **options)
405405
end
406406
end
407407

408-
# Detect and download from Apache Mirror
408+
# Detect and download from Apache Mirror.
409409
class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
410410
def mirrors
411411
return @combined_mirrors if defined?(@combined_mirrors)
@@ -440,7 +440,7 @@ def apache_mirrors
440440
end
441441

442442
# Download via an HTTP POST.
443-
# Query parameters on the URL are converted into POST parameters
443+
# Query parameters on the URL are converted into POST parameters.
444444
class CurlPostDownloadStrategy < CurlDownloadStrategy
445445
private
446446

@@ -477,7 +477,7 @@ def initialize(path)
477477
# S3DownloadStrategy downloads tarballs from AWS S3.
478478
# To use it, add `:using => :s3` to the URL section of your
479479
# formula. This download strategy uses AWS access tokens (in the
480-
# environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
480+
# environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`)
481481
# to sign the request. This strategy is good in a corporate setting,
482482
# because it lets you use a private S3 bucket as a repo for internal
483483
# distribution. (It will work for public buckets as well.)
@@ -510,7 +510,7 @@ def _fetch(url:, resolved_url:)
510510
# Private Repository. To use it, add
511511
# `:using => :github_private_repo` to the URL section of
512512
# your formula. This download strategy uses GitHub access tokens (in the
513-
# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request. This
513+
# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request. This
514514
# strategy is suitable for corporate use just like S3DownloadStrategy, because
515515
# it lets you use a private GitHub repository for internal distribution. It
516516
# works with public one, but in that case simply use CurlDownloadStrategy.
@@ -568,7 +568,7 @@ def validate_github_repository_access!
568568
# GitHubPrivateRepositoryReleaseDownloadStrategy downloads tarballs from GitHub
569569
# Release assets. To use it, add `:using => :github_private_release` to the URL section
570570
# of your formula. This download strategy uses GitHub access tokens (in the
571-
# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request.
571+
# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request.
572572
class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
573573
def parse_url_pattern
574574
url_pattern = %r{https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)}
@@ -615,8 +615,7 @@ def fetch_release_metadata
615615
# authentication. If a public/private keypair is configured, it will not
616616
# prompt for a password.
617617
#
618-
# Usage:
619-
#
618+
# @example
620619
# class Abc < Formula
621620
# url "scp://example.com/src/abc.1.0.tar.gz"
622621
# ...

0 commit comments

Comments
 (0)