Merge remote-tracking branch 'origin/master' into cask-move-contents
This commit is contained in:
commit
a1571702d3
3
.github/actionlint.yaml
vendored
3
.github/actionlint.yaml
vendored
@ -2,6 +2,9 @@ self-hosted-runner:
|
||||
# Labels of self-hosted runner in array of strings.
|
||||
labels:
|
||||
- 11-arm64
|
||||
# FIXME: Remove `macos-13` when resolved:
|
||||
# https://github.com/rhysd/actionlint/issues/296
|
||||
- macos-13
|
||||
# Configuration variables in array of strings defined in your repository or
|
||||
# organization. `null` means disabling configuration variables check.
|
||||
# Empty array means no configuration variable is allowed.
|
||||
|
||||
2
.github/workflows/autogenerated-files.yml
vendored
2
.github/workflows/autogenerated-files.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Cache Bundler RubyGems
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||
|
||||
2
.github/workflows/build-pkg.yml
vendored
2
.github/workflows/build-pkg.yml
vendored
@ -10,7 +10,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
env:
|
||||
IDENTIFIER: sh.brew.Homebrew
|
||||
TMP_PATH: /tmp/brew
|
||||
|
||||
2
.github/workflows/sorbet.yml
vendored
2
.github/workflows/sorbet.yml
vendored
@ -21,7 +21,7 @@ permissions:
|
||||
jobs:
|
||||
tapioca:
|
||||
if: github.repository == 'Homebrew/brew'
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
|
||||
@ -2,6 +2,8 @@ name: Update sponsors, maintainers, manpage and completions
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
paths:
|
||||
- .github/workflows/sponsors-maintainers-man-completions.yml
|
||||
- README.md
|
||||
@ -39,7 +41,7 @@ jobs:
|
||||
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }}
|
||||
|
||||
- name: Cache Bundler RubyGems
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||
|
||||
20
.github/workflows/tests.yml
vendored
20
.github/workflows/tests.yml
vendored
@ -135,7 +135,7 @@ jobs:
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Cache Bundler RubyGems
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||
@ -157,7 +157,7 @@ jobs:
|
||||
name: cask audit
|
||||
needs: syntax
|
||||
if: startsWith(github.repository, 'Homebrew/')
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
env:
|
||||
HOMEBREW_NO_INSTALL_FROM_API: 1
|
||||
steps:
|
||||
@ -166,7 +166,7 @@ jobs:
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Cache Bundler RubyGems
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
|
||||
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
|
||||
@ -258,8 +258,8 @@ jobs:
|
||||
include:
|
||||
- name: update-test (Ubuntu 22.04)
|
||||
runs-on: ubuntu-22.04
|
||||
- name: update-test (macOS 12)
|
||||
runs-on: macos-12
|
||||
- name: update-test (macOS 13)
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
@ -300,9 +300,9 @@ jobs:
|
||||
- name: tests (Ubuntu 20.04)
|
||||
test-flags: --coverage
|
||||
runs-on: ubuntu-20.04
|
||||
- name: tests (macOS 12)
|
||||
- name: tests (macOS 13)
|
||||
test-flags: --coverage
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
@ -373,7 +373,7 @@ jobs:
|
||||
HOMEBREW_BUILDPULSE_ACCOUNT_ID: 1503512
|
||||
HOMEBREW_BUILDPULSE_REPOSITORY_ID: 53238813
|
||||
|
||||
- uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865
|
||||
- uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2
|
||||
with:
|
||||
directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
||||
files: Library/Homebrew/test/coverage/coverage.xml
|
||||
@ -390,8 +390,8 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
- name: test default formula (Ubuntu 20.04)
|
||||
runs-on: ubuntu-20.04
|
||||
- name: test default formula (macOS 12)
|
||||
runs-on: macos-12
|
||||
- name: test default formula (macOS 13)
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
|
||||
6
.github/workflows/vendor-gems.yml
vendored
6
.github/workflows/vendor-gems.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
contains(github.event.pull_request.title, '/Library/Homebrew')
|
||||
)
|
||||
)
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
@ -71,9 +71,9 @@ jobs:
|
||||
run: |
|
||||
if [[ "${GITHUB_EVENT_NAME}" == "pull_request_target" || "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]
|
||||
then
|
||||
brew vendor-gems
|
||||
brew vendor-gems --non-bundler-gems
|
||||
else
|
||||
brew vendor-gems --no-commit
|
||||
brew vendor-gems --non-bundler-gems --no-commit
|
||||
fi
|
||||
|
||||
- name: Update RBI files
|
||||
|
||||
50
.gitignore
vendored
50
.gitignore
vendored
@ -75,21 +75,30 @@
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/utility/
|
||||
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/*/*.jar
|
||||
**/vendor/bundle/ruby/*/gems/i18n-*/lib/i18n/tests*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/*.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/agent.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/*auth*.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/c*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/d*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/e*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/f*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/h*.rb
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/i*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/p*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/r*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/t*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u*
|
||||
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x*
|
||||
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util
|
||||
**/vendor/gems/mechanize-*/.*
|
||||
**/vendor/gems/mechanize-*/*.md
|
||||
**/vendor/gems/mechanize-*/*.rdoc
|
||||
**/vendor/gems/mechanize-*/*.gemspec
|
||||
**/vendor/gems/mechanize-*/Gemfile
|
||||
**/vendor/gems/mechanize-*/Rakefile
|
||||
**/vendor/gems/mechanize-*/examples/
|
||||
**/vendor/gems/mechanize-*/lib/*.rb
|
||||
**/vendor/gems/mechanize-*/lib/*.rb
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/http/agent.rb
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/http/*auth*.rb
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/c*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/d*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/e*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/f*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/h*.rb
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/i*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/p*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/r*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/t*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/u*
|
||||
**/vendor/gems/mechanize-*/lib/mechanize/x*
|
||||
**/vendor/gems/mechanize-*/test/
|
||||
|
||||
# Ignore dependencies we don't wish to vendor
|
||||
**/vendor/bundle/ruby/*/gems/ast-*/
|
||||
@ -99,28 +108,20 @@
|
||||
**/vendor/bundle/ruby/*/gems/coderay-*/
|
||||
**/vendor/bundle/ruby/*/gems/colorize-*/
|
||||
**/vendor/bundle/ruby/*/gems/commander-*/
|
||||
**/vendor/bundle/ruby/*/gems/connection_pool-*/
|
||||
**/vendor/bundle/ruby/*/gems/diff-lcs-*/
|
||||
**/vendor/bundle/ruby/*/gems/docile-*/
|
||||
**/vendor/bundle/ruby/*/gems/domain_name-*/
|
||||
**/vendor/bundle/ruby/*/gems/ecma-re-validator-*/
|
||||
**/vendor/bundle/ruby/*/gems/hana-*/
|
||||
**/vendor/bundle/ruby/*/gems/highline-*/
|
||||
**/vendor/bundle/ruby/*/gems/http-cookie-*/
|
||||
**/vendor/bundle/ruby/*/gems/hpricot-*/
|
||||
**/vendor/bundle/ruby/*/gems/jaro_winkler-*/
|
||||
**/vendor/bundle/ruby/*/gems/json-*/
|
||||
**/vendor/bundle/ruby/*/gems/json_schemer-*/
|
||||
**/vendor/bundle/ruby/*/gems/method_source-*/
|
||||
**/vendor/bundle/ruby/*/gems/mime-types-data-*/
|
||||
**/vendor/bundle/ruby/*/gems/mime-types-*/
|
||||
**/vendor/bundle/ruby/*/gems/mini_portile2-*/
|
||||
**/vendor/bundle/ruby/*/gems/minitest-*/
|
||||
**/vendor/bundle/ruby/*/gems/msgpack-*/
|
||||
**/vendor/bundle/ruby/*/gems/mustache-*/
|
||||
**/vendor/bundle/ruby/*/gems/net-http-digest_auth-*/
|
||||
**/vendor/bundle/ruby/*/gems/net-http-persistent-*/
|
||||
**/vendor/bundle/ruby/*/gems/nokogiri-*/
|
||||
**/vendor/bundle/ruby/*/gems/ntlm-http-*/
|
||||
**/vendor/bundle/ruby/*/gems/parallel-*/
|
||||
**/vendor/bundle/ruby/*/gems/parallel_tests-*/
|
||||
@ -129,7 +130,6 @@
|
||||
**/vendor/bundle/ruby/*/gems/powerpack-*/
|
||||
**/vendor/bundle/ruby/*/gems/psych-*/
|
||||
**/vendor/bundle/ruby/*/gems/pry-*/
|
||||
**/vendor/bundle/ruby/*/gems/racc-*/
|
||||
**/vendor/bundle/ruby/*/gems/rainbow-*/
|
||||
**/vendor/bundle/ruby/*/gems/rbi-*/
|
||||
**/vendor/bundle/ruby/*/gems/rdiscount-*/
|
||||
@ -158,14 +158,14 @@
|
||||
**/vendor/bundle/ruby/*/gems/strscan-*/
|
||||
**/vendor/bundle/ruby/*/gems/tapioca-*/
|
||||
**/vendor/bundle/ruby/*/gems/thor-*/
|
||||
**/vendor/bundle/ruby/*/gems/unf_ext-*/
|
||||
**/vendor/bundle/ruby/*/gems/unf-*/
|
||||
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/
|
||||
**/vendor/bundle/ruby/*/gems/unparser-*/
|
||||
**/vendor/bundle/ruby/*/gems/uri_template-*/
|
||||
**/vendor/bundle/ruby/*/gems/webrobots-*/
|
||||
**/vendor/bundle/ruby/*/gems/yard-*/
|
||||
**/vendor/bundle/ruby/*/gems/yard-sorbet-*/
|
||||
**/vendor/cache/
|
||||
**/vendor/specifications/
|
||||
|
||||
# Ignore `bin` contents (again).
|
||||
/bin
|
||||
|
||||
@ -38,7 +38,12 @@ RUN apt-get update \
|
||||
uuid-runtime \
|
||||
tzdata \
|
||||
jq \
|
||||
&& if [ "$(. /etc/lsb-release; echo "${DISTRIB_RELEASE}" | cut -d. -f1)" -ge 22 ]; then apt-get install -y --no-install-recommends gh skopeo; fi \
|
||||
&& if [ "$(. /etc/lsb-release; echo "${DISTRIB_RELEASE}" | cut -d. -f1)" -ge 22 ]; then apt-get install -y --no-install-recommends skopeo; fi \
|
||||
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends gh \
|
||||
&& apt-get remove --purge -y software-properties-common \
|
||||
&& apt-get autoremove --purge -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
|
||||
@ -280,12 +280,13 @@ RSpec/Focus:
|
||||
Sorbet/ConstantsFromStrings:
|
||||
Enabled: false
|
||||
|
||||
# This is already the default
|
||||
Sorbet/FalseSigil:
|
||||
Exclude:
|
||||
- "Taps/**/*"
|
||||
- "/**/{Formula,Casks}/**/*.rb"
|
||||
- "**/{Formula,Casks}/**/*.rb"
|
||||
- "Homebrew/test/**/Casks/**/*.rb"
|
||||
Enabled: false
|
||||
|
||||
# T::Sig is monkey-patched into Module
|
||||
Sorbet/RedundantExtendTSig:
|
||||
Enabled: true
|
||||
|
||||
Sorbet/StrictSigil:
|
||||
inherit_mode:
|
||||
@ -295,6 +296,14 @@ Sorbet/StrictSigil:
|
||||
Include:
|
||||
- "**/*.rbi"
|
||||
|
||||
Sorbet/TrueSigil:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- "Taps/**/*"
|
||||
- "/**/{Formula,Casks}/**/*.rb"
|
||||
- "**/{Formula,Casks}/**/*.rb"
|
||||
- "Homebrew/test/**/*.rb"
|
||||
|
||||
# Require &&/|| instead of and/or
|
||||
Style/AndOr:
|
||||
EnforcedStyle: always
|
||||
|
||||
@ -49,7 +49,6 @@ end
|
||||
gem "activesupport"
|
||||
gem "addressable"
|
||||
gem "concurrent-ruby"
|
||||
gem "mechanize"
|
||||
gem "patchelf"
|
||||
gem "plist"
|
||||
gem "rubocop-performance"
|
||||
|
||||
@ -18,12 +18,9 @@ GEM
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
concurrent-ruby (1.2.2)
|
||||
connection_pool (2.4.0)
|
||||
did_you_mean (1.6.3)
|
||||
diff-lcs (1.5.0)
|
||||
docile (1.4.0)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
ecma-re-validator (0.4.0)
|
||||
regexp_parser (~> 2.2)
|
||||
elftools (1.2.0)
|
||||
@ -31,8 +28,6 @@ GEM
|
||||
hana (1.3.7)
|
||||
highline (2.0.3)
|
||||
hpricot (0.8.6)
|
||||
http-cookie (1.0.5)
|
||||
domain_name (~> 0.5)
|
||||
i18n (1.12.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.6.3)
|
||||
@ -41,40 +36,11 @@ GEM
|
||||
hana (~> 1.3)
|
||||
regexp_parser (~> 2.0)
|
||||
uri_template (~> 0.7)
|
||||
mechanize (2.9.0)
|
||||
addressable (~> 2.8)
|
||||
domain_name (~> 0.5, >= 0.5.20190701)
|
||||
http-cookie (~> 1.0, >= 1.0.3)
|
||||
mime-types (~> 3.0)
|
||||
net-http-digest_auth (~> 1.4, >= 1.4.1)
|
||||
net-http-persistent (>= 2.5.2, < 5.0.dev)
|
||||
nokogiri (~> 1.11, >= 1.11.2)
|
||||
rubyntlm (~> 0.6, >= 0.6.3)
|
||||
webrick (~> 1.7)
|
||||
webrobots (~> 0.1.2)
|
||||
method_source (1.0.0)
|
||||
mime-types (3.4.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2023.0218.1)
|
||||
mini_portile2 (2.8.1)
|
||||
minitest (5.18.0)
|
||||
msgpack (1.7.0)
|
||||
mustache (1.1.1)
|
||||
net-http-digest_auth (1.4.1)
|
||||
net-http-persistent (4.0.2)
|
||||
connection_pool (~> 2.2)
|
||||
nokogiri (1.13.10)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.13.10-aarch64-linux)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.13.10-arm64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.13.10-x86_64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.13.10-x86_64-linux)
|
||||
racc (~> 1.4)
|
||||
parallel (1.22.1)
|
||||
parallel (1.23.0)
|
||||
parallel_tests (3.13.0)
|
||||
parallel
|
||||
parlour (8.1.0)
|
||||
@ -82,7 +48,7 @@ GEM
|
||||
parser
|
||||
rainbow (~> 3.0)
|
||||
sorbet-runtime (>= 0.5)
|
||||
parser (3.2.2.0)
|
||||
parser (3.2.2.1)
|
||||
ast (~> 2.4.1)
|
||||
patchelf (1.4.0)
|
||||
elftools (>= 1.2)
|
||||
@ -91,7 +57,6 @@ GEM
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
public_suffix (5.0.1)
|
||||
racc (1.6.2)
|
||||
rack (3.0.7)
|
||||
rainbow (3.1.1)
|
||||
rbi (0.0.14)
|
||||
@ -100,7 +65,7 @@ GEM
|
||||
sorbet-runtime (>= 0.5.9204)
|
||||
unparser
|
||||
rdiscount (2.2.7)
|
||||
regexp_parser (2.7.0)
|
||||
regexp_parser (2.8.0)
|
||||
rexml (3.2.5)
|
||||
ronn (0.7.3)
|
||||
hpricot (>= 0.8.2)
|
||||
@ -110,9 +75,9 @@ GEM
|
||||
rspec-core (~> 3.12.0)
|
||||
rspec-expectations (~> 3.12.0)
|
||||
rspec-mocks (~> 3.12.0)
|
||||
rspec-core (3.12.1)
|
||||
rspec-core (3.12.2)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-expectations (3.12.2)
|
||||
rspec-expectations (3.12.3)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-github (2.4.0)
|
||||
@ -130,7 +95,7 @@ GEM
|
||||
rspec-support (3.12.0)
|
||||
rspec_junit_formatter (0.6.0)
|
||||
rspec-core (>= 2, < 4, != 2.12.0)
|
||||
rubocop (1.50.1)
|
||||
rubocop (1.50.2)
|
||||
json (~> 2.3)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.2.0.0)
|
||||
@ -142,16 +107,16 @@ GEM
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.28.0)
|
||||
parser (>= 3.2.1.0)
|
||||
rubocop-capybara (2.17.1)
|
||||
rubocop-capybara (2.18.0)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-performance (1.17.1)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-ast (>= 0.4.0)
|
||||
rubocop-rails (2.19.0)
|
||||
rubocop-rails (2.19.1)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
rubocop-rspec (2.19.0)
|
||||
rubocop-rspec (2.20.0)
|
||||
rubocop (~> 1.33)
|
||||
rubocop-capybara (~> 2.17)
|
||||
rubocop-sorbet (0.7.0)
|
||||
@ -159,7 +124,6 @@ GEM
|
||||
ruby-macho (3.0.0)
|
||||
ruby-prof (1.4.3)
|
||||
ruby-progressbar (1.13.0)
|
||||
rubyntlm (0.6.3)
|
||||
simplecov (0.22.0)
|
||||
docile (~> 1.1)
|
||||
simplecov-html (~> 0.11)
|
||||
@ -202,17 +166,12 @@ GEM
|
||||
thor (1.2.1)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.8.2)
|
||||
unicode-display_width (2.4.2)
|
||||
unparser (0.6.4)
|
||||
diff-lcs (~> 1.3)
|
||||
parser (>= 3.1.0)
|
||||
uri_template (0.7.0)
|
||||
warning (1.3.0)
|
||||
webrick (1.8.1)
|
||||
webrobots (0.1.2)
|
||||
yard (0.9.34)
|
||||
yard-sorbet (0.6.1)
|
||||
sorbet-runtime (>= 0.5)
|
||||
@ -234,7 +193,6 @@ DEPENDENCIES
|
||||
concurrent-ruby
|
||||
did_you_mean
|
||||
json_schemer
|
||||
mechanize
|
||||
minitest
|
||||
parallel_tests
|
||||
parlour
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
#
|
||||
# @api private
|
||||
class PATH
|
||||
extend T::Sig
|
||||
|
||||
include Enumerable
|
||||
extend Forwardable
|
||||
|
||||
|
||||
@ -11,8 +11,6 @@ module Homebrew
|
||||
#
|
||||
# @api private
|
||||
module API
|
||||
extend T::Sig
|
||||
|
||||
extend Cachable
|
||||
|
||||
HOMEBREW_CACHE_API = (HOMEBREW_CACHE/"api").freeze
|
||||
|
||||
@ -8,8 +8,6 @@ module Homebrew
|
||||
# @api private
|
||||
module Analytics
|
||||
class << self
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def analytics_api_path
|
||||
"analytics"
|
||||
|
||||
@ -11,7 +11,6 @@ module Homebrew
|
||||
module Cask
|
||||
class << self
|
||||
include Cachable
|
||||
extend T::Sig
|
||||
|
||||
private :cache
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ module Homebrew
|
||||
module Formula
|
||||
class << self
|
||||
include Cachable
|
||||
extend T::Sig
|
||||
|
||||
private :cache
|
||||
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
#
|
||||
# @api private
|
||||
class BuildEnvironment
|
||||
extend T::Sig
|
||||
|
||||
sig { params(settings: Symbol).void }
|
||||
def initialize(*settings)
|
||||
@settings = Set.new(settings)
|
||||
@ -31,8 +29,6 @@ class BuildEnvironment
|
||||
|
||||
# DSL for specifying build environment settings.
|
||||
module DSL
|
||||
extend T::Sig
|
||||
|
||||
# Initialise @env for each class which may use this DSL (e.g. each formula subclass).
|
||||
# `env` may never be called, and it needs to be initialised before the class is frozen.
|
||||
def inherited(child)
|
||||
|
||||
@ -8,8 +8,6 @@ module Homebrew
|
||||
#
|
||||
# @api private
|
||||
class BundleVersion
|
||||
extend T::Sig
|
||||
|
||||
include Comparable
|
||||
|
||||
extend SystemCommand::Mixin
|
||||
|
||||
@ -8,7 +8,6 @@ require "cask/cache"
|
||||
require "cask/cask_loader"
|
||||
require "cask/cask"
|
||||
require "cask/caskroom"
|
||||
require "cask/cmd"
|
||||
require "cask/config"
|
||||
require "cask/exceptions"
|
||||
require "cask/denylist"
|
||||
|
||||
@ -9,7 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class AbstractArtifact
|
||||
extend T::Sig
|
||||
extend T::Helpers
|
||||
abstract!
|
||||
|
||||
|
||||
@ -13,8 +13,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class AbstractUninstall < AbstractArtifact
|
||||
extend T::Sig
|
||||
|
||||
ORDERED_DIRECTIVES = [
|
||||
:early_script,
|
||||
:launchctl,
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Artifact < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"Generic Artifact"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class KeyboardLayout < Moved
|
||||
extend T::Sig
|
||||
|
||||
def install_phase(**options)
|
||||
super(**options)
|
||||
delete_keyboard_layout_cache(**options)
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Mdimporter < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"Spotlight metadata importer"
|
||||
|
||||
@ -10,8 +10,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Moved < Relocated
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_description
|
||||
"#{english_name}s"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Prefpane < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"Preference Pane"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Qlplugin < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"QuickLook Plugin"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Relocated < AbstractArtifact
|
||||
extend T::Sig
|
||||
|
||||
def self.from_args(cask, *args)
|
||||
source_string, target_hash = args
|
||||
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class StageOnly < AbstractArtifact
|
||||
extend T::Sig
|
||||
|
||||
def self.from_args(cask, *args, **kwargs)
|
||||
if (args != [true] && args != ["true"]) || kwargs.present?
|
||||
raise CaskInvalidError.new(cask.token, "'stage_only' takes only a single argument: true")
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Suite < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"App Suite"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Symlinked < Relocated
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.link_type_english_name
|
||||
"Symlink"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Vst3Plugin < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"VST3 Plugin"
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class VstPlugin < Moved
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def self.english_name
|
||||
"VST Plugin"
|
||||
|
||||
@ -14,8 +14,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Audit
|
||||
extend T::Sig
|
||||
|
||||
extend Predicable
|
||||
|
||||
attr_reader :cask, :download
|
||||
@ -460,7 +458,9 @@ module Cask
|
||||
return if !signing? || download.blank? || cask.url.blank?
|
||||
|
||||
odebug "Auditing signing"
|
||||
artifacts = cask.artifacts.select { |k| k.is_a?(Artifact::Pkg) || k.is_a?(Artifact::App) }
|
||||
artifacts = cask.artifacts.select do |k|
|
||||
k.is_a?(Artifact::Pkg) || k.is_a?(Artifact::App) || k.is_a?(Artifact::Binary)
|
||||
end
|
||||
|
||||
return if artifacts.empty?
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
module Cache
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(Pathname) }
|
||||
def self.path
|
||||
@path ||= HOMEBREW_CACHE/"Cask"
|
||||
|
||||
@ -13,8 +13,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Cask
|
||||
extend T::Sig
|
||||
|
||||
extend Forwardable
|
||||
extend Predicable
|
||||
extend APIHashable
|
||||
@ -114,24 +112,6 @@ module Cask
|
||||
.reverse
|
||||
end
|
||||
|
||||
def os_versions
|
||||
# TODO: use #to_hash_with_variations instead once all casks use on_system blocks
|
||||
@os_versions ||= begin
|
||||
version_os_hash = {}
|
||||
actual_version = MacOS.full_version.to_s
|
||||
|
||||
MacOSVersions::SYMBOLS.each do |os_name, os_version|
|
||||
MacOS.full_version = os_version
|
||||
cask = CaskLoader.load(full_name)
|
||||
version_os_hash[os_name] = cask.version if cask.version != version
|
||||
end
|
||||
|
||||
version_os_hash
|
||||
ensure
|
||||
MacOS.full_version = actual_version if actual_version
|
||||
end
|
||||
end
|
||||
|
||||
def full_name
|
||||
return token if tap.nil?
|
||||
return token if tap.user == "Homebrew"
|
||||
@ -307,7 +287,6 @@ module Cask
|
||||
"url_specs" => url_specs,
|
||||
"appcast" => appcast,
|
||||
"version" => version,
|
||||
"versions" => os_versions,
|
||||
"installed" => versions.last,
|
||||
"outdated" => outdated?,
|
||||
"sha256" => sha256,
|
||||
|
||||
@ -13,7 +13,6 @@ module Cask
|
||||
extend Context
|
||||
|
||||
module ILoader
|
||||
extend T::Sig
|
||||
extend T::Helpers
|
||||
interface!
|
||||
|
||||
@ -110,8 +109,6 @@ module Cask
|
||||
|
||||
# Loads a cask from a URI.
|
||||
class FromURILoader < FromPathLoader
|
||||
extend T::Sig
|
||||
|
||||
def self.can_load?(ref)
|
||||
# Cache compiled regex
|
||||
@uri_regex ||= begin
|
||||
@ -362,8 +359,6 @@ module Cask
|
||||
|
||||
# Pseudo-loader which raises an error when trying to load the corresponding cask.
|
||||
class NullLoader < FromPathLoader
|
||||
extend T::Sig
|
||||
|
||||
def self.can_load?(*)
|
||||
true
|
||||
end
|
||||
|
||||
@ -8,8 +8,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
module Caskroom
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(Pathname) }
|
||||
def self.path
|
||||
@path ||= HOMEBREW_PREFIX/"Caskroom"
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "optparse"
|
||||
require "shellwords"
|
||||
|
||||
require "cli/parser"
|
||||
require "extend/optparse"
|
||||
|
||||
require "cask/config"
|
||||
|
||||
require "cask/cmd/abstract_command"
|
||||
require "cask/cmd/audit"
|
||||
require "cask/cmd/install"
|
||||
|
||||
module Cask
|
||||
# Implementation of the `brew cask` command-line interface.
|
||||
#
|
||||
# @api private
|
||||
class Cmd
|
||||
extend T::Sig
|
||||
|
||||
include Context
|
||||
|
||||
def self.parser(&block)
|
||||
Homebrew::CLI::Parser.new do
|
||||
instance_eval(&block) if block
|
||||
|
||||
cask_options
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1,98 +0,0 @@
|
||||
# typed: false
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "search"
|
||||
|
||||
module Cask
|
||||
class Cmd
|
||||
# Abstract superclass for all Cask implementations of commands.
|
||||
#
|
||||
# @api private
|
||||
class AbstractCommand
|
||||
extend T::Sig
|
||||
extend T::Helpers
|
||||
|
||||
OPTIONS = [
|
||||
[:switch, "--[no-]binaries", {
|
||||
description: "Disable/enable linking of helper executables (default: enabled).",
|
||||
env: :cask_opts_binaries,
|
||||
}],
|
||||
[:switch, "--require-sha", {
|
||||
description: "Require all casks to have a checksum.",
|
||||
env: :cask_opts_require_sha,
|
||||
}],
|
||||
[:switch, "--[no-]quarantine", {
|
||||
description: "Disable/enable quarantining of downloads (default: enabled).",
|
||||
env: :cask_opts_quarantine,
|
||||
}],
|
||||
].freeze
|
||||
|
||||
def self.parser(&block)
|
||||
Cmd.parser do
|
||||
instance_eval(&block) if block
|
||||
|
||||
OPTIONS.map(&:dup).each do |option|
|
||||
kwargs = option.pop
|
||||
send(*option, **kwargs)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def self.command_name
|
||||
@command_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def self.abstract?
|
||||
name.split("::").last.match?(/^Abstract[^a-z]/)
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def self.visible?
|
||||
true
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def self.help
|
||||
parser.generate_help_text
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def self.short_description
|
||||
description[/\A[^.]*\./]
|
||||
end
|
||||
|
||||
def self.run(*args)
|
||||
new(*args).run
|
||||
end
|
||||
|
||||
attr_reader :args
|
||||
|
||||
def initialize(*args)
|
||||
@args = self.class.parser.parse(args)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def casks(alternative: -> { [] })
|
||||
return @casks if defined?(@casks)
|
||||
|
||||
@casks = args.named.empty? ? alternative.call : args.named.to_casks
|
||||
rescue CaskUnavailableError => e
|
||||
reason = [e.reason, *suggestion_message(e.token)].join(" ")
|
||||
raise e.class.new(e.token, reason)
|
||||
end
|
||||
|
||||
def suggestion_message(cask_token)
|
||||
matches = Homebrew::Search.search_casks(cask_token)
|
||||
|
||||
if matches.one?
|
||||
"Did you mean '#{matches.first}'?"
|
||||
elsif !matches.empty?
|
||||
"Did you mean one of these?\n#{Formatter.columns(matches.take(20))}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1,110 +0,0 @@
|
||||
# typed: false
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "utils/github/actions"
|
||||
|
||||
module Cask
|
||||
class Cmd
|
||||
# Cask implementation of the `brew audit` command.
|
||||
#
|
||||
# @api private
|
||||
class Audit < AbstractCommand
|
||||
extend T::Sig
|
||||
|
||||
def self.parser
|
||||
super do
|
||||
switch "--[no-]download",
|
||||
description: "Audit the downloaded file"
|
||||
switch "--[no-]appcast",
|
||||
description: "Audit the appcast",
|
||||
replacement: false
|
||||
switch "--[no-]token-conflicts",
|
||||
description: "Audit for token conflicts"
|
||||
switch "--[no-]signing",
|
||||
description: "Audit for signed apps, which is required on ARM"
|
||||
switch "--[no-]strict",
|
||||
description: "Run additional, stricter style checks"
|
||||
switch "--[no-]online",
|
||||
description: "Run additional, slower style checks that require a network connection"
|
||||
switch "--new-cask",
|
||||
description: "Run various additional style checks to determine if a new cask is eligible " \
|
||||
"for Homebrew. This should be used when creating new casks and implies " \
|
||||
"`--strict` and `--online`"
|
||||
end
|
||||
end
|
||||
|
||||
sig { void }
|
||||
def run
|
||||
casks = args.named.flat_map do |name|
|
||||
next name if File.exist?(name)
|
||||
next Tap.fetch(name).cask_files if name.count("/") == 1
|
||||
|
||||
name
|
||||
end
|
||||
casks = casks.map { |c| CaskLoader.load(c, config: Config.from_args(args)) }
|
||||
any_named_args = casks.any?
|
||||
casks = Cask.to_a if casks.empty?
|
||||
|
||||
results = self.class.audit_casks(
|
||||
*casks,
|
||||
download: args.download?,
|
||||
online: args.online?,
|
||||
strict: args.strict?,
|
||||
signing: args.signing?,
|
||||
new_cask: args.new_cask?,
|
||||
token_conflicts: args.token_conflicts?,
|
||||
quarantine: args.quarantine?,
|
||||
any_named_args: any_named_args,
|
||||
language: args.language,
|
||||
only: [],
|
||||
except: [],
|
||||
)
|
||||
|
||||
failed_casks = results.reject { |_, result| result[:errors].empty? }.map(&:first)
|
||||
return if failed_casks.empty?
|
||||
|
||||
raise CaskError, "audit failed for casks: #{failed_casks.join(" ")}"
|
||||
end
|
||||
|
||||
def self.audit_casks(
|
||||
*casks,
|
||||
download:,
|
||||
online:,
|
||||
strict:,
|
||||
signing:,
|
||||
new_cask:,
|
||||
token_conflicts:,
|
||||
quarantine:,
|
||||
any_named_args:,
|
||||
language:,
|
||||
only:,
|
||||
except:
|
||||
)
|
||||
options = {
|
||||
audit_download: download,
|
||||
audit_online: online,
|
||||
audit_strict: strict,
|
||||
audit_signing: signing,
|
||||
audit_new_cask: new_cask,
|
||||
audit_token_conflicts: token_conflicts,
|
||||
quarantine: quarantine,
|
||||
language: language,
|
||||
any_named_args: any_named_args,
|
||||
only: only,
|
||||
except: except,
|
||||
}.compact
|
||||
|
||||
options[:quarantine] = true if options[:quarantine].nil?
|
||||
|
||||
Homebrew.auditing = true
|
||||
|
||||
require "cask/auditor"
|
||||
|
||||
casks.to_h do |cask|
|
||||
odebug "Auditing Cask #{cask}"
|
||||
[cask.sourcefile_path, { errors: Auditor.audit(cask, **options), warnings: [] }]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1,116 +0,0 @@
|
||||
# typed: false
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cask_dependent"
|
||||
|
||||
module Cask
|
||||
class Cmd
|
||||
# Cask implementation of the `brew install` command.
|
||||
#
|
||||
# @api private
|
||||
class Install < AbstractCommand
|
||||
extend T::Sig
|
||||
|
||||
OPTIONS = [
|
||||
[:switch, "--adopt", {
|
||||
description: "Adopt existing artifacts in the destination that are identical to those being installed. " \
|
||||
"Cannot be combined with --force.",
|
||||
}],
|
||||
[:switch, "--skip-cask-deps", {
|
||||
description: "Skip installing cask dependencies.",
|
||||
}],
|
||||
[:switch, "--zap", {
|
||||
description: "For use with `brew reinstall --cask`. Remove all files associated with a cask. " \
|
||||
"*May remove files which are shared between applications.*",
|
||||
}],
|
||||
].freeze
|
||||
|
||||
def self.parser(&block)
|
||||
super do
|
||||
switch "--force",
|
||||
description: "Force overwriting existing files."
|
||||
|
||||
OPTIONS.map(&:dup).each do |option|
|
||||
kwargs = option.pop
|
||||
send(*option, **kwargs)
|
||||
end
|
||||
|
||||
instance_eval(&block) if block
|
||||
end
|
||||
end
|
||||
|
||||
sig { void }
|
||||
def run
|
||||
self.class.install_casks(
|
||||
*casks,
|
||||
binaries: args.binaries?,
|
||||
verbose: args.verbose?,
|
||||
force: args.force?,
|
||||
adopt: args.adopt?,
|
||||
skip_cask_deps: args.skip_cask_deps?,
|
||||
require_sha: args.require_sha?,
|
||||
quarantine: args.quarantine?,
|
||||
quiet: args.quiet?,
|
||||
zap: args.zap?,
|
||||
)
|
||||
end
|
||||
|
||||
def self.install_casks(
|
||||
*casks,
|
||||
verbose: nil,
|
||||
force: nil,
|
||||
adopt: nil,
|
||||
binaries: nil,
|
||||
skip_cask_deps: nil,
|
||||
require_sha: nil,
|
||||
quarantine: nil,
|
||||
quiet: nil,
|
||||
zap: nil,
|
||||
dry_run: nil
|
||||
)
|
||||
|
||||
options = {
|
||||
verbose: verbose,
|
||||
force: force,
|
||||
adopt: adopt,
|
||||
binaries: binaries,
|
||||
skip_cask_deps: skip_cask_deps,
|
||||
require_sha: require_sha,
|
||||
quarantine: quarantine,
|
||||
quiet: quiet,
|
||||
zap: zap,
|
||||
}.compact
|
||||
|
||||
options[:quarantine] = true if options[:quarantine].nil?
|
||||
|
||||
if dry_run
|
||||
if (casks_to_install = casks.reject(&:installed?).presence)
|
||||
ohai "Would install #{::Utils.pluralize("cask", casks_to_install.count, include_count: true)}:"
|
||||
puts casks_to_install.map(&:full_name).join(" ")
|
||||
end
|
||||
casks.each do |cask|
|
||||
dep_names = CaskDependent.new(cask)
|
||||
.runtime_dependencies
|
||||
.reject(&:installed?)
|
||||
.map(&:to_formula)
|
||||
.map(&:name)
|
||||
next if dep_names.blank?
|
||||
|
||||
ohai "Would install #{::Utils.pluralize("dependenc", dep_names.count, plural: "ies", singular: "y",
|
||||
include_count: true)} for #{cask.full_name}:"
|
||||
puts dep_names.join(" ")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
require "cask/installer"
|
||||
|
||||
casks.each do |cask|
|
||||
Installer.new(cask, **options).install
|
||||
rescue CaskAlreadyInstalledError => e
|
||||
opoo e.message
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -11,8 +11,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Config
|
||||
extend T::Sig
|
||||
|
||||
DEFAULT_DIRS = {
|
||||
appdir: "/Applications",
|
||||
keyboard_layoutdir: "/Library/Keyboard Layouts",
|
||||
|
||||
@ -6,8 +6,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
module Denylist
|
||||
extend T::Sig
|
||||
|
||||
sig { params(name: String).returns(T.nilable(String)) }
|
||||
def self.reason(name)
|
||||
case name
|
||||
|
||||
@ -11,7 +11,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class DependsOn < SimpleDelegator
|
||||
extend T::Sig
|
||||
VALID_KEYS = Set.new([
|
||||
:formula,
|
||||
:cask,
|
||||
|
||||
@ -7,8 +7,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Version < ::String
|
||||
extend T::Sig
|
||||
|
||||
DIVIDERS = {
|
||||
"." => :dots,
|
||||
"-" => :hyphens,
|
||||
|
||||
@ -11,8 +11,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class MultipleCaskErrors < CaskError
|
||||
extend T::Sig
|
||||
|
||||
def initialize(errors)
|
||||
super()
|
||||
|
||||
@ -32,8 +30,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class AbstractCaskErrorWithToken < CaskError
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
attr_reader :token
|
||||
|
||||
@ -52,8 +48,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskNotInstalledError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"Cask '#{token}' is not installed."
|
||||
@ -64,8 +58,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskConflictError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
attr_reader :conflicting_cask
|
||||
|
||||
def initialize(token, conflicting_cask)
|
||||
@ -83,8 +75,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskUnavailableError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"Cask '#{token}' is unavailable#{reason.empty? ? "." : ": #{reason}"}"
|
||||
@ -95,8 +85,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskUnreadableError < CaskUnavailableError
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"Cask '#{token}' is unreadable#{reason.empty? ? "." : ": #{reason}"}"
|
||||
@ -107,8 +95,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class TapCaskUnavailableError < CaskUnavailableError
|
||||
extend T::Sig
|
||||
|
||||
attr_reader :tap
|
||||
|
||||
def initialize(tap, token)
|
||||
@ -128,8 +114,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class TapCaskAmbiguityError < CaskError
|
||||
extend T::Sig
|
||||
|
||||
def initialize(ref, loaders)
|
||||
super <<~EOS
|
||||
Cask #{ref} exists in multiple taps:
|
||||
@ -142,8 +126,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskAlreadyCreatedError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
%Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew edit --cask #{token}")} to edit it.)
|
||||
@ -154,8 +136,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskAlreadyInstalledError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
<<~EOS
|
||||
@ -171,8 +151,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskCyclicDependencyError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"Cask '#{token}' includes cyclic dependencies on other Casks#{reason.empty? ? "." : ": #{reason}"}"
|
||||
@ -183,8 +161,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskSelfReferencingDependencyError < CaskCyclicDependencyError
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"Cask '#{token}' depends on itself."
|
||||
@ -195,8 +171,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskUnspecifiedError < CaskError
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"This command requires a Cask token."
|
||||
@ -207,8 +181,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskInvalidError < AbstractCaskErrorWithToken
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
"Cask '#{token}' definition is invalid#{reason.empty? ? "." : ": #{reason}"}"
|
||||
@ -228,8 +200,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskQuarantineError < CaskError
|
||||
extend T::Sig
|
||||
|
||||
attr_reader :path, :reason
|
||||
|
||||
def initialize(path, reason)
|
||||
@ -257,8 +227,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskQuarantinePropagationError < CaskQuarantineError
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
s = +"Failed to quarantine one or more files within #{path}."
|
||||
@ -277,8 +245,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class CaskQuarantineReleaseError < CaskQuarantineError
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(String) }
|
||||
def to_s
|
||||
s = +"Failed to release #{path} from quarantine."
|
||||
|
||||
@ -16,8 +16,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Installer
|
||||
extend T::Sig
|
||||
|
||||
extend Predicable
|
||||
|
||||
def initialize(cask, command: SystemCommand, force: false, adopt: false,
|
||||
|
||||
@ -8,8 +8,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
class Pkg
|
||||
extend T::Sig
|
||||
|
||||
sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) }
|
||||
def self.all_matching(regexp, command)
|
||||
command.run("/usr/sbin/pkgutil", args: ["--pkgs=#{regexp}"]).stdout.split("\n").map do |package_id|
|
||||
|
||||
@ -9,8 +9,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
module Quarantine
|
||||
extend T::Sig
|
||||
|
||||
QUARANTINE_ATTRIBUTE = "com.apple.quarantine"
|
||||
|
||||
QUARANTINE_SCRIPT = (HOMEBREW_LIBRARY_PATH/"cask/utils/quarantine.swift").freeze
|
||||
|
||||
@ -8,8 +8,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
module Staged
|
||||
extend T::Sig
|
||||
|
||||
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
|
||||
# rubocop:disable Style/MutableConstant
|
||||
Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) }
|
||||
|
||||
@ -7,8 +7,6 @@ require "cask/config"
|
||||
module Cask
|
||||
# @api private
|
||||
class Upgrade
|
||||
extend T::Sig
|
||||
|
||||
sig {
|
||||
params(
|
||||
casks: Cask,
|
||||
|
||||
@ -5,12 +5,8 @@
|
||||
#
|
||||
# @api private
|
||||
class URL < Delegator
|
||||
extend T::Sig
|
||||
|
||||
# @api private
|
||||
class DSL
|
||||
extend T::Sig
|
||||
|
||||
attr_reader :uri, :specs,
|
||||
:verified, :using,
|
||||
:tag, :branch, :revisions, :revision,
|
||||
@ -79,12 +75,8 @@ class URL < Delegator
|
||||
|
||||
# @api private
|
||||
class BlockDSL
|
||||
extend T::Sig
|
||||
|
||||
# To access URL associated with page contents.
|
||||
module PageWithURL
|
||||
extend T::Sig
|
||||
|
||||
# @api public
|
||||
sig { returns(URI::Generic) }
|
||||
attr_accessor :url
|
||||
|
||||
@ -2,9 +2,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "utils/user"
|
||||
require "yaml"
|
||||
require "open3"
|
||||
require "stringio"
|
||||
|
||||
BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs"
|
||||
|
||||
@ -13,8 +11,6 @@ module Cask
|
||||
#
|
||||
# @api private
|
||||
module Utils
|
||||
extend T::Sig
|
||||
|
||||
def self.gain_permissions_remove(path, command: SystemCommand)
|
||||
if path.respond_to?(:rmtree) && path.exist?
|
||||
gain_permissions(path, ["-R"], command) do |p|
|
||||
|
||||
@ -16,8 +16,6 @@ module Homebrew
|
||||
private_constant :CLEANUP_DEFAULT_DAYS
|
||||
|
||||
class << self
|
||||
extend T::Sig
|
||||
|
||||
sig { params(pathname: Pathname).returns(T::Boolean) }
|
||||
def incomplete?(pathname)
|
||||
pathname.extname.end_with?(".incomplete")
|
||||
|
||||
@ -6,8 +6,6 @@ require "ostruct"
|
||||
module Homebrew
|
||||
module CLI
|
||||
class Args < OpenStruct
|
||||
extend T::Sig
|
||||
|
||||
attr_reader :options_only, :flags_only
|
||||
|
||||
# undefine tap to allow --tap argument
|
||||
|
||||
@ -11,8 +11,6 @@ module Homebrew
|
||||
#
|
||||
# @api private
|
||||
class NamedArgs < Array
|
||||
extend T::Sig
|
||||
|
||||
def initialize(*args, parent: Args.new, override_spec: nil, force_bottle: false, flags: [], cask_options: false)
|
||||
require "cask/cask"
|
||||
require "cask/cask_loader"
|
||||
|
||||
@ -15,8 +15,6 @@ HIDDEN_DESC_PLACEHOLDER = "@@HIDDEN@@"
|
||||
module Homebrew
|
||||
module CLI
|
||||
class Parser
|
||||
extend T::Sig
|
||||
|
||||
attr_reader :processed_options, :hide_from_man_page, :named_args_type
|
||||
|
||||
def self.from_cmd_path(cmd_path)
|
||||
@ -680,8 +678,6 @@ module Homebrew
|
||||
end
|
||||
|
||||
class MaxNamedArgumentsError < UsageError
|
||||
extend T::Sig
|
||||
|
||||
sig { params(maximum: Integer, types: T::Array[Symbol]).void }
|
||||
def initialize(maximum, types: [])
|
||||
super case maximum
|
||||
@ -698,8 +694,6 @@ module Homebrew
|
||||
end
|
||||
|
||||
class MinNamedArgumentsError < UsageError
|
||||
extend T::Sig
|
||||
|
||||
sig { params(minimum: Integer, types: T::Array[Symbol]).void }
|
||||
def initialize(minimum, types: [])
|
||||
types << :named if types.empty?
|
||||
@ -711,8 +705,6 @@ module Homebrew
|
||||
end
|
||||
|
||||
class NumberOfNamedArgumentsError < UsageError
|
||||
extend T::Sig
|
||||
|
||||
sig { params(minimum: Integer, types: T::Array[Symbol]).void }
|
||||
def initialize(minimum, types: [])
|
||||
types << :named if types.empty?
|
||||
|
||||
@ -6,8 +6,6 @@ require "cli/parser"
|
||||
require "cask/download"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
extend Fetch
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -7,8 +7,6 @@ require "utils/shell"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def self.__prefix_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -5,8 +5,6 @@ require "cleanup"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -5,8 +5,6 @@ require "cli/parser"
|
||||
require "completions"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -5,8 +5,6 @@ require "system_config"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -7,8 +7,6 @@ require "cask/caskroom"
|
||||
require "dependencies_helpers"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
extend DependenciesHelpers
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -7,8 +7,6 @@ require "description_cache_store"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -6,8 +6,6 @@ require "cli/parser"
|
||||
require "cask/caskroom"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def self.doctor_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
|
||||
@ -7,8 +7,6 @@ require "cli/parser"
|
||||
require "cask/download"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
extend Fetch
|
||||
|
||||
FETCH_MAX_TRIES = 5
|
||||
|
||||
@ -9,8 +9,6 @@ require "socket"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
extend Install
|
||||
|
||||
module_function
|
||||
|
||||
@ -5,8 +5,6 @@ require "cli/parser"
|
||||
require "formula"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -14,8 +14,6 @@ require "deprecate_disable"
|
||||
require "api"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
VALID_DAYS = %w[30 90 365].freeze
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cask/config"
|
||||
require "cask/cmd"
|
||||
require "cask/cmd/install"
|
||||
require "cask/installer"
|
||||
require "cask_dependent"
|
||||
require "missing_formula"
|
||||
require "formula_installer"
|
||||
require "development_tools"
|
||||
@ -13,12 +13,8 @@ require "cli/parser"
|
||||
require "upgrade"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def install_args
|
||||
def self.install_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
description <<~EOS
|
||||
Install a <formula> or <cask>. Additional options specific to a <formula> may be
|
||||
@ -129,8 +125,29 @@ module Homebrew
|
||||
formula_options
|
||||
[
|
||||
[:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }],
|
||||
*Cask::Cmd::AbstractCommand::OPTIONS.map(&:dup),
|
||||
*Cask::Cmd::Install::OPTIONS.map(&:dup),
|
||||
[:switch, "--[no-]binaries", {
|
||||
description: "Disable/enable linking of helper executables (default: enabled).",
|
||||
env: :cask_opts_binaries,
|
||||
}],
|
||||
[:switch, "--require-sha", {
|
||||
description: "Require all casks to have a checksum.",
|
||||
env: :cask_opts_require_sha,
|
||||
}],
|
||||
[:switch, "--[no-]quarantine", {
|
||||
description: "Disable/enable quarantining of downloads (default: enabled).",
|
||||
env: :cask_opts_quarantine,
|
||||
}],
|
||||
[:switch, "--adopt", {
|
||||
description: "Adopt existing artifacts in the destination that are identical to those being installed. " \
|
||||
"Cannot be combined with --force.",
|
||||
}],
|
||||
[:switch, "--skip-cask-deps", {
|
||||
description: "Skip installing cask dependencies.",
|
||||
}],
|
||||
[:switch, "--zap", {
|
||||
description: "For use with `brew reinstall --cask`. Remove all files associated with a cask. " \
|
||||
"*May remove files which are shared between applications.*",
|
||||
}],
|
||||
].each do |args|
|
||||
options = args.pop
|
||||
send(*args, **options)
|
||||
@ -146,7 +163,7 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
def install
|
||||
def self.install
|
||||
args = install_args.parse
|
||||
|
||||
if args.env.present?
|
||||
@ -178,15 +195,38 @@ module Homebrew
|
||||
begin
|
||||
formulae, casks = args.named.to_formulae_and_casks
|
||||
.partition { |formula_or_cask| formula_or_cask.is_a?(Formula) }
|
||||
rescue FormulaOrCaskUnavailableError, Cask::CaskUnavailableError => e
|
||||
rescue FormulaOrCaskUnavailableError, Cask::CaskUnavailableError
|
||||
retry if Tap.install_default_cask_tap_if_necessary(force: args.cask?)
|
||||
|
||||
raise e
|
||||
raise
|
||||
end
|
||||
|
||||
if casks.any?
|
||||
Cask::Cmd::Install.install_casks(
|
||||
*casks,
|
||||
|
||||
if args.dry_run?
|
||||
if (casks_to_install = casks.reject(&:installed?).presence)
|
||||
ohai "Would install #{::Utils.pluralize("cask", casks_to_install.count, include_count: true)}:"
|
||||
puts casks_to_install.map(&:full_name).join(" ")
|
||||
end
|
||||
casks.each do |cask|
|
||||
dep_names = CaskDependent.new(cask)
|
||||
.runtime_dependencies
|
||||
.reject(&:installed?)
|
||||
.map(&:to_formula)
|
||||
.map(&:name)
|
||||
next if dep_names.blank?
|
||||
|
||||
ohai "Would install #{::Utils.pluralize("dependenc", dep_names.count, plural: "ies", singular: "y",
|
||||
include_count: true)} for #{cask.full_name}:"
|
||||
puts dep_names.join(" ")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
require "cask/installer"
|
||||
|
||||
casks.each do |cask|
|
||||
Cask::Installer.new(cask,
|
||||
binaries: args.binaries?,
|
||||
verbose: args.verbose?,
|
||||
force: args.force?,
|
||||
@ -194,9 +234,10 @@ module Homebrew
|
||||
require_sha: args.require_sha?,
|
||||
skip_cask_deps: args.skip_cask_deps?,
|
||||
quarantine: args.quarantine?,
|
||||
quiet: args.quiet?,
|
||||
dry_run: args.dry_run?,
|
||||
)
|
||||
quiet: args.quiet?).install
|
||||
rescue Cask::CaskAlreadyInstalledError => e
|
||||
opoo e.message
|
||||
end
|
||||
end
|
||||
|
||||
# if the user's flags will prevent bottle only-installations when no
|
||||
|
||||
@ -5,8 +5,6 @@ require "formula"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -6,8 +6,6 @@ require "cli/parser"
|
||||
require "unlink"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -7,8 +7,6 @@ require "cli/parser"
|
||||
require "cask/list"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def self.log_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
|
||||
@ -5,8 +5,6 @@ require "migrator"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -7,8 +7,6 @@ require "diagnostic"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -5,8 +5,6 @@ require "formula"
|
||||
require "options"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,13 +4,10 @@
|
||||
require "formula"
|
||||
require "keg"
|
||||
require "cli/parser"
|
||||
require "cask/cmd"
|
||||
require "cask/caskroom"
|
||||
require "api"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def self.outdated_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
|
||||
@ -5,8 +5,6 @@ require "formula"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -6,8 +6,6 @@ require "formula_installer"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -6,8 +6,6 @@ require "cli/parser"
|
||||
require "env_config"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -8,7 +8,6 @@ require "install"
|
||||
require "reinstall"
|
||||
require "cli/parser"
|
||||
require "cleanup"
|
||||
require "cask/cmd"
|
||||
require "cask/utils"
|
||||
require "cask/macos"
|
||||
require "cask/reinstall"
|
||||
@ -16,12 +15,8 @@ require "upgrade"
|
||||
require "api"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def reinstall_args
|
||||
def self.reinstall_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
description <<~EOS
|
||||
Uninstall and then reinstall a <formula> or <cask> using the same options it was
|
||||
@ -77,8 +72,29 @@ module Homebrew
|
||||
formula_options
|
||||
[
|
||||
[:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }],
|
||||
*Cask::Cmd::AbstractCommand::OPTIONS.map(&:dup),
|
||||
*Cask::Cmd::Install::OPTIONS.map(&:dup),
|
||||
[:switch, "--[no-]binaries", {
|
||||
description: "Disable/enable linking of helper executables (default: enabled).",
|
||||
env: :cask_opts_binaries,
|
||||
}],
|
||||
[:switch, "--require-sha", {
|
||||
description: "Require all casks to have a checksum.",
|
||||
env: :cask_opts_require_sha,
|
||||
}],
|
||||
[:switch, "--[no-]quarantine", {
|
||||
description: "Disable/enable quarantining of downloads (default: enabled).",
|
||||
env: :cask_opts_quarantine,
|
||||
}],
|
||||
[:switch, "--adopt", {
|
||||
description: "Adopt existing artifacts in the destination that are identical to those being installed. " \
|
||||
"Cannot be combined with --force.",
|
||||
}],
|
||||
[:switch, "--skip-cask-deps", {
|
||||
description: "Skip installing cask dependencies.",
|
||||
}],
|
||||
[:switch, "--zap", {
|
||||
description: "For use with `brew reinstall --cask`. Remove all files associated with a cask. " \
|
||||
"*May remove files which are shared between applications.*",
|
||||
}],
|
||||
].each do |args|
|
||||
options = args.pop
|
||||
send(*args, **options)
|
||||
@ -92,7 +108,7 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
def reinstall
|
||||
def self.reinstall
|
||||
args = reinstall_args.parse
|
||||
|
||||
formulae, casks = args.named.to_formulae_and_casks(method: :resolve)
|
||||
|
||||
@ -8,8 +8,6 @@ require "cli/parser"
|
||||
require "search"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
PACKAGE_MANAGERS = {
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -13,8 +13,6 @@ require "cask/uninstall"
|
||||
require "uninstall"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -5,8 +5,6 @@ require "cli/parser"
|
||||
require "unlink"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -5,8 +5,6 @@ require "formula"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
|
||||
@ -11,8 +11,6 @@ require "settings"
|
||||
require "linuxbrew-core-migration"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
def auto_update_header(args:)
|
||||
@ -607,8 +605,6 @@ class Reporter
|
||||
end
|
||||
|
||||
class ReporterHub
|
||||
extend T::Sig
|
||||
|
||||
extend Forwardable
|
||||
|
||||
attr_reader :reporters
|
||||
|
||||
@ -5,15 +5,12 @@ require "cli/parser"
|
||||
require "formula_installer"
|
||||
require "install"
|
||||
require "upgrade"
|
||||
require "cask/cmd"
|
||||
require "cask/utils"
|
||||
require "cask/upgrade"
|
||||
require "cask/macos"
|
||||
require "api"
|
||||
|
||||
module Homebrew
|
||||
extend T::Sig
|
||||
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
@ -100,7 +97,18 @@ module Homebrew
|
||||
[:switch, "--greedy-auto-updates", {
|
||||
description: "Also include casks with `auto_updates true`.",
|
||||
}],
|
||||
*Cask::Cmd::AbstractCommand::OPTIONS.map(&:dup),
|
||||
[:switch, "--[no-]binaries", {
|
||||
description: "Disable/enable linking of helper executables (default: enabled).",
|
||||
env: :cask_opts_binaries,
|
||||
}],
|
||||
[:switch, "--require-sha", {
|
||||
description: "Require all casks to have a checksum.",
|
||||
env: :cask_opts_require_sha,
|
||||
}],
|
||||
[:switch, "--[no-]quarantine", {
|
||||
description: "Disable/enable quarantining of downloads (default: enabled).",
|
||||
env: :cask_opts_quarantine,
|
||||
}],
|
||||
].each do |args|
|
||||
options = args.pop
|
||||
send(*args, **options)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user