language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | Homebrew | brew | 51ca60d6d5faf97f74774ee8366785a6a8d1e168.json | add formula cleanup to install and reinstall | Library/Homebrew/cmd/install.rb | @@ -73,6 +73,9 @@
#:
#: If `--git` (or `-g`) is passed, Homebrew will create a Git repository, useful for
#: creating patches to the software.
+#:
+#: If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions
+#: of upgraded <formulae>.
require "missing_formula"
require "formula_installer"
@@ -254,6 +257,7 @@ def install
formulae.each do |f|
Migrator.migrate_if_needed(f)
install_formula(f)
+ Cleanup.new.cleanup_formula(f) if ENV["HOMEBREW_INSTALL_CLEANUP"]
end
Homebrew.messages.display_messages
rescue FormulaUnreadableError, FormulaClassUnavailableError, | true |
Other | Homebrew | brew | 51ca60d6d5faf97f74774ee8366785a6a8d1e168.json | add formula cleanup to install and reinstall | Library/Homebrew/cmd/reinstall.rb | @@ -3,6 +3,9 @@
#:
#: If `--display-times` is passed, install times for each formula are printed
#: at the end of the run.
+#:
+#: If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions
+#: of upgraded <formulae>.
require "formula_installer"
require "development_tools"
@@ -24,6 +27,7 @@ def reinstall
end
Migrator.migrate_if_needed(f)
reinstall_formula(f)
+ Cleanup.new.cleanup_formula(f) if ENV["HOMEBREW_INSTALL_CLEANUP"]
end
Homebrew.messages.display_messages
end | true |
Other | Homebrew | brew | 51ca60d6d5faf97f74774ee8366785a6a8d1e168.json | add formula cleanup to install and reinstall | Library/Homebrew/cmd/upgrade.rb | @@ -3,7 +3,7 @@
#:
#: Options for the `install` command are also valid here.
#:
-#: If `--cleanup` is specified, `HOMEBREW_INSTALL_CLEANUP` or `HOMEBREW_UPGRADE_CLEANUP` is set then remove
+#: If `--cleanup` is specified or `HOMEBREW_INSTALL_CLEANUP` is set then remove
#: previously installed version(s) of upgraded <formulae>.
#:
#: If `--fetch-HEAD` is passed, fetch the upstream repository to detect if | true |
Other | Homebrew | brew | 51ca60d6d5faf97f74774ee8366785a6a8d1e168.json | add formula cleanup to install and reinstall | Library/Homebrew/test/cmd/upgrade_spec.rb | @@ -17,17 +17,4 @@
expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory
expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist
end
-
- it "upgrades a Formula and cleans up old versions when `HOMEBREW_INSTALL_CLEANUP` is set" do
- setup_test_formula "testball"
- # allow(ENV).to receive(:[]).and_call_original
- # allow(ENV).to receive(:[]).with("HOMEBREW_INSTALL_CLEANUP").and_return("1")
- ENV["HOMEBREW_INSTALL_CLEANUP"] = "1"
- (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
-
- expect { brew "upgrade" }.to be_a_success
-
- expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory
- expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist
- end
end | true |
Other | Homebrew | brew | 51ca60d6d5faf97f74774ee8366785a6a8d1e168.json | add formula cleanup to install and reinstall | docs/Manpage.md | @@ -1243,11 +1243,10 @@ Note that environment variables must have a value set to be detected. For exampl
This issue typically occurs when using FileVault or custom SSD
configurations.
- * `HOMEBREW_UPGRADE_CLEANUP`:
- If set, `brew upgrade` always assumes `--cleanup` has been passed.
-
* `HOMEBREW_INSTALL_CLEANUP`:
If set, `brew upgrade` always assumes `--cleanup` has been passed.
+ Additionally, `brew install` and `brew reinstall` will clean up associated
+ formulae.
* `HOMEBREW_VERBOSE`:
If set, Homebrew always assumes `--verbose` when running commands. | true |
Other | Homebrew | brew | 7380ebf85b8dc9564ab12194ce0149498559bd48.json | diy: add meson support
Also print the path to put files into if no build system was
determined. | Library/Homebrew/cmd/diy.rb | @@ -25,8 +25,10 @@ def diy
puts "-DCMAKE_INSTALL_PREFIX=#{prefix}"
elsif File.file? "configure"
puts "--prefix=#{prefix}"
+ elsif File.file? "meson.build"
+ puts "-Dprefix=#{prefix}"
else
- raise "Couldn't determine build system"
+ raise "Couldn't determine build system. You can manually put files into #{prefix}"
end
end
| false |
Other | Homebrew | brew | 8e092d0ae038f0af2a12c51d0fce58742c7516f3.json | README: add Jason Tedor.
Welcome! | README.md | @@ -44,7 +44,7 @@ Homebrew/brew's other current maintainers are [Claudia](https://github.com/claui
Homebrew/brew's Linux support (and Linuxbrew) maintainers are [Michka Popoff](https://github.com/imichka) and [Shaun Jackman](https://github.com/sjackman).
-Homebrew/homebrew-core's other current maintainers are [Claudia](https://github.com/claui), [Michka Popoff](https://github.com/imichka), [Shaun Jackman](https://github.com/sjackman), [Chongyu Zhu](https://github.com/lembacon), [commitay](https://github.com/commitay), [Izaak Beekman](https://github.com/zbeekman), [Sean Molenaar](https://github.com/SMillerDev), [Jan Viljanen](https://github.com/javian), [Viktor Szakats](https://github.com/vszakats), [FX Coudert](https://github.com/fxcoudert), [Thierry Moisan](https://github.com/moisan), [Steven Peters](https://github.com/scpeters), [JCount](https://github.com/jcount), [Misty De Meo](https://github.com/mistydemeo) and [Tom Schoonjans](https://github.com/tschoonj).
+Homebrew/homebrew-core's other current maintainers are [Claudia](https://github.com/claui), [Michka Popoff](https://github.com/imichka), [Shaun Jackman](https://github.com/sjackman), [Chongyu Zhu](https://github.com/lembacon), [commitay](https://github.com/commitay), [Izaak Beekman](https://github.com/zbeekman), [Sean Molenaar](https://github.com/SMillerDev), [Jan Viljanen](https://github.com/javian), [Jason Tedor](https://github.com/jasontedor), [Viktor Szakats](https://github.com/vszakats), [FX Coudert](https://github.com/fxcoudert), [Thierry Moisan](https://github.com/moisan), [Steven Peters](https://github.com/scpeters), [JCount](https://github.com/jcount), [Misty De Meo](https://github.com/mistydemeo) and [Tom Schoonjans](https://github.com/tschoonj).
Former maintainers with significant contributions include [Dominyk Tiller](https://github.com/DomT4), [Tim Smith](https://github.com/tdsmith), [Baptiste Fontaine](https://github.com/bfontaine), [Xu Cheng](https://github.com/xu-cheng), [Martin Afanasjew](https://github.com/UniqMartin), [Brett Koonce](https://github.com/asparagui), [Charlie Sharpsteen](https://github.com/Sharpie), [Jack Nagel](https://github.com/jacknagel), [Adam Vandenberg](https://github.com/adamv), [Andrew Janke](https://github.com/apjanke), [Alex Dunn](https://github.com/dunn), [neutric](https://github.com/neutric), [Tomasz Pajor](https://github.com/nijikon), [Uladzislau Shablinski](https://github.com/vladshablinsky), [Alyssa Ross](https://github.com/alyssais), [ilovezfs](https://github.com/ilovezfs) and Homebrew's creator: [Max Howell](https://github.com/mxcl).
| true |
Other | Homebrew | brew | 8e092d0ae038f0af2a12c51d0fce58742c7516f3.json | README: add Jason Tedor.
Welcome! | docs/Manpage.md | @@ -1315,7 +1315,7 @@ Homebrew/brew's other current maintainers are Claudia, Michka Popoff, Shaun Jack
Homebrew/brew's Linux support (and Linuxbrew) maintainers are Michka Popoff and Shaun Jackman.
-Homebrew/homebrew-core's other current maintainers are Claudia, Michka Popoff, Shaun Jackman, Chongyu Zhu, commitay, Izaak Beekman, Sean Molenaar, Jan Viljanen, Viktor Szakats, FX Coudert, Thierry Moisan, Steven Peters, JCount, Misty De Meo and Tom Schoonjans.
+Homebrew/homebrew-core's other current maintainers are Claudia, Michka Popoff, Shaun Jackman, Chongyu Zhu, commitay, Izaak Beekman, Sean Molenaar, Jan Viljanen, Jason Tedor, Viktor Szakats, FX Coudert, Thierry Moisan, Steven Peters, JCount, Misty De Meo and Tom Schoonjans.
Former maintainers with significant contributions include Dominyk Tiller, Tim Smith, Baptiste Fontaine, Xu Cheng, Martin Afanasjew, Brett Koonce, Charlie Sharpsteen, Jack Nagel, Adam Vandenberg, Andrew Janke, Alex Dunn, neutric, Tomasz Pajor, Uladzislau Shablinski, Alyssa Ross, ilovezfs and Homebrew's creator: Max Howell.
| true |
Other | Homebrew | brew | 8e092d0ae038f0af2a12c51d0fce58742c7516f3.json | README: add Jason Tedor.
Welcome! | manpages/brew.1 | @@ -1462,7 +1462,7 @@ Homebrew/brew\'s other current maintainers are Claudia, Michka Popoff, Shaun Jac
Homebrew/brew\'s Linux support (and Linuxbrew) maintainers are Michka Popoff and Shaun Jackman\.
.
.P
-Homebrew/homebrew\-core\'s other current maintainers are Claudia, Michka Popoff, Shaun Jackman, Chongyu Zhu, commitay, Izaak Beekman, Sean Molenaar, Jan Viljanen, Viktor Szakats, FX Coudert, Thierry Moisan, Steven Peters, JCount, Misty De Meo and Tom Schoonjans\.
+Homebrew/homebrew\-core\'s other current maintainers are Claudia, Michka Popoff, Shaun Jackman, Chongyu Zhu, commitay, Izaak Beekman, Sean Molenaar, Jan Viljanen, Jason Tedor, Viktor Szakats, FX Coudert, Thierry Moisan, Steven Peters, JCount, Misty De Meo and Tom Schoonjans\.
.
.P
Former maintainers with significant contributions include Dominyk Tiller, Tim Smith, Baptiste Fontaine, Xu Cheng, Martin Afanasjew, Brett Koonce, Charlie Sharpsteen, Jack Nagel, Adam Vandenberg, Andrew Janke, Alex Dunn, neutric, Tomasz Pajor, Uladzislau Shablinski, Alyssa Ross, ilovezfs and Homebrew\'s creator: Max Howell\. | true |
Other | Homebrew | brew | b30ab67ca68155586620f55d1ee562fbf4cffacf.json | unpack_strategy: fix extension for compress | Library/Homebrew/unpack_strategy/compress.rb | @@ -5,7 +5,7 @@ class Compress < Tar
using Magic
def self.extensions
- [".compress"]
+ [".Z"]
end
def self.can_extract?(path) | false |
Other | Homebrew | brew | 9e4fb40f92ed2acadc82909cc3bc4b2d66467c2d.json | docs: update descriptions of git- and curl-related vars
Note that the `HOMEBREW_FORCE_BREWED_` vars are automatically set if the system `git` and `curl` are too old. Drop mention of `HOMEBREW_GIT` which isn't user-settable. | Library/Homebrew/manpages/brew.1.md.erb | @@ -10,7 +10,7 @@
# When done, regenerate the man page and its HTML version by running `brew man`.
%>
brew(1) -- The missing package manager for macOS
-===============================================
+================================================
## SYNOPSIS
@@ -105,6 +105,7 @@ can take several different forms:
The formula file will be cached for later use.
## ENVIRONMENT
+
Note that environment variables must have a value set to be detected. For example, `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just `export HOMEBREW_NO_INSECURE_REDIRECT`.
* `HOMEBREW_ARTIFACT_DOMAIN`:
@@ -180,22 +181,16 @@ Note that environment variables must have a value set to be detected. For exampl
editors will do strange things in this case.
* `HOMEBREW_FORCE_BREWED_CURL`:
- If set, Homebrew will use a Homebrew-installed `curl` rather than the
- system version.
+ If set, Homebrew will always use a Homebrew-installed `curl` rather than the
+ system version. Automatically set if the system version of `curl` is too old.
* `HOMEBREW_FORCE_VENDOR_RUBY`:
If set, Homebrew will always use its vendored, relocatable Ruby version
even if the system version of Ruby is new enough.
- * `HOMEBREW_GIT`:
- When using Git, Homebrew will use `GIT` if set,
- a Homebrew-built Git if installed, or the system-provided binary.
-
- Set this to force Homebrew to use a particular git binary.
-
* `HOMEBREW_FORCE_BREWED_GIT`:
- If set, Homebrew will use a Homebrew-installed `git` rather than the
- system version.
+ If set, Homebrew will always use a Homebrew-installed `git` rather than the
+ system version. Automatically set if the system version of `git` is too old.
* `HOMEBREW_GITHUB_API_TOKEN`:
A personal access token for the GitHub API, which you can create at | true |
Other | Homebrew | brew | 9e4fb40f92ed2acadc82909cc3bc4b2d66467c2d.json | docs: update descriptions of git- and curl-related vars
Note that the `HOMEBREW_FORCE_BREWED_` vars are automatically set if the system `git` and `curl` are too old. Drop mention of `HOMEBREW_GIT` which isn't user-settable. | Library/Homebrew/shims/scm/git | @@ -1,6 +1,6 @@
#!/bin/bash
-# This script because we support $GIT, $HOMEBREW_SVN, etc., Xcode-only and
+# This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and
# no Xcode/CLT configurations. Order is careful to be what the user would want.
set +o posix | true |
Other | Homebrew | brew | 9e4fb40f92ed2acadc82909cc3bc4b2d66467c2d.json | docs: update descriptions of git- and curl-related vars
Note that the `HOMEBREW_FORCE_BREWED_` vars are automatically set if the system `git` and `curl` are too old. Drop mention of `HOMEBREW_GIT` which isn't user-settable. | docs/Manpage.md | @@ -1,5 +1,5 @@
brew(1) -- The missing package manager for macOS
-===============================================
+================================================
## SYNOPSIS
@@ -1100,6 +1100,7 @@ can take several different forms:
The formula file will be cached for later use.
## ENVIRONMENT
+
Note that environment variables must have a value set to be detected. For example, `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just `export HOMEBREW_NO_INSECURE_REDIRECT`.
* `HOMEBREW_ARTIFACT_DOMAIN`:
@@ -1175,22 +1176,16 @@ Note that environment variables must have a value set to be detected. For exampl
editors will do strange things in this case.
* `HOMEBREW_FORCE_BREWED_CURL`:
- If set, Homebrew will use a Homebrew-installed `curl` rather than the
- system version.
+ If set, Homebrew will always use a Homebrew-installed `curl` rather than the
+ system version. Automatically set if the system version of `curl` is too old.
* `HOMEBREW_FORCE_VENDOR_RUBY`:
If set, Homebrew will always use its vendored, relocatable Ruby version
even if the system version of Ruby is new enough.
- * `HOMEBREW_GIT`:
- When using Git, Homebrew will use `GIT` if set,
- a Homebrew-built Git if installed, or the system-provided binary.
-
- Set this to force Homebrew to use a particular git binary.
-
* `HOMEBREW_FORCE_BREWED_GIT`:
- If set, Homebrew will use a Homebrew-installed `git` rather than the
- system version.
+ If set, Homebrew will always use a Homebrew-installed `git` rather than the
+ system version. Automatically set if the system version of `git` is too old.
* `HOMEBREW_GITHUB_API_TOKEN`:
A personal access token for the GitHub API, which you can create at | true |
Other | Homebrew | brew | 9e4fb40f92ed2acadc82909cc3bc4b2d66467c2d.json | docs: update descriptions of git- and curl-related vars
Note that the `HOMEBREW_FORCE_BREWED_` vars are automatically set if the system `git` and `curl` are too old. Drop mention of `HOMEBREW_GIT` which isn't user-settable. | manpages/brew.1 | @@ -1297,22 +1297,15 @@ If set, Homebrew will use this editor when editing a single formula, or several
.
.TP
\fBHOMEBREW_FORCE_BREWED_CURL\fR
-If set, Homebrew will use a Homebrew\-installed \fBcurl\fR rather than the system version\.
+If set, Homebrew will always use a Homebrew\-installed \fBcurl\fR rather than the system version\. Automatically set if the system version of \fBcurl\fR is too old\.
.
.TP
\fBHOMEBREW_FORCE_VENDOR_RUBY\fR
If set, Homebrew will always use its vendored, relocatable Ruby version even if the system version of Ruby is new enough\.
.
.TP
-\fBHOMEBREW_GIT\fR
-When using Git, Homebrew will use \fBGIT\fR if set, a Homebrew\-built Git if installed, or the system\-provided binary\.
-.
-.IP
-Set this to force Homebrew to use a particular git binary\.
-.
-.TP
\fBHOMEBREW_FORCE_BREWED_GIT\fR
-If set, Homebrew will use a Homebrew\-installed \fBgit\fR rather than the system version\.
+If set, Homebrew will always use a Homebrew\-installed \fBgit\fR rather than the system version\. Automatically set if the system version of \fBgit\fR is too old\.
.
.TP
\fBHOMEBREW_GITHUB_API_TOKEN\fR | true |
Other | Homebrew | brew | f7ec07680ccf859fd331d3fe7195afc366fc3741.json | cli_parser: Add support for short flag options | Library/Homebrew/cli_parser.rb | @@ -76,20 +76,24 @@ def comma_array(name, description: nil)
end
end
- def flag(name, description: nil, required_for: nil, depends_on: nil)
- if name.end_with? "="
+ def flag(*names, description: nil, required_for: nil, depends_on: nil)
+ if names.any? { |name| name.end_with? "=" }
required = OptionParser::REQUIRED_ARGUMENT
- name.chomp! "="
else
required = OptionParser::OPTIONAL_ARGUMENT
end
- description = option_to_description(name) if description.nil?
- process_option(name, description)
- @parser.on(name, *wrap_option_desc(description), required) do |option_value|
- Homebrew.args[option_to_name(name)] = option_value
+ names.map! { |name| name.chomp "=" }
+ description = option_to_description(*names) if description.nil?
+ process_option(*names, description)
+ @parser.on(*names, *wrap_option_desc(description), required) do |option_value|
+ names.each do |name|
+ Homebrew.args[option_to_name(name)] = option_value
+ end
end
- set_constraints(name, required_for: required_for, depends_on: depends_on)
+ names.each do |name|
+ set_constraints(name, required_for: required_for, depends_on: depends_on)
+ end
end
def conflicts(*options) | true |
Other | Homebrew | brew | f7ec07680ccf859fd331d3fe7195afc366fc3741.json | cli_parser: Add support for short flag options | Library/Homebrew/test/cli_parser_spec.rb | @@ -76,6 +76,20 @@
end
end
+ describe "test short flag options" do
+ subject(:parser) {
+ described_class.new do
+ flag "-f", "--filename=", description: "Name of the file"
+ end
+ }
+
+ it "parses a short flag option with its argument" do
+ parser.parse(["--filename=random.txt"])
+ expect(Homebrew.args.filename).to eq "random.txt"
+ expect(Homebrew.args.f).to eq "random.txt"
+ end
+ end
+
describe "test constraints for flag options" do
subject(:parser) {
described_class.new do | true |
Other | Homebrew | brew | b0198d097e115d304d1169709c6029fa24e0f2fa.json | os/mac/utils/bottles: handle Linux bottles.
These are an invalid argument on macOS but still need to be handled. | Library/Homebrew/compat.rb | @@ -1,3 +1,4 @@
+require "compat/extend/os/mac/utils/bottles"
require "compat/requirements/x11_requirement"
require "compat/requirements/xcode_requirement"
require "compat/cask" | true |
Other | Homebrew | brew | b0198d097e115d304d1169709c6029fa24e0f2fa.json | os/mac/utils/bottles: handle Linux bottles.
These are an invalid argument on macOS but still need to be handled. | Library/Homebrew/compat/extend/os/mac/utils/bottles.rb | @@ -0,0 +1,19 @@
+module Utils
+ class Bottles
+ class Collector
+ module Compat
+ private
+
+ def tag_without_or_later(tag)
+ return super unless tag.to_s.end_with?("_or_later")
+
+ odeprecated "`or_later` bottles",
+ "bottles without `or_later` (or_later is implied now)"
+ tag.to_s[/(\w+)_or_later$/, 1].to_sym
+ end
+ end
+
+ prepend Compat
+ end
+ end
+end | true |
Other | Homebrew | brew | b0198d097e115d304d1169709c6029fa24e0f2fa.json | os/mac/utils/bottles: handle Linux bottles.
These are an invalid argument on macOS but still need to be handled. | Library/Homebrew/extend/os/mac/utils/bottles.rb | @@ -42,6 +42,10 @@ def find_altivec_tag(tag)
altivec_tag if key?(altivec_tag)
end
+ def tag_without_or_later(tag)
+ tag
+ end
+
# Find a bottle built for a previous version of macOS.
def find_older_compatible_tag(tag)
begin
@@ -51,13 +55,12 @@ def find_older_compatible_tag(tag)
end
keys.find do |key|
- # TODO: move to compat?
- key_tag_version = if key.to_s.end_with?("_or_later")
- key.to_s[/(\w+)_or_later$/, 1].to_sym
- else
- key
+ key_tag_version = tag_without_or_later(key)
+ begin
+ MacOS::Version.from_symbol(key_tag_version) <= tag_version
+ rescue ArgumentError
+ false
end
- MacOS::Version.from_symbol(key_tag_version) <= tag_version
end
end
end | true |
Other | Homebrew | brew | 462439ea1d3140b2b6a6adc5531dc3dd71d4b96c.json | README: use Azure Pipelines badge. | README.md | @@ -19,7 +19,7 @@ Second, read the [Troubleshooting Checklist](https://docs.brew.sh/Troubleshootin
**If you don't read these it will take us far longer to help you with your problem.**
## Contributing
-[](https://travis-ci.org/Homebrew/brew)
+[](https://dev.azure.com/Homebrew/Homebrew/_build/latest?definitionId=1)
[](https://codecov.io/gh/Homebrew/brew)
We'd love you to contribute to Homebrew. First, please read our [Contribution Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md#code-of-conduct). | false |
Other | Homebrew | brew | 44578adfdb3e780579381407e0a88677fa0eaa8c.json | audit: use debian canonical mirror | Library/Homebrew/rubocops/urls_cop.rb | @@ -43,6 +43,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
%r{^http://code\.google\.com/},
%r{^http://fossies\.org/},
%r{^http://mirrors\.kernel\.org/},
+ %r{^http://mirrors\.ocf\.berkeley\.edu/},
%r{^http://(?:[^/]*\.)?bintray\.com/},
%r{^http://tools\.ietf\.org/},
%r{^http://launchpad\.net/},
@@ -125,10 +126,19 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem <<~EOS
Please use a secure mirror for Debian URLs.
We recommend:
- https://mirrors.ocf.berkeley.edu/debian/#{match[1]}
+ https://deb.debian.org/debian/#{match[1]}
EOS
end
+ # Check to use canonical urls for Debian packages
+ noncanon_deb_pattern =
+ Regexp.union([%r{^https://mirrors\.kernel\.org/debian/},
+ %r{^https://mirrors\.ocf\.berkeley\.edu/debian/},
+ %r{^https://(?:[^/]*\.)?mirrorservice\.org/sites/ftp\.debian\.org/debian/}])
+ audit_urls(urls, noncanon_deb_pattern) do |_, url|
+ problem "Please use https://deb.debian.org/debian/ for #{url}"
+ end
+
# Check for new-url Google Code download urls, https:// is preferred
google_code_pattern = Regexp.union([%r{^http://.*\.googlecode\.com/files.*},
%r{^http://code\.google\.com/}]) | true |
Other | Homebrew | brew | 44578adfdb3e780579381407e0a88677fa0eaa8c.json | audit: use debian canonical mirror | Library/Homebrew/test/rubocops/urls_cop_spec.rb | @@ -76,9 +76,33 @@
"msg" => <<~EOS,
Please use a secure mirror for Debian URLs.
We recommend:
- https://mirrors.ocf.berkeley.edu/debian/dists/foo/
+ https://deb.debian.org/debian/dists/foo/
EOS
"col" => 2,
+ }, {
+ "url" => "https://mirrors.kernel.org/debian/pool/main/n/nc6/foo.tar.gz",
+ "msg" => "Please use " \
+ "https://deb.debian.org/debian/ for " \
+ "https://mirrors.kernel.org/debian/pool/main/n/nc6/foo.tar.gz",
+ "col" => 2,
+ }, {
+ "url" => "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mkcue/foo.tar.gz",
+ "msg" => "Please use " \
+ "https://deb.debian.org/debian/ for " \
+ "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mkcue/foo.tar.gz",
+ "col" => 2,
+ }, {
+ "url" => "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
+ "msg" => "Please use " \
+ "https://deb.debian.org/debian/ for " \
+ "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
+ "col" => 2,
+ }, {
+ "url" => "https://www.mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
+ "msg" => "Please use " \
+ "https://deb.debian.org/debian/ for " \
+ "https://www.mirrorservice.org/sites/ftp.debian.org/debian/pool/main/n/netris/foo.tar.gz",
+ "col" => 2,
}, {
"url" => "http://foo.googlecode.com/files/foo-1.0.zip",
"msg" => "Please use https:// for http://foo.googlecode.com/files/foo-1.0.zip", | true |
Other | Homebrew | brew | 5e68a0872e0540adacd4d5ff2a988113eba045d2.json | audit: remove heroku formula.
This was removed in https://github.com/Homebrew/homebrew-core/pull/33233. | Library/Homebrew/dev-cmd/audit.rb | @@ -684,7 +684,6 @@ def audit_specs
throttled = %w[
aws-sdk-cpp 10
awscli 10
- heroku 10
quicktype 10
vim 50
] | false |
Other | Homebrew | brew | bd3bc09720c0adc764b7082622cdedc933d0d28e.json | restore sh test | Library/Homebrew/test/utils/shell_spec.rb | @@ -7,6 +7,11 @@
expect(subject.profile).to eq("~/.bash_profile")
end
+ it "returns ~/.bash_profile by default" do
+ ENV["SHELL"] = "/bin/sh"
+ expect(subject.profile).to eq("~/.bash_profile")
+ end
+
it "returns ~/.bash_profile for Bash" do
ENV["SHELL"] = "/bin/bash"
expect(subject.profile).to eq("~/.bash_profile") | false |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/audit.rb | @@ -53,7 +53,7 @@ module Homebrew
def audit_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `audit` [<options>] <formulae>:
+ `audit` [<options>] <formulae>
Check <formulae> for Homebrew coding style violations. This should be run before
submitting a new formula. Will exit with a non-zero status if any errors are | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/bottle.rb | @@ -72,7 +72,7 @@ module Homebrew
def bottle_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `bottle` [<options>] <formulae>:
+ `bottle` [<options>] <formulae>
Generate a bottle (binary package) from a formula that was installed with
`--build-bottle`. | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -50,7 +50,7 @@ module Homebrew
def bump_formula_pr_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `bump-formula-pr` [<options>] [<formula>]:
+ `bump-formula-pr` [<options>] [<formula>]
Create a pull request to update a formula with a new URL or a new tag.
| true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/create.rb | @@ -30,7 +30,7 @@ module Homebrew
def create_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `create` [<options>] <URL>:
+ `create` [<options>] <URL>
Generate a formula for the downloadable file at <URL> and open it in the editor.
Homebrew will attempt to automatically derive the formula name and version, but | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/edit.rb | @@ -13,7 +13,7 @@ module Homebrew
def edit_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `edit` [<formulae>]:
+ `edit` [<formulae>]
Open a formula in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the
Homebrew repository for editing if no <formula> is provided. | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/extract.rb | @@ -99,7 +99,7 @@ module Homebrew
def extract_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `extract` [<options>] <formula> <tap>:
+ `extract` [<options>] <formula> <tap>
Look through repository history to find the most recent version of <formula> and
create a copy in <tap>`/Formula/`<formula>`@`<version>`.rb`. If the tap is not | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/formula.rb | @@ -10,7 +10,7 @@ module Homebrew
def formula_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `formula` <formulae>:
+ `formula` <formulae>
Display the path where a formula is located.
EOS | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/irb.rb | @@ -26,7 +26,7 @@ module Homebrew
def irb_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `irb` [<options>]:
+ `irb` [<options>]
Enter the interactive Homebrew Ruby shell.
EOS | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/linkage.rb | @@ -20,7 +20,7 @@ module Homebrew
def linkage_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `linkage` [<options>] [<formulae>]:
+ `linkage` [<options>] [<formulae>]
Check the library links for kegs of installed formulae.
Raises an error if run on uninstalled formulae. | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/man.rb | @@ -40,7 +40,7 @@ module Homebrew
def man_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `man` [<options>]:
+ `man` [<options>]
Generate Homebrew's manpages.
EOS | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/mirror.rb | @@ -10,7 +10,7 @@ module Homebrew
def mirror_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `mirror` <formulae>:
+ `mirror` <formulae>
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
EOS | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/prof.rb | @@ -9,7 +9,7 @@ module Homebrew
def prof_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `prof` [<ruby options>]:
+ `prof` [<ruby options>]
Run Homebrew with the Ruby profiler.
| true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/pull.rb | @@ -74,7 +74,7 @@ module Homebrew
def pull_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `pull` [<options>] <patch sources>:
+ `pull` [<options>] <patch sources>
Get a patch from a GitHub commit or pull request and apply it to Homebrew.
Optionally, publish updated bottles for the formulae changed by the patch. | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/release-notes.rb | @@ -13,7 +13,7 @@ module Homebrew
def release_notes_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `release-notes` [<options>] [<previous_tag>] [<end_ref>]:
+ `release-notes` [<options>] [<previous_tag>] [<end_ref>]
Print the merged pull requests on Homebrew/brew between two Git refs.
If no <previous_tag> is provided it defaults to the latest tag. | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/ruby.rb | @@ -11,7 +11,7 @@ module Homebrew
def ruby_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `ruby` [<ruby options>]:
+ `ruby` [<ruby options>]
Run a Ruby instance with Homebrew's libraries loaded.
| true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/tap-new.rb | @@ -10,7 +10,7 @@ module Homebrew
def tap_new_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `tap-new` <user>`/`<repo>:
+ `tap-new` <user>`/`<repo>
Generate the template files for a new tap.
EOS | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/test.rb | @@ -25,7 +25,7 @@ module Homebrew
def test_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `test` [<options>] <formulae>:
+ `test` [<options>] <formulae>
Run the test method provided by an installed formula.
There is no standard output or return code, but generally it should notify the | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/tests.rb | @@ -24,7 +24,7 @@ module Homebrew
def tests_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `tests` [<options>]:
+ `tests` [<options>]
Run Homebrew's unit and integration tests.
EOS | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | Library/Homebrew/dev-cmd/update-test.rb | @@ -22,7 +22,7 @@ module Homebrew
def update_test_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
- `update-test` [<options>]:
+ `update-test` [<options>]
Run a test of `brew update` with a new repository clone.
If no arguments are passed, use `origin/master` as the start commit. | true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | docs/Manpage.md | @@ -663,199 +663,201 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
## DEVELOPER COMMANDS
-### `audit` [*`options`*] *`formulae`*:
+### `audit` [*`options`*] *`formulae`*
-Check *`formulae`* for Homebrew coding style violations. This should be
-run before submitting a new formula.
+Check *`formulae`* for Homebrew coding style violations. This should be run before
+submitting a new formula. Will exit with a non-zero status if any errors are
+found, which can be useful for implementing pre-commit hooks.
If no *`formulae`* are provided, all of them are checked.
-* `--strict`:
-Run additional style checks, including Rubocop style checks.
-* `--online`:
-Run additional slower style checks that require a network connection.
-* `--new-formula`:
-Run various additional style checks to determine if a new formula is eligible for Homebrew. This should be used when creating new formula and implies `--strict` and `--online`.
-* `--fix`:
-Fix style violations automatically using RuboCop's auto-correct feature.
-* `--display-cop-names`:
-Include the RuboCop cop name for each violation in the output.
-* `--display-filename`:
-Prefix everyline of output with name of the file or formula being audited, to make output easy to grep.
-* `-D`, `--audit-debug`:
-Activates debugging and profiling
-* `--only`:
-Passing `--only=`*`method`* will run only the methods named audit_*`method`*. *`method`* should be a comma-separated list.
-* `--except`:
-Passing `--except=`*`method`* will run only the methods named audit_*`method`*, *`method`* should be a comma-separated list.
-* `--only-cops`:
-Passing `--only-cops=`*`cops`* will check for violations of only the listed RuboCop cops. *`cops`* should be a comma-separated list of cop names.
-* `--except-cops`:
-Passing `--except-cops=`*`cops`* will skip checking the listed RuboCop cops violations. *`cops`* should be a comma-separated list of cop names.
-
-### `bottle` [*`options`*] *`formulae`*:
-
-Generate a bottle (binary package) from a formula installed with
+* `--strict`:
+ Run additional style checks, including RuboCop style checks.
+* `--online`:
+ Run additional slower style checks that require a network connection.
+* `--new-formula`:
+ Run various additional style checks to determine if a new formula is eligible for Homebrew. This should be used when creating new formula and implies `--strict` and `--online`.
+* `--fix`:
+ Fix style violations automatically using RuboCop's auto-correct feature.
+* `--display-cop-names`:
+ Include the RuboCop cop name for each violation in the output.
+* `--display-filename`:
+ Prefix every line of output with name of the file or formula being audited, to make output easy to grep.
+* `-D`, `--audit-debug`:
+ Enable debugging and profiling of audit methods.
+* `--only`:
+ Specify a comma-separated *`method`* list to only run the methods named `audit_`*`method`*.
+* `--except`:
+ Specify a comma-separated *`method`* list to skip running the methods named `audit_`*`method`*.
+* `--only-cops`:
+ Specify a comma-separated *`cops`* list to check for violations of only the listed RuboCop cops.
+* `--except-cops`:
+ Specify a comma-separated *`cops`* list to skip checking for violations of the listed RuboCop cops.
+
+### `bottle` [*`options`*] *`formulae`*
+
+Generate a bottle (binary package) from a formula that was installed with
`--build-bottle`.
If the formula specifies a rebuild version, it will be incremented in the
-generated DSL. Passing `--keep-old` will attempt to keep it at its
-original value, while `--no-rebuild` will remove it.
-
-* `--skip-relocation`:
-Do not check if the bottle can be marked as relocatable.
-* `--or-later`:
-Append `_or_later` to the bottle tag.
-* `--force-core-tap`:
-Build a bottle even if *`formula`* is not in homebrew/core or any installed taps.
-* `--no-rebuild`:
-If the formula specifies a rebuild version, it will be removed in the generated DSL.
-* `--keep-old`:
-If the formula specifies a rebuild version, it will attempted to be kept in the generated DSL.
-* `--merge`:
-Generate a bottle from a formula and print the new DSL merged into the existing formula.
-* `--write`:
-Changes will be written to the formula file. A new commit will be generated unless `--no-commit` is passed.
-* `--no-commit`:
-When passed with `--write`, a new commit will not generated while writing changes to the formula file.
-* `--json`:
-Write bottle information to a JSON file, which can be used as the argument for `--merge`.
-* `--root-url`:
-Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default.
-
-### `bump-formula-pr` [*`options`*] *`formula`*:
-
-Creates a pull request to update the formula with a new URL or a new tag.
-
-If a *`URL`* is specified, the *`sha-256`* checksum of the new download must
-also be specified. A best effort to determine the *`sha-256`* and *`formula`*
-name will be made if either or both values are not supplied by the user.
-
-If a *`tag`* is specified, the git commit *`revision`* corresponding to that
-tag must also be specified.
-
-Note that this command cannot be used to transition a formula from a
-URL-and-sha256 style specification into a tag-and-revision style
-specification, nor vice versa. It must use whichever style specification
-the preexisting formula already uses.
-
-* `--devel`:
-Bump the development rather than stable version. The development spec must already exist.
-* `-n`, `--dry-run`:
-Print what would be done rather than doing it.
-* `--write`:
-When passed along with `--dry-run`, perform a not-so-dry run making the expected file modifications but not taking any git actions.
-* `--audit`:
-Run `brew audit` before opening the PR.
-* `--strict`:
-Run `brew audit --strict` before opening the PR.
-* `--no-browse`:
-Output the pull request URL instead of opening in a browser
-* `--url`:
-Provide new *`URL`* for the formula. If a *`URL`* is specified, the *`sha-256`* checksum of the new download must also be specified.
-* `--revision`:
-Specify the new git commit *`revision`* corresponding to a specified *`tag`*.
-* `--tag`:
-Specify the new git commit *`tag`* for the formula.
-* `--sha256`:
-Specify the *`sha-256`* checksum of new download.
-* `--mirror`:
-Use the provided *`URL`* as a mirror URL.
-* `--version`:
-Use the provided *`version`* to override the value parsed from the URL or tag. Note that `--version=0` can be used to delete an existing `version` override from a formula if it has become redundant.
-* `--message`:
-Append provided *`message`* to the default PR message.
-
-### `create` *`URL`* [*`options`*]:
+generated DSL. Passing `--keep-old` will attempt to keep it at its original
+value, while `--no-rebuild` will remove it.
+
+* `--skip-relocation`:
+ Do not check if the bottle can be marked as relocatable.
+* `--or-later`:
+ Append `_or_later` to the bottle tag.
+* `--force-core-tap`:
+ Build a bottle even if *`formula`* is not in homebrew/core or any installed taps.
+* `--no-rebuild`:
+ If the formula specifies a rebuild version, remove it from the generated DSL.
+* `--keep-old`:
+ If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL.
+* `--json`:
+ Write bottle information to a JSON file, which can be used as the argument for `--merge`.
+* `--merge`:
+ Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires a JSON file generated with `brew bottle --json` *`formula`*.
+* `--write`:
+ Write the changes to the formula file. A new commit will be generated unless `--no-commit` is passed.
+* `--no-commit`:
+ When passed with `--write`, a new commit will not generated after writing changes to the formula file.
+* `--root-url`:
+ Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default.
+
+### `bump-formula-pr` [*`options`*] [*`formula`*]
+
+Create a pull request to update a formula with a new URL or a new tag.
+
+If a *`URL`* is specified, the *`SHA-256`* checksum of the new download should also
+be specified. A best effort to determine the *`SHA-256`* and *`formula`* name will
+be made if either or both values are not supplied by the user.
+
+If a *`tag`* is specified, the Git commit *`revision`* corresponding to that tag
+must also be specified.
+
+*Note:* this command cannot be used to transition a formula from a
+URL-and-SHA-256 style specification into a tag-and-revision style specification,
+nor vice versa. It must use whichever style specification the preexisting
+formula already uses.
+
+* `--devel`:
+ Bump the development rather than stable version. The development spec must already exist.
+* `-n`, `--dry-run`:
+ Print what would be done rather than doing it.
+* `--write`:
+ When passed along with `--dry-run`, perform a not-so-dry run by making the expected file modifications but not taking any Git actions.
+* `--audit`:
+ Run `brew audit` before opening the PR.
+* `--strict`:
+ Run `brew audit --strict` before opening the PR.
+* `--no-browse`:
+ Print the pull request URL instead of opening in a browser.
+* `--mirror`:
+ Use the provided *`URL`* as a mirror URL.
+* `--version`:
+ Use the provided *`version`* to override the value parsed from the URL or tag. Note that `--version=0` can be used to delete an existing version override from a formula if it has become redundant.
+* `--message`:
+ Append the provided *`message`* to the default PR message.
+* `--url`:
+ Specify the *`URL`* for the new download. If a *`URL`* is specified, the *`SHA-256`* checksum of the new download should also be specified.
+* `--sha256`:
+ Specify the *`SHA-256`* checksum of the new download.
+* `--tag`:
+ Specify the new git commit *`tag`* for the formula.
+* `--revision`:
+ Specify the new git commit *`revision`* corresponding to a specified *`tag`*.
+
+### `create` [*`options`*] *`URL`*
Generate a formula for the downloadable file at *`URL`* and open it in the editor.
-Homebrew will attempt to automatically derive the formula name
-and version, but if it fails, you'll have to make your own template. The `wget`
-formula serves as a simple example. For the complete API have a look at
-<http://www.rubydoc.info/github/Homebrew/brew/master/Formula>.
+Homebrew will attempt to automatically derive the formula name and version, but
+if it fails, you'll have to make your own template. The `wget` formula serves as
+a simple example. For the complete API, see:
+<http://www.rubydoc.info/github/Homebrew/brew/master/Formula>
-* `--autotools`:
-Create a basic template for an Autotools-style build.
-* `--cmake`:
-Create a basic template for a CMake-style build.
-* `--meson`:
-Create a basic template for a Meson-style build.
-* `--no-fetch`:
-Homebrew will not download *`URL`* to the cache and will thus not add the SHA256 to the formula for you. It will also not check the GitHub API for GitHub projects (to fill out the description and homepage).
-* `--HEAD`:
-HEAD
-* `--set-name`:
-Set the provided name of the package you are creating.
-* `--set-version`:
-Set the provided version of the package you are creating.
-* `--tap`:
-Takes a tap [*`user`*`/`*`repo`*] as argument and generates the formula in the specified tap.
+* `--autotools`:
+ Create a basic template for an Autotools-style build.
+* `--cmake`:
+ Create a basic template for a CMake-style build.
+* `--meson`:
+ Create a basic template for a Meson-style build.
+* `--no-fetch`:
+ Homebrew will not download *`URL`* to the cache and will thus not add the SHA-256 to the formula for you, nor will it check the GitHub API for GitHub projects (to fill out its description and homepage).
+* `--HEAD`:
+ Indicate that *`URL`* points to the package's repository rather than a file.
+* `--set-name`:
+ Set the name of the new formula to the provided *`name`*.
+* `--set-version`:
+ Set the version of the new formula to the provided *`version`*.
+* `--tap`:
+ Generate the new formula in the provided tap, specified as *`user`*`/`*`repo`*.
-### `edit` *`formula`*:
- Open *`formula`* in the editor. Open all of Homebrew for editing if
- no *`formula`* is provided.
+### `edit` [*`formulae`*]
+Open a formula in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the
+Homebrew repository for editing if no *`formula`* is provided.
-### `extract` [*`options`*] *`formula`* *`tap`*:
-Looks through repository history to find the *`version`* of *`formula`* and
-creates a copy in *`tap`*/Formula/*`formula`*@*`version`*.rb. If the tap is
-not installed yet, attempts to install/clone the tap before continuing.
+### `extract` [*`options`*] *`formula`* *`tap`*
-* `--version`:
-Provided *`version`* of *`formula`* will be extracted and placed in the destination tap. Otherwise, the most recent version that can be found will be used.
+Look through repository history to find the most recent version of *`formula`* and
+create a copy in *`tap`*`/Formula/`*`formula`*`@`*`version`*`.rb`. If the tap is not
+installed yet, attempt to install/clone the tap before continuing.
-### `formula` *`formula`*:
+* `--version`:
+ Extract the provided *`version`* of *`formula`* instead of the most recent.
-Display the path where *`formula`* is located.
+### `formula` *`formulae`*
+Display the path where a formula is located.
-### `irb` [*`options`*]:
-Enter the interactive Homebrew Ruby shell.
+### `irb` [*`options`*]
-* `--examples`:
-Show several examples.
-* `--pry`:
-Pry will be used instead of irb if `--pry` is passed or HOMEBREW_PRY is set.
+Enter the interactive Homebrew Ruby shell.
-### `linkage` [*`options`*] *`formula`*:
+* `--examples`:
+ Show several examples.
+* `--pry`:
+ Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set.
-Checks the library links of an installed formula.
+### `linkage` [*`options`*] [*`formulae`*]
-Only works on installed formulae. An error is raised if it is run on
-uninstalled formulae.
+Check the library links for kegs of installed formulae.
+Raises an error if run on uninstalled formulae.
-* `--test`:
-Display only missing libraries and exit with a non-zero exit code if any missing libraries were found.
-* `--reverse`:
-Print the dylib followed by the binaries which link to it for each library the keg references.
-* `--cached`:
-Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous `brew linkage` run.
+* `--test`:
+ Display only missing libraries and exit with a non-zero status if any missing libraries are found.
+* `--reverse`:
+ For every library that a keg references, print its dylib path followed by the binaries that link to it.
+* `--cached`:
+ Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous `brew linkage` run.
-### `man` [*`options`*]:
+### `man` [*`options`*]
Generate Homebrew's manpages.
-* `--fail-if-changed`:
-Return a failing status code if changes are detected in the manpage outputs. This can be used for CI to be notified when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date).
-* `--link`:
-It is now done automatically by `brew update`.
+* `--fail-if-changed`:
+ Return a failing status code if changes are detected in the manpage outputs. This can be used for CI to be notified when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date).
+* `--link`:
+ This is now done automatically by `brew update`.
-### `mirror` *`formulae`*:
+### `mirror` *`formulae`*
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
- * `prof` [*`ruby options`*]:
- Run Homebrew with the Ruby profiler.
- For example:
- brew prof readall
+### `prof` [*`ruby options`*]
+
+Run Homebrew with the Ruby profiler.
+
+*Example:* `brew prof readall`
+
-### `pull` [*`options`*] *`formula`*:
+### `pull` [*`options`*] *`patch sources`*
-Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
-Optionally, installs the formulae changed by the patch.
+Get a patch from a GitHub commit or pull request and apply it to Homebrew.
+Optionally, publish updated bottles for the formulae changed by the patch.
-Each *`patch-source`* may be one of:
+Each *`patch source`* may be one of:
~ The ID number of a PR (pull request) in the homebrew/core GitHub
repository
@@ -868,113 +870,113 @@ Each *`patch-source`* may be one of:
~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID
-* `--bottle`:
-Handle bottles, pulling the bottle-update commit and publishing files on Bintray.
-* `--bump`:
-For one-formula PRs, automatically reword commit message to our preferred format.
-* `--clean`:
-Do not rewrite or otherwise modify the commits found in the pulled PR.
-* `--ignore-whitespace`:
-Silently ignore whitespace discrepancies when applying diffs.
-* `--resolve`:
-When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting.
-* `--branch-okay`:
-Do not warn if pulling to a branch besides master (useful for testing).
-* `--no-pbcopy`:
-Do not copy anything to the system clipboard.
-* `--no-publish`:
-Do not publish bottles to Bintray.
-* `--warn-on-publish-failure`:
-Do not exit if there's a failure publishing bottles on Bintray.
-* `--bintray-org`:
-Publish at the given Bintray organisation.
-* `--test-bot-user`:
-Pull the bottle block commit from the specified user on GitHub.
-
-### `release-notes` [*`options`*] [*`previous_tag`*] [*`end_ref`*]:
-
-Output the merged pull requests on Homebrew/brew between two Git refs.
+* `--bottle`:
+ Handle bottles, pulling the bottle-update commit and publishing files on Bintray.
+* `--bump`:
+ For one-formula PRs, automatically reword commit message to our preferred format.
+* `--clean`:
+ Do not rewrite or otherwise modify the commits found in the pulled PR.
+* `--ignore-whitespace`:
+ Silently ignore whitespace discrepancies when applying diffs.
+* `--resolve`:
+ When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting.
+* `--branch-okay`:
+ Do not warn if pulling to a branch besides master (useful for testing).
+* `--no-pbcopy`:
+ Do not copy anything to the system clipboard.
+* `--no-publish`:
+ Do not publish bottles to Bintray.
+* `--warn-on-publish-failure`:
+ Do not exit if there's a failure publishing bottles on Bintray.
+* `--bintray-org`:
+ Publish bottles at the provided Bintray *`organisation`*.
+* `--test-bot-user`:
+ Pull the bottle block commit from the provided *`user`* on GitHub.
+
+### `release-notes` [*`options`*] [*`previous_tag`*] [*`end_ref`*]
+
+Print the merged pull requests on Homebrew/brew between two Git refs.
If no *`previous_tag`* is provided it defaults to the latest tag.
If no *`end_ref`* is provided it defaults to `origin/master`.
-* `--markdown`:
-Output as a Markdown list.
+* `--markdown`:
+ Print as a Markdown list.
- * `ruby` [*`ruby options`*]:
- Run a Ruby instance with Homebrew's libraries loaded.
- For example:
+### `ruby` [*`ruby options`*]
-### `tap-new` *`user`*/*`repo`*:
+Run a Ruby instance with Homebrew's libraries loaded.
-Generate the template files for a new tap.
+*Example:* `brew ruby -e "puts :gcc.f.deps"` or `brew ruby script.rb`
+* `-e`:
+ Execute the provided string argument as a script.
- * `test` [`--devel`|`--HEAD`] [`--debug`] [`--keep-tmp`] *`formula`*:
- Most formulae provide a test method. `brew test` *`formula`* runs this
- test method. There is no standard output or return code, but it should
- generally indicate to the user if something is wrong with the installed
- formula.
+### `tap-new` *`user`*`/`*`repo`*
+
+Generate the template files for a new tap.
- To test the development or head version of a formula, use `--devel` or
- `--HEAD`.
- If `--debug` (or `-d`) is passed and the test fails, an interactive debugger will be
- launched with access to IRB or a shell inside the temporary test directory.
+### `test` [*`options`*] *`formulae`*
- If `--keep-tmp` is passed, the temporary files created for the test are
- not deleted.
+Run the test method provided by an installed formula.
+There is no standard output or return code, but generally it should notify the
+user if something is wrong with the installed formula.
- Example: `brew install jruby && brew test jruby`
+*Example:* `brew install jruby && brew test jruby`
-### `tests` [*`options`*]:
+* `--devel`:
+ Test the development version of a formula.
+* `--HEAD`:
+ Test the head version of a formula.
+* `--keep-tmp`:
+ Keep the temporary files created for the test.
-Run Homebrew's unit and integration tests. If provided,
-`--only=`*`test_script`* runs only *`test_script`*_spec.rb, and `--seed`
-randomizes tests with the provided value instead of a random seed.
+### `tests` [*`options`*]
-* `--coverage`:
-Generate code coverage reports.
-* `--generic`:
-Run only OS-agnostic tests.
-* `--no-compat`:
-Do not load the compatibility layer when running tests.
-* `--online`:
-Include tests that use the GitHub API and tests that use any of the taps for official external commands.
-* `--only`:
-Run only *`test_script`*_spec.rb
-* `--seed`:
-Randomizes tests with the provided value instead of a random seed.
+Run Homebrew's unit and integration tests.
-### `update-test` [*`options`*]:
+* `--coverage`:
+ Generate code coverage reports.
+* `--generic`:
+ Run only OS-agnostic tests.
+* `--no-compat`:
+ Do not load the compatibility layer when running tests.
+* `--online`:
+ Include tests that use the GitHub API and tests that use any of the taps for official external commands.
+* `--only`:
+ Run only *`test_script`*`_spec.rb`. Appending `:`*`line_number`* will start at a specific line.
+* `--seed`:
+ Randomize tests with the provided *`value`* instead of a random seed.
-Runs a test of `brew update` with a new repository clone.
+### `update-test` [*`options`*]
+Run a test of `brew update` with a new repository clone.
If no arguments are passed, use `origin/master` as the start commit.
-* `--to-tag`:
-Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags.
-* `--keep-tmp`:
-Retain the temporary directory containing the new repository clone.
-* `--commit`:
-Use provided *`commit`* as the start commit.
-* `--before`:
-Use the commit at provided *`date`* as the start commit.
+* `--to-tag`:
+ Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags.
+* `--keep-tmp`:
+ Retain the temporary directory containing the new repository clone.
+* `--commit`:
+ Use provided *`commit`* as the start commit.
+* `--before`:
+ Use the commit at provided *`date`* as the start commit.
## GLOBAL OPTIONS
These options are applicable across all sub-commands.
-* `-q`, `--quiet`:
-Suppress any warnings.
+* `-q`, `--quiet`:
+ Suppress any warnings.
-* `-v`, `--verbose`:
-Make some output more verbose.
+* `-v`, `--verbose`:
+ Make some output more verbose.
-* `-d`, `--debug`:
-Display any debugging information.
+* `-d`, `--debug`:
+ Display any debugging information.
-* `-f`, `--force`:
-Override warnings and enable potentially unsafe operations.
+* `-f`, `--force`:
+ Override warnings and enable potentially unsafe operations.
## OFFICIAL EXTERNAL COMMANDS
| true |
Other | Homebrew | brew | 388781f6a74d353d1a69b836217e859ac3f9bb30.json | dev-cmd/: remove colons from command specs.
These aren't needed when converting Parser-based help text to man page or Markdown formats.
Includes regenerated docs. | manpages/brew.1 | @@ -676,12 +676,12 @@ Print the version number of Homebrew to standard output and exit\.
.
.SH "DEVELOPER COMMANDS"
.
-.SS "\fBaudit\fR [\fIoptions\fR] \fIformulae\fR:"
-Check \fIformulae\fR for Homebrew coding style violations\. This should be run before submitting a new formula\. If no \fIformulae\fR are provided, all of them are checked\.
+.SS "\fBaudit\fR [\fIoptions\fR] \fIformulae\fR"
+Check \fIformulae\fR for Homebrew coding style violations\. This should be run before submitting a new formula\. Will exit with a non\-zero status if any errors are found, which can be useful for implementing pre\-commit hooks\. If no \fIformulae\fR are provided, all of them are checked\.
.
.TP
\fB\-\-strict\fR
-Run additional style checks, including Rubocop style checks\.
+Run additional style checks, including RuboCop style checks\.
.
.TP
\fB\-\-online\fR
@@ -701,30 +701,30 @@ Include the RuboCop cop name for each violation in the output\.
.
.TP
\fB\-\-display\-filename\fR
-Prefix everyline of output with name of the file or formula being audited, to make output easy to grep\.
+Prefix every line of output with name of the file or formula being audited, to make output easy to grep\.
.
.TP
\fB\-D\fR, \fB\-\-audit\-debug\fR
-Activates debugging and profiling
+Enable debugging and profiling of audit methods\.
.
.TP
\fB\-\-only\fR
-Passing \fB\-\-only=\fR\fImethod\fR will run only the methods named audit_\fImethod\fR\. \fImethod\fR should be a comma\-separated list\.
+Specify a comma\-separated \fImethod\fR list to only run the methods named \fBaudit_\fR\fImethod\fR\.
.
.TP
\fB\-\-except\fR
-Passing \fB\-\-except=\fR\fImethod\fR will run only the methods named audit_\fImethod\fR, \fImethod\fR should be a comma\-separated list\.
+Specify a comma\-separated \fImethod\fR list to skip running the methods named \fBaudit_\fR\fImethod\fR\.
.
.TP
\fB\-\-only\-cops\fR
-Passing \fB\-\-only\-cops=\fR\fIcops\fR will check for violations of only the listed RuboCop cops\. \fIcops\fR should be a comma\-separated list of cop names\.
+Specify a comma\-separated \fIcops\fR list to check for violations of only the listed RuboCop cops\.
.
.TP
\fB\-\-except\-cops\fR
-Passing \fB\-\-except\-cops=\fR\fIcops\fR will skip checking the listed RuboCop cops violations\. \fIcops\fR should be a comma\-separated list of cop names\.
+Specify a comma\-separated \fIcops\fR list to skip checking for violations of the listed RuboCop cops\.
.
-.SS "\fBbottle\fR [\fIoptions\fR] \fIformulae\fR:"
-Generate a bottle (binary package) from a formula installed with \fB\-\-build\-bottle\fR\. If the formula specifies a rebuild version, it will be incremented in the generated DSL\. Passing \fB\-\-keep\-old\fR will attempt to keep it at its original value, while \fB\-\-no\-rebuild\fR will remove it\.
+.SS "\fBbottle\fR [\fIoptions\fR] \fIformulae\fR"
+Generate a bottle (binary package) from a formula that was installed with \fB\-\-build\-bottle\fR\. If the formula specifies a rebuild version, it will be incremented in the generated DSL\. Passing \fB\-\-keep\-old\fR will attempt to keep it at its original value, while \fB\-\-no\-rebuild\fR will remove it\.
.
.TP
\fB\-\-skip\-relocation\fR
@@ -740,43 +740,43 @@ Build a bottle even if \fIformula\fR is not in homebrew/core or any installed ta
.
.TP
\fB\-\-no\-rebuild\fR
-If the formula specifies a rebuild version, it will be removed in the generated DSL\.
+If the formula specifies a rebuild version, remove it from the generated DSL\.
.
.TP
\fB\-\-keep\-old\fR
-If the formula specifies a rebuild version, it will attempted to be kept in the generated DSL\.
+If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL\.
+.
+.TP
+\fB\-\-json\fR
+Write bottle information to a JSON file, which can be used as the argument for \fB\-\-merge\fR\.
.
.TP
\fB\-\-merge\fR
-Generate a bottle from a formula and print the new DSL merged into the existing formula\.
+Generate an updated bottle block for a formula and optionally merge it into the formula file\. Instead of a formula name, requires a JSON file generated with \fBbrew bottle \-\-json\fR \fIformula\fR\.
.
.TP
\fB\-\-write\fR
-Changes will be written to the formula file\. A new commit will be generated unless \fB\-\-no\-commit\fR is passed\.
+Write the changes to the formula file\. A new commit will be generated unless \fB\-\-no\-commit\fR is passed\.
.
.TP
\fB\-\-no\-commit\fR
-When passed with \fB\-\-write\fR, a new commit will not generated while writing changes to the formula file\.
-.
-.TP
-\fB\-\-json\fR
-Write bottle information to a JSON file, which can be used as the argument for \fB\-\-merge\fR\.
+When passed with \fB\-\-write\fR, a new commit will not generated after writing changes to the formula file\.
.
.TP
\fB\-\-root\-url\fR
Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\.
.
-.SS "\fBbump\-formula\-pr\fR [\fIoptions\fR] \fIformula\fR:"
-Creates a pull request to update the formula with a new URL or a new tag\.
+.SS "\fBbump\-formula\-pr\fR [\fIoptions\fR] [\fIformula\fR]"
+Create a pull request to update a formula with a new URL or a new tag\.
.
.P
-If a \fIURL\fR is specified, the \fIsha\-256\fR checksum of the new download must also be specified\. A best effort to determine the \fIsha\-256\fR and \fIformula\fR name will be made if either or both values are not supplied by the user\.
+If a \fIURL\fR is specified, the \fISHA\-256\fR checksum of the new download should also be specified\. A best effort to determine the \fISHA\-256\fR and \fIformula\fR name will be made if either or both values are not supplied by the user\.
.
.P
-If a \fItag\fR is specified, the git commit \fIrevision\fR corresponding to that tag must also be specified\.
+If a \fItag\fR is specified, the Git commit \fIrevision\fR corresponding to that tag must also be specified\.
.
.P
-Note that this command cannot be used to transition a formula from a URL\-and\-sha256 style specification into a tag\-and\-revision style specification, nor vice versa\. It must use whichever style specification the preexisting formula already uses\.
+\fINote:\fR this command cannot be used to transition a formula from a URL\-and\-SHA\-256 style specification into a tag\-and\-revision style specification, nor vice versa\. It must use whichever style specification the preexisting formula already uses\.
.
.TP
\fB\-\-devel\fR
@@ -788,7 +788,7 @@ Print what would be done rather than doing it\.
.
.TP
\fB\-\-write\fR
-When passed along with \fB\-\-dry\-run\fR, perform a not\-so\-dry run making the expected file modifications but not taking any git actions\.
+When passed along with \fB\-\-dry\-run\fR, perform a not\-so\-dry run by making the expected file modifications but not taking any Git actions\.
.
.TP
\fB\-\-audit\fR
@@ -800,38 +800,38 @@ Run \fBbrew audit \-\-strict\fR before opening the PR\.
.
.TP
\fB\-\-no\-browse\fR
-Output the pull request URL instead of opening in a browser
+Print the pull request URL instead of opening in a browser\.
.
.TP
-\fB\-\-url\fR
-Provide new \fIURL\fR for the formula\. If a \fIURL\fR is specified, the \fIsha\-256\fR checksum of the new download must also be specified\.
+\fB\-\-mirror\fR
+Use the provided \fIURL\fR as a mirror URL\.
.
.TP
-\fB\-\-revision\fR
-Specify the new git commit \fIrevision\fR corresponding to a specified \fItag\fR\.
+\fB\-\-version\fR
+Use the provided \fIversion\fR to override the value parsed from the URL or tag\. Note that \fB\-\-version=0\fR can be used to delete an existing version override from a formula if it has become redundant\.
.
.TP
-\fB\-\-tag\fR
-Specify the new git commit \fItag\fR for the formula\.
+\fB\-\-message\fR
+Append the provided \fImessage\fR to the default PR message\.
.
.TP
-\fB\-\-sha256\fR
-Specify the \fIsha\-256\fR checksum of new download\.
+\fB\-\-url\fR
+Specify the \fIURL\fR for the new download\. If a \fIURL\fR is specified, the \fISHA\-256\fR checksum of the new download should also be specified\.
.
.TP
-\fB\-\-mirror\fR
-Use the provided \fIURL\fR as a mirror URL\.
+\fB\-\-sha256\fR
+Specify the \fISHA\-256\fR checksum of the new download\.
.
.TP
-\fB\-\-version\fR
-Use the provided \fIversion\fR to override the value parsed from the URL or tag\. Note that \fB\-\-version=0\fR can be used to delete an existing \fBversion\fR override from a formula if it has become redundant\.
+\fB\-\-tag\fR
+Specify the new git commit \fItag\fR for the formula\.
.
.TP
-\fB\-\-message\fR
-Append provided \fImessage\fR to the default PR message\.
+\fB\-\-revision\fR
+Specify the new git commit \fIrevision\fR corresponding to a specified \fItag\fR\.
.
-.SS "\fBcreate\fR \fIURL\fR [\fIoptions\fR]:"
-Generate a formula for the downloadable file at \fIURL\fR and open it in the editor\. Homebrew will attempt to automatically derive the formula name and version, but if it fails, you\'ll have to make your own template\. The \fBwget\fR formula serves as a simple example\. For the complete API have a look at \fIhttp://www\.rubydoc\.info/github/Homebrew/brew/master/Formula\fR\.
+.SS "\fBcreate\fR [\fIoptions\fR] \fIURL\fR"
+Generate a formula for the downloadable file at \fIURL\fR and open it in the editor\. Homebrew will attempt to automatically derive the formula name and version, but if it fails, you\'ll have to make your own template\. The \fBwget\fR formula serves as a simple example\. For the complete API, see: \fIhttp://www\.rubydoc\.info/github/Homebrew/brew/master/Formula\fR
.
.TP
\fB\-\-autotools\fR
@@ -847,38 +847,38 @@ Create a basic template for a Meson\-style build\.
.
.TP
\fB\-\-no\-fetch\fR
-Homebrew will not download \fIURL\fR to the cache and will thus not add the SHA256 to the formula for you\. It will also not check the GitHub API for GitHub projects (to fill out the description and homepage)\.
+Homebrew will not download \fIURL\fR to the cache and will thus not add the SHA\-256 to the formula for you, nor will it check the GitHub API for GitHub projects (to fill out its description and homepage)\.
.
.TP
\fB\-\-HEAD\fR
-HEAD
+Indicate that \fIURL\fR points to the package\'s repository rather than a file\.
.
.TP
\fB\-\-set\-name\fR
-Set the provided name of the package you are creating\.
+Set the name of the new formula to the provided \fIname\fR\.
.
.TP
\fB\-\-set\-version\fR
-Set the provided version of the package you are creating\.
+Set the version of the new formula to the provided \fIversion\fR\.
.
.TP
\fB\-\-tap\fR
-Takes a tap [\fIuser\fR\fB/\fR\fIrepo\fR] as argument and generates the formula in the specified tap\.
+Generate the new formula in the provided tap, specified as \fIuser\fR\fB/\fR\fIrepo\fR\.
.
-.SS "\fBedit\fR \fIformula\fR:"
-Open \fIformula\fR in the editor\. Open all of Homebrew for editing if no \fIformula\fR is provided\.
+.SS "\fBedit\fR [\fIformulae\fR]"
+Open a formula in the editor set by \fBEDITOR\fR or \fBHOMEBREW_EDITOR\fR, or open the Homebrew repository for editing if no \fIformula\fR is provided\.
.
-.SS "\fBextract\fR [\fIoptions\fR] \fIformula\fR \fItap\fR:"
-Looks through repository history to find the \fIversion\fR of \fIformula\fR and creates a copy in \fItap\fR/Formula/\fIformula\fR@\fIversion\fR\.rb\. If the tap is not installed yet, attempts to install/clone the tap before continuing\.
+.SS "\fBextract\fR [\fIoptions\fR] \fIformula\fR \fItap\fR"
+Look through repository history to find the most recent version of \fIformula\fR and create a copy in \fItap\fR\fB/Formula/\fR\fIformula\fR\fB@\fR\fIversion\fR\fB\.rb\fR\. If the tap is not installed yet, attempt to install/clone the tap before continuing\.
.
.TP
\fB\-\-version\fR
-Provided \fIversion\fR of \fIformula\fR will be extracted and placed in the destination tap\. Otherwise, the most recent version that can be found will be used\.
+Extract the provided \fIversion\fR of \fIformula\fR instead of the most recent\.
.
-.SS "\fBformula\fR \fIformula\fR:"
-Display the path where \fIformula\fR is located\.
+.SS "\fBformula\fR \fIformulae\fR"
+Display the path where a formula is located\.
.
-.SS "\fBirb\fR [\fIoptions\fR]:"
+.SS "\fBirb\fR [\fIoptions\fR]"
Enter the interactive Homebrew Ruby shell\.
.
.TP
@@ -887,27 +887,24 @@ Show several examples\.
.
.TP
\fB\-\-pry\fR
-Pry will be used instead of irb if \fB\-\-pry\fR is passed or HOMEBREW_PRY is set\.
+Use Pry instead of IRB\. Implied if \fBHOMEBREW_PRY\fR is set\.
.
-.SS "\fBlinkage\fR [\fIoptions\fR] \fIformula\fR:"
-Checks the library links of an installed formula\.
-.
-.P
-Only works on installed formulae\. An error is raised if it is run on uninstalled formulae\.
+.SS "\fBlinkage\fR [\fIoptions\fR] [\fIformulae\fR]"
+Check the library links for kegs of installed formulae\. Raises an error if run on uninstalled formulae\.
.
.TP
\fB\-\-test\fR
-Display only missing libraries and exit with a non\-zero exit code if any missing libraries were found\.
+Display only missing libraries and exit with a non\-zero status if any missing libraries are found\.
.
.TP
\fB\-\-reverse\fR
-Print the dylib followed by the binaries which link to it for each library the keg references\.
+For every library that a keg references, print its dylib path followed by the binaries that link to it\.
.
.TP
\fB\-\-cached\fR
-Print the cached linkage values stored in HOMEBREW_CACHE, set from a previous \fBbrew linkage\fR run\.
+Print the cached linkage values stored in \fBHOMEBREW_CACHE\fR, set by a previous \fBbrew linkage\fR run\.
.
-.SS "\fBman\fR [\fIoptions\fR]:"
+.SS "\fBman\fR [\fIoptions\fR]"
Generate Homebrew\'s manpages\.
.
.TP
@@ -916,20 +913,22 @@ Return a failing status code if changes are detected in the manpage outputs\. Th
.
.TP
\fB\-\-link\fR
-It is now done automatically by \fBbrew update\fR\.
+This is now done automatically by \fBbrew update\fR\.
.
-.SS "\fBmirror\fR \fIformulae\fR:"
+.SS "\fBmirror\fR \fIformulae\fR"
Reuploads the stable URL for a formula to Bintray to use it as a mirror\.
.
-.TP
-\fBprof\fR [\fIruby options\fR]
-Run Homebrew with the Ruby profiler\. For example: brew prof readall
+.SS "\fBprof\fR [\fIruby options\fR]"
+Run Homebrew with the Ruby profiler\.
.
-.SS "\fBpull\fR [\fIoptions\fR] \fIformula\fR:"
-Gets a patch from a GitHub commit or pull request and applies it to Homebrew\. Optionally, installs the formulae changed by the patch\.
+.P
+\fIExample:\fR \fBbrew prof readall\fR
+.
+.SS "\fBpull\fR [\fIoptions\fR] \fIpatch sources\fR"
+Get a patch from a GitHub commit or pull request and apply it to Homebrew\. Optionally, publish updated bottles for the formulae changed by the patch\.
.
.P
-Each \fIpatch\-source\fR may be one of:
+Each \fIpatch source\fR may be one of:
.
.P
~ The ID number of a PR (pull request) in the homebrew/core GitHub repository
@@ -981,44 +980,52 @@ Do not exit if there\'s a failure publishing bottles on Bintray\.
.
.TP
\fB\-\-bintray\-org\fR
-Publish at the given Bintray organisation\.
+Publish bottles at the provided Bintray \fIorganisation\fR\.
.
.TP
\fB\-\-test\-bot\-user\fR
-Pull the bottle block commit from the specified user on GitHub\.
+Pull the bottle block commit from the provided \fIuser\fR on GitHub\.
.
-.SS "\fBrelease\-notes\fR [\fIoptions\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]:"
-Output the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the latest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\.
+.SS "\fBrelease\-notes\fR [\fIoptions\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]"
+Print the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the latest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\.
.
.TP
\fB\-\-markdown\fR
-Output as a Markdown list\.
+Print as a Markdown list\.
+.
+.SS "\fBruby\fR [\fIruby options\fR]"
+Run a Ruby instance with Homebrew\'s libraries loaded\.
+.
+.P
+\fIExample:\fR \fBbrew ruby \-e "puts :gcc\.f\.deps"\fR or \fBbrew ruby script\.rb\fR
.
.TP
-\fBruby\fR [\fIruby options\fR]
-Run a Ruby instance with Homebrew\'s libraries loaded\. For example:
+\fB\-e\fR
+Execute the provided string argument as a script\.
.
-.SS "\fBtap\-new\fR \fIuser\fR/\fIrepo\fR:"
+.SS "\fBtap\-new\fR \fIuser\fR\fB/\fR\fIrepo\fR"
Generate the template files for a new tap\.
.
-.TP
-\fBtest\fR [\fB\-\-devel\fR|\fB\-\-HEAD\fR] [\fB\-\-debug\fR] [\fB\-\-keep\-tmp\fR] \fIformula\fR
-Most formulae provide a test method\. \fBbrew test\fR \fIformula\fR runs this test method\. There is no standard output or return code, but it should generally indicate to the user if something is wrong with the installed formula\.
+.SS "\fBtest\fR [\fIoptions\fR] \fIformulae\fR"
+Run the test method provided by an installed formula\. There is no standard output or return code, but generally it should notify the user if something is wrong with the installed formula\.
.
-.IP
-To test the development or head version of a formula, use \fB\-\-devel\fR or \fB\-\-HEAD\fR\.
+.P
+\fIExample:\fR \fBbrew install jruby && brew test jruby\fR
.
-.IP
-If \fB\-\-debug\fR (or \fB\-d\fR) is passed and the test fails, an interactive debugger will be launched with access to IRB or a shell inside the temporary test directory\.
+.TP
+\fB\-\-devel\fR
+Test the development version of a formula\.
.
-.IP
-If \fB\-\-keep\-tmp\fR is passed, the temporary files created for the test are not deleted\.
+.TP
+\fB\-\-HEAD\fR
+Test the head version of a formula\.
.
-.IP
-Example: \fBbrew install jruby && brew test jruby\fR
+.TP
+\fB\-\-keep\-tmp\fR
+Keep the temporary files created for the test\.
.
-.SS "\fBtests\fR [\fIoptions\fR]:"
-Run Homebrew\'s unit and integration tests\. If provided, \fB\-\-only=\fR\fItest_script\fR runs only \fItest_script\fR_spec\.rb, and \fB\-\-seed\fR randomizes tests with the provided value instead of a random seed\.
+.SS "\fBtests\fR [\fIoptions\fR]"
+Run Homebrew\'s unit and integration tests\.
.
.TP
\fB\-\-coverage\fR
@@ -1038,17 +1045,14 @@ Include tests that use the GitHub API and tests that use any of the taps for off
.
.TP
\fB\-\-only\fR
-Run only \fItest_script\fR_spec\.rb
+Run only \fItest_script\fR\fB_spec\.rb\fR\. Appending \fB:\fR\fIline_number\fR will start at a specific line\.
.
.TP
\fB\-\-seed\fR
-Randomizes tests with the provided value instead of a random seed\.
-.
-.SS "\fBupdate\-test\fR [\fIoptions\fR]:"
-Runs a test of \fBbrew update\fR with a new repository clone\.
+Randomize tests with the provided \fIvalue\fR instead of a random seed\.
.
-.P
-If no arguments are passed, use \fBorigin/master\fR as the start commit\.
+.SS "\fBupdate\-test\fR [\fIoptions\fR]"
+Run a test of \fBbrew update\fR with a new repository clone\. If no arguments are passed, use \fBorigin/master\fR as the start commit\.
.
.TP
\fB\-\-to\-tag\fR | true |
Other | Homebrew | brew | 599ecc9b5ad7951b8ddc51490ebe93a976d43b29.json | Deprecate unused download strategies
Download the unused, private download strategies. These are a better fit
for being declared in the formulae and/or taps that use them rather than
in Homebrew/brew where they are unused by Homebrew maintainers or
official taps/formulae. | Library/Homebrew/compat.rb | @@ -1,6 +1,7 @@
require "compat/os/mac"
require "compat/dependable"
require "compat/dependency_collector"
+require "compat/download_strategy"
require "compat/fileutils"
require "compat/formula_support"
require "compat/cask" | true |
Other | Homebrew | brew | 599ecc9b5ad7951b8ddc51490ebe93a976d43b29.json | Deprecate unused download strategies
Download the unused, private download strategies. These are a better fit
for being declared in the formulae and/or taps that use them rather than
in Homebrew/brew where they are unused by Homebrew maintainers or
official taps/formulae. | Library/Homebrew/compat/download_strategy.rb | @@ -0,0 +1,254 @@
+require "download_strategy"
+
+# S3DownloadStrategy downloads tarballs from AWS S3.
+# To use it, add `:using => :s3` to the URL section of your
+# formula. This download strategy uses AWS access tokens (in the
+# environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`)
+# to sign the request. This strategy is good in a corporate setting,
+# because it lets you use a private S3 bucket as a repo for internal
+# distribution. (It will work for public buckets as well.)
+class S3DownloadStrategy < CurlDownloadStrategy
+ def initialize(url, name, version, **meta)
+ odeprecated("S3DownloadStrategy",
+ "maintaining S3DownloadStrategy in your own formula or tap")
+ super
+ end
+
+ def _fetch(url:, resolved_url:)
+ if url !~ %r{^https?://([^.].*)\.s3\.amazonaws\.com/(.+)$} &&
+ url !~ %r{^s3://([^.].*?)/(.+)$}
+ raise "Bad S3 URL: " + url
+ end
+
+ bucket = Regexp.last_match(1)
+ key = Regexp.last_match(2)
+
+ ENV["AWS_ACCESS_KEY_ID"] = ENV["HOMEBREW_AWS_ACCESS_KEY_ID"]
+ ENV["AWS_SECRET_ACCESS_KEY"] = ENV["HOMEBREW_AWS_SECRET_ACCESS_KEY"]
+
+ begin
+ signer = Aws::S3::Presigner.new
+ s3url = signer.presigned_url :get_object, bucket: bucket, key: key
+ rescue Aws::Sigv4::Errors::MissingCredentialsError
+ ohai "AWS credentials missing, trying public URL instead."
+ s3url = url
+ end
+
+ curl_download s3url, to: temporary_path
+ end
+end
+
+# GitHubPrivateRepositoryDownloadStrategy downloads contents from GitHub
+# Private Repository. To use it, add
+# `:using => :github_private_repo` to the URL section of
+# your formula. This download strategy uses GitHub access tokens (in the
+# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request. This
+# strategy is suitable for corporate use just like S3DownloadStrategy, because
+# it lets you use a private GitHub repository for internal distribution. It
+# works with public one, but in that case simply use CurlDownloadStrategy.
+class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
+ require "utils/formatter"
+ require "utils/github"
+
+ def initialize(url, name, version, **meta)
+ odeprecated("GitHubPrivateRepositoryDownloadStrategy",
+ "maintaining GitHubPrivateRepositoryDownloadStrategy in your own formula or tap")
+ super
+ parse_url_pattern
+ set_github_token
+ end
+
+ def parse_url_pattern
+ unless match = url.match(%r{https://github.com/([^/]+)/([^/]+)/(\S+)})
+ raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Repository."
+ end
+
+ _, @owner, @repo, @filepath = *match
+ end
+
+ def download_url
+ "https://#{@github_token}@github.com/#{@owner}/#{@repo}/#{@filepath}"
+ end
+
+ private
+
+ def _fetch(url:, resolved_url:)
+ curl_download download_url, to: temporary_path
+ end
+
+ def set_github_token
+ @github_token = ENV["HOMEBREW_GITHUB_API_TOKEN"]
+ unless @github_token
+ raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required."
+ end
+
+ validate_github_repository_access!
+ end
+
+ def validate_github_repository_access!
+ # Test access to the repository
+ GitHub.repository(@owner, @repo)
+ rescue GitHub::HTTPNotFoundError
+ # We only handle HTTPNotFoundError here,
+ # becase AuthenticationFailedError is handled within util/github.
+ message = <<~EOS
+ HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
+ This token may not have permission to access the repository or the url of formula may be incorrect.
+ EOS
+ raise CurlDownloadStrategyError, message
+ end
+end
+
+# GitHubPrivateRepositoryReleaseDownloadStrategy downloads tarballs from GitHub
+# Release assets. To use it, add `:using => :github_private_release` to the URL section
+# of your formula. This download strategy uses GitHub access tokens (in the
+# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request.
+class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
+ def initialize(url, name, version, **meta)
+ odeprecated("GitHubPrivateRepositoryReleaseDownloadStrategy",
+ "maintaining GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap")
+ super
+ end
+
+ def parse_url_pattern
+ url_pattern = %r{https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)}
+ unless @url =~ url_pattern
+ raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release."
+ end
+
+ _, @owner, @repo, @tag, @filename = *@url.match(url_pattern)
+ end
+
+ def download_url
+ "https://#{@github_token}@api.github.com/repos/#{@owner}/#{@repo}/releases/assets/#{asset_id}"
+ end
+
+ private
+
+ def _fetch(url:, resolved_url:)
+ # HTTP request header `Accept: application/octet-stream` is required.
+ # Without this, the GitHub API will respond with metadata, not binary.
+ curl_download download_url, "--header", "Accept: application/octet-stream", to: temporary_path
+ end
+
+ def asset_id
+ @asset_id ||= resolve_asset_id
+ end
+
+ def resolve_asset_id
+ release_metadata = fetch_release_metadata
+ assets = release_metadata["assets"].select { |a| a["name"] == @filename }
+ raise CurlDownloadStrategyError, "Asset file not found." if assets.empty?
+
+ assets.first["id"]
+ end
+
+ def fetch_release_metadata
+ release_url = "https://api.github.com/repos/#{@owner}/#{@repo}/releases/tags/#{@tag}"
+ GitHub.open_api(release_url)
+ end
+end
+
+# ScpDownloadStrategy downloads files using ssh via scp. To use it, add
+# `:using => :scp` to the URL section of your formula or
+# provide a URL starting with scp://. This strategy uses ssh credentials for
+# authentication. If a public/private keypair is configured, it will not
+# prompt for a password.
+#
+# @example
+# class Abc < Formula
+# url "scp://example.com/src/abc.1.0.tar.gz"
+# ...
+class ScpDownloadStrategy < AbstractFileDownloadStrategy
+ def initialize(url, name, version, **meta)
+ odeprecated("ScpDownloadStrategy",
+ "maintaining ScpDownloadStrategy in your own formula or tap")
+ super
+ parse_url_pattern
+ end
+
+ def parse_url_pattern
+ url_pattern = %r{scp://([^@]+@)?([^@:/]+)(:\d+)?/(\S+)}
+ if @url !~ url_pattern
+ raise ScpDownloadStrategyError, "Invalid URL for scp: #{@url}"
+ end
+
+ _, @user, @host, @port, @path = *@url.match(url_pattern)
+ end
+
+ def fetch
+ ohai "Downloading #{@url}"
+
+ if cached_location.exist?
+ puts "Already downloaded: #{cached_location}"
+ else
+ system_command! "scp", args: [scp_source, temporary_path.to_s]
+ ignore_interrupts { temporary_path.rename(cached_location) }
+ end
+ end
+
+ def clear_cache
+ super
+ rm_rf(temporary_path)
+ end
+
+ private
+
+ def scp_source
+ path_prefix = "/" unless @path.start_with?("~")
+ port_arg = "-P #{@port[1..-1]} " if @port
+ "#{port_arg}#{@user}#{@host}:#{path_prefix}#{@path}"
+ end
+end
+
+class DownloadStrategyDetector
+ class << self
+ module Compat
+ def detect(url, using = nil)
+ strategy = super
+ require_aws_sdk if strategy == S3DownloadStrategy
+ strategy
+ end
+
+ def detect_from_url(url)
+ case url
+ when %r{^s3://}
+ odeprecated("s3://",
+ "maintaining S3DownloadStrategy in your own formula or tap")
+ S3DownloadStrategy
+ when %r{^scp://}
+ odeprecated("scp://",
+ "maintaining ScpDownloadStrategy in your own formula or tap")
+ ScpDownloadStrategy
+ else
+ super(url)
+ end
+ end
+
+ def detect_from_symbol(symbol)
+ case symbol
+ when :github_private_repo
+ odeprecated(":github_private_repo",
+ "maintaining GitHubPrivateRepositoryDownloadStrategy in your own formula or tap")
+ GitHubPrivateRepositoryDownloadStrategy
+ when :github_private_release
+ odeprecated(":github_private_repo",
+ "maintaining GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap")
+ GitHubPrivateRepositoryReleaseDownloadStrategy
+ when :s3
+ odeprecated(":s3",
+ "maintaining S3DownloadStrategy in your own formula or tap")
+ S3DownloadStrategy
+ when :scp
+ odeprecated(":scp",
+ "maintaining ScpDownloadStrategy in your own formula or tap")
+ ScpDownloadStrategy
+ else
+ super(symbol)
+ end
+ end
+ end
+
+ prepend Compat
+ end
+end | true |
Other | Homebrew | brew | 599ecc9b5ad7951b8ddc51490ebe93a976d43b29.json | Deprecate unused download strategies
Download the unused, private download strategies. These are a better fit
for being declared in the formulae and/or taps that use them rather than
in Homebrew/brew where they are unused by Homebrew maintainers or
official taps/formulae. | Library/Homebrew/download_strategy.rb | @@ -474,191 +474,6 @@ def initialize(path)
end
end
-# S3DownloadStrategy downloads tarballs from AWS S3.
-# To use it, add `:using => :s3` to the URL section of your
-# formula. This download strategy uses AWS access tokens (in the
-# environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`)
-# to sign the request. This strategy is good in a corporate setting,
-# because it lets you use a private S3 bucket as a repo for internal
-# distribution. (It will work for public buckets as well.)
-class S3DownloadStrategy < CurlDownloadStrategy
- def _fetch(url:, resolved_url:)
- if url !~ %r{^https?://([^.].*)\.s3\.amazonaws\.com/(.+)$} &&
- url !~ %r{^s3://([^.].*?)/(.+)$}
- raise "Bad S3 URL: " + url
- end
-
- bucket = Regexp.last_match(1)
- key = Regexp.last_match(2)
-
- ENV["AWS_ACCESS_KEY_ID"] = ENV["HOMEBREW_AWS_ACCESS_KEY_ID"]
- ENV["AWS_SECRET_ACCESS_KEY"] = ENV["HOMEBREW_AWS_SECRET_ACCESS_KEY"]
-
- begin
- signer = Aws::S3::Presigner.new
- s3url = signer.presigned_url :get_object, bucket: bucket, key: key
- rescue Aws::Sigv4::Errors::MissingCredentialsError
- ohai "AWS credentials missing, trying public URL instead."
- s3url = url
- end
-
- curl_download s3url, to: temporary_path
- end
-end
-
-# GitHubPrivateRepositoryDownloadStrategy downloads contents from GitHub
-# Private Repository. To use it, add
-# `:using => :github_private_repo` to the URL section of
-# your formula. This download strategy uses GitHub access tokens (in the
-# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request. This
-# strategy is suitable for corporate use just like S3DownloadStrategy, because
-# it lets you use a private GitHub repository for internal distribution. It
-# works with public one, but in that case simply use CurlDownloadStrategy.
-class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
- require "utils/formatter"
- require "utils/github"
-
- def initialize(url, name, version, **meta)
- super
- parse_url_pattern
- set_github_token
- end
-
- def parse_url_pattern
- unless match = url.match(%r{https://github.com/([^/]+)/([^/]+)/(\S+)})
- raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Repository."
- end
-
- _, @owner, @repo, @filepath = *match
- end
-
- def download_url
- "https://#{@github_token}@github.com/#{@owner}/#{@repo}/#{@filepath}"
- end
-
- private
-
- def _fetch(url:, resolved_url:)
- curl_download download_url, to: temporary_path
- end
-
- def set_github_token
- @github_token = ENV["HOMEBREW_GITHUB_API_TOKEN"]
- unless @github_token
- raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required."
- end
-
- validate_github_repository_access!
- end
-
- def validate_github_repository_access!
- # Test access to the repository
- GitHub.repository(@owner, @repo)
- rescue GitHub::HTTPNotFoundError
- # We only handle HTTPNotFoundError here,
- # becase AuthenticationFailedError is handled within util/github.
- message = <<~EOS
- HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
- This token may not have permission to access the repository or the url of formula may be incorrect.
- EOS
- raise CurlDownloadStrategyError, message
- end
-end
-
-# GitHubPrivateRepositoryReleaseDownloadStrategy downloads tarballs from GitHub
-# Release assets. To use it, add `:using => :github_private_release` to the URL section
-# of your formula. This download strategy uses GitHub access tokens (in the
-# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request.
-class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
- def parse_url_pattern
- url_pattern = %r{https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)}
- unless @url =~ url_pattern
- raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release."
- end
-
- _, @owner, @repo, @tag, @filename = *@url.match(url_pattern)
- end
-
- def download_url
- "https://#{@github_token}@api.github.com/repos/#{@owner}/#{@repo}/releases/assets/#{asset_id}"
- end
-
- private
-
- def _fetch(url:, resolved_url:)
- # HTTP request header `Accept: application/octet-stream` is required.
- # Without this, the GitHub API will respond with metadata, not binary.
- curl_download download_url, "--header", "Accept: application/octet-stream", to: temporary_path
- end
-
- def asset_id
- @asset_id ||= resolve_asset_id
- end
-
- def resolve_asset_id
- release_metadata = fetch_release_metadata
- assets = release_metadata["assets"].select { |a| a["name"] == @filename }
- raise CurlDownloadStrategyError, "Asset file not found." if assets.empty?
-
- assets.first["id"]
- end
-
- def fetch_release_metadata
- release_url = "https://api.github.com/repos/#{@owner}/#{@repo}/releases/tags/#{@tag}"
- GitHub.open_api(release_url)
- end
-end
-
-# ScpDownloadStrategy downloads files using ssh via scp. To use it, add
-# `:using => :scp` to the URL section of your formula or
-# provide a URL starting with scp://. This strategy uses ssh credentials for
-# authentication. If a public/private keypair is configured, it will not
-# prompt for a password.
-#
-# @example
-# class Abc < Formula
-# url "scp://example.com/src/abc.1.0.tar.gz"
-# ...
-class ScpDownloadStrategy < AbstractFileDownloadStrategy
- def initialize(url, name, version, **meta)
- super
- parse_url_pattern
- end
-
- def parse_url_pattern
- url_pattern = %r{scp://([^@]+@)?([^@:/]+)(:\d+)?/(\S+)}
- if @url !~ url_pattern
- raise ScpDownloadStrategyError, "Invalid URL for scp: #{@url}"
- end
-
- _, @user, @host, @port, @path = *@url.match(url_pattern)
- end
-
- def fetch
- ohai "Downloading #{@url}"
-
- if cached_location.exist?
- puts "Already downloaded: #{cached_location}"
- else
- system_command! "scp", args: [scp_source, temporary_path.to_s]
- ignore_interrupts { temporary_path.rename(cached_location) }
- end
- end
-
- def clear_cache
- super
- rm_rf(temporary_path)
- end
-
- private
-
- def scp_source
- path_prefix = "/" unless @path.start_with?("~")
- port_arg = "-P #{@port[1..-1]} " if @port
- "#{port_arg}#{@user}#{@host}:#{path_prefix}#{@path}"
- end
-end
-
class SubversionDownloadStrategy < VCSDownloadStrategy
def initialize(url, name, version, **meta)
super
@@ -1220,8 +1035,6 @@ def self.detect(url, using = nil)
"Unknown download strategy specification #{strategy.inspect}"
end
- require_aws_sdk if strategy == S3DownloadStrategy
-
strategy
end
@@ -1254,10 +1067,6 @@ def self.detect_from_url(url)
SubversionDownloadStrategy
when %r{^https?://(.+?\.)?sourceforge\.net/hgweb/}
MercurialDownloadStrategy
- when %r{^s3://}
- S3DownloadStrategy
- when %r{^scp://}
- ScpDownloadStrategy
else
CurlDownloadStrategy
end
@@ -1268,11 +1077,7 @@ def self.detect_from_symbol(symbol)
when :hg then MercurialDownloadStrategy
when :nounzip then NoUnzipCurlDownloadStrategy
when :git then GitDownloadStrategy
- when :github_private_repo then GitHubPrivateRepositoryDownloadStrategy
- when :github_private_release then GitHubPrivateRepositoryReleaseDownloadStrategy
when :bzr then BazaarDownloadStrategy
- when :s3 then S3DownloadStrategy
- when :scp then ScpDownloadStrategy
when :svn then SubversionDownloadStrategy
when :curl then CurlDownloadStrategy
when :cvs then CVSDownloadStrategy
@@ -1282,9 +1087,4 @@ def self.detect_from_symbol(symbol)
raise "Unknown download strategy #{symbol} was requested."
end
end
-
- def self.require_aws_sdk
- Homebrew.install_gem! "aws-sdk-s3", "~> 1.8"
- require "aws-sdk-s3"
- end
end | true |
Other | Homebrew | brew | 599ecc9b5ad7951b8ddc51490ebe93a976d43b29.json | Deprecate unused download strategies
Download the unused, private download strategies. These are a better fit
for being declared in the formulae and/or taps that use them rather than
in Homebrew/brew where they are unused by Homebrew maintainers or
official taps/formulae. | Library/Homebrew/test/download_strategies_spec.rb | @@ -46,8 +46,8 @@
end
end
-describe GitHubPrivateRepositoryDownloadStrategy do
- subject { described_class.new(url, "foo", version) }
+describe "GitHubPrivateRepositoryDownloadStrategy", :needs_compat do
+ subject { GitHubPrivateRepositoryDownloadStrategy.new(url, "foo", version) }
let(:url) { "https://github.com/owner/repo/archive/1.1.5.tar.gz" }
let(:version) { nil }
@@ -70,8 +70,8 @@
its(:download_url) { is_expected.to eq("https://token@github.com/owner/repo/archive/1.1.5.tar.gz") }
end
-describe GitHubPrivateRepositoryReleaseDownloadStrategy do
- subject { described_class.new(url, "foo", version) }
+describe "GitHubPrivateRepositoryReleaseDownloadStrategy", :needs_compat do
+ subject { GitHubPrivateRepositoryReleaseDownloadStrategy.new(url, "foo", version) }
let(:url) { "https://github.com/owner/repo/releases/download/tag/foo_v0.1.0_darwin_amd64.tar.gz" }
let(:version) { nil }
@@ -200,8 +200,8 @@ def setup_git_repo
end
end
-describe S3DownloadStrategy do
- subject { described_class.new(url, name, version) }
+describe "S3DownloadStrategy", :needs_compat do
+ subject { S3DownloadStrategy.new(url, name, version) }
let(:name) { "foo" }
let(:url) { "https://bucket.s3.amazonaws.com/foo.tar.gz" }
@@ -427,8 +427,8 @@ def setup_git_repo
end
end
-describe ScpDownloadStrategy do
- subject { described_class.new(url, name, version) }
+describe "ScpDownloadStrategy", :needs_compat do
+ subject { ScpDownloadStrategy.new(url, name, version) }
let(:name) { "foo" }
let(:url) { "scp://example.com/foo.tar.gz" }
@@ -565,7 +565,7 @@ def setup_git_repo
it { is_expected.to eq(GitHubGitDownloadStrategy) }
end
- context "when given an S3 URL" do
+ context "when given an S3 URL", :needs_compat do
let(:url) { "s3://bucket/homebrew/brew.tar.gz" }
it "returns S3DownloadStrategy" do
@@ -574,7 +574,7 @@ def setup_git_repo
end
end
- context "when given strategy = S3DownloadStrategy" do
+ context "when given strategy = S3DownloadStrategy", :needs_compat do
let(:url) { "https://bkt.s3.amazonaws.com/key.tar.gz" }
let(:strategy) { S3DownloadStrategy }
@@ -584,7 +584,7 @@ def setup_git_repo
end
end
- context "when given an scp URL" do
+ context "when given an scp URL", :needs_compat do
let(:url) { "scp://example.com/brew.tar.gz" }
it { is_expected.to eq(ScpDownloadStrategy) } | true |
Other | Homebrew | brew | 599ecc9b5ad7951b8ddc51490ebe93a976d43b29.json | Deprecate unused download strategies
Download the unused, private download strategies. These are a better fit
for being declared in the formulae and/or taps that use them rather than
in Homebrew/brew where they are unused by Homebrew maintainers or
official taps/formulae. | docs/Formula-Cookbook.md | @@ -546,7 +546,7 @@ class Python3 < Formula
head "https://hg.python.org/cpython", :using => :hg
```
-Homebrew offers both anonymous and authenticated download strategies.
+Homebrew offers anonymous download strategies.
| `:using` value | download strategy |
|----------------|-------------------------------|
@@ -561,19 +561,13 @@ Homebrew offers both anonymous and authenticated download strategies.
| `:svn` | `SubversionDownloadStrategy` |
|----------------|-------------------------------|
-| `:using` value | download strategy | authentication source |
-|---------------------------|--------------------------------------------------|----------------------------------------------|
-| `:github_private_release` | `GitHubPrivateRepositoryReleaseDownloadStrategy` | `HOMEBREW_GITHUB_API_TOKEN` |
-| `:github_private_repo` | `GitHubPrivateRepositoryDownloadStrategy` | `HOMEBREW_GITHUB_API_TOKEN` |
-| `:s3` | `S3DownloadStrategy` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` |
-| `:scp` | `ScpDownloadStrategy` | SSH key pair |
-|---------------------------|--------------------------------------------------|----------------------------------------------|
-
If you need more control over the way files are downloaded and staged, you can create a custom download strategy and specify it using the [`url`](https://www.rubydoc.info/github/Homebrew/brew/master/Formula#url-class_method) method's `:using` option:
```ruby
class MyDownloadStrategy < SomeHomebrewDownloadStrategy
- # Does something cool
+ def fetch
+ # downloads output to `temporary_path`
+ end
end
class Foo < Formula | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | .yardopts | @@ -7,7 +7,4 @@
--exclude Library/Homebrew/compat/
Library/Homebrew/**/*.rb
-
-share/doc/homebrew/*.html
-Library/Homebrew/*.md
-share/doc/homebrew/*.md
*.md | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/cache_store.rb | @@ -2,7 +2,7 @@
#
# `CacheStoreDatabase` acts as an interface to a persistent storage mechanism
-# residing in the `HOMEBREW_CACHE`
+# residing in the `HOMEBREW_CACHE`.
#
class CacheStoreDatabase
# Yields the cache store database.
@@ -107,7 +107,7 @@ def cache_path
#
# `CacheStore` provides methods to mutate and fetch data from a persistent
-# storage mechanism
+# storage mechanism.
#
class CacheStore
# @param [CacheStoreDatabase] database | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/cask/cmd/doctor.rb | @@ -42,7 +42,7 @@ def check_software_versions
end
# This could be done by calling into Homebrew, but the situation
- # where "doctor" is needed is precisely the situation where such
+ # where `brew doctor` is needed is precisely the situation where such
# things are less dependable.
def check_install_location
ohai "Homebrew Cask Install Location" | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/cask/installer.rb | @@ -221,9 +221,9 @@ def install_artifacts
end
end
- # TODO: move dependencies to a separate class
- # dependencies should also apply for "brew cask stage"
- # override dependencies with --force or perhaps --force-deps
+ # TODO: move dependencies to a separate class,
+ # dependencies should also apply for `brew cask stage`,
+ # override dependencies with `--force` or perhaps `--force-deps`
def satisfy_dependencies
return unless @cask.depends_on
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/cleaner.rb | @@ -1,8 +1,9 @@
# Cleans a newly installed keg.
# By default:
-# * removes .la files
-# * removes perllocal.pod files
-# * removes .packlist files
+#
+# * removes `.la` files
+# * removes `perllocal.pod` files
+# * removes `.packlist` files
# * removes empty directories
# * sets permissions on executables
# * removes unresolved symlinks | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/cmd/upgrade.rb | @@ -91,8 +91,8 @@ def upgrade
def upgrade_formulae(formulae_to_install)
return if formulae_to_install.empty?
- # Sort keg_only before non-keg_only formulae to avoid any needless conflicts
- # with outdated, non-keg_only versions of formulae being upgraded.
+ # Sort keg-only before non-keg-only formulae to avoid any needless conflicts
+ # with outdated, non-keg-only versions of formulae being upgraded.
formulae_to_install.sort! do |a, b|
if !a.keg_only? && b.keg_only?
1 | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/config.rb | @@ -2,13 +2,13 @@
raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
end
-# Path to `bin/brew` main executable in HOMEBREW_PREFIX
+# Path to `bin/brew` main executable in `HOMEBREW_PREFIX`
HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
# Where we link under
HOMEBREW_PREFIX = Pathname.new(ENV["HOMEBREW_PREFIX"])
-# Where .git is found
+# Where `.git` is found
HOMEBREW_REPOSITORY = Pathname.new(ENV["HOMEBREW_REPOSITORY"])
# Where we store most of Homebrew, taps, and various metadata
@@ -38,7 +38,7 @@
# Where build, postinstall, and test logs of formulae are written to
HOMEBREW_LOGS = Pathname.new(ENV["HOMEBREW_LOGS"] || "~/Library/Logs/Homebrew/").expand_path
-# Must use /tmp instead of $TMPDIR because long paths break Unix domain sockets
+# Must use `/tmp` instead of `TMPDIR` because long paths break Unix domain sockets
HOMEBREW_TEMP = begin
# /tmp fallback is here for people auto-updating from a version where
# HOMEBREW_TEMP isn't set. | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/cxxstdlib.rb | @@ -40,10 +40,10 @@ def initialize(type, compiler)
@compiler = compiler.to_sym
end
- # If either package doesn't use C++, all is well
- # libstdc++ and libc++ aren't ever intercompatible
+ # If either package doesn't use C++, all is well.
+ # libstdc++ and libc++ aren't ever intercompatible.
# libstdc++ is compatible across Apple compilers, but
- # not between Apple and GNU compilers, or between GNU compiler versions
+ # not between Apple and GNU compilers, or between GNU compiler versions.
def compatible_with?(other)
return true if type.nil? || other.type.nil?
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/dependable.rb | @@ -1,7 +1,7 @@
require "options"
module Dependable
- # :run and :linked are no longer used but keep them here to avoid them being
+ # `:run` and `:linked` are no longer used but keep them here to avoid them being
# misused in future.
RESERVED_TAGS = [:build, :optional, :recommended, :run, :test, :linked].freeze
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/dependency.rb | @@ -71,7 +71,7 @@ def self._load(marshaled)
class << self
# Expand the dependencies of dependent recursively, optionally yielding
- # [dependent, dep] pairs to allow callers to apply arbitrary filters to
+ # `[dependent, dep]` pairs to allow callers to apply arbitrary filters to
# the list.
# The default filter, which is applied when a block is not given, omits
# optionals and recommendeds based on what the dependent has asked for. | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/description_cache_store.rb | @@ -4,24 +4,24 @@
#
# `DescriptionCacheStore` provides methods to fetch and mutate linkage-specific data used
-# by the `brew linkage` command
+# by the `brew linkage` command.
#
class DescriptionCacheStore < CacheStore
include Searchable
# Inserts a formula description into the cache if it does not exist or
- # updates the formula description if it does exist
+ # updates the formula description if it does exist.
#
- # @param [String] formula_name: the name of the formula to set
- # @param [String] description: the description from the formula to set
+ # @param formula_name [String] the name of the formula to set
+ # @param description [String] the description from the formula to set
# @return [nil]
def update!(formula_name, description)
database.set(formula_name, description)
end
- # Delete the formula description from the `DescriptionCacheStore`
+ # Delete the formula description from the `DescriptionCacheStore`.
#
- # @param [String] formula_name: the name of the formula to delete
+ # @param formula_name [String] the name of the formula to delete
# @return [nil]
def delete!(formula_name)
database.delete(formula_name)
@@ -37,7 +37,7 @@ def populate_if_empty!
# Use an update report to update the `DescriptionCacheStore`.
#
- # @param [Report] report: an update report generated by cmd/update.rb
+ # @param report [Report] an update report generated by cmd/update.rb
# @return [nil]
def update_from_report!(report)
return populate_if_empty! if database.empty?
@@ -55,7 +55,7 @@ def update_from_report!(report)
# Use an array of formulae names to update the `DescriptionCacheStore`.
#
- # @param [Array] formula_names: the formulae to update.
+ # @param formula_names [Array] the formulae to update
# @return [nil]
def update_from_formula_names!(formula_names)
return populate_if_empty! if database.empty?
@@ -71,7 +71,7 @@ def update_from_formula_names!(formula_names)
# Use an array of formulae names to delete them from the `DescriptionCacheStore`.
#
- # @param [Array] formula_names: the formulae to delete.
+ # @param formula_names [Array] the formulae to delete
# @return [nil]
def delete_from_formula_names!(formula_names)
return if database.empty? | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/dev-cmd/pull.rb | @@ -453,9 +453,9 @@ def files_changed_in_patch(patchfile, tap)
{ files: files, formulae: formulae, others: others }
end
- # Get current formula versions without loading formula definition in this process
- # Returns info as a hash (type => version), for pull.rb's internal use
- # Uses special key :nonexistent => true for nonexistent formulae
+ # Get current formula versions without loading formula definition in this process.
+ # Returns info as a hash (type => version), for pull.rb's internal use.
+ # Uses special key `:nonexistent => true` for nonexistent formulae.
def current_versions_from_info_external(formula_name)
info = FormulaInfoFromJson.lookup(formula_name)
versions = {}
@@ -540,7 +540,7 @@ def publish_bottle_file_on_bintray(f, bintray_org, creds)
false
end
- # Formula info drawn from an external "brew info --json" call
+ # Formula info drawn from an external `brew info --json` call
class FormulaInfoFromJson
# The whole info structure parsed from the JSON
attr_accessor :info
@@ -549,8 +549,8 @@ def initialize(info)
@info = info
end
- # Looks up formula on disk and reads its info
- # Returns nil if formula is absent or if there was an error reading it
+ # Looks up formula on disk and reads its info.
+ # Returns nil if formula is absent or if there was an error reading it.
def self.lookup(name)
json = Utils.popen_read(HOMEBREW_BREW_FILE, "info", "--json=v1", name)
@@ -600,11 +600,11 @@ def revision
end
end
- # Bottle info as used internally by pull, with alternate platform support
+ # Bottle info as used internally by pull, with alternate platform support.
class BottleInfo
# URL of bottle as string
attr_accessor :url
- # Expected SHA256 as string
+ # Expected SHA-256 as string
attr_accessor :sha256
def initialize(url, sha256) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/diagnostic.rb | @@ -59,8 +59,8 @@ def get_mounts(path = nil)
class Checks
############# HELPERS
- # Finds files in HOMEBREW_PREFIX *and* /usr/local.
- # Specify paths relative to a prefix eg. "include/foo.h".
+ # Finds files in `HOMEBREW_PREFIX` *and* /usr/local.
+ # Specify paths relative to a prefix e.g. "include/foo.h".
# Sets @found for your convenience.
def find_relative_paths(*relative_paths)
@found = [HOMEBREW_PREFIX, "/usr/local"].uniq.reduce([]) do |found, prefix| | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/download_strategy.rb | @@ -72,8 +72,8 @@ def chdir
end
private :chdir
- # @!attribute [r]
- # return most recent modified time for all files in the current working directory after stage.
+ # @!attribute [r] source_modified_time
+ # Returns the most recent modified time for all files in the current working directory after stage.
def source_modified_time
Pathname.pwd.to_enum(:find).select(&:file?).map(&:mtime).max
end
@@ -405,7 +405,7 @@ def curl(*args, **options)
end
end
-# Detect and download from Apache Mirror
+# Detect and download from Apache Mirror.
class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
def mirrors
return @combined_mirrors if defined?(@combined_mirrors)
@@ -440,7 +440,7 @@ def apache_mirrors
end
# Download via an HTTP POST.
-# Query parameters on the URL are converted into POST parameters
+# Query parameters on the URL are converted into POST parameters.
class CurlPostDownloadStrategy < CurlDownloadStrategy
private
@@ -477,7 +477,7 @@ def initialize(path)
# S3DownloadStrategy downloads tarballs from AWS S3.
# To use it, add `:using => :s3` to the URL section of your
# formula. This download strategy uses AWS access tokens (in the
-# environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
+# environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`)
# to sign the request. This strategy is good in a corporate setting,
# because it lets you use a private S3 bucket as a repo for internal
# distribution. (It will work for public buckets as well.)
@@ -510,7 +510,7 @@ def _fetch(url:, resolved_url:)
# Private Repository. To use it, add
# `:using => :github_private_repo` to the URL section of
# your formula. This download strategy uses GitHub access tokens (in the
-# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request. This
+# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request. This
# strategy is suitable for corporate use just like S3DownloadStrategy, because
# it lets you use a private GitHub repository for internal distribution. It
# works with public one, but in that case simply use CurlDownloadStrategy.
@@ -568,7 +568,7 @@ def validate_github_repository_access!
# GitHubPrivateRepositoryReleaseDownloadStrategy downloads tarballs from GitHub
# Release assets. To use it, add `:using => :github_private_release` to the URL section
# of your formula. This download strategy uses GitHub access tokens (in the
-# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request.
+# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request.
class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
def parse_url_pattern
url_pattern = %r{https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)}
@@ -615,8 +615,7 @@ def fetch_release_metadata
# authentication. If a public/private keypair is configured, it will not
# prompt for a password.
#
-# Usage:
-#
+# @example
# class Abc < Formula
# url "scp://example.com/src/abc.1.0.tar.gz"
# ... | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/exceptions.rb | @@ -436,9 +436,9 @@ def dump
end
end
-# raised by FormulaInstaller.check_dependencies_bottled and
-# FormulaInstaller.install if the formula or its dependencies are not bottled
-# and are being installed on a system without necessary build tools
+# Raised by {FormulaInstaller#check_dependencies_bottled} and
+# {FormulaInstaller#install} if the formula or its dependencies are not bottled
+# and are being installed on a system without necessary build tools.
class BuildToolsError < RuntimeError
def initialize(formulae)
super <<~EOS
@@ -450,9 +450,9 @@ def initialize(formulae)
end
end
-# raised by Homebrew.install, Homebrew.reinstall, and Homebrew.upgrade
+# Raised by Homebrew.install, Homebrew.reinstall, and Homebrew.upgrade
# if the user passes any flags/environment that would case a bottle-only
-# installation on a system without build tools to fail
+# installation on a system without build tools to fail.
class BuildFlagsError < RuntimeError
def initialize(flags, bottled: true)
if flags.length > 1
@@ -478,8 +478,8 @@ def initialize(flags, bottled: true)
end
end
-# raised by CompilerSelector if the formula fails with all of
-# the compilers available on the user's system
+# Raised by {CompilerSelector} if the formula fails with all of
+# the compilers available on the user's system.
class CompilerSelectionError < RuntimeError
def initialize(formula)
super <<~EOS
@@ -489,7 +489,7 @@ def initialize(formula)
end
end
-# Raised in Resource.fetch
+# Raised in {Resource#fetch}.
class DownloadError < RuntimeError
def initialize(resource, cause)
super <<~EOS
@@ -500,7 +500,7 @@ def initialize(resource, cause)
end
end
-# raised in CurlDownloadStrategy.fetch
+# Raised in {CurlDownloadStrategy#fetch}.
class CurlDownloadStrategyError < RuntimeError
def initialize(url)
case url
@@ -512,14 +512,14 @@ def initialize(url)
end
end
-# raised in ScpDownloadStrategy.fetch
+# Raised in {ScpDownloadStrategy#fetch}.
class ScpDownloadStrategyError < RuntimeError
def initialize(cause)
super "Download failed: #{cause}"
end
end
-# raised by safe_system in utils.rb
+# Raised by {#safe_system} in `utils.rb`.
class ErrorDuringExecution < RuntimeError
attr_reader :cmd
attr_reader :status
@@ -556,10 +556,10 @@ def initialize(cmd, status:, output: nil)
end
end
-# raised by Pathname#verify_checksum when "expected" is nil or empty
+# Raised by {Pathname#verify_checksum} when "expected" is nil or empty.
class ChecksumMissingError < ArgumentError; end
-# raised by Pathname#verify_checksum when verification fails
+# Raised by {Pathname#verify_checksum} when verification fails.
class ChecksumMismatchError < RuntimeError
attr_reader :expected, :hash_type
@@ -589,7 +589,7 @@ def initialize(resource)
end
end
-# raised when a single patch file is not found and apply hasn't been specified
+# Raised when a single patch file is not found and apply hasn't been specified.
class MissingApplyError < RuntimeError; end
class BottleFormulaUnavailableError < RuntimeError | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/extend/ARGV.rb | @@ -243,7 +243,7 @@ def fetch_head?
include? "--fetch-HEAD"
end
- # eg. `foo -ns -i --bar` has three switches, n, s and i
+ # e.g. `foo -ns -i --bar` has three switches: `n`, `s` and `i`
def switch?(char)
return false if char.length > 1
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/extend/ENV/shared.rb | @@ -88,11 +88,11 @@ def append_path(key, path)
# Prepends a directory to `PATH`.
# Is the formula struggling to find the pkgconfig file? Point it to it.
- # This is done automatically for `keg_only` formulae.
+ # This is done automatically for keg-only formulae.
# <pre>ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["glib"].opt_lib}/pkgconfig"</pre>
# Prepending a system path such as /usr/bin is a no-op so that requirements
- # don't accidentally override superenv shims or formulae's `bin` directories
- # (e.g. <pre>ENV.prepend_path "PATH", which("emacs").dirname</pre>)
+ # don't accidentally override superenv shims or formulae's `bin` directories, e.g.
+ # <pre>ENV.prepend_path "PATH", which("emacs").dirname</pre>
def prepend_path(key, path)
return if %w[/usr/bin /bin /usr/sbin /sbin].include? path.to_s
@@ -194,7 +194,7 @@ def determine_cc
end
# Snow Leopard defines an NCURSES value the opposite of most distros.
- # See: https://bugs.python.org/issue6848
+ # @see https://bugs.python.org/issue6848
# Currently only used by aalib in core.
def ncurses_define
append "CPPFLAGS", "-DNCURSES_OPAQUE=0" | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/extend/os/mac/hardware/cpu.rb | @@ -94,7 +94,7 @@ def universal_archs
# Determines whether the current CPU and macOS combination
# can run an executable of the specified architecture.
# `arch` is a symbol in the same format returned by
- # Hardware::CPU.family
+ # {Hardware::CPU.family}.
def can_run?(arch)
if Hardware::CPU.intel?
intel_can_run? arch | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/extend/pathname.rb | @@ -145,7 +145,7 @@ def install_symlink_p(src, new_basename)
# @private
alias old_write write
- # we assume this pathname object is a file obviously
+ # We assume this pathname object is a file, obviously
def write(content, *open_args)
raise "Will not overwrite #{self}" if exist?
@@ -196,7 +196,7 @@ def cp_path_sub(pattern, replacement)
# @private
alias extname_old extname
- # extended to support common double extensions
+ # Extended to support common double extensions
def extname(path = to_s)
basename = File.basename(path)
@@ -212,7 +212,7 @@ def extname(path = to_s)
File.extname(basename)
end
- # for filetypes we support, basename without extension
+ # For filetypes we support, basename without extension
def stem
File.basename((path = to_s), extname(path))
end
@@ -351,7 +351,7 @@ def env_script_all_files(dst, env)
end
end
- # Writes an exec script that invokes a java jar
+ # Writes an exec script that invokes a Java jar
def write_jar_script(target_jar, script_name, java_opts = "", java_version: nil)
mkpath
java_home = if java_version | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/extend/string.rb | @@ -18,7 +18,7 @@ class NilClass
def chuzzle; end
end
-# used by the inreplace function (in utils.rb)
+# Used by the inreplace function (in `utils.rb`).
module StringInreplaceExtension
attr_accessor :errors
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/formula.rb | @@ -29,8 +29,8 @@
# Make sure you check with `brew search` that the name is free!
# @abstract
# @see SharedEnvExtension
-# @see FileUtils
# @see Pathname
+# @see https://www.rubydoc.info/stdlib/fileutils FileUtils
# @see https://docs.brew.sh/Formula-Cookbook Formula Cookbook
# @see https://github.com/styleguide/ruby Ruby Style Guide
#
@@ -57,8 +57,9 @@ class Formula
# prefer a patch but if you need the `prefix` of this formula in the
# patch you have to resort to `inreplace`, because in the patch
# you don't have access to any var defined by the formula. Only
- # HOMEBREW_PREFIX is available in the embedded patch.
- # inreplace supports regular expressions.
+ # `HOMEBREW_PREFIX` is available in the embedded patch.
+ #
+ # `inreplace` supports regular expressions:
# <pre>inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool"</pre>
# @see Utils::Inreplace.inreplace
@@ -132,7 +133,7 @@ class Formula
# Used for creating new Homebrew versions of software without new upstream
# versions.
- # @see .revision
+ # @see .revision=
attr_reader :revision
# Used to change version schemes for packages
@@ -143,7 +144,7 @@ class Formula
attr_reader :buildpath
# The current working directory during tests.
- # Will only be non-`nil` inside {#test}.
+ # Will only be non-`nil` inside {.test}.
attr_reader :testpath
# When installing a bottle (binary package) from a local path this will be
@@ -157,13 +158,13 @@ class Formula
attr_reader :active_log_type
# The {BuildOptions} for this {Formula}. Lists the arguments passed and any
- # {#options} in the {Formula}. Note that these may differ at different times
+ # {.option}s in the {Formula}. Note that these may differ at different times
# during the installation of a {Formula}. This is annoying but the result of
# state that we're trying to eliminate.
# @return [BuildOptions]
attr_accessor :build
- # A {Boolean} indicating whether this formula should be considered outdated
+ # A Boolean indicating whether this formula should be considered outdated
# if the target of the alias it was installed with has since changed.
# Defaults to true.
# @return [Boolean]
@@ -265,7 +266,7 @@ def validate_attributes!
public
# The alias path that was used to install this formula, if it exists.
- # Can differ from alias_path, which is the alias used to find the formula,
+ # Can differ from {#alias_path}, which is the alias used to find the formula,
# and is specified to this instance.
def installed_alias_path
path = build.source["path"] if build.is_a?(Tab)
@@ -344,12 +345,12 @@ def bottle
# The description of the software.
# @method desc
- # @see .desc
+ # @see .desc=
delegate desc: :"self.class"
# The homepage for the software.
# @method homepage
- # @see .homepage
+ # @see .homepage=
delegate homepage: :"self.class"
# The version for the currently active {SoftwareSpec}.
@@ -413,7 +414,7 @@ def oldname
end
end
- # All of aliases for the formula
+ # All aliases for the formula
def aliases
@aliases ||= if tap
tap.alias_reverse_table[full_name].to_a.map do |a|
@@ -555,12 +556,12 @@ def linked?
linked_keg.symlink?
end
- # Is the formula linked to opt?
+ # Is the formula linked to `opt`?
def optlinked?
opt_prefix.symlink?
end
- # Is formula's linked keg points to the prefix.
+ # If a formula's linked keg points to the prefix.
def prefix_linked?(v = pkg_version)
return false unless linked?
@@ -597,7 +598,7 @@ def installed_kegs
# This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only.
#
- # Need to install into the {.bin} but the makefile doesn't mkdir -p prefix/bin?
+ # Need to install into the {.bin} but the makefile doesn't `mkdir -p prefix/bin`?
# <pre>bin.mkpath</pre>
#
# No `make install` available?
@@ -643,7 +644,7 @@ def lib
# The directory where the formula's binaries should be installed.
# This is not symlinked into `HOMEBREW_PREFIX`.
# It is also commonly used to install files that we do not wish to be
- # symlinked into HOMEBREW_PREFIX from one of the other directories and
+ # symlinked into `HOMEBREW_PREFIX` from one of the other directories and
# instead manually create symlinks or wrapper scripts into e.g. {#bin}.
def libexec
prefix/"libexec"
@@ -652,7 +653,7 @@ def libexec
# The root directory where the formula's manual pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only.
- # Often one of the more specific `man` functions should be used instead
+ # Often one of the more specific `man` functions should be used instead,
# e.g. {#man1}
def man
share/"man"
@@ -786,14 +787,14 @@ def kext_prefix
# The directory where the formula's configuration files should be installed.
# Anything using `etc.install` will not overwrite other files on e.g. upgrades
# but will write a new file named `*.default`.
- # This directory is not inside the `HOMEBREW_CELLAR` so it is persisted
+ # This directory is not inside the `HOMEBREW_CELLAR` so it persists
# across upgrades.
def etc
(HOMEBREW_PREFIX/"etc").extend(InstallRenamed)
end
# The directory where the formula's variable files should be installed.
- # This directory is not inside the `HOMEBREW_CELLAR` so it is persisted
+ # This directory is not inside the `HOMEBREW_CELLAR` so it persists
# across upgrades.
def var
HOMEBREW_PREFIX/"var"
@@ -872,8 +873,7 @@ def with_logging(log_type)
end
# This method can be overridden to provide a plist.
- # For more examples read Apple's handy manpage:
- # https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html
+ # @see https://www.unix.com/man-page/all/5/plist/ Apple's plist(5) man page
# <pre>def plist; <<~EOS
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -894,6 +894,7 @@ def with_logging(log_type)
# <string>/dev/null</string>
# <key>StandardOutPath</key>
# <string>/dev/null</string>
+ # </dict>
# </plist>
# EOS
# end</pre>
@@ -925,7 +926,7 @@ def plist_startup
# but no version number. Only the active version will be linked here if
# multiple versions are installed.
#
- # This is the prefered way to refer a formula in plists or from another
+ # This is the preferred way to refer to a formula in plists or from another
# formula, as the path is stable even when the software is updated.
# <pre>args << "--with-readline=#{Formula["readline"].opt_prefix}" if build.with? "readline"</pre>
def opt_prefix
@@ -1029,7 +1030,7 @@ def run_post_install
#
# <pre>def caveats
# s = <<~EOS
- # Print some important notice to the user when `brew info <formula>` is
+ # Print some important notice to the user when `brew info [formula]` is
# called or when brewing a formula.
# This is optional. You can use all the vars like #{version} here.
# EOS
@@ -1040,8 +1041,8 @@ def caveats
nil
end
- # rarely, you don't want your library symlinked into the main prefix
- # see gettext.rb for an example
+ # Rarely, you don't want your library symlinked into the main prefix.
+ # See `gettext.rb` for an example.
def keg_only?
return false unless keg_only_reason
@@ -1319,7 +1320,7 @@ def inspect
end
# Standard parameters for CMake builds.
- # Setting CMAKE_FIND_FRAMEWORK to "LAST" tells CMake to search for our
+ # Setting `CMAKE_FIND_FRAMEWORK` to "LAST" tells CMake to search for our
# libraries before trying to utilize Frameworks, many of which will be from
# 3rd party installs.
# Note: there isn't a std_autotools variant because autotools is a lot
@@ -1951,7 +1952,7 @@ def eligible_kegs_for_cleanup
end
# Create a temporary directory then yield. When the block returns,
- # recursively delete the temporary directory. Passing opts[:retain]
+ # recursively delete the temporary directory. Passing `opts[:retain]`
# or calling `do |staging| ... staging.retain!` in the block will skip
# the deletion and retain the temporary directory's contents.
def mktemp(prefix = name, opts = {})
@@ -2159,10 +2160,10 @@ def method_added(method)
attr_rw :revision
# @!attribute [w] version_scheme
- # Used for creating new Homebrew versions schemes. For example, if we want
+ # Used for creating new Homebrew version schemes. For example, if we want
# to change version scheme from one to another, then we may need to update
# `version_scheme` of this {Formula} to be able to use new version scheme.
- # E.g. to move from 20151020 scheme to 1.0.0 we need to increment
+ # e.g. to move from 20151020 scheme to 1.0.0 we need to increment
# `version_scheme`. Without this, the prior scheme will always equate to a
# higher version.
# `0` if unset.
@@ -2177,14 +2178,15 @@ def specs
end
# @!attribute [w] url
- # The URL used to download the source for the {#stable} version of the formula.
+ # The URL used to download the source for the {.stable} version of the formula.
# We prefer `https` for security and proxy reasons.
# If not inferrable, specify the download strategy with `:using => ...`
- # `:git`, `:hg`, `:svn`, `:bzr`, `:cvs`,
- # `:curl` (normal file download. Will also extract.)
- # `:nounzip` (without extracting)
- # `:post` (download via an HTTP POST)
- # `:s3` (download from S3 using signed request)
+ #
+ # - `:git`, `:hg`, `:svn`, `:bzr`, `:fossil`, `:cvs`,
+ # - `:curl` (normal file download. Will also extract.)
+ # - `:nounzip` (without extracting)
+ # - `:post` (download via an HTTP POST)
+ # - `:s3` (download from S3 using signed request)
#
# <pre>url "https://packed.sources.and.we.prefer.https.example.com/archive-1.2.3.tar.bz2"</pre>
# <pre>url "https://some.dont.provide.archives.example.com",
@@ -2196,7 +2198,7 @@ def url(val, specs = {})
end
# @!attribute [w] version
- # The version string for the {#stable} version of the formula.
+ # The version string for the {.stable} version of the formula.
# The version is autodetected from the URL and/or tag so only needs to be
# declared if it cannot be autodetected correctly.
#
@@ -2206,7 +2208,7 @@ def version(val = nil)
end
# @!attribute [w] mirror
- # Additional URLs for the {#stable} version of the formula.
+ # Additional URLs for the {.stable} version of the formula.
# These are only used if the {.url} fails to download. It's optional and
# there can be more than one. Generally we add them when the main {.url}
# is unreliable. If {.url} is really unreliable then we may swap the
@@ -2220,8 +2222,8 @@ def mirror(val)
# @!attribute [w] sha256
# @scope class
- # To verify the {#cached_download}'s integrity and security we verify the
- # SHA-256 hash matches what we've declared in the {Formula}. To quickly fill
+ # To verify the cached download's integrity and security we verify the
+ # SHA-256 hash matches which we've declared in the {Formula}. To quickly fill
# this value you can leave it blank and run `brew fetch --force` and it'll
# tell you the currently valid value.
#
@@ -2237,7 +2239,7 @@ def mirror(val)
# and you haven't passed or previously used any options on this formula.
#
# If you maintain your own repository, you can add your own bottle links.
- # https://docs.brew.sh/Bottles
+ # @see https://docs.brew.sh/Bottles
# You can ignore this block entirely if submitting to Homebrew/homebrew-core.
# It'll be handled for you by the Brew Test Bot.
#
@@ -2251,11 +2253,11 @@ def mirror(val)
# sha256 "1121cfccd5913f0a63fec40a6ffd44ea64f9dc135c66634ba001d10bcf4302a2" => :mavericks
# end</pre>
#
- # Only formulae where the upstream URL breaks or moves frequently, require compile
+ # Only formulae where the upstream URL breaks or moves frequently, require compiling
# or have a reasonable amount of patches/resources should be bottled.
# Formulae which do not meet the above requirements should not be bottled.
#
- # Formulae which should not be bottled & can be installed without any compile
+ # Formulae which should not be bottled and can be installed without any compile
# required should be tagged with:
# <pre>bottle :unneeded</pre>
#
@@ -2272,7 +2274,7 @@ def build
end
# @!attribute [w] stable
- # Allows adding {.depends_on} and {#patch}es just to the {.stable} {SoftwareSpec}.
+ # Allows adding {.depends_on} and {Patch}es just to the {.stable} {SoftwareSpec}.
# This is required instead of using a conditional.
# It is preferrable to also pull the {url} and {.sha256} into the block if one is added.
#
@@ -2314,7 +2316,7 @@ def devel(&block)
# This can be installed by passing the `--HEAD` option to allow
# installing software directly from a branch of a version-control repository.
# If called as a method this provides just the {url} for the {SoftwareSpec}.
- # If a block is provided you can also add {.depends_on} and {#patch}es just to the {.head} {SoftwareSpec}.
+ # If a block is provided you can also add {.depends_on} and {Patch}es just to the {.head} {SoftwareSpec}.
# The download strategies (e.g. `:using =>`) are the same as for {url}.
# `master` is the default branch and doesn't need stating with a `:branch` parameter.
# <pre>head "https://we.prefer.https.over.git.example.com/.git"</pre>
@@ -2333,8 +2335,8 @@ def head(val = nil, specs = {}, &block)
end
# Additional downloads can be defined as resources and accessed in the
- # install method. Resources can also be defined inside a stable, devel, or
- # head block. This mechanism replaces ad-hoc "subformula" classes.
+ # install method. Resources can also be defined inside a {.stable}, {.devel} or
+ # {.head} block. This mechanism replaces ad-hoc "subformula" classes.
# <pre>resource "additional_files" do
# url "https://example.com/additional-stuff.tar.gz"
# sha256 "c6bc3f48ce8e797854c4b865f6a8ff969867bbcaebd648ae6fd825683e59fef2"
@@ -2378,11 +2380,10 @@ def go_resource(name, &block)
# depends_on :ld64 # Sometimes ld fails on `MacOS.version < :leopard`. Then use this.
# depends_on :x11 => :optional # X11/XQuartz components.
# depends_on :osxfuse # Permits the use of the upstream signed binary or our source package.
- # depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above.
+ # depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above.</pre>
# <pre># It is possible to only depend on something if
# # `build.with?` or `build.without? "another_formula"`:
- # depends_on "postgresql" if build.without? "sqlite"
- #
+ # depends_on "postgresql" if build.without? "sqlite"</pre>
# <pre># Python 3.x if the `--with-python` is given to `brew install example`
# depends_on "python3" => :optional</pre>
# <pre># Python 2.7:
@@ -2397,10 +2398,11 @@ def depends_on(dep)
# Options can be used as arguments to `brew install`.
# To switch features on/off: `"with-something"` or `"with-otherthing"`.
# To use other software: `"with-other-software"` or `"without-foo"`
- # Note, that for {.depends_on} that are `:optional` or `:recommended`, options
+ # Note that for {.depends_on} that are `:optional` or `:recommended`, options
# are generated automatically.
#
# There are also some special options:
+ #
# - `:universal`: build a universal binary/library (e.g. on newer Intel Macs
# this means a combined x86_64/x86 binary/library).
# <pre>option "with-spam", "The description goes here without a dot at the end"</pre>
@@ -2491,10 +2493,10 @@ def skip_clean_paths
@skip_clean_paths ||= Set.new
end
- # Software that will not be sym-linked into the `brew --prefix` will only
+ # Software that will not be symlinked into the `brew --prefix` will only
# live in its Cellar. Other formulae can depend on it and then brew will
# add the necessary includes and libs (etc.) during the brewing of that
- # other formula. But generally, keg_only formulae are not in your PATH
+ # other formula. But generally, keg-only formulae are not in your PATH
# and not seen by compilers if you build your own software outside of
# Homebrew. This way, we don't shadow software provided by macOS.
# <pre>keg_only :provided_by_macos</pre>
@@ -2503,7 +2505,7 @@ def keg_only(reason, explanation = "")
@keg_only_reason = KegOnlyReason.new(reason, explanation)
end
- # Pass :skip to this method to disable post-install stdlib checking
+ # Pass `:skip` to this method to disable post-install stdlib checking
def cxxstdlib_check(check_type)
define_method(:skip_cxxstdlib_check?) { true } if check_type == :skip
end
@@ -2538,13 +2540,13 @@ def needs(*standards)
specs.each { |spec| spec.needs(*standards) }
end
- # Test (is required for new formula and makes us happy).
+ # A test is required for new formulae and makes us happy.
# @return [Boolean]
#
# The block will create, run in and delete a temporary directory.
#
# We are fine if the executable does not error out, so we know linking
- # and building the software was ok.
+ # and building the software was OK.
# <pre>system bin/"foobar", "--version"</pre>
#
# <pre>(testpath/"test.file").write <<~EOS | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/formula_support.rb | @@ -1,4 +1,4 @@
-# Used to track formulae that cannot be installed at the same time
+# Used to track formulae that cannot be installed at the same time.
FormulaConflict = Struct.new(:name, :reason)
# Used to annotate formulae that duplicate macOS provided software
@@ -39,7 +39,7 @@ def to_s
end
end
-# Used to annotate formulae that don't require compiling or cannot build bottle.
+# Used to annotate formulae that don't require compiling or cannot build a bottle.
class BottleDisableReason
SUPPORTED_TYPES = [:unneeded, :disable].freeze
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/formulary.rb | @@ -1,7 +1,7 @@
require "digest/md5"
require "extend/cachable"
-# The Formulary is responsible for creating instances of Formula.
+# The Formulary is responsible for creating instances of {Formula}.
# It is not meant to be used directly from formulae.
module Formulary
@@ -175,15 +175,15 @@ def initialize(alias_path)
end
end
- # Loads formulae from disk using a path
+ # Loads formulae from disk using a path.
class FromPathLoader < FormulaLoader
def initialize(path)
path = Pathname.new(path).expand_path
super path.basename(".rb").to_s, path
end
end
- # Loads formulae from URLs
+ # Loads formulae from URLs.
class FromUrlLoader < FormulaLoader
attr_reader :url
@@ -280,7 +280,7 @@ def get_formula(*)
end
end
- # Load formulae directly from their contents
+ # Load formulae directly from their contents.
class FormulaContentsLoader < FormulaLoader
# The formula's contents
attr_reader :contents
@@ -298,7 +298,8 @@ def klass
end
# Return a Formula instance for the given reference.
- # `ref` is string containing:
+ # `ref` is a string containing:
+ #
# * a formula name
# * a formula pathname
# * a formula URL | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/global.rb | @@ -51,7 +51,7 @@
"(KHTML, like Gecko) Version/10.0.3 Safari/602.4.8".freeze
# Bintray fallback is here for people auto-updating from a version where
-# HOMEBREW_BOTTLE_DEFAULT_DOMAIN isn't set.
+# `HOMEBREW_BOTTLE_DEFAULT_DOMAIN` isn't set.
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = if ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
elsif OS.mac? | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/keg.rb | @@ -111,9 +111,8 @@ def to_s
].freeze
# Given an array of kegs, this method will try to find some other kegs
- # that depend on them.
+ # that depend on them. If it does, it returns:
#
- # If it does, it returns:
# - some kegs in the passed array that have installed dependents
# - some installed dependents of those kegs.
# | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/language/python.rb | @@ -94,7 +94,7 @@ def self.included(base)
end
# Instantiates, creates, and yields a {Virtualenv} object for use from
- # Formula#install, which provides helper methods for instantiating and
+ # {Formula#install}, which provides helper methods for instantiating and
# installing packages into a Python virtualenv.
# @param venv_root [Pathname, String] the path to the root of the virtualenv
# (often `libexec/"venv"`)
@@ -140,7 +140,7 @@ def needs_python?(python)
# Helper method for the common case of installing a Python application.
# Creates a virtualenv in `libexec`, installs all `resource`s defined
# on the formula, and then installs the formula. An options hash may be
- # passed (e.g., :using => "python") to override the default, guessed
+ # passed (e.g., `:using => "python"`) to override the default, guessed
# formula preference for python or python2, or to resolve an ambiguous
# case where it's not clear whether python or python2 should be the
# default guess. | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/linkage_cache_store.rb | @@ -3,11 +3,11 @@
#
# `LinkageCacheStore` provides methods to fetch and mutate linkage-specific data used
-# by the `brew linkage` command
+# by the `brew linkage` command.
#
class LinkageCacheStore < CacheStore
- # @param [String] keg_path
- # @param [CacheStoreDatabase] database
+ # @param keg_path [String]
+ # @param database [CacheStoreDatabase]
# @return [nil]
def initialize(keg_path, database)
@keg_path = keg_path
@@ -24,7 +24,7 @@ def keg_exists?
# Inserts dylib-related information into the cache if it does not exist or
# updates data into the linkage cache if it does exist
#
- # @param [Hash] hash_values: hash containing KVPs of { :type => Hash }
+ # @param hash_values [Hash] hash containing KVPs of { :type => Hash }
# @return [nil]
def update!(hash_values)
hash_values.each_key do |type|
@@ -38,7 +38,7 @@ def update!(hash_values)
database.set @keg_path, hash_values
end
- # @param [Symbol] the type to fetch from the `LinkageCacheStore`
+ # @param type [Symbol] the type to fetch from the `LinkageCacheStore`
# @raise [TypeError] error if the type is not in `HASH_LINKAGE_TYPES`
# @return [Hash]
def fetch(type)
@@ -64,7 +64,7 @@ def delete!
HASH_LINKAGE_TYPES = [:keg_files_dylibs].freeze
- # @param [Symbol] type
+ # @param type [Symbol]
# @return [Hash]
def fetch_hash_values(type)
keg_cache = database.get(@keg_path) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/messages.rb | @@ -1,5 +1,5 @@
# A Messages object collects messages that may need to be displayed together
-# at the end of a multi-step `brew` command run
+# at the end of a multi-step `brew` command run.
class Messages
attr_reader :caveats, :formula_count, :install_times
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/migrator.rb | @@ -137,7 +137,7 @@ def initialize(formula, force: ARGV.force?)
@old_pin_link_record = old_pin_record.readlink if @pinned
end
- # Fix INSTALL_RECEIPTS for tap-migrated formula.
+ # Fix INSTALL_RECEIPTs for tap-migrated formula.
def fix_tabs
old_tabs.each do |tab|
tab.tap = formula.tap
@@ -160,7 +160,7 @@ def from_same_tap_user?
if formula_tap_user == old_tap_user
true
# Homebrew didn't use to update tabs while performing tap-migrations,
- # so there can be INSTALL_RECEIPT's containing wrong information about tap,
+ # so there can be INSTALL_RECEIPTs containing wrong information about tap,
# so we check if there is an entry about oldname migrated to tap and if
# newname's tap is the same as tap to which oldname migrated, then we
# can perform migrations and the taps for oldname and newname are the same. | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/os/linux/elf.rb | @@ -1,5 +1,5 @@
+# @see https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
module ELFShim
- # See: https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
MAGIC_NUMBER_OFFSET = 0
MAGIC_NUMBER_ASCII = "\x7fELF".freeze
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/os/mac.rb | @@ -72,20 +72,23 @@ def active_developer_dir
@active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip
end
- # If a specific SDK is requested
- # a) The requested SDK is returned, if it's installed.
- # b) If the requested SDK is not installed, the newest SDK (if any SDKs
+ # If a specific SDK is requested:
+ #
+ # 1. The requested SDK is returned, if it's installed.
+ # 2. If the requested SDK is not installed, the newest SDK (if any SDKs
# are available) is returned.
- # c) If no SDKs are available, nil is returned.
- # If no specific SDK is requested
- # a) For Xcode >= 7, the latest SDK is returned even if the latest SDK is
+ # 3. If no SDKs are available, nil is returned.
+ #
+ # If no specific SDK is requested:
+ #
+ # 1. For Xcode >= 7, the latest SDK is returned even if the latest SDK is
# named after a newer OS version than the running OS. The
- # MACOSX_DEPLOYMENT_TARGET must be set to the OS for which you're
+ # `MACOSX_DEPLOYMENT_TARGET` must be set to the OS for which you're
# actually building (usually the running OS version).
- # https://github.com/Homebrew/legacy-homebrew/pull/50355
- # https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/Introduction.html#//apple_ref/doc/uid/TP40004626
+ # - https://github.com/Homebrew/legacy-homebrew/pull/50355
+ # - https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/Introduction.html#//apple_ref/doc/uid/TP40004626
# Section "About SDKs and Simulator"
- # b) For Xcode < 7, proceed as if the SDK for the running OS version had
+ # 2. For Xcode < 7, proceed as if the SDK for the running OS version had
# specifically been requested according to the rules above.
def sdk(v = nil)
@@ -98,7 +101,7 @@ def sdk(v = nil)
@locator.sdk_if_applicable(v)
end
- # Returns the path to an SDK or nil, following the rules set by #sdk.
+ # Returns the path to an SDK or nil, following the rules set by {.sdk}.
def sdk_path(v = nil)
s = sdk(v)
s&.path
@@ -122,9 +125,10 @@ def sdk_path_if_needed(v = nil)
end
# See these issues for some history:
- # https://github.com/Homebrew/legacy-homebrew/issues/13
- # https://github.com/Homebrew/legacy-homebrew/issues/41
- # https://github.com/Homebrew/legacy-homebrew/issues/48
+ #
+ # - https://github.com/Homebrew/legacy-homebrew/issues/13
+ # - https://github.com/Homebrew/legacy-homebrew/issues/41
+ # - https://github.com/Homebrew/legacy-homebrew/issues/48
def macports_or_fink
paths = []
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/os/mac/xquartz.rb | @@ -60,8 +60,8 @@ def minimum_version
"2.7.11"
end
- # https://xquartz.macosforge.org/trac/wiki
- # https://xquartz.macosforge.org/trac/wiki/Releases
+ # - https://xquartz.macosforge.org/trac/wiki
+ # - https://xquartz.macosforge.org/trac/wiki/Releases
def latest_version
case MacOS.version
when "10.5"
@@ -114,8 +114,8 @@ def provided_by_apple?
end
# This should really be private, but for compatibility reasons it must
- # remain public. New code should use MacOS::X11.bin, MacOS::X11.lib and
- # MacOS::X11.include instead, as that accounts for Xcode-only systems.
+ # remain public. New code should use `MacOS::X11.bin`, `MacOS::X11.lib` and
+ # `MacOS::X11.include` instead, as that accounts for Xcode-only systems.
def prefix
@prefix ||= if Pathname.new("/opt/X11/lib/libpng.dylib").exist?
Pathname.new("/opt/X11")
@@ -139,10 +139,10 @@ def outdated?
end
# If XQuartz and/or the CLT are installed, headers will be found under
- # /opt/X11/include or /usr/X11/include. For Xcode-only systems, they are
- # found in the SDK, so we use sdk_path for both the headers and libraries.
+ # `/opt/X11/include` or `/usr/X11/include`. For Xcode-only systems, they are
+ # found in the SDK, so we use {.sdk_path} for both the headers and libraries.
# Confusingly, executables (e.g. config scripts) are only found under
- # /opt/X11/bin or /usr/X11/bin in all cases.
+ # `/opt/X11/bin` or `/usr/X11/bin` in all cases.
def effective_prefix
if provided_by_apple? && Xcode.without_clt?
Pathname.new("#{OS::Mac.sdk_path}/usr/X11") | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/patch.rb | @@ -162,7 +162,7 @@ def inspect
end
end
-# Legacy patches have no checksum and are not cached
+# Legacy patches have no checksum and are not cached.
class LegacyPatch < ExternalPatch
def initialize(strip, url)
super(strip) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/requirement.rb | @@ -49,7 +49,7 @@ def message
s
end
- # Overriding #satisfied? is unsupported.
+ # Overriding {#satisfied?} is unsupported.
# Pass a block or boolean to the satisfy DSL method instead.
def satisfied?
satisfy = self.class.satisfy
@@ -61,7 +61,7 @@ def satisfied?
true
end
- # Overriding #fatal? is unsupported.
+ # Overriding {#fatal?} is unsupported.
# Pass a boolean to the fatal DSL method instead.
def fatal?
self.class.fatal || false
@@ -77,7 +77,7 @@ def satisfied_result_parent
parent
end
- # Overriding #modify_build_environment is unsupported.
+ # Overriding {#modify_build_environment} is unsupported.
# Pass a block to the env DSL method instead.
def modify_build_environment
satisfied?
@@ -196,7 +196,7 @@ def yielder
class << self
# Expand the requirements of dependent recursively, optionally yielding
- # [dependent, req] pairs to allow callers to apply arbitrary filters to
+ # `[dependent, req]` pairs to allow callers to apply arbitrary filters to
# the list.
# The default filter, which is applied when a block is not given, omits
# optionals and recommendeds based on what the dependent has asked for. | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/resource.rb | @@ -61,10 +61,10 @@ def clear_cache
downloader.clear_cache
end
- # Verifies download and unpacks it
+ # Verifies download and unpacks it.
# The block may call `|resource,staging| staging.retain!` to retain the staging
# directory. Subclasses that override stage should implement the tmp
- # dir using Resource#mktemp so that works with all subtypes.
+ # dir using {Mktemp} so that works with all subtypes.
def stage(target = nil, &block)
unless target || block
raise ArgumentError, "target directory or block is required"
@@ -91,8 +91,8 @@ def apply_patches
end
# If a target is given, unpack there; else unpack to a temp folder.
- # If block is given, yield to that block with |stage|, where stage
- # is a ResourceStagingContext.
+ # If block is given, yield to that block with `|stage|`, where stage
+ # is a {ResourceStageContext}.
# A target or a block must be given, but not both.
def unpack(target = nil)
mktemp(download_name) do |staging|
@@ -210,15 +210,15 @@ def apply(*paths)
end
end
-# The context in which a Resource.stage() occurs. Supports access to both
-# the Resource and associated Mktemp in a single block argument. The interface
-# is back-compatible with Resource itself as used in that context.
+# The context in which a {Resource.stage} occurs. Supports access to both
+# the {Resource} and associated {Mktemp} in a single block argument. The interface
+# is back-compatible with {Resource} itself as used in that context.
class ResourceStageContext
extend Forwardable
- # The Resource that is being staged
+ # The {Resource} that is being staged
attr_reader :resource
- # The Mktemp in which @resource is staged
+ # The {Mktemp} in which {#resource} is staged
attr_reader :staging
def_delegators :@resource, :version, :url, :mirrors, :specs, :using, :source_modified_time | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/class_cop.rb | @@ -68,7 +68,7 @@ def autocorrect(node)
end
module FormulaAuditStrict
- # - `test do ..end` should be meaningfully defined in the formula
+ # - `test do ..end` should be meaningfully defined in the formula.
class Test < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
test = find_block(body_node, :test) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/components_order_cop.rb | @@ -3,9 +3,9 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop checks for correct order of components in a Formula
+ # This cop checks for correct order of components in Formulae.
#
- # - component_precedence_list has component hierarchy in a nested list
+ # - `component_precedence_list` has component hierarchy in a nested list
# where each sub array contains components' details which are at same precedence level
class ComponentsOrder < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
@@ -96,9 +96,9 @@ def autocorrect(_node)
end
end
- # Reorder two nodes in the source, using the corrector instance in autocorrect method
- # Components of same type are grouped together when rewriting the source
- # Linebreaks are introduced if components are of two different methods/blocks/multilines
+ # Reorder two nodes in the source, using the corrector instance in autocorrect method.
+ # Components of same type are grouped together when rewriting the source.
+ # Linebreaks are introduced if components are of two different methods/blocks/multilines.
def reorder_components(corrector, node1, node2)
# order_idx : node1's index in component_precedence_list
# curr_p_idx: node1's index in preceding_comp_arr | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/components_redundancy_cop.rb | @@ -3,11 +3,11 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop checks if redundant components are present and other component errors
+ # This cop checks if redundant components are present and other component errors.
#
# - `url|checksum|mirror` should be inside `stable` block
# - `head` and `head do` should not be simultaneously present
- # - `bottle :unneeded/:disable` and `bottle do` should not be simultaneously present
+ # - `bottle :unneeded`/`:disable` and `bottle do` should not be simultaneously present
# - `stable do` should not be present without a `head` or `devel` spec
class ComponentsRedundancy < FormulaCop | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/conflicts_cop.rb | @@ -4,7 +4,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop audits versioned Formulae for `conflicts_with`
+ # This cop audits versioned Formulae for `conflicts_with`.
class Conflicts < FormulaCop
MSG = "Versioned formulae should not use `conflicts_with`. " \
"Use `keg_only :versioned_formula` instead.".freeze | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/dependency_order_cop.rb | @@ -3,7 +3,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop checks for correct order of `depends_on` in a Formula
+ # This cop checks for correct order of `depends_on` in Formulae.
#
# precedence order:
# build-time > run-time > normal > recommended > optional | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/extend/formula_cop.rb | @@ -30,7 +30,7 @@ def on_class(node)
end
# Checks for regex match of pattern in the node and
- # Sets the appropriate instance variables to report the match
+ # sets the appropriate instance variables to report the match
def regex_match_group(node, pattern)
string_repr = string_content(node)
match_object = string_repr.match(pattern)
@@ -51,9 +51,9 @@ def regex_match_group(node, pattern)
match_object
end
- # Yields to block when there is a match
- # Parameters: urls : Array of url/mirror method call nodes
- # regex: regex pattern to match urls
+ # Yields to block when there is a match.
+ # @param urls [Array] url/mirror method call nodes
+ # @param regex [Regexp] pattern to match urls
def audit_urls(urls, regex)
urls.each do |url_node|
url_string_node = parameters(url_node).first
@@ -104,8 +104,8 @@ def find_method_calls_by_name(node, method_name)
node.each_child_node(:send).select { |method_node| method_name == method_node.method_name }
end
- # Returns an array of method call nodes matching method_name in every descendant of node
- # Returns every method call if no method_name is passed
+ # Returns an array of method call nodes matching method_name in every descendant of node.
+ # Returns every method call if no method_name is passed.
def find_every_method_call_by_name(node, method_name = nil)
return if node.nil?
@@ -115,10 +115,11 @@ def find_every_method_call_by_name(node, method_name = nil)
end
end
- # Returns array of function call nodes matching func_name in every descendant of node
- # Ex. function call: foo(*args, **kwargs)
- # Does not match method calls: foo.bar(*args, **kwargs)
- # Returns every function calls if no func_name is passed
+ # Returns array of function call nodes matching func_name in every descendant of node.
+ #
+ # - matches function call: `foo(*args, **kwargs)`
+ # - does not match method calls: `foo.bar(*args, **kwargs)`
+ # - returns every function calls if no func_name is passed
def find_every_func_call_by_name(node, func_name = nil)
return if node.nil?
@@ -139,12 +140,13 @@ def find_method_with_args(node, method_name, *args)
end
end
- # Matches a method with a receiver,
- # EX: to match `Formula.factory(name)`
- # call `find_instance_method_call(node, "Formula", :factory)`
- # EX: to match `build.head?`
- # call `find_instance_method_call(node, :build, :head?)`
- # yields to a block with matching method node
+ # Matches a method with a receiver.
+ #
+ # - e.g. to match `Formula.factory(name)`
+ # call `find_instance_method_call(node, "Formula", :factory)`
+ # - e.g. to match `build.head?`
+ # call `find_instance_method_call(node, :build, :head?)`
+ # - yields to a block with matching method node
def find_instance_method_call(node, instance, method_name)
methods = find_every_method_call_by_name(node, method_name)
methods.each do |method|
@@ -160,10 +162,11 @@ def find_instance_method_call(node, instance, method_name)
end
end
- # Matches receiver part of method,
- # EX: to match `ARGV.<whatever>()`
- # call `find_instance_call(node, "ARGV")`
- # yields to a block with parent node of receiver
+ # Matches receiver part of method.
+ #
+ # - e.g. to match `ARGV.<whatever>()`
+ # call `find_instance_call(node, "ARGV")`
+ # - yields to a block with parent node of receiver
def find_instance_call(node, name)
node.each_descendant(:send) do |method_node|
next if method_node.receiver.nil?
@@ -178,8 +181,8 @@ def find_instance_call(node, name)
end
end
- # Returns nil if does not depend on dependency_name
- # args: node - dependency_name - dependency's name
+ # Returns nil if does not depend on dependency_name.
+ # @param dependency_name dependency's name
def depends_on?(dependency_name, *types)
types = [:any] if types.empty?
dependency_nodes = find_every_method_call_by_name(@body, :depends_on)
@@ -192,7 +195,7 @@ def depends_on?(dependency_name, *types)
@offensive_node = dependency_nodes[idx]
end
- # Returns true if given dependency name and dependency type exist in given dependency method call node
+ # Returns true if given dependency name and dependency type exist in given dependency method call node.
# TODO: Add case where key of hash is an array
def depends_on_name_type?(node, name = nil, type = :required)
if name
@@ -223,8 +226,8 @@ def depends_on_name_type?(node, name = nil, type = :required)
type_match && name_match
end
- # Find CONSTANTs in the source
- # if block given, yield matching nodes
+ # Find CONSTANTs in the source.
+ # If block given, yield matching nodes.
def find_const(node, const_name)
return if node.nil?
@@ -284,7 +287,7 @@ def find_blocks(node, block_name)
node.each_child_node(:block).select { |block_node| block_name == block_node.method_name }
end
- # Returns an array of block nodes of any depth below node in AST
+ # Returns an array of block nodes of any depth below node in AST.
# If a block is given then yields matching block node to the block!
def find_all_blocks(node, block_name)
return if node.nil?
@@ -298,8 +301,8 @@ def find_all_blocks(node, block_name)
end
end
- # Returns a method definition node with method_name
- # Returns first method def if method_name is nil
+ # Returns a method definition node with method_name.
+ # Returns first method def if method_name is nil.
def find_method_def(node, method_name = nil)
return if node.nil?
@@ -332,8 +335,8 @@ def method_called_in_block?(node, method_name)
false
end
- # Check if method_name is called among the direct children nodes in the given node
- # Check if the node itself is the method
+ # Check if method_name is called among the direct children nodes in the given node.
+ # Check if the node itself is the method.
def method_called?(node, method_name)
if node.send_type? && node.method_name == method_name
offending_node(node)
@@ -400,8 +403,8 @@ def parameters(method_node)
end
# Returns true if the given parameters are present in method call
- # and sets the method call as the offending node
- # params can be string, symbol, array, hash, matching regex
+ # and sets the method call as the offending node.
+ # Params can be string, symbol, array, hash, matching regex.
def parameters_passed?(method_node, *params)
method_params = parameters(method_node)
@offensive_node = method_node | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/formula_desc_cop.rb | @@ -4,7 +4,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop audits `desc` in Formulae
+ # This cop audits `desc` in Formulae.
#
# - Checks for existence of `desc`
# - Checks if size of `desc` > 80
@@ -37,7 +37,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
module FormulaAuditStrict
- # This cop audits `desc` in Formulae
+ # This cop audits `desc` in Formulae.
#
# - Checks for leading/trailing whitespace in `desc`
# - Checks if `desc` begins with an article | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/homepage_cop.rb | @@ -3,7 +3,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop audits `homepage` url in Formulae
+ # This cop audits the `homepage` URL in Formulae.
class Homepage < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
homepage_node = find_node_method_by_name(body_node, :homepage) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/lines_cop.rb | @@ -3,7 +3,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop checks for various miscellaneous Homebrew coding styles
+ # This cop checks for various miscellaneous Homebrew coding styles.
class Lines < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
[:automake, :ant, :autoconf, :emacs, :expat, :libtool, :mysql, :perl, | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/options_cop.rb | @@ -3,7 +3,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop audits `options` in Formulae
+ # This cop audits `options` in Formulae.
class Options < FormulaCop
DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated.".freeze
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/patches_cop.rb | @@ -4,7 +4,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop audits patches in Formulae
+ # This cop audits patches in Formulae.
class Patches < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body)
external_patches = find_all_blocks(body, :patch) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/rubocops/urls_cop.rb | @@ -3,7 +3,7 @@
module RuboCop
module Cop
module FormulaAudit
- # This cop audits urls and mirrors in Formulae
+ # This cop audits URLs and mirrors in Formulae.
class Urls < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
urls = find_every_func_call_by_name(body_node, :url) | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/software_spec.rb | @@ -359,7 +359,7 @@ def compatible_cellar?
cellar == :any || cellar == :any_skip_relocation || cellar == HOMEBREW_CELLAR.to_s
end
- # Does the Bottle this BottleSpecification belongs to need to be relocated?
+ # Does the {Bottle} this BottleSpecification belongs to need to be relocated?
def skip_relocation?
cellar == :any_skip_relocation
end | true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/tap.rb | @@ -2,7 +2,7 @@
require "readall"
require "description_cache_store"
-# a {Tap} is used to extend the formulae provided by Homebrew core.
+# A {Tap} is used to extend the formulae provided by Homebrew core.
# Usually, it's synced with a remote git repository. And it's likely
# a GitHub repository with the name of `user/homebrew-repo`. In such
# case, `user/repo` will be used as the {#name} of this {Tap}, where
@@ -55,7 +55,7 @@ def self.default_cask_tap
extend Enumerable
# The user name of this {Tap}. Usually, it's the GitHub username of
- # this #{Tap}'s remote repository.
+ # this {Tap}'s remote repository.
attr_reader :user
# The repository name of this {Tap} without leading `homebrew-`.
@@ -87,7 +87,7 @@ def initialize(user, repo)
@alias_reverse_table = nil
end
- # clear internal cache
+ # Clear internal cache
def clear_cache
@remote = nil
@repo_var = nil
@@ -153,7 +153,7 @@ def git_short_head
path.git_short_head
end
- # time since git last commit for this {Tap}.
+ # Time since git last commit for this {Tap}.
def git_last_commit
raise TapUnavailableError, name unless installed?
@@ -224,7 +224,7 @@ def core_tap?
false
end
- # install this {Tap}.
+ # Install this {Tap}.
#
# @param [Hash] options
# @option options [String] :clone_target If passed, it will be used as the clone remote.
@@ -324,7 +324,7 @@ def link_completions_and_manpages
Utils::Link.link_completions(path, command)
end
- # uninstall this {Tap}.
+ # Uninstall this {Tap}.
def uninstall
require "descriptions"
raise TapUnavailableError, name unless installed?
@@ -354,7 +354,7 @@ def custom_remote?
remote.casecmp(default_remote).nonzero?
end
- # path to the directory of all {Formula} files for this {Tap}.
+ # Path to the directory of all {Formula} files for this {Tap}.
def formula_dir
@formula_dir ||= potential_formula_dirs.find(&:directory?) || path/"Formula"
end
@@ -363,7 +363,7 @@ def potential_formula_dirs
@potential_formula_dirs ||= [path/"Formula", path/"HomebrewFormula", path].freeze
end
- # path to the directory of all {Cask} files for this {Tap}.
+ # Path to the directory of all {Cask} files for this {Tap}.
def cask_dir
@cask_dir ||= path/"Casks"
end
@@ -386,7 +386,7 @@ def contents
contents
end
- # an array of all {Formula} files of this {Tap}.
+ # An array of all {Formula} files of this {Tap}.
def formula_files
@formula_files ||= if formula_dir.directory?
formula_dir.children.select(&method(:ruby_file?))
@@ -395,7 +395,7 @@ def formula_files
end
end
- # an array of all {Cask} files of this {Tap}.
+ # An array of all {Cask} files of this {Tap}.
def cask_files
@cask_files ||= if cask_dir.directory?
cask_dir.children.select(&method(:ruby_file?))
@@ -428,7 +428,7 @@ def cask_file?(file)
ruby_file?(file) && file.parent == cask_dir
end
- # an array of all {Formula} names of this {Tap}.
+ # An array of all {Formula} names of this {Tap}.
def formula_names
@formula_names ||= formula_files.map { |f| formula_file_to_name(f) }
end
@@ -487,7 +487,7 @@ def command_file?(file)
(file.executable? || file.extname == ".rb")
end
- # an array of all commands files of this {Tap}.
+ # An array of all commands files of this {Tap}.
def command_files
@command_files ||= if command_dir.directory?
command_dir.children.select(&method(:command_file?))
@@ -509,7 +509,7 @@ def pinned?
@pinned = pinned_symlink_path.directory?
end
- # pin this {Tap}.
+ # Pin this {Tap}.
def pin
raise TapUnavailableError, name unless installed?
raise TapPinStatusError.new(name, true) if pinned?
@@ -518,7 +518,7 @@ def pin
@pinned = true
end
- # unpin this {Tap}.
+ # Unpin this {Tap}.
def unpin
raise TapUnavailableError, name unless installed?
raise TapPinStatusError.new(name, false) unless pinned?
@@ -591,12 +591,12 @@ def self.each
end
end
- # an array of all installed {Tap} names.
+ # An array of all installed {Tap} names.
def self.names
map(&:name).sort
end
- # an array of all tap cmd directory {Pathname}s
+ # An array of all tap cmd directory {Pathname}s
def self.cmd_directories
Pathname.glob TAP_DIRECTORY/"*/*/cmd"
end
@@ -633,7 +633,7 @@ def read_or_set_private_config
end
end
-# A specialized {Tap} class for the core formulae
+# A specialized {Tap} class for the core formulae.
class CoreTap < Tap
def default_remote
"https://github.com/Homebrew/homebrew-core".freeze
@@ -722,7 +722,7 @@ def alias_file_to_name(file)
end
end
-# Permanent configuration per {Tap} using `git-config(1)`
+# Permanent configuration per {Tap} using `git-config(1)`.
class TapConfig
attr_reader :tap
| true |
Other | Homebrew | brew | 20167e5f1b45c486a05d3be4c0b5209d5d1a838d.json | Adjust comments to tidy API docs output. | Library/Homebrew/utils.rb | @@ -303,7 +303,7 @@ def safe_system(cmd, *args, **options)
raise(ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS))
end
-# prints no output
+# Prints no output
def quiet_system(cmd, *args)
Homebrew._system(cmd, *args) do
# Redirect output streams to `/dev/null` instead of closing as some programs
@@ -504,9 +504,9 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {})
# Calls the given block with the passed environment variables
# added to ENV, then restores ENV afterwards.
# Example:
-# with_env(PATH: "/bin") do
+# <pre>with_env(PATH: "/bin") do
# system "echo $PATH"
-# end
+# end</pre>
#
# Note that this method is *not* thread-safe - other threads
# which happen to be scheduled during the block will also | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.