diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 4ae8fc8639..5225a46b6e 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -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. diff --git a/.github/workflows/autogenerated-files.yml b/.github/workflows/autogenerated-files.yml index 3d483e4d29..29468440d2 100644 --- a/.github/workflows/autogenerated-files.yml +++ b/.github/workflows/autogenerated-files.yml @@ -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 }} diff --git a/.github/workflows/build-pkg.yml b/.github/workflows/build-pkg.yml index 1902420674..ccc5ca24f1 100644 --- a/.github/workflows/build-pkg.yml +++ b/.github/workflows/build-pkg.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: macos-12 + runs-on: macos-13 env: IDENTIFIER: sh.brew.Homebrew TMP_PATH: /tmp/brew diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml index 68f13c2b1e..c6fa0db8be 100644 --- a/.github/workflows/sorbet.yml +++ b/.github/workflows/sorbet.yml @@ -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 diff --git a/.github/workflows/sponsors-maintainers-man-completions.yml b/.github/workflows/sponsors-maintainers-man-completions.yml index ff56c85161..efa52ece07 100644 --- a/.github/workflows/sponsors-maintainers-man-completions.yml +++ b/.github/workflows/sponsors-maintainers-man-completions.yml @@ -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 }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index be64fdea5e..4ab6e45c00 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.github/workflows/vendor-gems.yml b/.github/workflows/vendor-gems.yml index 40b61d299f..4f7b31d13f 100644 --- a/.github/workflows/vendor-gems.yml +++ b/.github/workflows/vendor-gems.yml @@ -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 diff --git a/.gitignore b/.gitignore index 1d380aeb76..79667c0d53 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Dockerfile b/Dockerfile index 5f64a7014b..f692f7e3ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/* \ diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 312c43ad51..7cb07e6f70 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -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 diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index 99200a97c7..6a020b3aff 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -49,7 +49,6 @@ end gem "activesupport" gem "addressable" gem "concurrent-ruby" -gem "mechanize" gem "patchelf" gem "plist" gem "rubocop-performance" diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index f0a5f0b176..33a7f1c8b3 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -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 diff --git a/Library/Homebrew/PATH.rb b/Library/Homebrew/PATH.rb index 0c949555f9..5730b2a11f 100644 --- a/Library/Homebrew/PATH.rb +++ b/Library/Homebrew/PATH.rb @@ -5,8 +5,6 @@ # # @api private class PATH - extend T::Sig - include Enumerable extend Forwardable diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index 4b154f4432..ebdb3d77df 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -11,8 +11,6 @@ module Homebrew # # @api private module API - extend T::Sig - extend Cachable HOMEBREW_CACHE_API = (HOMEBREW_CACHE/"api").freeze diff --git a/Library/Homebrew/api/analytics.rb b/Library/Homebrew/api/analytics.rb index 9609eb37c1..fb5ddd7b44 100644 --- a/Library/Homebrew/api/analytics.rb +++ b/Library/Homebrew/api/analytics.rb @@ -8,8 +8,6 @@ module Homebrew # @api private module Analytics class << self - extend T::Sig - sig { returns(String) } def analytics_api_path "analytics" diff --git a/Library/Homebrew/api/cask.rb b/Library/Homebrew/api/cask.rb index 32be78af09..50c22b981d 100644 --- a/Library/Homebrew/api/cask.rb +++ b/Library/Homebrew/api/cask.rb @@ -11,7 +11,6 @@ module Homebrew module Cask class << self include Cachable - extend T::Sig private :cache diff --git a/Library/Homebrew/api/formula.rb b/Library/Homebrew/api/formula.rb index a93fa4043d..adf2226ca9 100644 --- a/Library/Homebrew/api/formula.rb +++ b/Library/Homebrew/api/formula.rb @@ -11,7 +11,6 @@ module Homebrew module Formula class << self include Cachable - extend T::Sig private :cache diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index d1b7f8b861..e8427cb5c0 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -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) diff --git a/Library/Homebrew/bundle_version.rb b/Library/Homebrew/bundle_version.rb index 92c522659a..b13cbf28ea 100644 --- a/Library/Homebrew/bundle_version.rb +++ b/Library/Homebrew/bundle_version.rb @@ -8,8 +8,6 @@ module Homebrew # # @api private class BundleVersion - extend T::Sig - include Comparable extend SystemCommand::Mixin diff --git a/Library/Homebrew/cask.rb b/Library/Homebrew/cask.rb index 2f9df69d02..d3e6d8ebae 100644 --- a/Library/Homebrew/cask.rb +++ b/Library/Homebrew/cask.rb @@ -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" diff --git a/Library/Homebrew/cask/artifact/abstract_artifact.rb b/Library/Homebrew/cask/artifact/abstract_artifact.rb index 752dabfa57..b5f120cc47 100644 --- a/Library/Homebrew/cask/artifact/abstract_artifact.rb +++ b/Library/Homebrew/cask/artifact/abstract_artifact.rb @@ -9,7 +9,6 @@ module Cask # # @api private class AbstractArtifact - extend T::Sig extend T::Helpers abstract! diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index f95a828771..2b1df3e80f 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -13,8 +13,6 @@ module Cask # # @api private class AbstractUninstall < AbstractArtifact - extend T::Sig - ORDERED_DIRECTIVES = [ :early_script, :launchctl, diff --git a/Library/Homebrew/cask/artifact/artifact.rb b/Library/Homebrew/cask/artifact/artifact.rb index a3b25a5972..4ab625dfdf 100644 --- a/Library/Homebrew/cask/artifact/artifact.rb +++ b/Library/Homebrew/cask/artifact/artifact.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Artifact < Moved - extend T::Sig - sig { returns(String) } def self.english_name "Generic Artifact" diff --git a/Library/Homebrew/cask/artifact/keyboard_layout.rb b/Library/Homebrew/cask/artifact/keyboard_layout.rb index cd853e921f..c7d549be00 100644 --- a/Library/Homebrew/cask/artifact/keyboard_layout.rb +++ b/Library/Homebrew/cask/artifact/keyboard_layout.rb @@ -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) diff --git a/Library/Homebrew/cask/artifact/mdimporter.rb b/Library/Homebrew/cask/artifact/mdimporter.rb index d85cf27438..27419fa7c2 100644 --- a/Library/Homebrew/cask/artifact/mdimporter.rb +++ b/Library/Homebrew/cask/artifact/mdimporter.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Mdimporter < Moved - extend T::Sig - sig { returns(String) } def self.english_name "Spotlight metadata importer" diff --git a/Library/Homebrew/cask/artifact/moved.rb b/Library/Homebrew/cask/artifact/moved.rb index cefa8a029f..41bf8a5944 100644 --- a/Library/Homebrew/cask/artifact/moved.rb +++ b/Library/Homebrew/cask/artifact/moved.rb @@ -10,8 +10,6 @@ module Cask # # @api private class Moved < Relocated - extend T::Sig - sig { returns(String) } def self.english_description "#{english_name}s" diff --git a/Library/Homebrew/cask/artifact/prefpane.rb b/Library/Homebrew/cask/artifact/prefpane.rb index a2a1057b34..04483f3170 100644 --- a/Library/Homebrew/cask/artifact/prefpane.rb +++ b/Library/Homebrew/cask/artifact/prefpane.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Prefpane < Moved - extend T::Sig - sig { returns(String) } def self.english_name "Preference Pane" diff --git a/Library/Homebrew/cask/artifact/qlplugin.rb b/Library/Homebrew/cask/artifact/qlplugin.rb index e5766f4ee3..ed3994aa28 100644 --- a/Library/Homebrew/cask/artifact/qlplugin.rb +++ b/Library/Homebrew/cask/artifact/qlplugin.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Qlplugin < Moved - extend T::Sig - sig { returns(String) } def self.english_name "QuickLook Plugin" diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 80d2e727b1..0642db0e2b 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -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 diff --git a/Library/Homebrew/cask/artifact/stage_only.rb b/Library/Homebrew/cask/artifact/stage_only.rb index ced0f5eed8..41f23e0c11 100644 --- a/Library/Homebrew/cask/artifact/stage_only.rb +++ b/Library/Homebrew/cask/artifact/stage_only.rb @@ -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") diff --git a/Library/Homebrew/cask/artifact/suite.rb b/Library/Homebrew/cask/artifact/suite.rb index 5eb8462640..6d7a2e3ccf 100644 --- a/Library/Homebrew/cask/artifact/suite.rb +++ b/Library/Homebrew/cask/artifact/suite.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Suite < Moved - extend T::Sig - sig { returns(String) } def self.english_name "App Suite" diff --git a/Library/Homebrew/cask/artifact/symlinked.rb b/Library/Homebrew/cask/artifact/symlinked.rb index 3cef93a179..3d920c1ede 100644 --- a/Library/Homebrew/cask/artifact/symlinked.rb +++ b/Library/Homebrew/cask/artifact/symlinked.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Symlinked < Relocated - extend T::Sig - sig { returns(String) } def self.link_type_english_name "Symlink" diff --git a/Library/Homebrew/cask/artifact/vst3_plugin.rb b/Library/Homebrew/cask/artifact/vst3_plugin.rb index 3ffe75f82f..313c09cb95 100644 --- a/Library/Homebrew/cask/artifact/vst3_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst3_plugin.rb @@ -9,8 +9,6 @@ module Cask # # @api private class Vst3Plugin < Moved - extend T::Sig - sig { returns(String) } def self.english_name "VST3 Plugin" diff --git a/Library/Homebrew/cask/artifact/vst_plugin.rb b/Library/Homebrew/cask/artifact/vst_plugin.rb index 9c3b5f5de0..d2cdca6073 100644 --- a/Library/Homebrew/cask/artifact/vst_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst_plugin.rb @@ -9,8 +9,6 @@ module Cask # # @api private class VstPlugin < Moved - extend T::Sig - sig { returns(String) } def self.english_name "VST Plugin" diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 696ff6f513..a99698862c 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -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? diff --git a/Library/Homebrew/cask/cache.rb b/Library/Homebrew/cask/cache.rb index 911a4eb833..62e7662e7f 100644 --- a/Library/Homebrew/cask/cache.rb +++ b/Library/Homebrew/cask/cache.rb @@ -6,8 +6,6 @@ module Cask # # @api private module Cache - extend T::Sig - sig { returns(Pathname) } def self.path @path ||= HOMEBREW_CACHE/"Cask" diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index c2924025a3..8932110cf9 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -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, diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index 7d20ee0af0..8e5fa074b9 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -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 diff --git a/Library/Homebrew/cask/caskroom.rb b/Library/Homebrew/cask/caskroom.rb index 1d35d466d7..a478f3c3b6 100644 --- a/Library/Homebrew/cask/caskroom.rb +++ b/Library/Homebrew/cask/caskroom.rb @@ -8,8 +8,6 @@ module Cask # # @api private module Caskroom - extend T::Sig - sig { returns(Pathname) } def self.path @path ||= HOMEBREW_PREFIX/"Caskroom" diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb deleted file mode 100644 index 1518b9518d..0000000000 --- a/Library/Homebrew/cask/cmd.rb +++ /dev/null @@ -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 diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb deleted file mode 100644 index 23e972087c..0000000000 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ /dev/null @@ -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 diff --git a/Library/Homebrew/cask/cmd/audit.rb b/Library/Homebrew/cask/cmd/audit.rb deleted file mode 100644 index 363c779ec1..0000000000 --- a/Library/Homebrew/cask/cmd/audit.rb +++ /dev/null @@ -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 diff --git a/Library/Homebrew/cask/cmd/install.rb b/Library/Homebrew/cask/cmd/install.rb deleted file mode 100644 index c4cbab03ef..0000000000 --- a/Library/Homebrew/cask/cmd/install.rb +++ /dev/null @@ -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 diff --git a/Library/Homebrew/cask/config.rb b/Library/Homebrew/cask/config.rb index 164f98c5d4..706ab32300 100644 --- a/Library/Homebrew/cask/config.rb +++ b/Library/Homebrew/cask/config.rb @@ -11,8 +11,6 @@ module Cask # # @api private class Config - extend T::Sig - DEFAULT_DIRS = { appdir: "/Applications", keyboard_layoutdir: "/Library/Keyboard Layouts", diff --git a/Library/Homebrew/cask/denylist.rb b/Library/Homebrew/cask/denylist.rb index 6b3a0ca589..7afbcb46b1 100644 --- a/Library/Homebrew/cask/denylist.rb +++ b/Library/Homebrew/cask/denylist.rb @@ -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 diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index 9522f0553e..7af6ff40e0 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -11,7 +11,6 @@ module Cask # # @api private class DependsOn < SimpleDelegator - extend T::Sig VALID_KEYS = Set.new([ :formula, :cask, diff --git a/Library/Homebrew/cask/dsl/version.rb b/Library/Homebrew/cask/dsl/version.rb index 2b5170406b..20d26a7195 100644 --- a/Library/Homebrew/cask/dsl/version.rb +++ b/Library/Homebrew/cask/dsl/version.rb @@ -7,8 +7,6 @@ module Cask # # @api private class Version < ::String - extend T::Sig - DIVIDERS = { "." => :dots, "-" => :hyphens, diff --git a/Library/Homebrew/cask/exceptions.rb b/Library/Homebrew/cask/exceptions.rb index dcf76029fb..e37817b6c3 100644 --- a/Library/Homebrew/cask/exceptions.rb +++ b/Library/Homebrew/cask/exceptions.rb @@ -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." diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index a5153c4258..ef2cb1ef10 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -16,8 +16,6 @@ module Cask # # @api private class Installer - extend T::Sig - extend Predicable def initialize(cask, command: SystemCommand, force: false, adopt: false, diff --git a/Library/Homebrew/cask/pkg.rb b/Library/Homebrew/cask/pkg.rb index 83447c4b6e..cc3d4d06cb 100644 --- a/Library/Homebrew/cask/pkg.rb +++ b/Library/Homebrew/cask/pkg.rb @@ -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| diff --git a/Library/Homebrew/cask/quarantine.rb b/Library/Homebrew/cask/quarantine.rb index 0e13a65dd1..3328bf7da4 100644 --- a/Library/Homebrew/cask/quarantine.rb +++ b/Library/Homebrew/cask/quarantine.rb @@ -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 diff --git a/Library/Homebrew/cask/staged.rb b/Library/Homebrew/cask/staged.rb index bc05bb0b79..bd7b2f2a53 100644 --- a/Library/Homebrew/cask/staged.rb +++ b/Library/Homebrew/cask/staged.rb @@ -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)]) } diff --git a/Library/Homebrew/cask/upgrade.rb b/Library/Homebrew/cask/upgrade.rb index 771852df1a..6e350d96f9 100644 --- a/Library/Homebrew/cask/upgrade.rb +++ b/Library/Homebrew/cask/upgrade.rb @@ -7,8 +7,6 @@ require "cask/config" module Cask # @api private class Upgrade - extend T::Sig - sig { params( casks: Cask, diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index 09bc6ad9c7..f7ef0197d3 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -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 diff --git a/Library/Homebrew/cask/utils.rb b/Library/Homebrew/cask/utils.rb index e47510ca3c..dd5ba92ca0 100644 --- a/Library/Homebrew/cask/utils.rb +++ b/Library/Homebrew/cask/utils.rb @@ -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| diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index cc690902b6..2439afcb3e 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -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") diff --git a/Library/Homebrew/cli/args.rb b/Library/Homebrew/cli/args.rb index 414448fcb7..cf49a4dcc2 100644 --- a/Library/Homebrew/cli/args.rb +++ b/Library/Homebrew/cli/args.rb @@ -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 diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index d87ec0b655..97646e4d67 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -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" diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index 0fc1cf2f09..76e7dcc8b0 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -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? diff --git a/Library/Homebrew/cmd/--cache.rb b/Library/Homebrew/cmd/--cache.rb index 00d0847748..26cb74200d 100644 --- a/Library/Homebrew/cmd/--cache.rb +++ b/Library/Homebrew/cmd/--cache.rb @@ -6,8 +6,6 @@ require "cli/parser" require "cask/download" module Homebrew - extend T::Sig - extend Fetch sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/--caskroom.rb b/Library/Homebrew/cmd/--caskroom.rb index 681cdf0331..e3d64ec694 100644 --- a/Library/Homebrew/cmd/--caskroom.rb +++ b/Library/Homebrew/cmd/--caskroom.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/--env.rb b/Library/Homebrew/cmd/--env.rb index f9814ccd94..84a4e46f7e 100644 --- a/Library/Homebrew/cmd/--env.rb +++ b/Library/Homebrew/cmd/--env.rb @@ -7,8 +7,6 @@ require "utils/shell" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/--prefix.rb b/Library/Homebrew/cmd/--prefix.rb index 7204cfade7..95e21d38d6 100644 --- a/Library/Homebrew/cmd/--prefix.rb +++ b/Library/Homebrew/cmd/--prefix.rb @@ -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 diff --git a/Library/Homebrew/cmd/--repository.rb b/Library/Homebrew/cmd/--repository.rb index c72c0510fe..0d15e532ec 100644 --- a/Library/Homebrew/cmd/--repository.rb +++ b/Library/Homebrew/cmd/--repository.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/analytics.rb b/Library/Homebrew/cmd/analytics.rb index 984ad24db1..b6d622ab71 100644 --- a/Library/Homebrew/cmd/analytics.rb +++ b/Library/Homebrew/cmd/analytics.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 897cd07df5..885a7bd524 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -5,8 +5,6 @@ require "cleanup" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index f7ea8186b4..5f87e44284 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/completions.rb b/Library/Homebrew/cmd/completions.rb index 4003dd0de0..c9655658e0 100644 --- a/Library/Homebrew/cmd/completions.rb +++ b/Library/Homebrew/cmd/completions.rb @@ -5,8 +5,6 @@ require "cli/parser" require "completions" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb index 7271881e56..b71022140c 100644 --- a/Library/Homebrew/cmd/config.rb +++ b/Library/Homebrew/cmd/config.rb @@ -5,8 +5,6 @@ require "system_config" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 444da12f15..56a0db6dca 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -7,8 +7,6 @@ require "cask/caskroom" require "dependencies_helpers" module Homebrew - extend T::Sig - extend DependenciesHelpers sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 8abbf08588..c415d7526e 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -7,8 +7,6 @@ require "description_cache_store" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/developer.rb b/Library/Homebrew/cmd/developer.rb index 131f18cef5..9f3ebc30ea 100755 --- a/Library/Homebrew/cmd/developer.rb +++ b/Library/Homebrew/cmd/developer.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/docs.rb b/Library/Homebrew/cmd/docs.rb index 31aa410df3..f3d7d713d1 100644 --- a/Library/Homebrew/cmd/docs.rb +++ b/Library/Homebrew/cmd/docs.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index d5956b2242..cfe47fae8d 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -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 diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index af75f9995e..744e317b29 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -7,8 +7,6 @@ require "cli/parser" require "cask/download" module Homebrew - extend T::Sig - extend Fetch FETCH_MAX_TRIES = 5 diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 9bf01bc759..dba4217ee2 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -9,8 +9,6 @@ require "socket" require "cli/parser" module Homebrew - extend T::Sig - extend Install module_function diff --git a/Library/Homebrew/cmd/home.rb b/Library/Homebrew/cmd/home.rb index 649c3d09da..8fe5bcd9a6 100644 --- a/Library/Homebrew/cmd/home.rb +++ b/Library/Homebrew/cmd/home.rb @@ -5,8 +5,6 @@ require "cli/parser" require "formula" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 0d0580471b..266cf96b82 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -14,8 +14,6 @@ require "deprecate_disable" require "api" module Homebrew - extend T::Sig - module_function VALID_DAYS = %w[30 90 365].freeze diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 24bf1287b4..3741bd6b2a 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -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 or . Additional options specific to a 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,25 +195,49 @@ 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, - binaries: args.binaries?, - verbose: args.verbose?, - force: args.force?, - adopt: args.adopt?, - require_sha: args.require_sha?, - skip_cask_deps: args.skip_cask_deps?, - quarantine: args.quarantine?, - quiet: args.quiet?, - dry_run: args.dry_run?, - ) + + 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?, + adopt: args.adopt?, + require_sha: args.require_sha?, + skip_cask_deps: args.skip_cask_deps?, + quarantine: args.quarantine?, + 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 diff --git a/Library/Homebrew/cmd/leaves.rb b/Library/Homebrew/cmd/leaves.rb index 621d64ae84..76fb8784ca 100644 --- a/Library/Homebrew/cmd/leaves.rb +++ b/Library/Homebrew/cmd/leaves.rb @@ -5,8 +5,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 9bacec52f3..3b6520e91c 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -6,8 +6,6 @@ require "cli/parser" require "unlink" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 2a5ee074cb..624be479f3 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -7,8 +7,6 @@ require "cli/parser" require "cask/list" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index b598f00a3c..a0f56165b4 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -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 diff --git a/Library/Homebrew/cmd/migrate.rb b/Library/Homebrew/cmd/migrate.rb index 68cae13b40..1a50c1eddb 100644 --- a/Library/Homebrew/cmd/migrate.rb +++ b/Library/Homebrew/cmd/migrate.rb @@ -5,8 +5,6 @@ require "migrator" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/missing.rb b/Library/Homebrew/cmd/missing.rb index d4784c683d..5cd689b13b 100644 --- a/Library/Homebrew/cmd/missing.rb +++ b/Library/Homebrew/cmd/missing.rb @@ -7,8 +7,6 @@ require "diagnostic" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index 8263c1cac3..6d3af41063 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -5,8 +5,6 @@ require "formula" require "options" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index becc267a2d..6df2c6e2d2 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -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 diff --git a/Library/Homebrew/cmd/pin.rb b/Library/Homebrew/cmd/pin.rb index 304105ffe9..cd5d91edbf 100644 --- a/Library/Homebrew/cmd/pin.rb +++ b/Library/Homebrew/cmd/pin.rb @@ -5,8 +5,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 821195f6dd..93ed03f059 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -6,8 +6,6 @@ require "formula_installer" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index 98efb088a9..5659889cec 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -6,8 +6,6 @@ require "cli/parser" require "env_config" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index dc09ab35ec..6a88b3eb0e 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -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 or 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) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 064b10911b..43733bb427 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -8,8 +8,6 @@ require "cli/parser" require "search" module Homebrew - extend T::Sig - module_function PACKAGE_MANAGERS = { diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index cea6eb2528..281db2a6c1 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 2361e6b0e9..7b1a9c1259 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb index e0db1db786..65642fb159 100644 --- a/Library/Homebrew/cmd/uninstall.rb +++ b/Library/Homebrew/cmd/uninstall.rb @@ -13,8 +13,6 @@ require "cask/uninstall" require "uninstall" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/unlink.rb b/Library/Homebrew/cmd/unlink.rb index 5034b6a2a7..f7572d15f6 100644 --- a/Library/Homebrew/cmd/unlink.rb +++ b/Library/Homebrew/cmd/unlink.rb @@ -5,8 +5,6 @@ require "cli/parser" require "unlink" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/unpin.rb b/Library/Homebrew/cmd/unpin.rb index 7e287d5956..9b26e4eda5 100644 --- a/Library/Homebrew/cmd/unpin.rb +++ b/Library/Homebrew/cmd/unpin.rb @@ -5,8 +5,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb index 89b8421536..bf12b54b8d 100644 --- a/Library/Homebrew/cmd/untap.rb +++ b/Library/Homebrew/cmd/untap.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 41e67f8c9f..0292c9f8eb 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -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 diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 0146f38aae..5480a2ec5a 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -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) diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index 9b77b71723..451eb6d447 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -12,8 +12,6 @@ require "dependencies_helpers" require "ostruct" module Homebrew - extend T::Sig - extend DependenciesHelpers sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/commands.rb b/Library/Homebrew/commands.rb index 6b0de992a4..993490144e 100644 --- a/Library/Homebrew/commands.rb +++ b/Library/Homebrew/commands.rb @@ -7,8 +7,6 @@ require "completions" # # @api private module Commands - module_function - HOMEBREW_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"cmd").freeze HOMEBREW_DEV_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"dev-cmd").freeze # If you are going to change anything in below hash, @@ -38,35 +36,35 @@ module Commands # middle due to dots in URLs or paths. DESCRIPTION_SPLITTING_PATTERN = /\.(?>\s|$)/.freeze - def valid_internal_cmd?(cmd) + def self.valid_internal_cmd?(cmd) require?(HOMEBREW_CMD_PATH/cmd) end - def valid_internal_dev_cmd?(cmd) + def self.valid_internal_dev_cmd?(cmd) require?(HOMEBREW_DEV_CMD_PATH/cmd) end - def method_name(cmd) + def self.method_name(cmd) cmd.to_s .tr("-", "_") .downcase .to_sym end - def args_method_name(cmd_path) + def self.args_method_name(cmd_path) cmd_path_basename = basename_without_extension(cmd_path) cmd_method_prefix = method_name(cmd_path_basename) "#{cmd_method_prefix}_args".to_sym end - def internal_cmd_path(cmd) + def self.internal_cmd_path(cmd) [ HOMEBREW_CMD_PATH/"#{cmd}.rb", HOMEBREW_CMD_PATH/"#{cmd}.sh", ].find(&:exist?) end - def internal_dev_cmd_path(cmd) + def self.internal_dev_cmd_path(cmd) [ HOMEBREW_DEV_CMD_PATH/"#{cmd}.rb", HOMEBREW_DEV_CMD_PATH/"#{cmd}.sh", @@ -74,21 +72,21 @@ module Commands end # Ruby commands which can be `require`d without being run. - def external_ruby_v2_cmd_path(cmd) + def self.external_ruby_v2_cmd_path(cmd) path = which("#{cmd}.rb", Tap.cmd_directories) path if require?(path) end # Ruby commands which are run by being `require`d. - def external_ruby_cmd_path(cmd) + def self.external_ruby_cmd_path(cmd) which("brew-#{cmd}.rb", PATH.new(ENV.fetch("PATH")).append(Tap.cmd_directories)) end - def external_cmd_path(cmd) + def self.external_cmd_path(cmd) which("brew-#{cmd}", PATH.new(ENV.fetch("PATH")).append(Tap.cmd_directories)) end - def path(cmd) + def self.path(cmd) internal_cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd) path ||= internal_cmd_path(internal_cmd) path ||= internal_dev_cmd_path(internal_cmd) @@ -98,7 +96,7 @@ module Commands path end - def commands(external: true, aliases: false) + def self.commands(external: true, aliases: false) cmds = internal_commands cmds += internal_developer_commands cmds += external_commands if external @@ -106,15 +104,15 @@ module Commands cmds.sort end - def internal_commands_paths + def self.internal_commands_paths find_commands HOMEBREW_CMD_PATH end - def internal_developer_commands_paths + def self.internal_developer_commands_paths find_commands HOMEBREW_DEV_CMD_PATH end - def official_external_commands_paths(quiet:) + def self.official_external_commands_paths(quiet:) OFFICIAL_CMD_TAPS.flat_map do |tap_name, cmds| tap = Tap.fetch(tap_name) tap.install(quiet: quiet) unless tap.installed? @@ -122,24 +120,24 @@ module Commands end end - def internal_commands + def self.internal_commands find_internal_commands(HOMEBREW_CMD_PATH).map(&:to_s) end - def internal_developer_commands + def self.internal_developer_commands find_internal_commands(HOMEBREW_DEV_CMD_PATH).map(&:to_s) end - def internal_commands_aliases + def self.internal_commands_aliases HOMEBREW_INTERNAL_COMMAND_ALIASES.keys end - def find_internal_commands(path) + def self.find_internal_commands(path) find_commands(path).map(&:basename) .map(&method(:basename_without_extension)) end - def external_commands + def self.external_commands Tap.cmd_directories.flat_map do |path| find_commands(path).select(&:executable?) .map(&method(:basename_without_extension)) @@ -148,17 +146,17 @@ module Commands .sort end - def basename_without_extension(path) + def self.basename_without_extension(path) path.basename(path.extname) end - def find_commands(path) + def self.find_commands(path) Pathname.glob("#{path}/*") .select(&:file?) .sort end - def rebuild_internal_commands_completion_list + def self.rebuild_internal_commands_completion_list cmds = internal_commands + internal_developer_commands + internal_commands_aliases cmds.reject! { |cmd| Homebrew::Completions::COMPLETIONS_EXCLUSION_LIST.include? cmd } @@ -166,7 +164,7 @@ module Commands file.atomic_write("#{cmds.sort.join("\n")}\n") end - def rebuild_commands_completion_list + def self.rebuild_commands_completion_list # Ensure that the cache exists so we can build the commands list HOMEBREW_CACHE.mkpath @@ -178,7 +176,7 @@ module Commands external_commands_file.atomic_write("#{external_commands.sort.join("\n")}\n") end - def command_options(command) + def self.command_options(command) path = self.path(command) return if path.blank? @@ -202,7 +200,7 @@ module Commands end end - def command_description(command, short: false) + def self.command_description(command, short: false) path = self.path(command) return if path.blank? @@ -228,7 +226,7 @@ module Commands end end - def named_args_type(command) + def self.named_args_type(command) path = self.path(command) return if path.blank? @@ -239,7 +237,7 @@ module Commands end # Returns the conflicts of a given `option` for `command`. - def option_conflicts(command, option) + def self.option_conflicts(command, option) path = self.path(command) return if path.blank? diff --git a/Library/Homebrew/commands.rbi b/Library/Homebrew/commands.rbi deleted file mode 100644 index 13522bd09f..0000000000 --- a/Library/Homebrew/commands.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module Commands - include Kernel -end diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index b620fc0845..12ac6cdb22 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -3,8 +3,8 @@ # @private module CompilerConstants - GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12].freeze - GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12)$/.freeze + GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12 13].freeze + GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13)$/.freeze COMPILER_SYMBOL_MAP = { "gcc" => :gcc, "clang" => :clang, @@ -100,7 +100,6 @@ end # # @api private class CompilerSelector - extend T::Sig include CompilerConstants Compiler = Struct.new(:type, :name, :version) diff --git a/Library/Homebrew/completions.rb b/Library/Homebrew/completions.rb index e7fca41fc7..b61499a6e8 100644 --- a/Library/Homebrew/completions.rb +++ b/Library/Homebrew/completions.rb @@ -10,8 +10,6 @@ module Homebrew # # @api private module Completions - extend T::Sig - Variables = Struct.new( :aliases, :builtin_command_descriptions, @@ -20,8 +18,6 @@ module Homebrew keyword_init: true, ) - module_function - COMPLETIONS_DIR = (HOMEBREW_REPOSITORY/"completions").freeze TEMPLATE_DIR = (HOMEBREW_LIBRARY_PATH/"completions").freeze @@ -74,7 +70,7 @@ module Homebrew }.freeze sig { void } - def link! + def self.link! Settings.write :linkcompletions, true Tap.each do |tap| Utils::Link.link_completions tap.path, "brew completions link" @@ -82,7 +78,7 @@ module Homebrew end sig { void } - def unlink! + def self.unlink! Settings.write :linkcompletions, false Tap.each do |tap| next if tap.official? @@ -92,12 +88,12 @@ module Homebrew end sig { returns(T::Boolean) } - def link_completions? + def self.link_completions? Settings.read(:linkcompletions) == "true" end sig { returns(T::Boolean) } - def completions_to_link? + def self.completions_to_link? Tap.each do |tap| next if tap.official? @@ -110,7 +106,7 @@ module Homebrew end sig { void } - def show_completions_message_if_needed + def self.show_completions_message_if_needed return if Settings.read(:completionsmessageshown) == "true" return unless completions_to_link? @@ -125,7 +121,7 @@ module Homebrew end sig { void } - def update_shell_completions! + def self.update_shell_completions! commands = Commands.commands(external: false, aliases: true).sort puts "Writing completions to #{COMPLETIONS_DIR}" @@ -136,12 +132,12 @@ module Homebrew end sig { params(command: String).returns(T::Boolean) } - def command_gets_completions?(command) + def self.command_gets_completions?(command) command_options(command).any? end sig { params(description: String, fish: T::Boolean).returns(String) } - def format_description(description, fish: false) + def self.format_description(description, fish: false) description = if fish description.gsub("'", "\\\\'") else @@ -151,7 +147,7 @@ module Homebrew end sig { params(command: String).returns(T::Hash[String, String]) } - def command_options(command) + def self.command_options(command) options = {} Commands.command_options(command)&.each do |option| next if option.blank? @@ -169,7 +165,7 @@ module Homebrew end sig { params(command: String).returns(T.nilable(String)) } - def generate_bash_subcommand_completion(command) + def self.generate_bash_subcommand_completion(command) return unless command_gets_completions? command named_completion_string = "" @@ -202,7 +198,7 @@ module Homebrew end sig { params(commands: T::Array[String]).returns(String) } - def generate_bash_completion_file(commands) + def self.generate_bash_completion_file(commands) variables = Variables.new( completion_functions: commands.map do |command| generate_bash_subcommand_completion command @@ -218,7 +214,7 @@ module Homebrew end sig { params(command: String).returns(T.nilable(String)) } - def generate_zsh_subcommand_completion(command) + def self.generate_zsh_subcommand_completion(command) return unless command_gets_completions? command options = command_options(command) @@ -270,7 +266,7 @@ module Homebrew COMPLETION end - def generate_zsh_option_exclusions(command, option) + def self.generate_zsh_option_exclusions(command, option) conflicts = Commands.option_conflicts(command, option.gsub(/^--/, "")) return "" unless conflicts.presence @@ -278,7 +274,7 @@ module Homebrew end sig { params(commands: T::Array[String]).returns(String) } - def generate_zsh_completion_file(commands) + def self.generate_zsh_completion_file(commands) variables = Variables.new( aliases: Commands::HOMEBREW_INTERNAL_COMMAND_ALIASES.map do |alias_command, command| alias_command = "'#{alias_command}'" if alias_command.start_with? "-" @@ -305,7 +301,7 @@ module Homebrew end sig { params(command: String).returns(T.nilable(String)) } - def generate_fish_subcommand_completion(command) + def self.generate_fish_subcommand_completion(command) return unless command_gets_completions? command command_description = format_description Commands.command_description(command, short: true), fish: true @@ -352,7 +348,7 @@ module Homebrew end sig { params(commands: T::Array[String]).returns(String) } - def generate_fish_completion_file(commands) + def self.generate_fish_completion_file(commands) variables = Variables.new( completion_functions: commands.map do |command| generate_fish_subcommand_completion command diff --git a/Library/Homebrew/completions.rbi b/Library/Homebrew/completions.rbi deleted file mode 100644 index 8c4746bcaf..0000000000 --- a/Library/Homebrew/completions.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Homebrew - module Completions - include Kernel - end -end diff --git a/Library/Homebrew/completions/fish.erb b/Library/Homebrew/completions/fish.erb index 02769bee55..2d75db2d59 100644 --- a/Library/Homebrew/completions/fish.erb +++ b/Library/Homebrew/completions/fish.erb @@ -130,11 +130,11 @@ function __fish_brew_suggest_casks_all -d "Lists locally available casks" end function __fish_brew_suggest_casks_installed -d "Lists installed casks" - command ls -1 (brew --caskroom) + command ls -1 (brew --caskroom) 2>/dev/null end function __fish_brew_suggest_casks_outdated -d "Lists outdated casks with the information about potential upgrade" - brew outdated --cask --verbose \ + brew outdated --cask --verbose 2>/dev/null \ # replace first space with tab to make the following a description in the completions list: | string replace -r '\s' '\t' end diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index ed43d0c387..a87523c472 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -5,8 +5,6 @@ require "compilers" # Combination of C++ standard library and compiler. class CxxStdlib - extend T::Sig - def self.create(type, compiler) raise ArgumentError, "Invalid C++ stdlib type: #{type}" if type && [:libstdcxx, :libcxx].exclude?(type) diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb index 05acc2da8b..b64ca304ff 100644 --- a/Library/Homebrew/debrew.rb +++ b/Library/Homebrew/debrew.rb @@ -28,8 +28,6 @@ module Debrew # Module for displaying a debugging menu. class Menu - extend T::Sig - Entry = Struct.new(:name, :action) attr_accessor :prompt, :entries diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index fedb68cb72..018c9f438e 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -7,8 +7,6 @@ require "delegate" # # @api private class Dependencies < SimpleDelegator - extend T::Sig - def initialize(*args) super(args) end @@ -45,8 +43,6 @@ end # # @api private class Requirements < SimpleDelegator - extend T::Sig - def initialize(*args) super(Set.new(args)) end diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index 15ea12ecbd..0879cf268e 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -7,8 +7,6 @@ require "dependable" # # @api private class Dependency - extend T::Sig - extend Forwardable include Dependable extend Cachable @@ -82,8 +80,6 @@ class Dependency end class << self - extend T::Sig - # Expand the dependencies of each dependent recursively, optionally yielding # `[dependent, dep]` pairs to allow callers to apply arbitrary filters to # the list. diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 28e028b5ca..abaead8394 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -18,8 +18,6 @@ require "extend/cachable" # This class is used by `depends_on` in the formula DSL to turn dependency # specifications into the proper kinds of dependencies and requirements. class DependencyCollector - extend T::Sig - extend Cachable attr_reader :deps, :requirements diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 96fdb7aea1..e8575cbf3b 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -20,8 +20,6 @@ require "formula_auditor" require "tap_auditor" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.audit_args Homebrew::CLI::Parser.new do @@ -239,39 +237,44 @@ module Homebrew end end - [f.path, { errors: fa.problems + fa.new_formula_problems, warnings: [] }] + [f.path, fa.problems + fa.new_formula_problems] end cask_results = if audit_casks.empty? {} else - require "cask/cmd/abstract_command" - require "cask/cmd/audit" if args.display_failures_only? odeprecated "`brew audit --display-failures-only`", "`brew audit ` without the argument" end - # For switches, we add `|| nil` so that `nil` will be passed instead of `false` if they aren't set. - # This way, we can distinguish between "not set" and "set to false". - Cask::Cmd::Audit.audit_casks( - *audit_casks, - download: nil, - # No need for `|| nil` for `--[no-]signing` because boolean switches are already `nil` if not passed - signing: args.signing?, - online: args.online? || nil, - strict: args.strict? || nil, - new_cask: args.new_cask? || nil, - token_conflicts: args.token_conflicts? || nil, - quarantine: nil, - any_named_args: !no_named_args, - language: nil, - only: args.only, - except: args.except, - ) + require "cask/auditor" + + audit_casks.to_h do |cask| + odebug "Auditing Cask #{cask}" + errors = Cask::Auditor.audit( + cask, + # For switches, we add `|| nil` so that `nil` will be passed + # instead of `false` if they aren't set. + # This way, we can distinguish between "not set" and "set to false". + audit_online: (args.online? || nil), + audit_strict: (args.strict? || nil), + + # No need for `|| nil` for `--[no-]signing` + # because boolean switches are already `nil` if not passed + audit_signing: args.signing?, + audit_new_cask: (args.new_cask? || nil), + audit_token_conflicts: (args.token_conflicts? || nil), + quarantine: true, + any_named_args: !no_named_args, + only: args.only, + except: args.except, + ) + [cask.sourcefile_path, errors] + end end - failed_casks = cask_results.reject { |_, result| result[:errors].empty? } + failed_casks = cask_results.select { |_, problems| problems.present? } cask_count = failed_casks.count @@ -304,20 +307,17 @@ module Homebrew return unless ENV["GITHUB_ACTIONS"] - annotations = formula_results.merge(cask_results).flat_map do |path, result| - ( - result[:warnings].map { |w| [:warning, w] } + - result[:errors].map { |e| [:error, e] } - ).map do |type, problem| + annotations = formula_results.merge(cask_results).flat_map do |path, problems| + problems.map do |problem| GitHub::Actions::Annotation.new( - type, + :error, problem[:message], file: path, line: problem[:location]&.line, column: problem[:location]&.column, ) end - end + end.compact annotations.each do |annotation| puts annotation if annotation.relevant? diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 48bd0f9e9e..610c3e4658 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -36,8 +36,6 @@ ALLOWABLE_HOMEBREW_REPOSITORY_LINKS = [ ].freeze module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.bottle_args Homebrew::CLI::Parser.new do diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index be951dadbd..c3a0cf1e63 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -7,8 +7,6 @@ require "cli/parser" require "utils/tar" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } @@ -135,6 +133,8 @@ module Homebrew if new_version.latest? || new_hash == :no_check opoo "Ignoring specified `--sha256=` argument." if new_hash.is_a?(String) replacement_pairs << [/"#{old_hash}"/, ":no_check"] if old_hash != :no_check + elsif old_hash == :no_check && new_hash != :no_check + replacement_pairs << [":no_check", "\"#{new_hash}\""] if new_hash.is_a?(String) elsif old_hash != :no_check if new_hash.nil? || cask.languages.present? if new_hash && cask.languages.present? diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 519cf2d4b4..c963291903 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -7,8 +7,6 @@ require "utils/pypi" require "utils/tar" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } @@ -123,7 +121,7 @@ module Homebrew tap_remote_repo = formula.tap.full_name || formula.tap.remote_repo remote = "origin" - remote_branch = formula.tap.path.git_origin_branch + remote_branch = formula.tap.git_repo.origin_branch_name previous_branch = "-" check_open_pull_requests(formula, tap_remote_repo, args: args) diff --git a/Library/Homebrew/dev-cmd/bump-revision.rb b/Library/Homebrew/dev-cmd/bump-revision.rb index 897d8e67cb..78aa44c8f7 100644 --- a/Library/Homebrew/dev-cmd/bump-revision.rb +++ b/Library/Homebrew/dev-cmd/bump-revision.rb @@ -5,8 +5,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index ed363ed391..f6eafe1567 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -10,8 +10,6 @@ require "tap" require "unversioned_cask_checker" module Homebrew - extend T::Sig - extend SystemCommand::Mixin sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index 50916f9a2f..9dd4d193f3 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -5,8 +5,6 @@ require "cli/parser" require "livecheck/livecheck" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/cat.rb b/Library/Homebrew/dev-cmd/cat.rb index 7b9faa1c25..6a1cb11791 100644 --- a/Library/Homebrew/dev-cmd/cat.rb +++ b/Library/Homebrew/dev-cmd/cat.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.cat_args Homebrew::CLI::Parser.new do diff --git a/Library/Homebrew/dev-cmd/command.rb b/Library/Homebrew/dev-cmd/command.rb index 0a9aa85bfa..18afa2316b 100644 --- a/Library/Homebrew/dev-cmd/command.rb +++ b/Library/Homebrew/dev-cmd/command.rb @@ -5,8 +5,6 @@ require "commands" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index 3abc22f96e..ca60d25a4b 100755 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -5,8 +5,6 @@ require "cli/parser" require "csv" module Homebrew - extend T::Sig - module_function PRIMARY_REPOS = %w[brew core cask].freeze diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 678cd5409b..5cbba2bd73 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -9,8 +9,6 @@ require "utils/pypi" require "cask/cask_loader" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/determine-test-runners.rb b/Library/Homebrew/dev-cmd/determine-test-runners.rb index c3903988fe..d85319e99e 100755 --- a/Library/Homebrew/dev-cmd/determine-test-runners.rb +++ b/Library/Homebrew/dev-cmd/determine-test-runners.rb @@ -6,8 +6,6 @@ require "test_runner_formula" require "github_runner_matrix" module Homebrew - extend T::Sig - sig { returns(Homebrew::CLI::Parser) } def self.determine_test_runners_args Homebrew::CLI::Parser.new do diff --git a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb index 7ed05e1abf..dfd525d5bc 100644 --- a/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb +++ b/Library/Homebrew/dev-cmd/dispatch-build-bottle.rb @@ -5,8 +5,6 @@ require "cli/parser" require "utils/github" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 04b1bb39f6..af1a5eb2b2 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -5,8 +5,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index ac002199cc..8c6bab1acc 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -69,8 +69,6 @@ ensure end module Homebrew - extend T::Sig - BOTTLE_BLOCK_REGEX = / bottle (?:do.+?end|:[a-z]+)\n\n/m.freeze sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index ec5dca7997..66afd0b7e7 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -5,8 +5,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/generate-cask-api.rb b/Library/Homebrew/dev-cmd/generate-cask-api.rb index 614cf5a7ff..6d001a287d 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-api.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-api.rb @@ -5,8 +5,6 @@ require "cli/parser" require "cask/cask" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/generate-formula-api.rb b/Library/Homebrew/dev-cmd/generate-formula-api.rb index fb05cb187c..b5c2aded77 100644 --- a/Library/Homebrew/dev-cmd/generate-formula-api.rb +++ b/Library/Homebrew/dev-cmd/generate-formula-api.rb @@ -5,8 +5,6 @@ require "cli/parser" require "formula" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/generate-man-completions.rb b/Library/Homebrew/dev-cmd/generate-man-completions.rb index 8c48755473..25dd019278 100644 --- a/Library/Homebrew/dev-cmd/generate-man-completions.rb +++ b/Library/Homebrew/dev-cmd/generate-man-completions.rb @@ -6,8 +6,6 @@ require "completions" require "manpages" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/install-bundler-gems.rb b/Library/Homebrew/dev-cmd/install-bundler-gems.rb index 742ed9ef6d..45cf04e19c 100644 --- a/Library/Homebrew/dev-cmd/install-bundler-gems.rb +++ b/Library/Homebrew/dev-cmd/install-bundler-gems.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 07e42818f3..8b80ed8bb3 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -26,8 +26,6 @@ class Symbol end module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 55431777a2..1eee527d66 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -6,8 +6,6 @@ require "linkage_checker" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index 0fa2910d3e..a63359cf6e 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -7,8 +7,6 @@ require "livecheck/livecheck" require "livecheck/strategy" module Homebrew - extend T::Sig - module_function WATCHLIST_PATH = File.expand_path(Homebrew::EnvConfig.livecheck_watchlist).freeze diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index 87c54ca518..e3d698f78f 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -5,8 +5,6 @@ require "cli/parser" require "utils/github" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } @@ -23,7 +21,8 @@ module Homebrew description: "Pull requests must have this label." comma_array "--without-labels", description: "Pull requests must not have these labels (default: " \ - "`do not merge`, `new formula`, `automerge-skip`, `CI-published-bottle-commits`)." + "`do not merge`, `new formula`, `automerge-skip`, " \ + "`pre-release`, `CI-published-bottle-commits`)." switch "--without-approval", description: "Pull requests do not require approval to be merged." switch "--publish", @@ -50,6 +49,7 @@ module Homebrew "do not merge", "new formula", "automerge-skip", + "pre-release", "CI-published-bottle-commits", ] tap = Tap.fetch(args.tap || CoreTap.instance.name) diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index c6c64dd1aa..da152254ce 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -5,8 +5,6 @@ require "cli/parser" require "utils/github" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index f37f993463..1d1384df57 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -8,8 +8,6 @@ require "tmpdir" require "formula" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.pr_pull_args Homebrew::CLI::Parser.new do @@ -85,12 +83,12 @@ module Homebrew [subject, body, trailers] end - def self.signoff!(path, pull_request: nil, dry_run: false) - subject, body, trailers = separate_commit_message(path.git_commit_message) + def self.signoff!(git_repo, pull_request: nil, dry_run: false) + subject, body, trailers = separate_commit_message(git_repo.commit_message) if pull_request # This is a tap pull request and approving reviewers should also sign-off. - tap = Tap.from_path(path) + tap = Tap.from_path(git_repo.pathname) review_trailers = GitHub.approved_reviews(tap.user, tap.full_name.split("/").last, pull_request).map do |r| "Signed-off-by: #{r["name"]} <#{r["email"]}>" end @@ -101,7 +99,7 @@ module Homebrew body += "\n\n#{close_message}" unless body.include? close_message end - git_args = Utils::Git.git, "-C", path, "commit", "--amend", "--signoff", "--allow-empty", "--quiet", + git_args = Utils::Git.git, "-C", git_repo.pathname, "commit", "--amend", "--signoff", "--allow-empty", "--quiet", "--message", subject, "--message", body, "--message", trailers if dry_run @@ -156,21 +154,21 @@ module Homebrew # Cherry picks a single commit that modifies a single file. # Potentially rewords this commit using {determine_bump_subject}. - def self.reword_package_commit(commit, file, reason: "", verbose: false, resolve: false, path: ".") - package_file = Pathname.new(path) / file + def self.reword_package_commit(commit, file, git_repo:, reason: "", verbose: false, resolve: false) + package_file = git_repo.pathname / file package_name = package_file.basename.to_s.chomp(".rb") odebug "Cherry-picking #{package_file}: #{commit}" - Utils::Git.cherry_pick!(path, commit, verbose: verbose, resolve: resolve) + Utils::Git.cherry_pick!(git_repo.to_s, commit, verbose: verbose, resolve: resolve) - old_package = Utils::Git.file_at_commit(path, file, "HEAD^") - new_package = Utils::Git.file_at_commit(path, file, "HEAD") + old_package = Utils::Git.file_at_commit(git_repo.to_s, file, "HEAD^") + new_package = Utils::Git.file_at_commit(git_repo.to_s, file, "HEAD") bump_subject = determine_bump_subject(old_package, new_package, package_file, reason: reason).strip - subject, body, trailers = separate_commit_message(path.git_commit_message) + subject, body, trailers = separate_commit_message(git_repo.commit_message) if subject != bump_subject && !subject.start_with?("#{package_name}:") - safe_system("git", "-C", path, "commit", "--amend", "-q", + safe_system("git", "-C", git_repo.pathname, "commit", "--amend", "-q", "-m", bump_subject, "-m", subject, "-m", body, "-m", trailers) ohai bump_subject else @@ -181,7 +179,7 @@ module Homebrew # Cherry picks multiple commits that each modify a single file. # Words the commit according to {determine_bump_subject} with the body # corresponding to all the original commit messages combined. - def self.squash_package_commits(commits, file, reason: "", verbose: false, resolve: false, path: ".") + def self.squash_package_commits(commits, file, git_repo:, reason: "", verbose: false, resolve: false) odebug "Squashing #{file}: #{commits.join " "}" # Format commit messages into something similar to `git fmt-merge-message`. @@ -192,35 +190,36 @@ module Homebrew messages = [] trailers = [] commits.each do |commit| - subject, body, trailer = separate_commit_message(path.git_commit_message(commit)) + subject, body, trailer = separate_commit_message(git_repo.commit_message(commit)) body = body.lines.map { |line| " #{line.strip}" }.join("\n") messages << "* #{subject}\n#{body}".strip trailers << trailer end # Get the set of authors in this series. - authors = Utils.safe_popen_read("git", "-C", path, "show", + authors = Utils.safe_popen_read("git", "-C", git_repo.pathname, "show", "--no-patch", "--pretty=%an <%ae>", *commits).lines.map(&:strip).uniq.compact # Get the author and date of the first commit of this series, which we use for the squashed commit. original_author = authors.shift - original_date = Utils.safe_popen_read "git", "-C", path, "show", "--no-patch", "--pretty=%ad", commits.first + original_date = Utils.safe_popen_read "git", "-C", git_repo.pathname, "show", "--no-patch", "--pretty=%ad", + commits.first # Generate trailers for coauthors and combine them with the existing trailers. co_author_trailers = authors.map { |au| "Co-authored-by: #{au}" } trailers = [trailers + co_author_trailers].flatten.uniq.compact # Apply the patch series but don't commit anything yet. - Utils::Git.cherry_pick!(path, "--no-commit", *commits, verbose: verbose, resolve: resolve) + Utils::Git.cherry_pick!(git_repo.pathname, "--no-commit", *commits, verbose: verbose, resolve: resolve) # Determine the bump subject by comparing the original state of the tree to its current state. - package_file = Pathname.new(path) / file - old_package = Utils::Git.file_at_commit(path, file, "#{commits.first}^") + package_file = git_repo.pathname / file + old_package = Utils::Git.file_at_commit(git_repo.pathname, file, "#{commits.first}^") new_package = package_file.read bump_subject = determine_bump_subject(old_package, new_package, package_file, reason: reason) # Commit with the new subject, body, and trailers. - safe_system("git", "-C", path, "commit", "--quiet", + safe_system("git", "-C", git_repo.pathname, "commit", "--quiet", "-m", bump_subject, "-m", messages.join("\n"), "-m", trailers.join("\n"), "--author", original_author, "--date", original_date, "--", file) ohai bump_subject @@ -228,7 +227,8 @@ module Homebrew # TODO: fix test in `test/dev-cmd/pr-pull_spec.rb` and assume `cherry_picked: false`. def self.autosquash!(original_commit, tap:, reason: "", verbose: false, resolve: false, cherry_picked: true) - original_head = tap.path.git_head + git_repo = tap.git_repo + original_head = git_repo.head_ref commits = Utils.safe_popen_read("git", "-C", tap.path, "rev-list", "--reverse", "#{original_commit}..HEAD").lines.map(&:strip) @@ -268,13 +268,15 @@ module Homebrew files = commits_to_files[commit] if files.length == 1 && files_to_commits[files.first].length == 1 # If there's a 1:1 mapping of commits to files, just cherry pick and (maybe) reword. - reword_package_commit(commit, files.first, path: tap.path, reason: reason, verbose: verbose, resolve: resolve) + reword_package_commit( + commit, files.first, git_repo: git_repo, reason: reason, verbose: verbose, resolve: resolve + ) processed_commits << commit elsif files.length == 1 && files_to_commits[files.first].length > 1 # If multiple commits modify a single file, squash them down into a single commit. file = files.first commits = files_to_commits[file] - squash_package_commits(commits, file, path: tap.path, reason: reason, verbose: verbose, resolve: resolve) + squash_package_commits(commits, file, git_repo: git_repo, reason: reason, verbose: verbose, resolve: resolve) processed_commits += commits else # We can't split commits (yet) so just raise an error. @@ -450,8 +452,9 @@ module Homebrew _, user, repo, pr = *url_match odie "Not a GitHub pull request: #{arg}" unless pr - if !tap.path.git_default_origin_branch? || args.branch_okay? || args.clean? - opoo "Current branch is #{tap.path.git_branch}: do you need to pull inside #{tap.path.git_origin_branch}?" + git_repo = tap.git_repo + if !git_repo.default_origin_branch? || args.branch_okay? || args.clean? + opoo "Current branch is #{git_repo.branch_name}: do you need to pull inside #{git_repo.origin_branch_name}?" end pr_labels = GitHub.pull_request_labels(user, repo, pr) @@ -479,7 +482,7 @@ module Homebrew autosquash!(original_commit, tap: tap, cherry_picked: !args.no_cherry_pick?, verbose: args.verbose?, resolve: args.resolve?, reason: args.message) end - signoff!(tap.path, pull_request: pr, dry_run: args.dry_run?) unless args.clean? + signoff!(git_repo, pull_request: pr, dry_run: args.dry_run?) unless args.clean? end unless formulae_need_bottles?(tap, original_commit, pr_labels, args: args) @@ -525,8 +528,6 @@ module Homebrew end class GitHubArtifactDownloadStrategy < AbstractFileDownloadStrategy - extend T::Sig - def fetch(timeout: nil) ohai "Downloading #{url}" if cached_location.exist? diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index c966dcde1c..8b7f3128b0 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -6,8 +6,6 @@ require "github_packages" require "github_releases" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb index 04bbc62079..6457c08f60 100644 --- a/Library/Homebrew/dev-cmd/prof.rb +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/release.rb b/Library/Homebrew/dev-cmd/release.rb index e7e87a4486..bd981a221b 100755 --- a/Library/Homebrew/dev-cmd/release.rb +++ b/Library/Homebrew/dev-cmd/release.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb index 5db9c72641..9cdfe64d1e 100644 --- a/Library/Homebrew/dev-cmd/ruby.rb +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/sh.rb b/Library/Homebrew/dev-cmd/sh.rb index 4fbc9e2e78..7ac99cb5fa 100644 --- a/Library/Homebrew/dev-cmd/sh.rb +++ b/Library/Homebrew/dev-cmd/sh.rb @@ -6,8 +6,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/style.rb b/Library/Homebrew/dev-cmd/style.rb index 01744ac29b..f186aada1e 100644 --- a/Library/Homebrew/dev-cmd/style.rb +++ b/Library/Homebrew/dev-cmd/style.rb @@ -7,8 +7,6 @@ require "style" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 510b1e3030..7b62b6cf91 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -5,8 +5,6 @@ require "tap" require "cli/parser" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.tap_new_args Homebrew::CLI::Parser.new do @@ -72,7 +70,7 @@ module Homebrew test-bot: strategy: matrix: - os: [ubuntu-22.04, macos-12] + os: [ubuntu-22.04, macos-13] runs-on: ${{ matrix.os }} steps: - name: Set up Homebrew diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb index 0641fe8ad9..7187f77337 100644 --- a/Library/Homebrew/dev-cmd/test.rb +++ b/Library/Homebrew/dev-cmd/test.rb @@ -7,8 +7,6 @@ require "timeout" require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index fb1e8f3c19..41bb42c048 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -5,8 +5,6 @@ require "cli/parser" require "fileutils" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 37805c83ba..beb5878cba 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.typecheck_args Homebrew::CLI::Parser.new do diff --git a/Library/Homebrew/dev-cmd/unbottled.rb b/Library/Homebrew/dev-cmd/unbottled.rb index 8cbe3ad802..f708d167ea 100644 --- a/Library/Homebrew/dev-cmd/unbottled.rb +++ b/Library/Homebrew/dev-cmd/unbottled.rb @@ -7,8 +7,6 @@ require "api" require "os/mac/xcode" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/unpack.rb b/Library/Homebrew/dev-cmd/unpack.rb index b08e7a2aba..86a35544a0 100644 --- a/Library/Homebrew/dev-cmd/unpack.rb +++ b/Library/Homebrew/dev-cmd/unpack.rb @@ -6,8 +6,6 @@ require "formula" require "cli/parser" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.unpack_args Homebrew::CLI::Parser.new do diff --git a/Library/Homebrew/dev-cmd/update-license-data.rb b/Library/Homebrew/dev-cmd/update-license-data.rb index 05326a9ac1..1eb9344d00 100644 --- a/Library/Homebrew/dev-cmd/update-license-data.rb +++ b/Library/Homebrew/dev-cmd/update-license-data.rb @@ -6,7 +6,6 @@ require "utils/spdx" require "system_command" module Homebrew - extend T::Sig include SystemCommand::Mixin module_function diff --git a/Library/Homebrew/dev-cmd/update-maintainers.rb b/Library/Homebrew/dev-cmd/update-maintainers.rb index 98923595e3..dfac1f11ee 100644 --- a/Library/Homebrew/dev-cmd/update-maintainers.rb +++ b/Library/Homebrew/dev-cmd/update-maintainers.rb @@ -8,8 +8,6 @@ require "manpages" require "active_support/core_ext/hash/slice" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/update-python-resources.rb b/Library/Homebrew/dev-cmd/update-python-resources.rb index 1e6e7bf96f..8d73ff7e8c 100644 --- a/Library/Homebrew/dev-cmd/update-python-resources.rb +++ b/Library/Homebrew/dev-cmd/update-python-resources.rb @@ -5,8 +5,6 @@ require "cli/parser" require "utils/pypi" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } diff --git a/Library/Homebrew/dev-cmd/update-sponsors.rb b/Library/Homebrew/dev-cmd/update-sponsors.rb index 0ea4d480c6..52d491764d 100644 --- a/Library/Homebrew/dev-cmd/update-sponsors.rb +++ b/Library/Homebrew/dev-cmd/update-sponsors.rb @@ -5,8 +5,6 @@ require "cli/parser" require "utils/github" module Homebrew - extend T::Sig - module_function NAMED_MONTHLY_AMOUNT = 100 diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 4c92356af5..c9e66b55d3 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -3,8 +3,6 @@ require "cli/parser" module Homebrew - extend T::Sig - sig { returns(CLI::Parser) } def self.update_test_args Homebrew::CLI::Parser.new do diff --git a/Library/Homebrew/dev-cmd/vendor-gems.rb b/Library/Homebrew/dev-cmd/vendor-gems.rb index 30ddc13b27..da03d58f11 100644 --- a/Library/Homebrew/dev-cmd/vendor-gems.rb +++ b/Library/Homebrew/dev-cmd/vendor-gems.rb @@ -4,8 +4,6 @@ require "cli/parser" module Homebrew - extend T::Sig - module_function sig { returns(CLI::Parser) } @@ -19,6 +17,9 @@ module Homebrew description: "Update the specified list of vendored gems to the latest version." switch "--no-commit", description: "Do not generate a new commit upon completion." + switch "--non-bundler-gems", + description: "Update vendored gems that aren't using Bundler.", + hidden: true named_args :none end @@ -53,9 +54,24 @@ module Homebrew ohai "bundle pristine" safe_system "bundle", "pristine" + if args.non_bundler_gems? + %w[ + mechanize + ].each do |gem| + ohai "gem install #{gem}" + safe_system "gem", "install", "mechanize", "--install-dir", "vendor", + "--no-document", "--no-wrappers", "--ignore-dependencies", "--force" + (HOMEBREW_LIBRARY_PATH/"vendor/gems").cd do + if (source = Pathname.glob("#{gem}-*/").first) + FileUtils.ln_sf source, gem + end + end + end + end + unless args.no_commit? - ohai "git add vendor/bundle" - system "git", "add", "vendor/bundle" + ohai "git add vendor" + system "git", "add", "vendor" Utils::Git.set_name_email! Utils::Git.setup_gpg! diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 6a7014f902..3ad70e3e93 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -6,8 +6,6 @@ require "version" # @private class DevelopmentTools class << self - extend T::Sig - sig { params(tool: String).returns(T.nilable(Pathname)) } def locate(tool) # Don't call tools (cc, make, strip, etc.) directly! diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 9b88e6ef7b..043c060305 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -48,8 +48,6 @@ module Homebrew # Diagnostic checks. class Checks - extend T::Sig - def initialize(verbose: true) @verbose = verbose end @@ -126,10 +124,11 @@ module Homebrew EOS end + sig { params(repository_path: GitRepository, desired_origin: String).returns(T.nilable(String)) } def examine_git_origin(repository_path, desired_origin) - return if !Utils::Git.available? || !repository_path.git? + return if !Utils::Git.available? || !repository_path.git_repo? - current_origin = repository_path.git_origin + current_origin = repository_path.origin_url if current_origin.nil? <<~EOS @@ -155,8 +154,8 @@ module Homebrew def broken_tap(tap) return unless Utils::Git.available? - repo = HOMEBREW_REPOSITORY.dup.extend(GitRepositoryExtension) - return unless repo.git? + repo = GitRepository.new(HOMEBREW_REPOSITORY) + return unless repo.git_repo? message = <<~EOS #{tap.full_name} was not tapped properly! Run: @@ -168,7 +167,7 @@ module Homebrew tap_head = tap.git_head return message if tap_head.blank? - return if tap_head != repo.git_head + return if tap_head != repo.head_ref message end @@ -516,7 +515,7 @@ module Homebrew end def check_brew_git_origin - repo = HOMEBREW_REPOSITORY.dup.extend(GitRepositoryExtension) + repo = GitRepository.new(HOMEBREW_REPOSITORY) examine_git_origin(repo, Homebrew::EnvConfig.brew_git_remote) end @@ -528,14 +527,14 @@ module Homebrew CoreTap.ensure_installed! end - broken_tap(coretap) || examine_git_origin(coretap.path, Homebrew::EnvConfig.core_git_remote) + broken_tap(coretap) || examine_git_origin(coretap.git_repo, Homebrew::EnvConfig.core_git_remote) end def check_casktap_integrity default_cask_tap = Tap.default_cask_tap return unless default_cask_tap.installed? - broken_tap(default_cask_tap) || examine_git_origin(default_cask_tap.path, default_cask_tap.remote) + broken_tap(default_cask_tap) || examine_git_origin(default_cask_tap.git_repo, default_cask_tap.remote) end sig { returns(T.nilable(String)) } @@ -544,9 +543,9 @@ module Homebrew return unless Utils::Git.available? commands = Tap.map do |tap| - next if tap.path.git_default_origin_branch? + next if tap.git_repo.default_origin_branch? - "git -C $(brew --repo #{tap.name}) checkout #{tap.path.git_origin_branch}" + "git -C $(brew --repo #{tap.name}) checkout #{tap.git_repo.origin_branch_name}" end.compact return if commands.blank? diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index cd57614bd1..3d2bed473e 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -8,8 +8,12 @@ require "lazy_object" require "cgi" require "lock_file" -require "mechanize/version" -require "mechanize/http/content_disposition_parser" +# Need to define this before requiring Mechanize to avoid: +# uninitialized constant Mechanize +# rubocop:disable Lint/EmptyClass +class Mechanize; end +require "vendor/gems/mechanize/lib/mechanize/http/content_disposition_parser" +# rubocop:enable Lint/EmptyClass require "utils/curl" require "utils/github" @@ -23,8 +27,6 @@ using TimeRemaining # # @api private class AbstractDownloadStrategy - extend T::Sig - extend Forwardable include FileUtils include Context @@ -328,8 +330,11 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy @resolved_url_and_basename = [url, parse_basename(url)] end + sig { params(url: String, search_query: T::Boolean).returns(String) } def parse_basename(url, search_query: true) - uri_path = if url.match?(URI::DEFAULT_PARSER.make_regexp) + components = { path: T.let([], T::Array[String]), query: T.let([], T::Array[String]) } + + if url.match?(URI::DEFAULT_PARSER.make_regexp) uri = URI(url) if uri.query @@ -340,29 +345,32 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy end end - if uri.query && search_query - "#{uri.path}?#{uri.query}" - else - uri.path + if (uri_path = uri.path.presence) + components[:path] = uri_path.split("/").map do |part| + URI::DEFAULT_PARSER.unescape(part).presence + end.compact + end + + if search_query && (uri_query = uri.query.presence) + components[:query] = URI.decode_www_form(uri_query).map(&:second) end else - url + components[:path] = [url] end - uri_path = URI.decode_www_form_component(uri_path) - query_regex = /[^?&]+/ - # We need a Pathname because we've monkeypatched extname to support double # extensions (e.g. tar.gz). # Given a URL like https://example.com/download.php?file=foo-1.0.tar.gz # the basename we want is "foo-1.0.tar.gz", not "download.php". - Pathname.new(uri_path).ascend do |path| - ext = path.extname[query_regex] - return path.basename.to_s[/#{query_regex.source}#{Regexp.escape(ext)}/] if ext + [*components[:path], *components[:query]].reverse_each do |path| + path = Pathname(path) + return path.basename.to_s if path.extname.present? end - # Strip query string - File.basename(uri_path)[query_regex] + filename = components[:path].last + return "" if filename.blank? + + File.basename(filename) end end @@ -396,20 +404,22 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy ohai "Downloading #{url}" - resolved_url, _, url_time, _, is_redirection = + use_cached_location = cached_location.exist? + use_cached_location = false if version.respond_to?(:latest?) && version.latest? + + resolved_url, _, last_modified, _, is_redirection = begin resolve_url_basename_time_file_size(url, timeout: end_time&.remaining!) + rescue ErrorDuringExecution + raise unless use_cached_location + end + # Authorization is no longer valid after redirects meta[:headers]&.delete_if { |header| header.start_with?("Authorization") } if is_redirection - fresh = if cached_location.exist? && url_time - url_time <= cached_location.mtime - elsif version.respond_to?(:latest?) - !version.latest? - else - true - end + # The cached location is no longer fresh if Last-Modified is after the file's timestamp + use_cached_location = false if cached_location.exist? && last_modified && last_modified > cached_location.mtime - if cached_location.exist? && fresh + if use_cached_location puts "Already downloaded: #{cached_location}" else begin @@ -699,8 +709,6 @@ end # # @api public class SubversionDownloadStrategy < VCSDownloadStrategy - extend T::Sig - def initialize(url, name, version, **meta) super @url = @url.sub("svn+http://", "") @@ -909,7 +917,8 @@ class GitDownloadStrategy < VCSDownloadStrategy args << "--no-checkout" << "--filter=blob:none" if partial_clone_sparse_checkout? - args << "-c" << "advice.detachedHead=false" # silences detached head warning + args << "--config" << "advice.detachedHead=false" # silences detached head warning + args << "--config" << "core.fsmonitor=false" # prevent fsmonitor from watching this repo args << @url << cached_location.to_s end @@ -942,6 +951,9 @@ class GitDownloadStrategy < VCSDownloadStrategy command! "git", args: ["config", "advice.detachedHead", "false"], chdir: cached_location + command! "git", + args: ["config", "core.fsmonitor", "false"], + chdir: cached_location return unless partial_clone_sparse_checkout? @@ -1121,8 +1133,6 @@ end # # @api public class CVSDownloadStrategy < VCSDownloadStrategy - extend T::Sig - def initialize(url, name, version, **meta) super @url = @url.sub(%r{^cvs://}, "") @@ -1203,8 +1213,6 @@ end # # @api public class MercurialDownloadStrategy < VCSDownloadStrategy - extend T::Sig - def initialize(url, name, version, **meta) super @url = @url.sub(%r{^hg://}, "") @@ -1267,8 +1275,6 @@ end # # @api public class BazaarDownloadStrategy < VCSDownloadStrategy - extend T::Sig - def initialize(url, name, version, **meta) super @url.sub!(%r{^bzr://}, "") @@ -1332,8 +1338,6 @@ end # # @api public class FossilDownloadStrategy < VCSDownloadStrategy - extend T::Sig - def initialize(url, name, version, **meta) super @url = @url.sub(%r{^fossil://}, "") diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index 94a3ca7f96..5884ea4b05 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -8,8 +8,6 @@ module Homebrew # # @api private module EnvConfig - extend T::Sig - module_function ENVS = { diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 7f8b4f9d6b..ff627360c9 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -6,8 +6,6 @@ require "utils" # Raised when a command is used wrong. class UsageError < RuntimeError - extend T::Sig - attr_reader :reason def initialize(reason = nil) @@ -83,8 +81,6 @@ end # Raised when neither a formula nor a cask with the given name is available. class FormulaOrCaskUnavailableError < RuntimeError - extend T::Sig - attr_reader :name def initialize(name) @@ -111,8 +107,6 @@ end # Raised when a formula or cask in a specific tap is not available. class TapFormulaOrCaskUnavailableError < FormulaOrCaskUnavailableError - extend T::Sig - attr_reader :tap def initialize(tap, name) @@ -130,8 +124,6 @@ end # Raised when a formula is not available. class FormulaUnavailableError < FormulaOrCaskUnavailableError - extend T::Sig - attr_accessor :dependent sig { returns(T.nilable(String)) } @@ -149,8 +141,6 @@ end # # @api private module FormulaClassUnavailableErrorModule - extend T::Sig - attr_reader :path, :class_name, :class_list def to_s @@ -195,8 +185,6 @@ end # # @api private module FormulaUnreadableErrorModule - extend T::Sig - attr_reader :formula_error sig { returns(String) } @@ -404,8 +392,6 @@ end # Raised when a formula conflicts with another one. class FormulaConflictError < RuntimeError - extend T::Sig - attr_reader :formula, :conflicts def initialize(formula, conflicts) @@ -466,8 +452,6 @@ end # Raised when an error occurs during a formula build. class BuildError < RuntimeError - extend T::Sig - attr_reader :cmd, :args, :env attr_accessor :formula, :options @@ -651,8 +635,6 @@ end # Raised by {Kernel#safe_system} in `utils.rb`. class ErrorDuringExecution < RuntimeError - extend T::Sig - attr_reader :cmd, :status, :output def initialize(cmd, status:, output: nil, secrets: []) diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index b4c149a577..0a95b5ebb1 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -8,8 +8,6 @@ require "extend/ENV/std" require "extend/ENV/super" module Kernel - extend T::Sig - sig { params(env: T.nilable(String)).returns(T::Boolean) } def superenv?(env) return false if env == "std" @@ -24,8 +22,6 @@ end # # @see https://rubydoc.info/stdlib/core/ENV ENV core documentation # class ENV; end module EnvActivation - extend T::Sig - sig { params(env: T.nilable(String)).void } def activate_extensions!(env: nil) if superenv?(env) diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index 6f337e543a..bef56363bc 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -11,8 +11,6 @@ require "development_tools" # @see Stdenv # @see https://www.rubydoc.info/stdlib/Env Ruby's ENV API module SharedEnvExtension - extend T::Sig - include CompilerConstants CC_FLAG_VARS = %w[CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS].freeze diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 62b2692c43..8929f5f6c9 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -6,8 +6,6 @@ require "extend/ENV/shared" # @api private module Stdenv - extend T::Sig - include SharedEnvExtension # @private diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 977c30fd45..734eccb95d 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -15,8 +15,6 @@ require "development_tools" # 7. Simpler formulae that *just work* # 8. Build-system agnostic configuration of the toolchain module Superenv - extend T::Sig - include SharedEnvExtension # @private diff --git a/Library/Homebrew/extend/git_repository.rbi b/Library/Homebrew/extend/git_repository.rbi deleted file mode 100644 index 9ffee241cf..0000000000 --- a/Library/Homebrew/extend/git_repository.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module GitRepositoryExtension - requires_ancestor { Pathname } -end diff --git a/Library/Homebrew/extend/kernel.rb b/Library/Homebrew/extend/kernel.rb index 8c9672ec4a..d575d3f888 100644 --- a/Library/Homebrew/extend/kernel.rb +++ b/Library/Homebrew/extend/kernel.rb @@ -4,8 +4,6 @@ # Contains shorthand Homebrew utility methods like `ohai`, `opoo`, `odisabled`. # TODO: move these out of `Kernel`. module Kernel - extend T::Sig - def require?(path) return false if path.nil? diff --git a/Library/Homebrew/extend/module.rb b/Library/Homebrew/extend/module.rb index b09433b483..62b97c2b01 100644 --- a/Library/Homebrew/extend/module.rb +++ b/Library/Homebrew/extend/module.rb @@ -2,6 +2,8 @@ # frozen_string_literal: true class Module + include T::Sig + def attr_rw(*attrs) attrs.each do |attr| module_eval <<-EOS, __FILE__, __LINE__+1 diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/extend/on_system.rb index 2fc253904c..7d8670a65f 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/extend/on_system.rb @@ -4,8 +4,6 @@ require "simulate_system" module OnSystem - extend T::Sig - ARCH_OPTIONS = [:intel, :arm].freeze BASE_OS_OPTIONS = [:macos, :linux].freeze @@ -139,8 +137,6 @@ module OnSystem end module MacOSAndLinux - extend T::Sig - sig { params(base: Class).void } def self.included(base) OnSystem.setup_arch_methods(base) @@ -150,8 +146,6 @@ module OnSystem end module MacOSOnly - extend T::Sig - sig { params(base: Class).void } def self.included(base) OnSystem.setup_arch_methods(base) diff --git a/Library/Homebrew/extend/os/linux/cleaner.rb b/Library/Homebrew/extend/os/linux/cleaner.rb index 8ac06950da..8a21e6e91d 100644 --- a/Library/Homebrew/extend/os/linux/cleaner.rb +++ b/Library/Homebrew/extend/os/linux/cleaner.rb @@ -4,7 +4,6 @@ class Cleaner private - extend T::Sig sig { params(path: Pathname).returns(T.nilable(T::Boolean)) } def executable_path?(path) path.elf? || path.text_executable? diff --git a/Library/Homebrew/extend/os/linux/cmd/update-report.rb b/Library/Homebrew/extend/os/linux/cmd/update-report.rb index 5e9091a3e7..fd0ad1aeeb 100644 --- a/Library/Homebrew/extend/os/linux/cmd/update-report.rb +++ b/Library/Homebrew/extend/os/linux/cmd/update-report.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Homebrew - extend T::Sig - module_function def no_changes_message diff --git a/Library/Homebrew/extend/os/linux/dependency_collector.rb b/Library/Homebrew/extend/os/linux/dependency_collector.rb index 785ca93326..e049afcaf6 100644 --- a/Library/Homebrew/extend/os/linux/dependency_collector.rb +++ b/Library/Homebrew/extend/os/linux/dependency_collector.rb @@ -4,8 +4,6 @@ require "os/linux/glibc" class DependencyCollector - extend T::Sig - undef gcc_dep_if_needed undef glibc_dep_if_needed undef init_global_dep_tree_if_needed! diff --git a/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb b/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb index 0f711eeafd..4072a84b44 100644 --- a/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb +++ b/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Homebrew - extend T::Sig - class << self alias generic_git_tags git_tags diff --git a/Library/Homebrew/extend/os/linux/development_tools.rb b/Library/Homebrew/extend/os/linux/development_tools.rb index f5928260f4..d26b73f312 100644 --- a/Library/Homebrew/extend/os/linux/development_tools.rb +++ b/Library/Homebrew/extend/os/linux/development_tools.rb @@ -3,8 +3,6 @@ class DevelopmentTools class << self - extend T::Sig - sig { params(tool: String).returns(T.nilable(Pathname)) } def locate(tool) (@locate ||= {}).fetch(tool) do |key| diff --git a/Library/Homebrew/extend/os/linux/diagnostic.rb b/Library/Homebrew/extend/os/linux/diagnostic.rb index f583b965ae..fea32b3893 100644 --- a/Library/Homebrew/extend/os/linux/diagnostic.rb +++ b/Library/Homebrew/extend/os/linux/diagnostic.rb @@ -51,9 +51,9 @@ module Homebrew <<~EOS The directory #{HOMEBREW_TEMP} does not permit executing programs. It is likely mounted as "noexec". Please set HOMEBREW_TEMP - in your #{shell_profile} to a different directory, for example: + in your #{Utils::Shell.profile} to a different directory, for example: export HOMEBREW_TEMP=~/tmp - echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile} + echo 'export HOMEBREW_TEMP=~/tmp' >> #{Utils::Shell.profile} EOS ensure f&.unlink @@ -68,7 +68,7 @@ module Homebrew this variable set to include other locations. Some programs like `vapigen` may not work correctly. Consider adding Homebrew's share directory to XDG_DATA_DIRS like so: - echo 'export XDG_DATA_DIRS="#{HOMEBREW_PREFIX}/share:$XDG_DATA_DIRS"' >> #{shell_profile} + echo 'export XDG_DATA_DIRS="#{HOMEBREW_PREFIX}/share:$XDG_DATA_DIRS"' >> #{Utils::Shell.profile} EOS end @@ -78,8 +78,8 @@ module Homebrew <<~EOS umask is currently set to 000. Directories created by Homebrew cannot be world-writable. This issue can be resolved by adding "umask 002" to - your #{shell_profile}: - echo 'umask 002' >> #{shell_profile} + your #{Utils::Shell.profile}: + echo 'umask 002' >> #{Utils::Shell.profile} EOS end diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index c0691c0001..2f151597d5 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Superenv - extend T::Sig - # The location of Homebrew's shims on Linux. def self.shims_path HOMEBREW_SHIMS_PATH/"linux/super" diff --git a/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb b/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb index 11eb2a0db0..b08411fb1b 100644 --- a/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true module FormulaCellarChecks - extend T::Sig sig { params(filename: Pathname).returns(T::Boolean) } def valid_library_extension?(filename) generic_valid_library_extension?(filename) || filename.basename.to_s.include?(".so.") diff --git a/Library/Homebrew/extend/os/linux/install.rb b/Library/Homebrew/extend/os/linux/install.rb index 2202386424..cc8a6b4715 100644 --- a/Library/Homebrew/extend/os/linux/install.rb +++ b/Library/Homebrew/extend/os/linux/install.rb @@ -3,8 +3,6 @@ module Homebrew module Install - module_function - # This is a list of known paths to the host dynamic linker on Linux if # the host glibc is new enough. The symlink_ld_so method will fail if # the host linker cannot be found in this list. @@ -32,19 +30,19 @@ module Homebrew ].freeze private_constant :GCC_RUNTIME_LIBS - def perform_preinstall_checks(all_fatal: false, cc: nil) + def self.perform_preinstall_checks(all_fatal: false, cc: nil) generic_perform_preinstall_checks(all_fatal: all_fatal, cc: cc) symlink_ld_so setup_preferred_gcc_libs end - def global_post_install + def self.global_post_install generic_global_post_install symlink_ld_so setup_preferred_gcc_libs end - def check_cpu + def self.check_cpu return if Hardware::CPU.intel? && Hardware::CPU.is_64_bit? return if Hardware::CPU.arm? @@ -59,7 +57,7 @@ module Homebrew end private_class_method :check_cpu - def symlink_ld_so + def self.symlink_ld_so brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so" ld_so = HOMEBREW_PREFIX/"opt/glibc/bin/ld.so" @@ -79,7 +77,7 @@ module Homebrew end private_class_method :symlink_ld_so - def setup_preferred_gcc_libs + def self.setup_preferred_gcc_libs gcc_opt_prefix = HOMEBREW_PREFIX/"opt/#{OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA}" glibc_installed = (HOMEBREW_PREFIX/"opt/glibc/bin/ld.so").readable? diff --git a/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb b/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb index 8ebc4ecd72..296663fbca 100644 --- a/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb +++ b/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb @@ -4,8 +4,6 @@ require "requirement" class XcodeRequirement < Requirement - extend T::Sig - sig { returns(T::Boolean) } def xcode_installed_version true diff --git a/Library/Homebrew/extend/os/linux/software_spec.rb b/Library/Homebrew/extend/os/linux/software_spec.rb index 7f5b4d2890..fca4a667af 100644 --- a/Library/Homebrew/extend/os/linux/software_spec.rb +++ b/Library/Homebrew/extend/os/linux/software_spec.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true class BottleSpecification - extend T::Sig - sig { params(tag: Utils::Bottles::Tag).returns(T::Boolean) } def skip_relocation?(tag: Utils::Bottles.tag) false diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index 353ae30428..0df45d805d 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -6,8 +6,6 @@ require "os/mac/xcode" # @private class DevelopmentTools class << self - extend T::Sig - alias generic_locate locate undef installed?, default_compiler, curl_handles_most_https_certificates?, subversion_handles_most_https_certificates? diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb b/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb index a13761a8b3..c696261f26 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module SharedEnvExtension - extend T::Sig - def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, debug_symbols: false) generic_shared_setup_build_environment(formula: formula, cc: cc, build_bottle: build_bottle, diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index 36aac56489..3d0459a5a1 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Superenv - extend T::Sig - class << self # The location of Homebrew's shims on macOS. def shims_path diff --git a/Library/Homebrew/extend/os/mac/formula_support.rb b/Library/Homebrew/extend/os/mac/formula_support.rb index 64e8d14726..563f652d74 100644 --- a/Library/Homebrew/extend/os/mac/formula_support.rb +++ b/Library/Homebrew/extend/os/mac/formula_support.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true class KegOnlyReason - extend T::Sig sig { returns(T::Boolean) } def applicable? true diff --git a/Library/Homebrew/extend/os/mac/hardware.rb b/Library/Homebrew/extend/os/mac/hardware.rb index 43adfa1dea..fb3273b7df 100644 --- a/Library/Homebrew/extend/os/mac/hardware.rb +++ b/Library/Homebrew/extend/os/mac/hardware.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true module Hardware - extend T::Sig sig { params(version: T.nilable(Version)).returns(Symbol) } def self.oldest_cpu(version = nil) version = if version diff --git a/Library/Homebrew/extend/os/mac/missing_formula.rb b/Library/Homebrew/extend/os/mac/missing_formula.rb index 681747e88b..8721980e76 100644 --- a/Library/Homebrew/extend/os/mac/missing_formula.rb +++ b/Library/Homebrew/extend/os/mac/missing_formula.rb @@ -1,16 +1,13 @@ # typed: strict # frozen_string_literal: true -require "cask/cmd/abstract_command" require "cask/info" require "cask/cask_loader" require "cask/caskroom" module Homebrew module MissingFormula - extend T::Sig class << self - extend T::Sig sig { params(name: String).returns(T.nilable(String)) } def disallowed_reason(name) case name.downcase diff --git a/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb b/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb index cff64f5802..9bbdf4a33a 100644 --- a/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb +++ b/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb @@ -6,8 +6,6 @@ require "system_command" module UnpackStrategy class Zip module MacOSZipExtension - extend T::Sig - include UnpackStrategy include SystemCommand::Mixin diff --git a/Library/Homebrew/extend/os/mac/utils/analytics.rb b/Library/Homebrew/extend/os/mac/utils/analytics.rb index 4d104e6dce..63f45f9f3b 100644 --- a/Library/Homebrew/extend/os/mac/utils/analytics.rb +++ b/Library/Homebrew/extend/os/mac/utils/analytics.rb @@ -4,8 +4,6 @@ module Utils module Analytics class << self - extend T::Sig - sig { returns(String) } def custom_prefix_label_google return generic_custom_prefix_label_google if Hardware::CPU.arm? diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index ca9144b27a..ee2d91f0b3 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -6,8 +6,6 @@ require "resource" require "metafiles" module DiskUsageExtension - extend T::Sig - sig { returns(Integer) } def disk_usage return @disk_usage if defined?(@disk_usage) @@ -78,8 +76,6 @@ end # Homebrew extends Ruby's `Pathname` to make our code more readable. # @see https://ruby-doc.org/stdlib-2.6.3/libdoc/pathname/rdoc/Pathname.html Ruby's Pathname API class Pathname - extend T::Sig - include DiskUsageExtension # Moves a file from the original location to the {Pathname}'s. @@ -498,11 +494,7 @@ require "extend/os/pathname" # @private module ObserverPathnameExtension - extend T::Sig - class << self - extend T::Sig - include Context sig { returns(Integer) } diff --git a/Library/Homebrew/fetch.rb b/Library/Homebrew/fetch.rb index 09b5614fd2..c71ebc8efe 100644 --- a/Library/Homebrew/fetch.rb +++ b/Library/Homebrew/fetch.rb @@ -4,8 +4,6 @@ module Homebrew # @api private module Fetch - extend T::Sig - sig { params(formula: Formula, args: CLI::Args).returns(T::Boolean) } def fetch_bottle?(formula, args:) bottle = formula.bottle diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 0e4feeb1c6..d528ab402f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -58,8 +58,6 @@ require "extend/api_hashable" # end # end class Formula - extend T::Sig - include FileUtils include Utils::Inreplace include Utils::Shebang @@ -2199,7 +2197,7 @@ class Formula "sha256" => resource("ruby-source").checksum.hexdigest, } elsif !self.class.loaded_from_api && path.exist? - hsh["ruby_source_path"] = path.relative_path_from(tap.path).to_s + hsh["ruby_source_path"] = (path.relative_path_from(tap.path).to_s if tap) hsh["ruby_source_checksum"] = { "sha256" => Digest::SHA256.file(path).hexdigest, } @@ -2726,7 +2724,7 @@ class Formula # The methods below define the formula DSL. class << self extend Predicable - extend T::Sig + include BuildEnvironment::DSL include OnSystem::MacOSAndLinux diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 4174530677..35113d38b6 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -826,28 +826,6 @@ module Homebrew end end - def audit_github_issue_comment - return unless @online - - matches = text.to_s.scan(%r{https://github.com/([-\w_]*)/([-\w_]*)/(pull|issues)/([0-9]*)}) - return unless matches - - matches.each do |match| - owner, repo, type, id = match - - # Do not trigger for self references - next if "#{owner}/#{repo}" == formula.tap.remote_repo || owner == "Homebrew" - - issue = GitHub::API.open_rest("https://api.github.com/repos/#{owner}/#{repo}/issues/#{id}") - next if issue.blank? - next if issue["state"] == "open" - next if issue.dig("pull_request", "merged_at").present? - - issue_url = "https://github.com/#{owner}/#{repo}/#{type}/#{id}" - problem "Formula refers to a GitHub issue or pull request that is closed: #{issue_url}" - end - end - def audit_reverse_migration # Only enforce for new formula being re-added to core return unless @strict diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index ed988b1d7c..285bd5e126 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -7,7 +7,6 @@ require "utils/shell" # # @api private module FormulaCellarChecks - extend T::Sig extend T::Helpers abstract! diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 2e0ab2f35f..800f4a548f 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -9,8 +9,6 @@ module Homebrew # # @api private class FormulaCreator - extend T::Sig - attr_reader :args, :url, :sha256, :desc, :homepage attr_accessor :name, :version, :tap, :path, :mode, :license diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index d69d38b367..187e85d3c5 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -27,8 +27,6 @@ require "service" # # @api private class FormulaInstaller - extend T::Sig - include FormulaCellarChecks extend Predicable diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index 4859606c9b..fa570fd296 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -7,8 +7,6 @@ FormulaConflict = Struct.new(:name, :reason) # Used to annotate formulae that duplicate macOS-provided software # or cause conflicts when linked in. class KegOnlyReason - extend T::Sig - attr_reader :reason def initialize(reason, explanation) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 349b5b5041..eba35694cc 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -14,8 +14,6 @@ require "active_support/core_ext/hash/deep_transform_values" # # @api private module Formulary - extend T::Sig - extend Cachable URL_START_REGEX = %r{(https?|ftp|file)://}.freeze @@ -287,6 +285,7 @@ module Formulary def caveats self.class.instance_variable_get(:@caveats_string) &.gsub(HOMEBREW_PREFIX_PLACEHOLDER, HOMEBREW_PREFIX) + &.gsub(HOMEBREW_HOME_PLACEHOLDER, Dir.home) end @tap_git_head_string = json_formula["tap_git_head"] @@ -485,8 +484,6 @@ module Formulary # Loads formulae from URLs. class FromUrlLoader < FormulaLoader - extend T::Sig - attr_reader :url sig { params(url: T.any(URI::Generic, String), from: T.nilable(Symbol)).void } diff --git a/Library/Homebrew/extend/git_repository.rb b/Library/Homebrew/git_repository.rb similarity index 73% rename from Library/Homebrew/extend/git_repository.rb rename to Library/Homebrew/git_repository.rb index 6e21970e31..c50626f5fd 100644 --- a/Library/Homebrew/extend/git_repository.rb +++ b/Library/Homebrew/git_repository.rb @@ -4,111 +4,122 @@ require "utils/git" require "utils/popen" -# Extensions to {Pathname} for querying Git repository information. +# Given a {Pathname}, provides methods for querying Git repository information. # @see Utils::Git # @api private -module GitRepositoryExtension - extend T::Sig +class GitRepository + sig { returns(Pathname) } + attr_reader :pathname + + sig { params(pathname: Pathname).void } + def initialize(pathname) + @pathname = pathname + end sig { returns(T::Boolean) } - def git? - join(".git").exist? + def git_repo? + pathname.join(".git").exist? end # Gets the URL of the Git origin remote. sig { returns(T.nilable(String)) } - def git_origin + def origin_url popen_git("config", "--get", "remote.origin.url") end # Sets the URL of the Git origin remote. sig { params(origin: String).returns(T.nilable(T::Boolean)) } - def git_origin=(origin) - return if !git? || !Utils::Git.available? + def origin_url=(origin) + return if !git_repo? || !Utils::Git.available? - safe_system Utils::Git.git, "remote", "set-url", "origin", origin, chdir: self + safe_system Utils::Git.git, "remote", "set-url", "origin", origin, chdir: pathname end # Gets the full commit hash of the HEAD commit. sig { params(safe: T::Boolean).returns(T.nilable(String)) } - def git_head(safe: false) + def head_ref(safe: false) popen_git("rev-parse", "--verify", "--quiet", "HEAD", safe: safe) end # Gets a short commit hash of the HEAD commit. sig { params(length: T.nilable(Integer), safe: T::Boolean).returns(T.nilable(String)) } - def git_short_head(length: nil, safe: false) + def short_head_ref(length: nil, safe: false) short_arg = length.present? ? "--short=#{length}" : "--short" popen_git("rev-parse", short_arg, "--verify", "--quiet", "HEAD", safe: safe) end # Gets the relative date of the last commit, e.g. "1 hour ago" sig { returns(T.nilable(String)) } - def git_last_commit + def last_committed popen_git("show", "-s", "--format=%cr", "HEAD") end # Gets the name of the currently checked-out branch, or HEAD if the repository is in a detached HEAD state. sig { params(safe: T::Boolean).returns(T.nilable(String)) } - def git_branch(safe: false) + def branch_name(safe: false) popen_git("rev-parse", "--abbrev-ref", "HEAD", safe: safe) end # Change the name of a local branch sig { params(old: String, new: String).void } - def git_rename_branch(old:, new:) + def rename_branch(old:, new:) popen_git("branch", "-m", old, new) end # Set an upstream branch for a local branch to track sig { params(local: String, origin: String).void } - def git_branch_set_upstream(local:, origin:) + def set_upstream_branch(local:, origin:) popen_git("branch", "-u", "origin/#{origin}", local) end # Gets the name of the default origin HEAD branch. sig { returns(T.nilable(String)) } - def git_origin_branch + def origin_branch_name popen_git("symbolic-ref", "-q", "--short", "refs/remotes/origin/HEAD")&.split("/")&.last end # Returns true if the repository's current branch matches the default origin branch. sig { returns(T.nilable(T::Boolean)) } - def git_default_origin_branch? - git_origin_branch == git_branch + def default_origin_branch? + origin_branch_name == branch_name end # Returns the date of the last commit, in YYYY-MM-DD format. sig { returns(T.nilable(String)) } - def git_last_commit_date + def last_commit_date popen_git("show", "-s", "--format=%cd", "--date=short", "HEAD") end # Returns true if the given branch exists on origin sig { params(branch: String).returns(T::Boolean) } - def git_origin_has_branch?(branch) + def origin_has_branch?(branch) popen_git("ls-remote", "--heads", "origin", branch).present? end sig { void } - def git_origin_set_head_auto + def set_head_origin_auto popen_git("remote", "set-head", "origin", "--auto") end # Gets the full commit message of the specified commit, or of the HEAD commit if unspecified. sig { params(commit: String, safe: T::Boolean).returns(T.nilable(String)) } - def git_commit_message(commit = "HEAD", safe: false) + def commit_message(commit = "HEAD", safe: false) popen_git("log", "-1", "--pretty=%B", commit, "--", safe: safe, err: :out)&.strip end + sig { returns(String) } + def to_s + pathname.to_s + end + private sig { params(args: T.untyped, safe: T::Boolean, err: T.nilable(Symbol)).returns(T.nilable(String)) } def popen_git(*args, safe: false, err: nil) - unless git? + unless git_repo? return unless safe - raise "Not a Git repository: #{self}" + raise "Not a Git repository: #{pathname}" end unless Utils::Git.available? @@ -117,6 +128,6 @@ module GitRepositoryExtension raise "Git is unavailable" end - Utils.popen_read(Utils::Git.git, *args, safe: safe, chdir: self, err: err).chomp.presence + Utils.popen_read(Utils::Git.git, *args, safe: safe, chdir: pathname, err: err).chomp.presence end end diff --git a/Library/Homebrew/github_packages.rb b/Library/Homebrew/github_packages.rb index dd0eefed30..636eb0823c 100644 --- a/Library/Homebrew/github_packages.rb +++ b/Library/Homebrew/github_packages.rb @@ -9,8 +9,6 @@ require "zlib" # # @api private class GitHubPackages - extend T::Sig - include Context URL_DOMAIN = "ghcr.io" @@ -356,11 +354,14 @@ class GitHubPackages documentation = "https://formulae.brew.sh/formula/#{formula_name}" if formula_core_tap + local_file_size = File.size(local_file) + descriptor_annotations_hash = { "org.opencontainers.image.ref.name" => tag, "sh.brew.bottle.cpu.variant" => cpu_variant, "sh.brew.bottle.digest" => tar_gz_sha256, "sh.brew.bottle.glibc.version" => glibc_version, + "sh.brew.bottle.size" => local_file_size.to_s, "sh.brew.tab" => tab.to_json, }.reject { |_, v| v.blank? } diff --git a/Library/Homebrew/github_releases.rb b/Library/Homebrew/github_releases.rb index e59d268991..53dccb0dc8 100644 --- a/Library/Homebrew/github_releases.rb +++ b/Library/Homebrew/github_releases.rb @@ -8,8 +8,6 @@ require "json" # # @api private class GitHubReleases - extend T::Sig - include Context include Utils::Curl diff --git a/Library/Homebrew/github_runner.rb b/Library/Homebrew/github_runner.rb index 0dbf845cdc..91da9f7454 100644 --- a/Library/Homebrew/github_runner.rb +++ b/Library/Homebrew/github_runner.rb @@ -5,8 +5,6 @@ require "linux_runner_spec" require "macos_runner_spec" class GitHubRunner < T::Struct - extend T::Sig - const :platform, Symbol const :arch, Symbol const :spec, T.any(LinuxRunnerSpec, MacOSRunnerSpec) diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index 632c3b3c64..3cee6e7acd 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -5,8 +5,6 @@ require "test_runner_formula" require "github_runner" class GitHubRunnerMatrix - extend T::Sig - # FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed. # rubocop:disable Style/MutableConstant MaybeStringArray = T.type_alias { T.nilable(T::Array[String]) } @@ -15,7 +13,7 @@ class GitHubRunnerMatrix RunnerSpec = T.type_alias { T.any(LinuxRunnerSpec, MacOSRunnerSpec) } private_constant :RunnerSpec - MacOSRunnerSpecHash = T.type_alias { { name: String, runner: String, cleanup: T::Boolean } } + MacOSRunnerSpecHash = T.type_alias { { name: String, runner: String, timeout: Integer, cleanup: T::Boolean } } private_constant :MacOSRunnerSpecHash LinuxRunnerSpecHash = T.type_alias do @@ -110,6 +108,7 @@ class GitHubRunnerMatrix github_run_id = ENV.fetch("GITHUB_RUN_ID") github_run_attempt = ENV.fetch("GITHUB_RUN_ATTEMPT") + timeout = ENV.fetch("HOMEBREW_MACOS_TIMEOUT").to_i ephemeral_suffix = +"-#{github_run_id}-#{github_run_attempt}" ephemeral_suffix << "-deps" if @dependent_matrix ephemeral_suffix.freeze @@ -118,9 +117,16 @@ class GitHubRunnerMatrix macos_version = OS::Mac::Version.new(version) next if macos_version.unsupported_release? + # Intel Big Sur is a bit slower than the other runners, + # so give it a little bit more time. The comparison below + # should be `==`, but it returns typecheck errors. + runner_timeout = timeout + runner_timeout += 30 if macos_version <= :big_sur + spec = MacOSRunnerSpec.new( name: "macOS #{version}-x86_64", runner: "#{version}#{ephemeral_suffix}", + timeout: runner_timeout, cleanup: false, ) @runners << create_runner(:macos, :x86_64, spec, macos_version) @@ -128,15 +134,14 @@ class GitHubRunnerMatrix next unless macos_version >= :big_sur # Use bare metal runner when testing dependents on ARM64 Monterey. - use_ephemeral = (macos_version >= :ventura && @dependent_matrix) || - (macos_version >= :monterey && !@dependent_matrix) + use_ephemeral = macos_version >= (@dependent_matrix ? :ventura : :monterey) runner, cleanup = if use_ephemeral ["#{version}-arm64#{ephemeral_suffix}", false] else ["#{version}-arm64", true] end - spec = MacOSRunnerSpec.new(name: "macOS #{version}-arm64", runner: runner, cleanup: cleanup) + spec = MacOSRunnerSpec.new(name: "macOS #{version}-arm64", runner: runner, timeout: timeout, cleanup: cleanup) @runners << create_runner(:macos, :arm64, spec, macos_version) end @@ -156,9 +161,12 @@ class GitHubRunnerMatrix arch = runner.arch macos_version = runner.macos_version - compatible_formulae.select! { |formula| formula.public_send(:"#{platform}_compatible?") } - compatible_formulae.select! { |formula| formula.public_send(:"#{arch}_compatible?") } - compatible_formulae.select! { |formula| formula.compatible_with?(macos_version) } if macos_version + compatible_formulae.select! do |formula| + next false if macos_version && !formula.compatible_with?(macos_version) + + formula.public_send(:"#{platform}_compatible?") && + formula.public_send(:"#{arch}_compatible?") + end compatible_formulae.present? end @@ -180,9 +188,12 @@ class GitHubRunnerMatrix compatible_dependents = formula.dependents(platform: platform, arch: arch, macos_version: macos_version&.to_sym) .dup - compatible_dependents.select! { |dependent_f| dependent_f.public_send(:"#{platform}_compatible?") } - compatible_dependents.select! { |dependent_f| dependent_f.public_send(:"#{arch}_compatible?") } - compatible_dependents.select! { |dependent_f| dependent_f.compatible_with?(macos_version) } if macos_version + compatible_dependents.select! do |dependent_f| + next false if macos_version && !dependent_f.compatible_with?(macos_version) + + dependent_f.public_send(:"#{platform}_compatible?") && + dependent_f.public_send(:"#{arch}_compatible?") + end # These arrays will generally have been generated by different Formulary caches, # so we can only compare them by name and not directly. diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 3c3cecdb2d..27f2015451 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -72,6 +72,7 @@ HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze +require "extend/module" require "env_config" require "macos_versions" require "os" @@ -131,10 +132,9 @@ end require "context" require "extend/array" -require "extend/git_repository" +require "git_repository" require "extend/pathname" require "extend/predicable" -require "extend/module" require "cli/args" require "PATH" diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index 02c6bec9df..22bebf626b 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -24,8 +24,6 @@ module Hardware INTEL_64BIT_OLDEST_CPU = :core2 class << self - extend T::Sig - def optimization_flags @optimization_flags ||= { native: arch_flag("native"), diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index fba154d8e0..a90d5a2d49 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -41,9 +41,7 @@ module Homebrew EOS private_constant :HOMEBREW_HELP - module_function - - def help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: []) + def self.help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: []) if cmd.nil? # Handle `brew` (no arguments). if empty_argv @@ -75,7 +73,7 @@ module Homebrew exit 0 end - def command_help(cmd, path, remaining_args:) + def self.command_help(cmd, path, remaining_args:) # Only some types of commands can have a parser. output = if Commands.valid_internal_cmd?(cmd) || Commands.valid_internal_dev_cmd?(cmd) || @@ -94,7 +92,7 @@ module Homebrew end private_class_method :command_help - def parser_help(path, remaining_args:) + def self.parser_help(path, remaining_args:) # Let OptionParser generate help text for commands which have a parser. cmd_parser = CLI::Parser.from_cmd_path(path) return unless cmd_parser @@ -105,7 +103,7 @@ module Homebrew end private_class_method :parser_help - def command_help_lines(path) + def self.command_help_lines(path) path.read .lines .grep(/^#:/) @@ -113,7 +111,7 @@ module Homebrew end private_class_method :command_help_lines - def comment_help(path) + def self.comment_help(path) # Otherwise read #: lines from the file. help_lines = command_help_lines(path) return if help_lines.blank? diff --git a/Library/Homebrew/help.rbi b/Library/Homebrew/help.rbi deleted file mode 100644 index 9db873c525..0000000000 --- a/Library/Homebrew/help.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Homebrew - module Help - include Kernel - end -end diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index fdf31bbe8a..47cf8084be 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -12,355 +12,351 @@ module Homebrew # # @api private module Install - module_function - - def perform_preinstall_checks(all_fatal: false, cc: nil) - check_prefix - check_cpu - attempt_directory_creation - check_cc_argv(cc) - Diagnostic.checks(:supported_configuration_checks, fatal: all_fatal) - Diagnostic.checks(:fatal_preinstall_checks) - end - alias generic_perform_preinstall_checks perform_preinstall_checks - module_function :generic_perform_preinstall_checks - - def perform_build_from_source_checks(all_fatal: false) - Diagnostic.checks(:fatal_build_from_source_checks) - Diagnostic.checks(:build_from_source_checks, fatal: all_fatal) - end - - def global_post_install; end - alias generic_global_post_install global_post_install - module_function :generic_global_post_install - - def check_prefix - if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) && - HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX - if Hardware::CPU.in_rosetta2? - odie <<~EOS - Cannot install under Rosetta 2 in ARM default prefix (#{HOMEBREW_PREFIX})! - To rerun under ARM use: - arch -arm64 brew install ... - To install under x86_64, install Homebrew into #{HOMEBREW_DEFAULT_PREFIX}. - EOS - else - odie "Cannot install on Intel processor in ARM default prefix (#{HOMEBREW_PREFIX})!" - end - elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX - odie <<~EOS - Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})! - Please create a new installation in #{HOMEBREW_MACOS_ARM_DEFAULT_PREFIX} using one of the - "Alternative Installs" from: - #{Formatter.url("https://docs.brew.sh/Installation")} - You can migrate your previously installed formula list with: - brew bundle dump - EOS + class << self + def perform_preinstall_checks(all_fatal: false, cc: nil) + check_prefix + check_cpu + attempt_directory_creation + check_cc_argv(cc) + Diagnostic.checks(:supported_configuration_checks, fatal: all_fatal) + Diagnostic.checks(:fatal_preinstall_checks) end - end + alias generic_perform_preinstall_checks perform_preinstall_checks - def check_cpu - return unless Hardware::CPU.ppc? - - odie <<~EOS - Sorry, Homebrew does not support your computer's CPU architecture! - For PowerPC Mac (PPC32/PPC64BE) support, see: - #{Formatter.url("https://github.com/mistydemeo/tigerbrew")} - EOS - end - private_class_method :check_cpu - - def attempt_directory_creation - Keg::MUST_EXIST_DIRECTORIES.each do |dir| - FileUtils.mkdir_p(dir) unless dir.exist? - - # Create these files to ensure that these directories aren't removed - # by the Catalina installer. - # (https://github.com/Homebrew/brew/issues/6263) - keep_file = dir/".keepme" - FileUtils.touch(keep_file) unless keep_file.exist? - rescue - nil - end - end - private_class_method :attempt_directory_creation - - def check_cc_argv(cc) - return unless cc - - @checks ||= Diagnostic::Checks.new - opoo <<~EOS - You passed `--cc=#{cc}`. - #{@checks.please_create_pull_requests} - EOS - end - private_class_method :check_cc_argv - - def install_formula?( - formula, - head: false, - fetch_head: false, - only_dependencies: false, - force: false, - quiet: false - ) - # head-only without --HEAD is an error - if !head && formula.stable.nil? - odie <<~EOS - #{formula.full_name} is a head-only formula. - To install it, run: - brew install --HEAD #{formula.full_name} - EOS + def perform_build_from_source_checks(all_fatal: false) + Diagnostic.checks(:fatal_build_from_source_checks) + Diagnostic.checks(:build_from_source_checks, fatal: all_fatal) end - # --HEAD, fail with no head defined - odie "No head is defined for #{formula.full_name}" if head && formula.head.nil? + def global_post_install; end + alias generic_global_post_install global_post_install - installed_head_version = formula.latest_head_version - if installed_head_version && - !formula.head_version_outdated?(installed_head_version, fetch_head: fetch_head) - new_head_installed = true - end - prefix_installed = formula.prefix.exist? && !formula.prefix.children.empty? - - if formula.keg_only? && formula.any_version_installed? && formula.optlinked? && !force - # keg-only install is only possible when no other version is - # linked to opt, because installing without any warnings can break - # dependencies. Therefore before performing other checks we need to be - # sure --force flag is passed. - if formula.outdated? - if !Homebrew::EnvConfig.no_install_upgrade? && !formula.pinned? - name = formula.name - version = formula.linked_version - puts "#{name} #{version} is already installed but outdated (so it will be upgraded)." - return true - end - - unpin_cmd_if_needed = ("brew unpin #{formula.full_name} && " if formula.pinned?) - optlinked_version = Keg.for(formula.opt_prefix).version - onoe <<~EOS - #{formula.full_name} #{optlinked_version} is already installed. - To upgrade to #{formula.version}, run: - #{unpin_cmd_if_needed}brew upgrade #{formula.full_name} - EOS - elsif only_dependencies - return true - elsif !quiet - opoo <<~EOS - #{formula.full_name} #{formula.pkg_version} is already installed and up-to-date. - To reinstall #{formula.pkg_version}, run: - brew reinstall #{formula.name} - EOS - end - elsif (head && new_head_installed) || prefix_installed - # After we're sure that --force flag is passed for linked to opt - # keg-only we need to be sure that the version we're attempting to - # install is not already installed. - - installed_version = if head - formula.latest_head_version - else - formula.pkg_version - end - - msg = "#{formula.full_name} #{installed_version} is already installed" - linked_not_equals_installed = formula.linked_version != installed_version - if formula.linked? && linked_not_equals_installed - msg = if quiet - nil - else - <<~EOS - #{msg}. - The currently linked version is: #{formula.linked_version} + def check_prefix + if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) && + HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX + if Hardware::CPU.in_rosetta2? + odie <<~EOS + Cannot install under Rosetta 2 in ARM default prefix (#{HOMEBREW_PREFIX})! + To rerun under ARM use: + arch -arm64 brew install ... + To install under x86_64, install Homebrew into #{HOMEBREW_DEFAULT_PREFIX}. EOS - end - elsif only_dependencies - msg = nil - return true - elsif !formula.linked? || formula.keg_only? - msg = <<~EOS - #{msg}, it's just not linked. - To link this version, run: - brew link #{formula} - EOS - else - msg = if quiet - nil else - <<~EOS - #{msg} and up-to-date. + odie "Cannot install on Intel processor in ARM default prefix (#{HOMEBREW_PREFIX})!" + end + elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX + odie <<~EOS + Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})! + Please create a new installation in #{HOMEBREW_MACOS_ARM_DEFAULT_PREFIX} using one of the + "Alternative Installs" from: + #{Formatter.url("https://docs.brew.sh/Installation")} + You can migrate your previously installed formula list with: + brew bundle dump + EOS + end + end + + def install_formula?( + formula, + head: false, + fetch_head: false, + only_dependencies: false, + force: false, + quiet: false + ) + # head-only without --HEAD is an error + if !head && formula.stable.nil? + odie <<~EOS + #{formula.full_name} is a head-only formula. + To install it, run: + brew install --HEAD #{formula.full_name} + EOS + end + + # --HEAD, fail with no head defined + odie "No head is defined for #{formula.full_name}" if head && formula.head.nil? + + installed_head_version = formula.latest_head_version + if installed_head_version && + !formula.head_version_outdated?(installed_head_version, fetch_head: fetch_head) + new_head_installed = true + end + prefix_installed = formula.prefix.exist? && !formula.prefix.children.empty? + + if formula.keg_only? && formula.any_version_installed? && formula.optlinked? && !force + # keg-only install is only possible when no other version is + # linked to opt, because installing without any warnings can break + # dependencies. Therefore before performing other checks we need to be + # sure --force flag is passed. + if formula.outdated? + if !Homebrew::EnvConfig.no_install_upgrade? && !formula.pinned? + name = formula.name + version = formula.linked_version + puts "#{name} #{version} is already installed but outdated (so it will be upgraded)." + return true + end + + unpin_cmd_if_needed = ("brew unpin #{formula.full_name} && " if formula.pinned?) + optlinked_version = Keg.for(formula.opt_prefix).version + onoe <<~EOS + #{formula.full_name} #{optlinked_version} is already installed. + To upgrade to #{formula.version}, run: + #{unpin_cmd_if_needed}brew upgrade #{formula.full_name} + EOS + elsif only_dependencies + return true + elsif !quiet + opoo <<~EOS + #{formula.full_name} #{formula.pkg_version} is already installed and up-to-date. To reinstall #{formula.pkg_version}, run: brew reinstall #{formula.name} EOS end - end - opoo msg if msg - elsif !formula.any_version_installed? && (old_formula = formula.old_installed_formulae.first) - msg = "#{old_formula.full_name} #{old_formula.any_installed_version} already installed" - msg = if !old_formula.linked? && !old_formula.keg_only? - <<~EOS - #{msg}, it's just not linked. - To link this version, run: - brew link #{old_formula.full_name} - EOS - elsif quiet - nil - else - "#{msg}." - end - opoo msg if msg - elsif formula.migration_needed? && !force - # Check if the formula we try to install is the same as installed - # but not migrated one. If --force is passed then install anyway. - opoo <<~EOS - #{formula.oldname} is already installed, it's just not migrated. - To migrate this formula, run: - brew migrate #{formula} - Or to force-install it, run: - brew install #{formula} --force - EOS - elsif formula.linked? - message = "#{formula.name} #{formula.linked_version} is already installed" - if formula.outdated? && !head - if !Homebrew::EnvConfig.no_install_upgrade? && !formula.pinned? - puts "#{message} but outdated (so it will be upgraded)." + elsif (head && new_head_installed) || prefix_installed + # After we're sure that --force flag is passed for linked to opt + # keg-only we need to be sure that the version we're attempting to + # install is not already installed. + + installed_version = if head + formula.latest_head_version + else + formula.pkg_version + end + + msg = "#{formula.full_name} #{installed_version} is already installed" + linked_not_equals_installed = formula.linked_version != installed_version + if formula.linked? && linked_not_equals_installed + msg = if quiet + nil + else + <<~EOS + #{msg}. + The currently linked version is: #{formula.linked_version} + EOS + end + elsif only_dependencies + msg = nil return true + elsif !formula.linked? || formula.keg_only? + msg = <<~EOS + #{msg}, it's just not linked. + To link this version, run: + brew link #{formula} + EOS + else + msg = if quiet + nil + else + <<~EOS + #{msg} and up-to-date. + To reinstall #{formula.pkg_version}, run: + brew reinstall #{formula.name} + EOS + end end - - unpin_cmd_if_needed = ("brew unpin #{formula.full_name} && " if formula.pinned?) - onoe <<~EOS - #{message} - To upgrade to #{formula.pkg_version}, run: - #{unpin_cmd_if_needed}brew upgrade #{formula.full_name} + opoo msg if msg + elsif !formula.any_version_installed? && (old_formula = formula.old_installed_formulae.first) + msg = "#{old_formula.full_name} #{old_formula.any_installed_version} already installed" + msg = if !old_formula.linked? && !old_formula.keg_only? + <<~EOS + #{msg}, it's just not linked. + To link this version, run: + brew link #{old_formula.full_name} + EOS + elsif quiet + nil + else + "#{msg}." + end + opoo msg if msg + elsif formula.migration_needed? && !force + # Check if the formula we try to install is the same as installed + # but not migrated one. If --force is passed then install anyway. + opoo <<~EOS + #{formula.oldname} is already installed, it's just not migrated. + To migrate this formula, run: + brew migrate #{formula} + Or to force-install it, run: + brew install #{formula} --force EOS - elsif only_dependencies - return true + elsif formula.linked? + message = "#{formula.name} #{formula.linked_version} is already installed" + if formula.outdated? && !head + if !Homebrew::EnvConfig.no_install_upgrade? && !formula.pinned? + puts "#{message} but outdated (so it will be upgraded)." + return true + end + + unpin_cmd_if_needed = ("brew unpin #{formula.full_name} && " if formula.pinned?) + onoe <<~EOS + #{message} + To upgrade to #{formula.pkg_version}, run: + #{unpin_cmd_if_needed}brew upgrade #{formula.full_name} + EOS + elsif only_dependencies + return true + else + onoe <<~EOS + #{message} + To install #{formula.pkg_version}, first run: + brew unlink #{formula.name} + EOS + end else - onoe <<~EOS - #{message} - To install #{formula.pkg_version}, first run: - brew unlink #{formula.name} - EOS + # If none of the above is true and the formula is linked, then + # FormulaInstaller will handle this case. + return true end - else - # If none of the above is true and the formula is linked, then - # FormulaInstaller will handle this case. - return true + + # Even if we don't install this formula mark it as no longer just + # installed as a dependency. + return false unless formula.opt_prefix.directory? + + keg = Keg.new(formula.opt_prefix.resolved_path) + tab = Tab.for_keg(keg) + unless tab.installed_on_request + tab.installed_on_request = true + tab.write + end + + false end - # Even if we don't install this formula mark it as no longer just - # installed as a dependency. - return false unless formula.opt_prefix.directory? + def install_formulae( + formulae_to_install, + build_bottle: false, + force_bottle: false, + bottle_arch: nil, + ignore_deps: false, + only_deps: false, + include_test_formulae: [], + build_from_source_formulae: [], + cc: nil, + git: false, + interactive: false, + keep_tmp: false, + debug_symbols: false, + force: false, + overwrite: false, + debug: false, + quiet: false, + verbose: false, + dry_run: false, + skip_post_install: false + ) + formula_installers = formulae_to_install.map do |formula| + Migrator.migrate_if_needed(formula, force: force, dry_run: dry_run) + build_options = formula.build - keg = Keg.new(formula.opt_prefix.resolved_path) - tab = Tab.for_keg(keg) - unless tab.installed_on_request - tab.installed_on_request = true - tab.write - end + formula_installer = FormulaInstaller.new( + formula, + options: build_options.used_options, + build_bottle: build_bottle, + force_bottle: force_bottle, + bottle_arch: bottle_arch, + ignore_deps: ignore_deps, + only_deps: only_deps, + include_test_formulae: include_test_formulae, + build_from_source_formulae: build_from_source_formulae, + cc: cc, + git: git, + interactive: interactive, + keep_tmp: keep_tmp, + debug_symbols: debug_symbols, + force: force, + overwrite: overwrite, + debug: debug, + quiet: quiet, + verbose: verbose, + skip_post_install: skip_post_install, + ) - false - end - - def install_formulae( - formulae_to_install, - build_bottle: false, - force_bottle: false, - bottle_arch: nil, - ignore_deps: false, - only_deps: false, - include_test_formulae: [], - build_from_source_formulae: [], - cc: nil, - git: false, - interactive: false, - keep_tmp: false, - debug_symbols: false, - force: false, - overwrite: false, - debug: false, - quiet: false, - verbose: false, - dry_run: false, - skip_post_install: false - ) - formula_installers = formulae_to_install.map do |formula| - Migrator.migrate_if_needed(formula, force: force, dry_run: dry_run) - build_options = formula.build - - formula_installer = FormulaInstaller.new( - formula, - options: build_options.used_options, - build_bottle: build_bottle, - force_bottle: force_bottle, - bottle_arch: bottle_arch, - ignore_deps: ignore_deps, - only_deps: only_deps, - include_test_formulae: include_test_formulae, - build_from_source_formulae: build_from_source_formulae, - cc: cc, - git: git, - interactive: interactive, - keep_tmp: keep_tmp, - debug_symbols: debug_symbols, - force: force, - overwrite: overwrite, - debug: debug, - quiet: quiet, - verbose: verbose, - skip_post_install: skip_post_install, - ) - - begin - unless dry_run - formula_installer.prelude - formula_installer.fetch + begin + unless dry_run + formula_installer.prelude + formula_installer.fetch + end + formula_installer + rescue CannotInstallFormulaError => e + ofail e.message + nil + rescue UnsatisfiedRequirements, DownloadError, ChecksumMismatchError => e + ofail "#{formula}: #{e}" + nil end - formula_installer - rescue CannotInstallFormulaError => e - ofail e.message - nil - rescue UnsatisfiedRequirements, DownloadError, ChecksumMismatchError => e - ofail "#{formula}: #{e}" - nil - end - end.compact + end.compact - if dry_run - if (formulae_name_to_install = formulae_to_install.map(&:name)) - ohai "Would install #{Utils.pluralize("formula", formulae_name_to_install.count, - plural: "e", include_count: true)}:" - puts formulae_name_to_install.join(" ") + if dry_run + if (formulae_name_to_install = formulae_to_install.map(&:name)) + ohai "Would install #{Utils.pluralize("formula", formulae_name_to_install.count, + plural: "e", include_count: true)}:" + puts formulae_name_to_install.join(" ") - formula_installers.each do |fi| - print_dry_run_dependencies(fi.formula, fi.compute_dependencies, &:name) + formula_installers.each do |fi| + print_dry_run_dependencies(fi.formula, fi.compute_dependencies, &:name) + end end + return + end + + formula_installers.each do |fi| + install_formula(fi) + Cleanup.install_formula_clean!(fi.formula) end - return end - formula_installers.each do |fi| - install_formula(fi) - Cleanup.install_formula_clean!(fi.formula) - end - end + def print_dry_run_dependencies(formula, dependencies, &block) + return if dependencies.empty? - def install_formula(formula_installer) - formula = formula_installer.formula - - upgrade = formula.linked? && formula.outdated? && !formula.head? && !Homebrew::EnvConfig.no_install_upgrade? - - Upgrade.install_formula(formula_installer, upgrade: upgrade) - end - private_class_method :install_formula - - def print_dry_run_dependencies(formula, dependencies, &block) - return if dependencies.empty? - - ohai "Would install #{Utils.pluralize("dependenc", dependencies.count, plural: "ies", singular: "y", + ohai "Would install #{Utils.pluralize("dependenc", dependencies.count, plural: "ies", singular: "y", include_count: true)} for #{formula.name}:" - formula_names = dependencies.map(&:first).map(&:to_formula).map(&block) - puts formula_names.join(" ") + formula_names = dependencies.map(&:first).map(&:to_formula).map(&block) + puts formula_names.join(" ") + end + + private + + def check_cc_argv(cc) + return unless cc + + @checks ||= Diagnostic::Checks.new + opoo <<~EOS + You passed `--cc=#{cc}`. + #{@checks.please_create_pull_requests} + EOS + end + + def attempt_directory_creation + Keg::MUST_EXIST_DIRECTORIES.each do |dir| + FileUtils.mkdir_p(dir) unless dir.exist? + + # Create these files to ensure that these directories aren't removed + # by the Catalina installer. + # (https://github.com/Homebrew/brew/issues/6263) + keep_file = dir/".keepme" + FileUtils.touch(keep_file) unless keep_file.exist? + rescue + nil + end + end + + def check_cpu + return unless Hardware::CPU.ppc? + + odie <<~EOS + Sorry, Homebrew does not support your computer's CPU architecture! + For PowerPC Mac (PPC32/PPC64BE) support, see: + #{Formatter.url("https://github.com/mistydemeo/tigerbrew")} + EOS + end + + def install_formula(formula_installer) + formula = formula_installer.formula + + upgrade = formula.linked? && formula.outdated? && !formula.head? && !Homebrew::EnvConfig.no_install_upgrade? + + Upgrade.install_formula(formula_installer, upgrade: upgrade) + end end end end diff --git a/Library/Homebrew/install.rbi b/Library/Homebrew/install.rbi deleted file mode 100644 index 5208127284..0000000000 --- a/Library/Homebrew/install.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Homebrew - module Install - include Kernel - end -end diff --git a/Library/Homebrew/installed_dependents.rb b/Library/Homebrew/installed_dependents.rb index 7977dea71d..1b0a188ce5 100644 --- a/Library/Homebrew/installed_dependents.rb +++ b/Library/Homebrew/installed_dependents.rb @@ -7,8 +7,6 @@ require "cask_dependent" # # @api private module InstalledDependents - extend T::Sig - module_function # Given an array of kegs, this method will try to find some other kegs diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 8ea2c98f85..2d6f21cb91 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -10,8 +10,6 @@ require "extend/cachable" # # @api private class Keg - extend T::Sig - extend Cachable # Error for when a keg is already linked. @@ -40,8 +38,6 @@ class Keg # Error for when a file already exists or belongs to another keg. class ConflictError < LinkError - extend T::Sig - sig { returns(String) } def suggestion conflict = Keg.for(dst) @@ -72,8 +68,6 @@ class Keg # Error for when a directory is not writable. class DirectoryNotWritableError < LinkError - extend T::Sig - sig { returns(String) } def to_s <<~EOS diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 083529719b..59ffeab115 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -12,8 +12,6 @@ class Keg NULL_BYTE_STRING = "\\x00" class Relocation - extend T::Sig - RELOCATABLE_PATH_REGEX_PREFIX = /(?:(?<=-F|-I|-L|-isystem)|(?.+?)-\d+/i.freeze diff --git a/Library/Homebrew/livecheck/strategy/header_match.rb b/Library/Homebrew/livecheck/strategy/header_match.rb index 5f3ceb6e4f..a0d2729bb7 100644 --- a/Library/Homebrew/livecheck/strategy/header_match.rb +++ b/Library/Homebrew/livecheck/strategy/header_match.rb @@ -12,8 +12,6 @@ module Homebrew # # @api private class HeaderMatch - extend T::Sig - NICE_NAME = "Header match" # A priority of zero causes livecheck to skip the strategy. We do this diff --git a/Library/Homebrew/livecheck/strategy/json.rb b/Library/Homebrew/livecheck/strategy/json.rb index 042dbe1644..3cf1c475ab 100644 --- a/Library/Homebrew/livecheck/strategy/json.rb +++ b/Library/Homebrew/livecheck/strategy/json.rb @@ -23,8 +23,6 @@ module Homebrew # # @api public class Json - extend T::Sig - NICE_NAME = "JSON" # A priority of zero causes livecheck to skip the strategy. We do this diff --git a/Library/Homebrew/livecheck/strategy/launchpad.rb b/Library/Homebrew/livecheck/strategy/launchpad.rb index 5593f04a01..773870f5e0 100644 --- a/Library/Homebrew/livecheck/strategy/launchpad.rb +++ b/Library/Homebrew/livecheck/strategy/launchpad.rb @@ -23,8 +23,6 @@ module Homebrew # # @api public class Launchpad - extend T::Sig - # The `Regexp` used to determine if the strategy applies to the URL. URL_MATCH_REGEX = %r{ ^https?://(?:[^/]+?\.)*launchpad\.net diff --git a/Library/Homebrew/livecheck/strategy/npm.rb b/Library/Homebrew/livecheck/strategy/npm.rb index b72051c472..b152397196 100644 --- a/Library/Homebrew/livecheck/strategy/npm.rb +++ b/Library/Homebrew/livecheck/strategy/npm.rb @@ -17,8 +17,6 @@ module Homebrew # # @api public class Npm - extend T::Sig - NICE_NAME = "npm" # The `Regexp` used to determine if the strategy applies to the URL. diff --git a/Library/Homebrew/livecheck/strategy/page_match.rb b/Library/Homebrew/livecheck/strategy/page_match.rb index 37a69b0c49..753b57adef 100644 --- a/Library/Homebrew/livecheck/strategy/page_match.rb +++ b/Library/Homebrew/livecheck/strategy/page_match.rb @@ -16,8 +16,6 @@ module Homebrew # # @api public class PageMatch - extend T::Sig - NICE_NAME = "Page match" # A priority of zero causes livecheck to skip the strategy. We do this diff --git a/Library/Homebrew/livecheck/strategy/pypi.rb b/Library/Homebrew/livecheck/strategy/pypi.rb index 206585474b..99d495a20f 100644 --- a/Library/Homebrew/livecheck/strategy/pypi.rb +++ b/Library/Homebrew/livecheck/strategy/pypi.rb @@ -17,8 +17,6 @@ module Homebrew # # @api public class Pypi - extend T::Sig - NICE_NAME = "PyPI" # The `Regexp` used to extract the package name and suffix (e.g., file diff --git a/Library/Homebrew/livecheck/strategy/sourceforge.rb b/Library/Homebrew/livecheck/strategy/sourceforge.rb index 8a08235fce..aa8d8d9d5c 100644 --- a/Library/Homebrew/livecheck/strategy/sourceforge.rb +++ b/Library/Homebrew/livecheck/strategy/sourceforge.rb @@ -31,8 +31,6 @@ module Homebrew # # @api public class Sourceforge - extend T::Sig - NICE_NAME = "SourceForge" # The `Regexp` used to determine if the strategy applies to the URL. diff --git a/Library/Homebrew/livecheck/strategy/sparkle.rb b/Library/Homebrew/livecheck/strategy/sparkle.rb index 3a34de97f5..03a34676e8 100644 --- a/Library/Homebrew/livecheck/strategy/sparkle.rb +++ b/Library/Homebrew/livecheck/strategy/sparkle.rb @@ -14,8 +14,6 @@ module Homebrew # # @api private class Sparkle - extend T::Sig - # A priority of zero causes livecheck to skip the strategy. We do this # for {Sparkle} so we can selectively apply it when appropriate. PRIORITY = 0 @@ -46,8 +44,6 @@ module Homebrew :bundle_version, keyword_init: true, ) do - extend T::Sig - extend Forwardable # @api public diff --git a/Library/Homebrew/livecheck/strategy/xml.rb b/Library/Homebrew/livecheck/strategy/xml.rb index b1a59d40ab..06c9b09457 100644 --- a/Library/Homebrew/livecheck/strategy/xml.rb +++ b/Library/Homebrew/livecheck/strategy/xml.rb @@ -27,8 +27,6 @@ module Homebrew # # @api public class Xml - extend T::Sig - NICE_NAME = "XML" # A priority of zero causes livecheck to skip the strategy. We do this diff --git a/Library/Homebrew/livecheck/strategy/xorg.rb b/Library/Homebrew/livecheck/strategy/xorg.rb index 513352d4a5..ed73d42bc6 100644 --- a/Library/Homebrew/livecheck/strategy/xorg.rb +++ b/Library/Homebrew/livecheck/strategy/xorg.rb @@ -38,8 +38,6 @@ module Homebrew # # @api public class Xorg - extend T::Sig - NICE_NAME = "X.Org" # A `Regexp` used in determining if the strategy applies to the URL and diff --git a/Library/Homebrew/livecheck/strategy/yaml.rb b/Library/Homebrew/livecheck/strategy/yaml.rb index e96ca16608..2f75f57378 100644 --- a/Library/Homebrew/livecheck/strategy/yaml.rb +++ b/Library/Homebrew/livecheck/strategy/yaml.rb @@ -23,8 +23,6 @@ module Homebrew # # @api public class Yaml - extend T::Sig - NICE_NAME = "YAML" # A priority of zero causes livecheck to skip the strategy. We do this diff --git a/Library/Homebrew/locale.rb b/Library/Homebrew/locale.rb index ac6b24c6a6..6c0fe89bf5 100644 --- a/Library/Homebrew/locale.rb +++ b/Library/Homebrew/locale.rb @@ -7,8 +7,6 @@ # # @api private class Locale - extend T::Sig - # Error when a string cannot be parsed to a `Locale`. class ParserError < StandardError end diff --git a/Library/Homebrew/macos_runner_spec.rb b/Library/Homebrew/macos_runner_spec.rb index eb3b5ff6c4..c808bb2e51 100644 --- a/Library/Homebrew/macos_runner_spec.rb +++ b/Library/Homebrew/macos_runner_spec.rb @@ -2,17 +2,17 @@ # frozen_string_literal: true class MacOSRunnerSpec < T::Struct - extend T::Sig - const :name, String const :runner, String + const :timeout, Integer const :cleanup, T::Boolean - sig { returns({ name: String, runner: String, cleanup: T::Boolean }) } + sig { returns({ name: String, runner: String, timeout: Integer, cleanup: T::Boolean }) } def to_h { name: name, runner: runner, + timeout: timeout, cleanup: cleanup, } end diff --git a/Library/Homebrew/manpages.rb b/Library/Homebrew/manpages.rb index 42b91bc3ac..8b53c571b4 100644 --- a/Library/Homebrew/manpages.rb +++ b/Library/Homebrew/manpages.rb @@ -12,8 +12,6 @@ module Homebrew # # @api private module Manpages - extend T::Sig - Variables = Struct.new( :alumni, :commands, @@ -29,9 +27,7 @@ module Homebrew keyword_init: true, ) - module_function - - def regenerate_man_pages(quiet:) + def self.regenerate_man_pages(quiet:) Homebrew.install_bundler_gems! markup = build_man_page(quiet: quiet) @@ -39,7 +35,7 @@ module Homebrew convert_man_page(markup, TARGET_MAN_PATH/"brew.1") end - def build_man_page(quiet:) + def self.build_man_page(quiet:) template = (SOURCE_PATH/"brew.1.md.erb").read readme = HOMEBREW_REPOSITORY/"README.md" variables = Variables.new( @@ -64,12 +60,12 @@ module Homebrew ERB.new(template, trim_mode: ">").result(variables.instance_eval { binding }) end - def sort_key_for_path(path) + def self.sort_key_for_path(path) # Options after regular commands (`~` comes after `z` in ASCII table). path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~") end - def convert_man_page(markup, target) + def self.convert_man_page(markup, target) manual = target.basename(".1") organisation = "Homebrew" @@ -113,7 +109,7 @@ module Homebrew end end - def target_path_to_format(target) + def self.target_path_to_format(target) case target.basename when /\.md$/ then ["--markdown", "markdown"] when /\.\d$/ then ["--roff", "man page"] @@ -122,7 +118,7 @@ module Homebrew end end - def generate_cmd_manpages(cmd_paths) + def self.generate_cmd_manpages(cmd_paths) man_page_lines = [] # preserve existing manpage order @@ -142,7 +138,7 @@ module Homebrew man_page_lines.compact.join("\n") end - def cmd_parser_manpage_lines(cmd_parser) + def self.cmd_parser_manpage_lines(cmd_parser) lines = [format_usage_banner(cmd_parser.usage_banner_text)] lines += cmd_parser.processed_options.map do |short, long, _, desc, hidden| next if hidden @@ -159,7 +155,7 @@ module Homebrew lines end - def cmd_comment_manpage_lines(cmd_path) + def self.cmd_comment_manpage_lines(cmd_path) comment_lines = cmd_path.read.lines.grep(/^#:/) return if comment_lines.empty? return if comment_lines.first.include?("@hide_from_man_page") @@ -185,7 +181,7 @@ module Homebrew end sig { returns(String) } - def global_cask_options_manpage + def self.global_cask_options_manpage lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` " \ "subcommands with the `--cask` flag.\n"] lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **| @@ -195,7 +191,7 @@ module Homebrew end sig { returns(String) } - def global_options_manpage + def self.global_options_manpage lines = ["These options are applicable across multiple subcommands.\n"] lines += Homebrew::CLI::Parser.global_options.map do |short, long, desc| generate_option_doc(short, long, desc) @@ -204,7 +200,7 @@ module Homebrew end sig { returns(String) } - def env_vars_manpage + def self.env_vars_manpage lines = Homebrew::EnvConfig::ENVS.flat_map do |env, hash| entry = "- `#{env}`:\n
#{hash[:description]}\n" default = hash[:default_text] @@ -216,11 +212,11 @@ module Homebrew lines.join("\n") end - def format_opt(opt) + def self.format_opt(opt) "`#{opt}`" unless opt.nil? end - def generate_option_doc(short, long, desc) + def self.generate_option_doc(short, long, desc) comma = (short && long) ? ", " : "" <<~EOS * #{format_opt(short)}#{comma}#{format_opt(long)}: @@ -228,7 +224,7 @@ module Homebrew EOS end - def format_usage_banner(usage_banner) + def self.format_usage_banner(usage_banner) usage_banner&.sub(/^(#: *\* )?/, "### ") end end diff --git a/Library/Homebrew/manpages.rbi b/Library/Homebrew/manpages.rbi deleted file mode 100644 index d3765f73a3..0000000000 --- a/Library/Homebrew/manpages.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Homebrew - module Manpages - include Kernel - end -end diff --git a/Library/Homebrew/messages.rb b/Library/Homebrew/messages.rb index 89e03b551a..b7f9a47a2f 100644 --- a/Library/Homebrew/messages.rb +++ b/Library/Homebrew/messages.rb @@ -4,8 +4,6 @@ # A {Messages} object collects messages that may need to be displayed together # at the end of a multi-step `brew` command run. class Messages - extend T::Sig - attr_reader :caveats, :package_count, :install_times sig { void } diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index eff91d77fc..89dd54c2af 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -9,8 +9,6 @@ require "tab" # # @api private class Migrator - extend T::Sig - include Context # Error for when a migration is necessary. diff --git a/Library/Homebrew/mktemp.rb b/Library/Homebrew/mktemp.rb index 159c0b88df..4bbf14b5dd 100644 --- a/Library/Homebrew/mktemp.rb +++ b/Library/Homebrew/mktemp.rb @@ -4,8 +4,6 @@ # Performs {Formula#mktemp}'s functionality, and tracks the results. # Each instance is only intended to be used once. class Mktemp - extend T::Sig - include FileUtils # Path to the tmpdir used in this run, as a {Pathname}. diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index e1877729a0..17ff40168d 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -5,8 +5,6 @@ # # @api private class Option - extend T::Sig - attr_reader :name, :description, :flag def initialize(name, description = "") @@ -44,8 +42,6 @@ end # # @api private class DeprecatedOption - extend T::Sig - attr_reader :old, :current def initialize(old, current) @@ -73,8 +69,6 @@ end # # @api private class Options - extend T::Sig - include Enumerable def self.create(array) diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index da59954324..4743f6b727 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -7,8 +7,6 @@ require "version" # # @api private module OS - extend T::Sig - # Check if the operating system is macOS. # # @api public diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb index 2b5df8cfc3..15d096bd97 100644 --- a/Library/Homebrew/os/linux.rb +++ b/Library/Homebrew/os/linux.rb @@ -6,12 +6,8 @@ require "utils" module OS # Helper module for querying system information on Linux. module Linux - extend T::Sig - - module_function - sig { returns(String) } - def os_version + def self.os_version if which("lsb_release") lsb_info = Utils.popen_read("lsb_release", "-a") description = lsb_info[/^Description:\s*(.*)$/, 1].force_encoding("UTF-8") @@ -29,12 +25,12 @@ module OS end sig { returns(T::Boolean) } - def wsl? + def self.wsl? /-microsoft/i.match?(OS.kernel_version.to_s) end sig { returns(Version) } - def wsl_version + def self.wsl_version return Version::NULL unless wsl? kernel = OS.kernel_version.to_s @@ -52,60 +48,54 @@ module OS # rubocop:disable Style/Documentation module Mac - module_function - ::MacOS = OS::Mac raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] - def version + def self.version ::Version::NULL end - def full_version + def self.full_version ::Version::NULL end - def languages + def self.languages @languages ||= Array(ENV["LANG"]&.slice(/[a-z]+/)).uniq end - def language + def self.language languages.first end - def sdk_root_needed? + def self.sdk_root_needed? false end - def sdk_path_if_needed(_version = nil) + def self.sdk_path_if_needed(_version = nil) nil end - def sdk_path(_version = nil) + def self.sdk_path(_version = nil) nil end module Xcode - module_function - - def version + def self.version ::Version::NULL end - def installed? + def self.installed? false end end module CLT - module_function - - def version + def self.version ::Version::NULL end - def installed? + def self.installed? false end end diff --git a/Library/Homebrew/os/linux.rbi b/Library/Homebrew/os/linux.rbi deleted file mode 100644 index b6f3164683..0000000000 --- a/Library/Homebrew/os/linux.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module OS - module Linux - include ::Kernel - end -end diff --git a/Library/Homebrew/os/linux/glibc.rb b/Library/Homebrew/os/linux/glibc.rb index 476723e741..440af7521d 100644 --- a/Library/Homebrew/os/linux/glibc.rb +++ b/Library/Homebrew/os/linux/glibc.rb @@ -7,8 +7,6 @@ module OS # # @api private module Glibc - extend T::Sig - module_function sig { returns(Version) } diff --git a/Library/Homebrew/os/linux/kernel.rb b/Library/Homebrew/os/linux/kernel.rb index 026e01e41a..0fe09b3952 100644 --- a/Library/Homebrew/os/linux/kernel.rb +++ b/Library/Homebrew/os/linux/kernel.rb @@ -7,8 +7,6 @@ module OS # # @api private module Kernel - extend T::Sig - module_function sig { returns(Version) } diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index b52a965130..3936b46d5f 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -9,10 +9,6 @@ require "os/mac/keg" module OS # Helper module for querying system information on macOS. module Mac - extend T::Sig - - module_function - ::MacOS = OS::Mac raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] @@ -23,14 +19,14 @@ module OS # This can be compared to numerics, strings, or symbols # using the standard Ruby Comparable methods. sig { returns(Version) } - def version + def self.version @version ||= full_version.strip_patch end # This can be compared to numerics, strings, or symbols # using the standard Ruby Comparable methods. sig { returns(Version) } - def full_version + def self.full_version @full_version ||= if ENV["HOMEBREW_FAKE_EL_CAPITAN"] # for Portable Ruby building Version.new("10.11.6") else @@ -39,21 +35,20 @@ module OS end sig { params(version: String).void } - def full_version=(version) + def self.full_version=(version) @full_version = Version.new(version.chomp) @version = nil end sig { returns(::Version) } - def latest_sdk_version + def self.latest_sdk_version # TODO: bump version when new Xcode macOS SDK is released # NOTE: We only track the major version of the SDK. ::Version.new("13") end - private :latest_sdk_version sig { returns(String) } - def preferred_perl_version + def self.preferred_perl_version if version >= :big_sur "5.30" else @@ -61,7 +56,7 @@ module OS end end - def languages + def self.languages return @languages if @languages os_langs = Utils.popen_read("defaults", "read", "-g", "AppleLanguages") @@ -74,17 +69,17 @@ module OS @languages = os_langs end - def language + def self.language languages.first end sig { returns(String) } - def active_developer_dir + def self.active_developer_dir @active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip end sig { returns(T::Boolean) } - def sdk_root_needed? + def self.sdk_root_needed? if MacOS::CLT.installed? # If there's no CLT SDK, return false return false unless MacOS::CLT.provides_sdk? @@ -105,7 +100,7 @@ module OS # If no specific SDK is requested, the SDK matching the OS version is returned, # if available. Otherwise, the latest SDK is returned. - def sdk_locator + def self.sdk_locator if CLT.installed? && CLT.provides_sdk? CLT.sdk_locator else @@ -113,11 +108,11 @@ module OS end end - def sdk(version = nil) + def self.sdk(version = nil) sdk_locator.sdk_if_applicable(version) end - def sdk_for_formula(formula, version = nil, check_only_runtime_requirements: false) + def self.sdk_for_formula(formula, version = nil, check_only_runtime_requirements: false) # If the formula requires Xcode, don't return the CLT SDK # If check_only_runtime_requirements is true, don't necessarily return the # Xcode SDK if the XcodeRequirement is only a build or test requirement. @@ -132,12 +127,12 @@ module OS end # Returns the path to an SDK or nil, following the rules set by {sdk}. - def sdk_path(version = nil) + def self.sdk_path(version = nil) s = sdk(version) s&.path end - def sdk_path_if_needed(version = nil) + def self.sdk_path_if_needed(version = nil) # Prefer CLT SDK when both Xcode and the CLT are installed. # Expected results: # 1. On Xcode-only systems, return the Xcode SDK. @@ -156,7 +151,7 @@ module OS # - {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 + def self.macports_or_fink paths = [] # First look in the path because MacPorts is relocatable and Fink @@ -186,7 +181,7 @@ module OS end sig { params(ids: String).returns(T.nilable(Pathname)) } - def app_with_bundle_id(*ids) + def self.app_with_bundle_id(*ids) path = mdfind(*ids) .reject { |p| p.include?("/Backups.backupdb/") } .first @@ -194,20 +189,20 @@ module OS end sig { params(ids: String).returns(T::Array[String]) } - def mdfind(*ids) + def self.mdfind(*ids) (@mdfind ||= {}).fetch(ids) do @mdfind[ids] = Utils.popen_read("/usr/bin/mdfind", mdfind_query(*ids)).split("\n") end end - def pkgutil_info(id) + def self.pkgutil_info(id) (@pkginfo ||= {}).fetch(id) do |key| @pkginfo[key] = Utils.popen_read("/usr/sbin/pkgutil", "--pkg-info", key).strip end end sig { params(ids: String).returns(String) } - def mdfind_query(*ids) + def self.mdfind_query(*ids) ids.map! { |id| "kMDItemCFBundleIdentifier == #{id}" }.join(" || ") end end diff --git a/Library/Homebrew/os/mac.rbi b/Library/Homebrew/os/mac.rbi deleted file mode 100644 index 85a546f554..0000000000 --- a/Library/Homebrew/os/mac.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module OS - module Mac - include Kernel - end -end diff --git a/Library/Homebrew/os/mac/sdk.rb b/Library/Homebrew/os/mac/sdk.rb index 3fadf31762..09cc68e61c 100644 --- a/Library/Homebrew/os/mac/sdk.rb +++ b/Library/Homebrew/os/mac/sdk.rb @@ -9,8 +9,6 @@ module OS # # @api private class SDK - extend T::Sig - # 11.x SDKs are explicitly excluded - we want the MacOSX11.sdk symlink instead. VERSIONED_SDK_REGEX = /MacOSX(10\.\d+|\d+)\.sdk$/.freeze @@ -35,7 +33,6 @@ module OS # # @api private class BaseSDKLocator - extend T::Sig extend T::Helpers abstract! @@ -146,8 +143,6 @@ module OS # # @api private class XcodeSDKLocator < BaseSDKLocator - extend T::Sig - sig { override.returns(Symbol) } def source :xcode @@ -173,8 +168,6 @@ module OS # # @api private class CLTSDKLocator < BaseSDKLocator - extend T::Sig - sig { override.returns(Symbol) } def source :clt diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb index ce8ebb6880..6dcda2f571 100644 --- a/Library/Homebrew/os/mac/version.rb +++ b/Library/Homebrew/os/mac/version.rb @@ -11,8 +11,6 @@ module OS # # @api private class Version < ::Version - extend T::Sig - sig { params(version: Symbol).returns(T.attached_class) } def self.from_symbol(version) str = MacOSVersions::SYMBOLS.fetch(version) { raise MacOSVersionError, version } diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 6e234f8268..4cc61a5762 100755 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -7,10 +7,6 @@ module OS # # @api private module Xcode - extend T::Sig - - module_function - DEFAULT_BUNDLE_PATH = Pathname("/Applications/Xcode.app").freeze BUNDLE_ID = "com.apple.dt.Xcode" OLD_BUNDLE_ID = "com.apple.Xcode" @@ -20,7 +16,7 @@ module OS # CI systems have been updated. # This may be a beta version for a beta macOS. sig { params(macos: MacOS::Version).returns(String) } - def latest_version(macos: MacOS.version) + def self.latest_version(macos: MacOS.version) latest_stable = "14.3" case macos when "13" then latest_stable @@ -44,7 +40,7 @@ module OS # macOS version (which may initially be a beta if that version of macOS is # also in beta). sig { returns(String) } - def minimum_version + def self.minimum_version case MacOS.version when "13" then "14.1" when "12" then "13.1" @@ -58,19 +54,19 @@ module OS end sig { returns(T::Boolean) } - def below_minimum_version? + def self.below_minimum_version? return false unless installed? version < minimum_version end sig { returns(T::Boolean) } - def latest_sdk_version? + def self.latest_sdk_version? OS::Mac.full_version >= OS::Mac.latest_sdk_version end sig { returns(T::Boolean) } - def needs_clt_installed? + def self.needs_clt_installed? return false if latest_sdk_version? # With fake El Capitan for Portable Ruby, we want the full 10.11 SDK so that we can link @@ -82,21 +78,21 @@ module OS end sig { returns(T::Boolean) } - def outdated? + def self.outdated? return false unless installed? version < latest_version end sig { returns(T::Boolean) } - def without_clt? + def self.without_clt? !MacOS::CLT.installed? end # Returns a Pathname object corresponding to Xcode.app's Developer # directory or nil if Xcode.app is not installed. sig { returns(T.nilable(Pathname)) } - def prefix + def self.prefix return @prefix if defined?(@prefix) @prefix = T.let(@prefix, T.nilable(Pathname)) @@ -115,12 +111,12 @@ module OS end sig { returns(Pathname) } - def toolchain_path + def self.toolchain_path Pathname("#{prefix}/Toolchains/XcodeDefault.xctoolchain") end sig { returns(T.nilable(Pathname)) } - def bundle_path + def self.bundle_path # Use the default location if it exists. return DEFAULT_BUNDLE_PATH if DEFAULT_BUNDLE_PATH.exist? @@ -131,27 +127,27 @@ module OS end sig { returns(T::Boolean) } - def installed? + def self.installed? !prefix.nil? end sig { returns(XcodeSDKLocator) } - def sdk_locator + def self.sdk_locator @sdk_locator ||= XcodeSDKLocator.new end sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) } - def sdk(version = nil) + def self.sdk(version = nil) sdk_locator.sdk_if_applicable(version) end sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) } - def sdk_path(version = nil) + def self.sdk_path(version = nil) sdk(version)&.path end sig { returns(String) } - def installation_instructions + def self.installation_instructions if OS::Mac.version.prerelease? <<~EOS Xcode can be installed from: @@ -165,7 +161,7 @@ module OS end sig { returns(String) } - def update_instructions + def self.update_instructions if OS::Mac.version.prerelease? <<~EOS Xcode can be updated from: @@ -179,7 +175,7 @@ module OS end sig { returns(::Version) } - def version + def self.version # may return a version string # that is guessed based on the compiler, so do not # use it in order to check if Xcode is installed. @@ -191,7 +187,7 @@ module OS end sig { returns(T.nilable(String)) } - def detect_version + def self.detect_version # This is a separate function as you can't cache the value out of a block # if return is used in the middle, which we do many times in here. return if !MacOS::Xcode.installed? && !MacOS::CLT.installed? @@ -219,7 +215,7 @@ module OS end sig { returns(String) } - def detect_version_from_clang_version + def self.detect_version_from_clang_version version = DevelopmentTools.clang_version return "dunno" if version.null? @@ -252,7 +248,7 @@ module OS end sig { returns(T::Boolean) } - def default_prefix? + def self.default_prefix? prefix.to_s == "/Applications/Xcode.app/Contents/Developer" end end @@ -261,10 +257,6 @@ module OS # # @api private module CLT - extend T::Sig - - module_function - # The original Mavericks CLT package ID EXECUTABLE_PKG_ID = "com.apple.pkg.CLTools_Executables" MAVERICKS_NEW_PKG_ID = "com.apple.pkg.CLTools_Base" # obsolete @@ -272,37 +264,37 @@ module OS # Returns true even if outdated tools are installed. sig { returns(T::Boolean) } - def installed? + def self.installed? !version.null? end sig { returns(T::Boolean) } - def separate_header_package? + def self.separate_header_package? version >= "10" && MacOS.version >= "10.14" end sig { returns(T::Boolean) } - def provides_sdk? + def self.provides_sdk? version >= "8" end sig { returns(CLTSDKLocator) } - def sdk_locator + def self.sdk_locator @sdk_locator ||= CLTSDKLocator.new end sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) } - def sdk(version = nil) + def self.sdk(version = nil) sdk_locator.sdk_if_applicable(version) end sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) } - def sdk_path(version = nil) + def self.sdk_path(version = nil) sdk(version)&.path end sig { returns(String) } - def installation_instructions + def self.installation_instructions if MacOS.version == "10.14" # This is not available from `xcode-select` <<~EOS @@ -318,7 +310,7 @@ module OS end sig { returns(String) } - def update_instructions + def self.update_instructions software_update_location = if MacOS.version >= "13" "System Settings" elsif MacOS.version >= "10.14" @@ -343,7 +335,7 @@ module OS # Bump these when the new version is distributed through Software Update # and our CI systems have been updated. sig { returns(String) } - def latest_clang_version + def self.latest_clang_version case MacOS.version when "13" then "1403.0.22.14.1" when "12" then "1400.0.29.202" @@ -360,7 +352,7 @@ module OS # without this. Generally this will be the first stable CLT release on # that macOS version. sig { returns(String) } - def minimum_version + def self.minimum_version case MacOS.version when "13" then "14.0.0" when "12" then "13.0.0" @@ -374,14 +366,14 @@ module OS end sig { returns(T::Boolean) } - def below_minimum_version? + def self.below_minimum_version? return false unless installed? version < minimum_version end sig { returns(T::Boolean) } - def outdated? + def self.outdated? clang_version = detect_clang_version return false unless clang_version @@ -389,13 +381,13 @@ module OS end sig { returns(T.nilable(String)) } - def detect_clang_version + def self.detect_clang_version version_output = Utils.popen_read("#{PKG_PATH}/usr/bin/clang", "--version") version_output[/clang-(\d+(\.\d+)+)/, 1] end sig { returns(T.nilable(String)) } - def detect_version_from_clang_version + def self.detect_version_from_clang_version detect_clang_version&.sub(/^(\d+)0(\d)\./, "\\1.\\2.") end @@ -403,7 +395,7 @@ module OS # Note that the different ways of installing the CLTs lead to different # version numbers. sig { returns(::Version) } - def version + def self.version if @version ||= detect_version ::Version.new @version else @@ -412,7 +404,7 @@ module OS end sig { returns(T.nilable(String)) } - def detect_version + def self.detect_version version = T.let(nil, T.nilable(String)) [EXECUTABLE_PKG_ID, MAVERICKS_NEW_PKG_ID].each do |id| next unless File.exist?("#{PKG_PATH}/usr/bin/clang") diff --git a/Library/Homebrew/os/mac/xcode.rbi b/Library/Homebrew/os/mac/xcode.rbi deleted file mode 100644 index b0707a034e..0000000000 --- a/Library/Homebrew/os/mac/xcode.rbi +++ /dev/null @@ -1,9 +0,0 @@ -# typed: strict - -module OS - module Mac - module Xcode - include Kernel - end - end -end diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index aac65d171f..5d470f89c8 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -35,8 +35,6 @@ end # # @api private class EmbeddedPatch - extend T::Sig - attr_writer :owner attr_reader :strip @@ -67,8 +65,6 @@ end # # @api private class DATAPatch < EmbeddedPatch - extend T::Sig - attr_accessor :path def initialize(strip) @@ -110,8 +106,6 @@ end # # @api private class ExternalPatch - extend T::Sig - extend Forwardable attr_reader :resource, :strip diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 39bd77469e..525f6522ca 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -12,8 +12,6 @@ require "build_environment" # # @api private class Requirement - extend T::Sig - include Dependable extend Cachable @@ -164,8 +162,6 @@ class Requirement end class << self - extend T::Sig - include BuildEnvironment::DSL attr_reader :env_proc, :build diff --git a/Library/Homebrew/requirements/arch_requirement.rb b/Library/Homebrew/requirements/arch_requirement.rb index 8c65b44fa6..17ce1c2701 100644 --- a/Library/Homebrew/requirements/arch_requirement.rb +++ b/Library/Homebrew/requirements/arch_requirement.rb @@ -7,8 +7,6 @@ require "requirement" # # @api private class ArchRequirement < Requirement - extend T::Sig - fatal true attr_reader :arch diff --git a/Library/Homebrew/requirements/codesign_requirement.rb b/Library/Homebrew/requirements/codesign_requirement.rb index c1c18d0d2f..7a006472c7 100644 --- a/Library/Homebrew/requirements/codesign_requirement.rb +++ b/Library/Homebrew/requirements/codesign_requirement.rb @@ -5,8 +5,6 @@ # # @api private class CodesignRequirement < Requirement - extend T::Sig - fatal true def initialize(tags) diff --git a/Library/Homebrew/requirements/linux_requirement.rb b/Library/Homebrew/requirements/linux_requirement.rb index 36b70585ac..058f5a1166 100644 --- a/Library/Homebrew/requirements/linux_requirement.rb +++ b/Library/Homebrew/requirements/linux_requirement.rb @@ -5,8 +5,6 @@ # # @api private class LinuxRequirement < Requirement - extend T::Sig - fatal true satisfy(build_env: false) { OS.linux? } diff --git a/Library/Homebrew/requirements/macos_requirement.rb b/Library/Homebrew/requirements/macos_requirement.rb index b6047e1ea1..ddcba52f97 100644 --- a/Library/Homebrew/requirements/macos_requirement.rb +++ b/Library/Homebrew/requirements/macos_requirement.rb @@ -7,8 +7,6 @@ require "requirement" # # @api private class MacOSRequirement < Requirement - extend T::Sig - fatal true attr_reader :comparator, :version diff --git a/Library/Homebrew/requirements/xcode_requirement.rb b/Library/Homebrew/requirements/xcode_requirement.rb index c75bea041e..097d0d3e07 100644 --- a/Library/Homebrew/requirements/xcode_requirement.rb +++ b/Library/Homebrew/requirements/xcode_requirement.rb @@ -7,8 +7,6 @@ require "requirement" # # @api private class XcodeRequirement < Requirement - extend T::Sig - fatal true attr_reader :version diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 475b7f320f..16579c8002 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -14,8 +14,6 @@ require "extend/on_system" # # @api private class Resource - extend T::Sig - include Context include FileUtils include OnSystem::MacOSAndLinux @@ -343,8 +341,6 @@ end # # @api private class ResourceStageContext - extend T::Sig - extend Forwardable # The {Resource} that is being staged. diff --git a/Library/Homebrew/rubocops.rb b/Library/Homebrew/rubocops.rb index 3e5daa64c3..187b692368 100644 --- a/Library/Homebrew/rubocops.rb +++ b/Library/Homebrew/rubocops.rb @@ -2,5 +2,6 @@ # frozen_string_literal: true require_relative "standalone" +require_relative "extend/module" require "rubocops/all" diff --git a/Library/Homebrew/rubocops/cask/ast/cask_header.rb b/Library/Homebrew/rubocops/cask/ast/cask_header.rb index 01386a4667..ae2231c22a 100644 --- a/Library/Homebrew/rubocops/cask/ast/cask_header.rb +++ b/Library/Homebrew/rubocops/cask/ast/cask_header.rb @@ -7,8 +7,6 @@ module RuboCop # This class wraps the AST method node that represents the cask header. It # includes various helper methods to aid cops in their analysis. class CaskHeader - extend T::Sig - def initialize(method_node) @method_node = method_node end diff --git a/Library/Homebrew/rubocops/cask/mixin/cask_help.rb b/Library/Homebrew/rubocops/cask/mixin/cask_help.rb index 66b8f04471..c4e76607cb 100644 --- a/Library/Homebrew/rubocops/cask/mixin/cask_help.rb +++ b/Library/Homebrew/rubocops/cask/mixin/cask_help.rb @@ -7,7 +7,7 @@ module RuboCop # Common functionality for cops checking casks. module CaskHelp extend T::Helpers - extend T::Sig + abstract! sig { abstract.params(cask_block: RuboCop::Cask::AST::CaskBlock).void } diff --git a/Library/Homebrew/rubocops/cask/no_dsl_version.rb b/Library/Homebrew/rubocops/cask/no_dsl_version.rb index 63dbda85e6..4e8e7410fb 100644 --- a/Library/Homebrew/rubocops/cask/no_dsl_version.rb +++ b/Library/Homebrew/rubocops/cask/no_dsl_version.rb @@ -19,8 +19,6 @@ module RuboCop # ... # end class NoDslVersion < Base - extend T::Sig - extend Forwardable extend AutoCorrector include CaskHelp diff --git a/Library/Homebrew/rubocops/cask/no_overrides.rb b/Library/Homebrew/rubocops/cask/no_overrides.rb index 8a72402cf1..0abc90794b 100644 --- a/Library/Homebrew/rubocops/cask/no_overrides.rb +++ b/Library/Homebrew/rubocops/cask/no_overrides.rb @@ -5,7 +5,6 @@ module RuboCop module Cop module Cask class NoOverrides < Base - extend T::Sig include CaskHelp ON_SYSTEM_METHODS = RuboCop::Cask::Constants::ON_SYSTEM_METHODS diff --git a/Library/Homebrew/rubocops/dependency_order.rb b/Library/Homebrew/rubocops/dependency_order.rb index 061b2a0633..d3964237fb 100644 --- a/Library/Homebrew/rubocops/dependency_order.rb +++ b/Library/Homebrew/rubocops/dependency_order.rb @@ -11,7 +11,6 @@ module RuboCop # precedence order: # build-time > test > normal > recommended > optional class DependencyOrder < FormulaCop - extend T::Sig extend AutoCorrector def audit_formula(_node, _class_node, _parent_class_node, body_node) diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb index 38b0b0725d..86801438ab 100644 --- a/Library/Homebrew/rubocops/extend/formula_cop.rb +++ b/Library/Homebrew/rubocops/extend/formula_cop.rb @@ -9,7 +9,6 @@ module RuboCop # # @api private class FormulaCop < Base - extend T::Sig extend T::Helpers include RangeHelp include HelperFunctions diff --git a/Library/Homebrew/rubocops/patches.rb b/Library/Homebrew/rubocops/patches.rb index e28b42761d..10ef997e25 100644 --- a/Library/Homebrew/rubocops/patches.rb +++ b/Library/Homebrew/rubocops/patches.rb @@ -9,7 +9,6 @@ module RuboCop # This cop audits `patch`es in formulae. # TODO: Many of these could be auto-corrected. class Patches < FormulaCop - extend T::Sig extend AutoCorrector def audit_formula(node, _class_node, _parent_class_node, body) diff --git a/Library/Homebrew/rubocops/shared/helper_functions.rb b/Library/Homebrew/rubocops/shared/helper_functions.rb index 67229a2623..6f24b6667b 100644 --- a/Library/Homebrew/rubocops/shared/helper_functions.rb +++ b/Library/Homebrew/rubocops/shared/helper_functions.rb @@ -14,7 +14,6 @@ module RuboCop # # @api private module HelperFunctions - extend T::Sig include RangeHelp # Checks for regex match of pattern in the node and diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 34d4a65e2b..e2048aaade 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -261,8 +261,6 @@ module RuboCop # # @api private class PyPiUrls < FormulaCop - extend T::Sig - def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 289ae6234c..6eda0073c5 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -10,8 +10,6 @@ require "tempfile" # # @api private class Sandbox - extend T::Sig - SANDBOX_EXEC = "/usr/bin/sandbox-exec" private_constant :SANDBOX_EXEC @@ -210,8 +208,6 @@ class Sandbox # Configuration profile for a sandbox. class SandboxProfile - extend T::Sig - SEATBELT_ERB = <<~ERB (version 1) (debug deny) ; log all denied operations to /var/log/system.log diff --git a/Library/Homebrew/search.rb b/Library/Homebrew/search.rb index 94175561a2..14f8d15f01 100644 --- a/Library/Homebrew/search.rb +++ b/Library/Homebrew/search.rb @@ -8,9 +8,7 @@ module Homebrew # # @api private module Search - module_function - - def query_regexp(query) + def self.query_regexp(query) if (m = query.match(%r{^/(.*)/$})) Regexp.new(m[1]) else @@ -20,7 +18,7 @@ module Homebrew raise "#{query} is not a valid regex." end - def search_descriptions(string_or_regex, args, search_type: :desc) + def self.search_descriptions(string_or_regex, args, search_type: :desc) both = !args.formula? && !args.cask? eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all? @@ -42,7 +40,7 @@ module Homebrew end end - def search_formulae(string_or_regex) + def self.search_formulae(string_or_regex) if string_or_regex.is_a?(String) && string_or_regex.match?(HOMEBREW_TAP_FORMULA_REGEX) return begin [Formulary.factory(string_or_regex).name] @@ -74,7 +72,7 @@ module Homebrew end.compact end - def search_casks(string_or_regex) + def self.search_casks(string_or_regex) if string_or_regex.is_a?(String) && string_or_regex.match?(HOMEBREW_TAP_CASK_REGEX) return begin [Cask::CaskLoader.load(string_or_regex).token] @@ -104,7 +102,7 @@ module Homebrew end.uniq end - def search_names(string_or_regex, args) + def self.search_names(string_or_regex, args) both = !args.formula? && !args.cask? all_formulae = if args.formula? || both @@ -122,7 +120,7 @@ module Homebrew [all_formulae, all_casks] end - def search(selectable, string_or_regex, &block) + def self.search(selectable, string_or_regex, &block) case string_or_regex when Regexp search_regex(selectable, string_or_regex, &block) @@ -131,11 +129,11 @@ module Homebrew end end - def simplify_string(string) + def self.simplify_string(string) string.downcase.gsub(/[^a-z\d]/i, "") end - def search_regex(selectable, regex) + def self.search_regex(selectable, regex) selectable.select do |*args| args = yield(*args) if block_given? args = Array(args).flatten.compact @@ -143,7 +141,7 @@ module Homebrew end end - def search_string(selectable, string) + def self.search_string(selectable, string) simplified_string = simplify_string(string) selectable.select do |*args| args = yield(*args) if block_given? diff --git a/Library/Homebrew/search.rbi b/Library/Homebrew/search.rbi deleted file mode 100644 index 2c8f4bdb6e..0000000000 --- a/Library/Homebrew/search.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module Homebrew::Search - include Kernel -end diff --git a/Library/Homebrew/service.rb b/Library/Homebrew/service.rb index 588642960e..4fafa2c80e 100644 --- a/Library/Homebrew/service.rb +++ b/Library/Homebrew/service.rb @@ -8,7 +8,6 @@ module Homebrew # `service` block and stores related instance variables. Most of these methods # also return the related instance variable when no argument is provided. class Service - extend T::Sig extend Forwardable include OnSystem::MacOSAndLinux diff --git a/Library/Homebrew/settings.rb b/Library/Homebrew/settings.rb index f04820eef2..4e5914899d 100644 --- a/Library/Homebrew/settings.rb +++ b/Library/Homebrew/settings.rb @@ -8,9 +8,7 @@ module Homebrew # # @api private module Settings - module_function - - def read(setting, repo: HOMEBREW_REPOSITORY) + def self.read(setting, repo: HOMEBREW_REPOSITORY) return unless (repo/".git/config").exist? value = Utils.popen_read("git", "-C", repo.to_s, "config", "--get", "homebrew.#{setting}").chomp @@ -20,7 +18,7 @@ module Homebrew value end - def write(setting, value, repo: HOMEBREW_REPOSITORY) + def self.write(setting, value, repo: HOMEBREW_REPOSITORY) return unless (repo/".git/config").exist? value = value.to_s @@ -30,7 +28,7 @@ module Homebrew Kernel.system("git", "-C", repo.to_s, "config", "--replace-all", "homebrew.#{setting}", value, exception: true) end - def delete(setting, repo: HOMEBREW_REPOSITORY) + def self.delete(setting, repo: HOMEBREW_REPOSITORY) return unless (repo/".git/config").exist? return if read(setting, repo: repo).blank? diff --git a/Library/Homebrew/settings.rbi b/Library/Homebrew/settings.rbi deleted file mode 100644 index d902c06acb..0000000000 --- a/Library/Homebrew/settings.rbi +++ /dev/null @@ -1,16 +0,0 @@ -# typed: strict - -module Homebrew - module Settings - include Kernel - - sig { params(setting: T.any(String, Symbol), repo: Pathname).returns(T.nilable(String)) } - def read(setting, repo: HOMEBREW_REPOSITORY); end - - sig { params(setting: T.any(String, Symbol), value: T.any(String, T::Boolean), repo: Pathname).void } - def write(setting, value, repo: HOMEBREW_REPOSITORY); end - - sig { params(setting: T.any(String, Symbol), repo: Pathname).void } - def delete(setting, repo: HOMEBREW_REPOSITORY); end - end -end diff --git a/Library/Homebrew/shims/linux/super/g++-13 b/Library/Homebrew/shims/linux/super/g++-13 new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/Library/Homebrew/shims/linux/super/g++-13 @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-13 b/Library/Homebrew/shims/linux/super/gcc-13 new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/Library/Homebrew/shims/linux/super/gcc-13 @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-13 b/Library/Homebrew/shims/mac/super/g++-13 new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/Library/Homebrew/shims/mac/super/g++-13 @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-13 b/Library/Homebrew/shims/mac/super/gcc-13 new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/Library/Homebrew/shims/mac/super/gcc-13 @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-13 b/Library/Homebrew/shims/super/g++-13 new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/Library/Homebrew/shims/super/g++-13 @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-13 b/Library/Homebrew/shims/super/gcc-13 new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/Library/Homebrew/shims/super/gcc-13 @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/Library/Homebrew/simulate_system.rb b/Library/Homebrew/simulate_system.rb index 51be4690a6..741aa41b48 100644 --- a/Library/Homebrew/simulate_system.rb +++ b/Library/Homebrew/simulate_system.rb @@ -7,8 +7,6 @@ module Homebrew # @api private class SimulateSystem class << self - extend T::Sig - attr_reader :arch, :os sig { params(new_os: Symbol).void } diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index d1c13f049c..800394cc6d 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -15,8 +15,6 @@ require "os/mac/version" require "extend/on_system" class SoftwareSpec - extend T::Sig - extend Forwardable include OnSystem::MacOSAndLinux @@ -293,8 +291,6 @@ end class Bottle class Filename - extend T::Sig - attr_reader :name, :version, :tag, :rebuild def self.create(formula, tag, rebuild) @@ -510,8 +506,6 @@ end class BottleSpecification RELOCATABLE_CELLARS = [:any, :any_skip_relocation].freeze - extend T::Sig - attr_rw :rebuild attr_accessor :tap attr_reader :collector, :root_url_specs, :repository diff --git a/Library/Homebrew/sorbet/config b/Library/Homebrew/sorbet/config index acca61b26a..bd4721bc92 100644 --- a/Library/Homebrew/sorbet/config +++ b/Library/Homebrew/sorbet/config @@ -1,5 +1,7 @@ --dir=. --enable-experimental-requires-ancestor ---ignore=/vendor +--ignore=/vendor/bundle +--ignore=/vendor/gems +--ignore=/vendor/portable-ruby --ignore=/test/.gem --suppress-error-code=7019 diff --git a/Library/Homebrew/sorbet/parlour.rb b/Library/Homebrew/sorbet/parlour.rb index 102df89819..6c64b82b53 100644 --- a/Library/Homebrew/sorbet/parlour.rb +++ b/Library/Homebrew/sorbet/parlour.rb @@ -1,6 +1,7 @@ # typed: true # frozen_string_literal: true +require_relative "../extend/module" require_relative "../warnings" Warnings.ignore :parser_syntax do require "parser/current" @@ -9,8 +10,6 @@ end module Homebrew # Parlour type signature generator helper class for Homebrew. module Parlour - extend T::Sig - ROOT_DIR = T.let(Pathname(__dir__).parent.realpath.freeze, Pathname).freeze sig { returns(T::Array[Parser::AST::Node]) } diff --git a/Library/Homebrew/sorbet/rbi/gems/connection_pool@2.4.0.rbi b/Library/Homebrew/sorbet/rbi/gems/connection_pool@2.4.0.rbi deleted file mode 100644 index ec752547a7..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/connection_pool@2.4.0.rbi +++ /dev/null @@ -1,66 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `connection_pool` gem. -# Please instead update this file by running `bin/tapioca gem connection_pool`. - -class ConnectionPool - def initialize(options = T.unsafe(nil), &block); end - - def available; end - def checkin(force: T.unsafe(nil)); end - def checkout(options = T.unsafe(nil)); end - def reload(&block); end - def shutdown(&block); end - def size; end - def then(options = T.unsafe(nil)); end - def with(options = T.unsafe(nil)); end - - class << self - def after_fork; end - def wrap(options, &block); end - end -end - -ConnectionPool::DEFAULTS = T.let(T.unsafe(nil), Hash) -class ConnectionPool::Error < ::RuntimeError; end -ConnectionPool::INSTANCES = T.let(T.unsafe(nil), ObjectSpace::WeakMap[T.untyped]) -class ConnectionPool::PoolShuttingDownError < ::ConnectionPool::Error; end - -class ConnectionPool::TimedStack - def initialize(size = T.unsafe(nil), &block); end - - def <<(obj, options = T.unsafe(nil)); end - def empty?; end - def length; end - def max; end - def pop(timeout = T.unsafe(nil), options = T.unsafe(nil)); end - def push(obj, options = T.unsafe(nil)); end - def shutdown(reload: T.unsafe(nil), &block); end - - private - - def connection_stored?(options = T.unsafe(nil)); end - def current_time; end - def fetch_connection(options = T.unsafe(nil)); end - def shutdown_connections(options = T.unsafe(nil)); end - def store_connection(obj, options = T.unsafe(nil)); end - def try_create(options = T.unsafe(nil)); end -end - -class ConnectionPool::TimeoutError < ::Timeout::Error; end -ConnectionPool::VERSION = T.let(T.unsafe(nil), String) - -class ConnectionPool::Wrapper < ::BasicObject - def initialize(options = T.unsafe(nil), &block); end - - def method_missing(name, *args, &block); end - def pool_available; end - def pool_shutdown(&block); end - def pool_size; end - def respond_to?(id, *args); end - def with(&block); end - def wrapped_pool; end -end - -ConnectionPool::Wrapper::METHODS = T.let(T.unsafe(nil), Array) diff --git a/Library/Homebrew/sorbet/rbi/gems/domain_name@0.5.20190701.rbi b/Library/Homebrew/sorbet/rbi/gems/domain_name@0.5.20190701.rbi deleted file mode 100644 index 7e96cdabf2..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/domain_name@0.5.20190701.rbi +++ /dev/null @@ -1,71 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `domain_name` gem. -# Please instead update this file by running `bin/tapioca gem domain_name`. - -class DomainName - def initialize(hostname); end - - def <(other); end - def <=(other); end - def <=>(other); end - def ==(other); end - def >(other); end - def >=(other); end - def canonical?; end - def canonical_tld?; end - def cookie_domain?(domain, host_only = T.unsafe(nil)); end - def domain; end - def domain_idn; end - def hostname; end - def hostname_idn; end - def idn; end - def inspect; end - def ipaddr; end - def ipaddr?; end - def superdomain; end - def tld; end - def tld_idn; end - def to_s; end - def to_str; end - def uri_host; end - - class << self - def etld_data; end - def normalize(domain); end - end -end - -DomainName::DOT = T.let(T.unsafe(nil), String) -DomainName::ETLD_DATA = T.let(T.unsafe(nil), Hash) -DomainName::ETLD_DATA_DATE = T.let(T.unsafe(nil), String) - -module DomainName::Punycode - class << self - def decode(string); end - def decode_hostname(hostname); end - def encode(string); end - def encode_hostname(hostname); end - end -end - -class DomainName::Punycode::ArgumentError < ::ArgumentError; end -DomainName::Punycode::BASE = T.let(T.unsafe(nil), Integer) -class DomainName::Punycode::BufferOverflowError < ::DomainName::Punycode::ArgumentError; end -DomainName::Punycode::CUTOFF = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::DAMP = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::DECODE_DIGIT = T.let(T.unsafe(nil), Hash) -DomainName::Punycode::DELIMITER = T.let(T.unsafe(nil), String) -DomainName::Punycode::DOT = T.let(T.unsafe(nil), String) -DomainName::Punycode::ENCODE_DIGIT = T.let(T.unsafe(nil), Proc) -DomainName::Punycode::INITIAL_BIAS = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::INITIAL_N = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::LOBASE = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::MAXINT = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::PREFIX = T.let(T.unsafe(nil), String) -DomainName::Punycode::RE_NONBASIC = T.let(T.unsafe(nil), Regexp) -DomainName::Punycode::SKEW = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::TMAX = T.let(T.unsafe(nil), Integer) -DomainName::Punycode::TMIN = T.let(T.unsafe(nil), Integer) -DomainName::VERSION = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/gems/http-cookie@1.0.5.rbi b/Library/Homebrew/sorbet/rbi/gems/http-cookie@1.0.5.rbi deleted file mode 100644 index e55f34138a..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/http-cookie@1.0.5.rbi +++ /dev/null @@ -1,216 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `http-cookie` gem. -# Please instead update this file by running `bin/tapioca gem http-cookie`. - -module HTTP; end - -class HTTP::Cookie - include ::Mechanize::CookieDeprecated - include ::Mechanize::CookieIMethods - include ::Comparable - extend ::Mechanize::CookieDeprecated - extend ::Mechanize::CookieCMethods - - def initialize(*args); end - - def <=>(other); end - def acceptable?; end - def acceptable_from_uri?(uri); end - def accessed_at; end - def accessed_at=(_arg0); end - def cookie_value; end - def created_at; end - def created_at=(_arg0); end - def domain; end - def domain=(domain); end - def domain_name; end - def dot_domain; end - def encode_with(coder); end - def expire!; end - def expired?(time = T.unsafe(nil)); end - def expires; end - def expires=(t); end - def expires_at; end - def expires_at=(t); end - def for_domain; end - def for_domain=(_arg0); end - def for_domain?; end - def httponly; end - def httponly=(_arg0); end - def httponly?; end - def init_with(coder); end - def inspect; end - def max_age; end - def max_age=(sec); end - def name; end - def name=(name); end - def origin; end - def origin=(origin); end - def path; end - def path=(path); end - def secure; end - def secure=(_arg0); end - def secure?; end - def session; end - def session?; end - def set_cookie_value; end - def to_s; end - def to_yaml_properties; end - def valid_for_uri?(uri); end - def value; end - def value=(value); end - def yaml_initialize(tag, map); end - - class << self - def cookie_value(cookies); end - def cookie_value_to_hash(cookie_value); end - def path_match?(base_path, target_path); end - end -end - -HTTP::Cookie::MAX_COOKIES_PER_DOMAIN = T.let(T.unsafe(nil), Integer) -HTTP::Cookie::MAX_COOKIES_TOTAL = T.let(T.unsafe(nil), Integer) -HTTP::Cookie::MAX_LENGTH = T.let(T.unsafe(nil), Integer) -HTTP::Cookie::PERSISTENT_PROPERTIES = T.let(T.unsafe(nil), Array) - -class HTTP::Cookie::Scanner < ::StringScanner - def initialize(string, logger = T.unsafe(nil)); end - - def parse_cookie_date(s); end - def scan_cookie; end - def scan_dquoted; end - def scan_name; end - def scan_name_value(comma_as_separator = T.unsafe(nil)); end - def scan_set_cookie; end - def scan_value(comma_as_separator = T.unsafe(nil)); end - def skip_wsp; end - - private - - def tuple_to_time(day_of_month, month, year, time); end - - class << self - def quote(s); end - end -end - -HTTP::Cookie::Scanner::RE_BAD_CHAR = T.let(T.unsafe(nil), Regexp) -HTTP::Cookie::Scanner::RE_COOKIE_COMMA = T.let(T.unsafe(nil), Regexp) -HTTP::Cookie::Scanner::RE_NAME = T.let(T.unsafe(nil), Regexp) -HTTP::Cookie::Scanner::RE_WSP = T.let(T.unsafe(nil), Regexp) -HTTP::Cookie::UNIX_EPOCH = T.let(T.unsafe(nil), Time) -HTTP::Cookie::VERSION = T.let(T.unsafe(nil), String) - -class HTTP::CookieJar - include ::Mechanize::CookieDeprecated - include ::Mechanize::CookieJarIMethods - include ::Enumerable - - def initialize(options = T.unsafe(nil)); end - - def <<(cookie); end - def cleanup(session = T.unsafe(nil)); end - def clear; end - def cookies(url = T.unsafe(nil)); end - def delete(cookie); end - def each(uri = T.unsafe(nil), &block); end - def empty?(url = T.unsafe(nil)); end - def load(readable, *options); end - def parse(set_cookie, origin, options = T.unsafe(nil)); end - def save(writable, *options); end - def store; end - - private - - def get_impl(base, value, *args); end - def initialize_copy(other); end - - class << self - def const_missing(name); end - end -end - -class HTTP::CookieJar::AbstractSaver - def initialize(options = T.unsafe(nil)); end - - def load(io, jar); end - def save(io, jar); end - - private - - def default_options; end - - class << self - def class_to_symbol(klass); end - def implementation(symbol); end - def inherited(subclass); end - end -end - -class HTTP::CookieJar::AbstractStore - include ::MonitorMixin - include ::Enumerable - - def initialize(options = T.unsafe(nil)); end - - def add(cookie); end - def cleanup(session = T.unsafe(nil)); end - def clear; end - def delete(cookie); end - def each(uri = T.unsafe(nil), &block); end - def empty?; end - - private - - def default_options; end - def initialize_copy(other); end - - class << self - def class_to_symbol(klass); end - def implementation(symbol); end - def inherited(subclass); end - end -end - -class HTTP::CookieJar::CookiestxtSaver < ::HTTP::CookieJar::AbstractSaver - def load(io, jar); end - def save(io, jar); end - - private - - def cookie_to_record(cookie); end - def default_options; end - def parse_record(line); end -end - -HTTP::CookieJar::CookiestxtSaver::False = T.let(T.unsafe(nil), String) -HTTP::CookieJar::CookiestxtSaver::HTTPONLY_PREFIX = T.let(T.unsafe(nil), String) -HTTP::CookieJar::CookiestxtSaver::RE_HTTPONLY_PREFIX = T.let(T.unsafe(nil), Regexp) -HTTP::CookieJar::CookiestxtSaver::True = T.let(T.unsafe(nil), String) - -class HTTP::CookieJar::HashStore < ::HTTP::CookieJar::AbstractStore - def initialize(options = T.unsafe(nil)); end - - def add(cookie); end - def cleanup(session = T.unsafe(nil)); end - def clear; end - def default_options; end - def delete(cookie); end - def each(uri = T.unsafe(nil)); end - - private - - def initialize_copy(other); end -end - -class HTTP::CookieJar::YAMLSaver < ::HTTP::CookieJar::AbstractSaver - def load(io, jar); end - def save(io, jar); end - - private - - def default_options; end - def load_yaml(yaml); end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/mechanize@2.9.0.rbi b/Library/Homebrew/sorbet/rbi/gems/mechanize@2.9.0.rbi deleted file mode 100644 index fd2e6eff7a..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/mechanize@2.9.0.rbi +++ /dev/null @@ -1,1134 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `mechanize` gem. -# Please instead update this file by running `bin/tapioca gem mechanize`. - -class HTTP::CookieJar - include ::Mechanize::CookieDeprecated - include ::Mechanize::CookieJarIMethods - include ::Enumerable - - def initialize(options = T.unsafe(nil)); end - - def <<(cookie); end - def cleanup(session = T.unsafe(nil)); end - def clear; end - def cookies(url = T.unsafe(nil)); end - def delete(cookie); end - def each(uri = T.unsafe(nil), &block); end - def empty?(url = T.unsafe(nil)); end - def load(readable, *options); end - def parse(set_cookie, origin, options = T.unsafe(nil)); end - def save(writable, *options); end - def store; end - - private - - def get_impl(base, value, *args); end - def initialize_copy(other); end - - class << self - def const_missing(name); end - end -end - -class Mechanize - def initialize(connection_name = T.unsafe(nil)); end - - def add_auth(uri, user, password, realm = T.unsafe(nil), domain = T.unsafe(nil)); end - def agent; end - def auth(user, password, domain = T.unsafe(nil)); end - def back; end - def basic_auth(user, password, domain = T.unsafe(nil)); end - def ca_file; end - def ca_file=(ca_file); end - def cert; end - def cert=(cert); end - def cert_store; end - def cert_store=(cert_store); end - def certificate; end - def click(link); end - def conditional_requests; end - def conditional_requests=(enabled); end - def content_encoding_hooks; end - def cookie_jar; end - def cookie_jar=(cookie_jar); end - def cookies; end - def current_page; end - def default_encoding; end - def default_encoding=(_arg0); end - def delete(uri, query_params = T.unsafe(nil), headers = T.unsafe(nil)); end - def download(uri, io_or_filename, parameters = T.unsafe(nil), referer = T.unsafe(nil), headers = T.unsafe(nil)); end - def follow_meta_refresh; end - def follow_meta_refresh=(follow); end - def follow_meta_refresh_self; end - def follow_meta_refresh_self=(follow); end - def follow_redirect=(follow); end - def follow_redirect?; end - def force_default_encoding; end - def force_default_encoding=(_arg0); end - def get(uri, parameters = T.unsafe(nil), referer = T.unsafe(nil), headers = T.unsafe(nil)); end - def get_file(url); end - def gzip_enabled; end - def gzip_enabled=(enabled); end - def head(uri, query_params = T.unsafe(nil), headers = T.unsafe(nil)); end - def history; end - def history_added; end - def history_added=(_arg0); end - def html_parser; end - def html_parser=(_arg0); end - def idle_timeout; end - def idle_timeout=(idle_timeout); end - def ignore_bad_chunking; end - def ignore_bad_chunking=(ignore_bad_chunking); end - def keep_alive; end - def keep_alive=(enable); end - def keep_alive_time; end - def keep_alive_time=(_arg0); end - def key; end - def key=(key); end - def log; end - def log=(logger); end - def max_file_buffer; end - def max_file_buffer=(bytes); end - def max_history; end - def max_history=(length); end - def open_timeout; end - def open_timeout=(open_timeout); end - def page; end - def parse(uri, response, body); end - def pass; end - def pass=(pass); end - def pluggable_parser; end - def post(uri, query = T.unsafe(nil), headers = T.unsafe(nil)); end - def post_connect_hooks; end - def pre_connect_hooks; end - def pretty_print(q); end - def proxy_addr; end - def proxy_pass; end - def proxy_port; end - def proxy_user; end - def put(uri, entity, headers = T.unsafe(nil)); end - def read_timeout; end - def read_timeout=(read_timeout); end - def redirect_ok; end - def redirect_ok=(follow); end - def redirection_limit; end - def redirection_limit=(limit); end - def request_headers; end - def request_headers=(request_headers); end - def request_with_entity(verb, uri, entity, headers = T.unsafe(nil)); end - def reset; end - def resolve(link); end - def retry_change_requests; end - def retry_change_requests=(retry_change_requests); end - def robots; end - def robots=(enabled); end - def scheme_handlers; end - def scheme_handlers=(scheme_handlers); end - def set_proxy(address, port, user = T.unsafe(nil), password = T.unsafe(nil)); end - def shutdown; end - def ssl_version; end - def ssl_version=(ssl_version); end - def submit(form, button = T.unsafe(nil), headers = T.unsafe(nil)); end - def transact; end - def user_agent; end - def user_agent=(user_agent); end - def user_agent_alias=(name); end - def verify_callback; end - def verify_callback=(verify_callback); end - def verify_mode; end - def verify_mode=(verify_mode); end - def visited?(url); end - def visited_page(url); end - def watch_for_set; end - def watch_for_set=(_arg0); end - - private - - def add_to_history(page); end - def post_form(uri, form, headers = T.unsafe(nil)); end - - class << self - def html_parser; end - def html_parser=(_arg0); end - def inherited(child); end - def log; end - def log=(_arg0); end - def start; end - end -end - -Mechanize::AGENT_ALIASES = T.let(T.unsafe(nil), Hash) -class Mechanize::ChunkedTerminationError < ::Mechanize::ResponseReadError; end - -class Mechanize::ContentTypeError < ::Mechanize::Error - def initialize(content_type); end - - def content_type; end -end - -Mechanize::Cookie = HTTP::Cookie - -module Mechanize::CookieCMethods - include ::Mechanize::CookieDeprecated - - def parse(arg1, arg2, arg3 = T.unsafe(nil), &block); end -end - -module Mechanize::CookieDeprecated - private - - def __deprecated__(to = T.unsafe(nil)); end -end - -module Mechanize::CookieIMethods - include ::Mechanize::CookieDeprecated - - def set_domain(domain); end -end - -class Mechanize::CookieJar < ::HTTP::CookieJar - def load(input, *options); end - def save(output, *options); end - - private - - def load_yaml(yaml); end -end - -module Mechanize::CookieJarIMethods - include ::Mechanize::CookieDeprecated - - def add(arg1, arg2 = T.unsafe(nil)); end - def add!(cookie); end - def clear!; end - def dump_cookiestxt(io); end - def jar; end - def load_cookiestxt(io); end - def save_as(filename, *options); end -end - -class Mechanize::DirectorySaver < ::Mechanize::Download - def initialize(uri = T.unsafe(nil), response = T.unsafe(nil), body_io = T.unsafe(nil), code = T.unsafe(nil)); end - - class << self - def decode_filename?; end - def directory; end - def overwrite?; end - def save_to(directory, options = T.unsafe(nil)); end - end -end - -class Mechanize::Download - include ::Mechanize::Parser - - def initialize(uri = T.unsafe(nil), response = T.unsafe(nil), body_io = T.unsafe(nil), code = T.unsafe(nil)); end - - def body; end - def body_io; end - def content; end - def filename; end - def filename=(_arg0); end - def save(filename = T.unsafe(nil)); end - def save!(filename = T.unsafe(nil)); end - def save_as(filename = T.unsafe(nil)); end -end - -module Mechanize::ElementMatcher - def elements_with(singular, plural = T.unsafe(nil)); end -end - -class Mechanize::ElementNotFoundError < ::Mechanize::Error - def initialize(source, element, conditions); end - - def conditions; end - def element; end - def source; end -end - -class Mechanize::Error < ::RuntimeError; end - -class Mechanize::File - include ::Mechanize::Parser - - def initialize(uri = T.unsafe(nil), response = T.unsafe(nil), body = T.unsafe(nil), code = T.unsafe(nil)); end - - def body; end - def body=(_arg0); end - def content; end - def filename; end - def filename=(_arg0); end - def save(filename = T.unsafe(nil)); end - def save!(filename = T.unsafe(nil)); end - def save_as(filename = T.unsafe(nil)); end -end - -class Mechanize::FileConnection - def request(uri, request); end - - class << self - def new(*a); end - end -end - -class Mechanize::FileRequest - def initialize(uri); end - - def []=(*a); end - def add_field(*a); end - def each_header; end - def path; end - def response_body_permitted?; end - def uri; end - def uri=(_arg0); end -end - -class Mechanize::FileResponse - def initialize(file_path); end - - def [](key); end - def code; end - def content_length; end - def each; end - def each_header; end - def file_path; end - def get_fields(key); end - def http_version; end - def message; end - def read_body; end - def uri; end - - private - - def dir_body; end - def directory?; end -end - -class Mechanize::FileSaver < ::Mechanize::Download - def initialize(uri = T.unsafe(nil), response = T.unsafe(nil), body_io = T.unsafe(nil), code = T.unsafe(nil)); end - - def filename; end - def save_as(filename = T.unsafe(nil)); end -end - -class Mechanize::Form - extend ::Forwardable - extend ::Mechanize::ElementMatcher - - def initialize(node, mech = T.unsafe(nil), page = T.unsafe(nil)); end - - def [](field_name); end - def []=(field_name, value); end - def action; end - def action=(_arg0); end - def add_button_to_query(button); end - def add_field!(field_name, value = T.unsafe(nil)); end - def at(*args, &block); end - def at_css(*args, &block); end - def at_xpath(*args, &block); end - def build_query(buttons = T.unsafe(nil)); end - def button(criteria = T.unsafe(nil)); end - def button_with(criteria = T.unsafe(nil)); end - def button_with!(criteria = T.unsafe(nil)); end - def buttons; end - def buttons_with(criteria = T.unsafe(nil)); end - def checkbox(criteria = T.unsafe(nil)); end - def checkbox_with(criteria = T.unsafe(nil)); end - def checkbox_with!(criteria = T.unsafe(nil)); end - def checkboxes; end - def checkboxes_with(criteria = T.unsafe(nil)); end - def click_button(button = T.unsafe(nil)); end - def css(*args, &block); end - def delete_field!(field_name); end - def dom_class; end - def dom_id; end - def elements; end - def encoding; end - def encoding=(_arg0); end - def enctype; end - def enctype=(_arg0); end - def field(criteria = T.unsafe(nil)); end - def field_with(criteria = T.unsafe(nil)); end - def field_with!(criteria = T.unsafe(nil)); end - def fields; end - def fields_with(criteria = T.unsafe(nil)); end - def file_upload(criteria = T.unsafe(nil)); end - def file_upload_with(criteria = T.unsafe(nil)); end - def file_upload_with!(criteria = T.unsafe(nil)); end - def file_uploads; end - def file_uploads_with(criteria = T.unsafe(nil)); end - def form_node; end - def has_field?(field_name); end - def has_key?(field_name); end - def has_value?(value); end - def hidden_field?(field_name); end - def hiddens; end - def ignore_encoding_error; end - def ignore_encoding_error=(_arg0); end - def inspect; end - def keygens; end - def keys; end - def method; end - def method=(_arg0); end - def method_missing(meth, *args); end - def name; end - def name=(_arg0); end - def node; end - def page; end - def pretty_print(q); end - def radiobutton(criteria = T.unsafe(nil)); end - def radiobutton_with(criteria = T.unsafe(nil)); end - def radiobutton_with!(criteria = T.unsafe(nil)); end - def radiobuttons; end - def radiobuttons_with(criteria = T.unsafe(nil)); end - def request_data; end - def reset; end - def reset_button?(button_name); end - def resets; end - def save_hash_field_order; end - def search(*args, &block); end - def select_buttons(selector, method = T.unsafe(nil)); end - def select_checkboxes(selector, method = T.unsafe(nil)); end - def select_fields(selector, method = T.unsafe(nil)); end - def select_file_uploads(selector, method = T.unsafe(nil)); end - def select_radiobuttons(selector, method = T.unsafe(nil)); end - def set_fields(fields = T.unsafe(nil)); end - def submit(button = T.unsafe(nil), headers = T.unsafe(nil)); end - def submit_button?(button_name); end - def submits; end - def text_field?(field_name); end - def textarea_field?(field_name); end - def textareas; end - def texts; end - def values; end - def xpath(*args, &block); end - - private - - def file_to_multipart(file, buf = T.unsafe(nil)); end - def from_native_charset(str); end - def mime_value_quote(str); end - def param_to_multipart(name, value, buf = T.unsafe(nil)); end - def parse; end - def proc_query(field); end - def rand_string(len = T.unsafe(nil)); end -end - -class Mechanize::Form::Button < ::Mechanize::Form::Field; end -Mechanize::Form::CRLF = T.let(T.unsafe(nil), String) - -class Mechanize::Form::CheckBox < ::Mechanize::Form::RadioButton - def inspect; end - def query_value; end -end - -class Mechanize::Form::Field - extend ::Forwardable - - def initialize(node, value = T.unsafe(nil)); end - - def <=>(other); end - def at(*args, &block); end - def at_css(*args, &block); end - def at_xpath(*args, &block); end - def css(*args, &block); end - def dom_class; end - def dom_id; end - def index; end - def index=(_arg0); end - def inspect; end - def name; end - def name=(_arg0); end - def node; end - def node=(_arg0); end - def query_value; end - def raw_value; end - def search(*args, &block); end - def type; end - def type=(_arg0); end - def value; end - def value=(_arg0); end - def xpath(*args, &block); end -end - -class Mechanize::Form::FileUpload < ::Mechanize::Form::Field - def initialize(node, file_name); end - - def file_data; end - def file_data=(_arg0); end - def file_name; end - def file_name=(_arg0); end - def mime_type; end - def mime_type=(_arg0); end -end - -class Mechanize::Form::Hidden < ::Mechanize::Form::Field; end - -class Mechanize::Form::ImageButton < ::Mechanize::Form::Button - def initialize(*args); end - - def query_value; end - def x; end - def x=(_arg0); end - def y; end - def y=(_arg0); end -end - -class Mechanize::Form::Keygen < ::Mechanize::Form::Field - def initialize(node, value = T.unsafe(nil)); end - - def challenge; end - def generate_key(key_size = T.unsafe(nil)); end - def key; end -end - -class Mechanize::Form::MultiSelectList < ::Mechanize::Form::Field - extend ::Mechanize::ElementMatcher - - def initialize(node); end - - def option(criteria = T.unsafe(nil)); end - def option_with(criteria = T.unsafe(nil)); end - def option_with!(criteria = T.unsafe(nil)); end - def options; end - def options=(_arg0); end - def options_with(criteria = T.unsafe(nil)); end - def query_value; end - def select_all; end - def select_none; end - def select_options(selector, method = T.unsafe(nil)); end - def selected_options; end - def value; end - def value=(values); end -end - -class Mechanize::Form::Option - def initialize(node, select_list); end - - def click; end - def node; end - def select; end - def select_list; end - def selected; end - def selected?; end - def text; end - def tick; end - def to_s; end - def unselect; end - def untick; end - def value; end - - private - - def unselect_peers; end -end - -class Mechanize::Form::RadioButton < ::Mechanize::Form::Field - def initialize(node, form); end - - def ==(other); end - def [](key); end - def check; end - def checked; end - def checked=(_arg0); end - def checked?; end - def click; end - def eql?(other); end - def form; end - def hash; end - def label; end - def pretty_print_instance_variables; end - def text; end - def uncheck; end - - private - - def uncheck_peers; end -end - -class Mechanize::Form::Reset < ::Mechanize::Form::Button; end - -class Mechanize::Form::SelectList < ::Mechanize::Form::MultiSelectList - def initialize(node); end - - def query_value; end - def value; end - def value=(new_value); end -end - -class Mechanize::Form::Submit < ::Mechanize::Form::Button; end -class Mechanize::Form::Text < ::Mechanize::Form::Field; end -class Mechanize::Form::Textarea < ::Mechanize::Form::Field; end -class Mechanize::HTTP; end - -class Mechanize::HTTP::Agent - def initialize(connection_name = T.unsafe(nil)); end - - def add_auth(uri, user, password, realm = T.unsafe(nil), domain = T.unsafe(nil)); end - def add_default_auth(user, password, domain = T.unsafe(nil)); end - def allowed_error_codes; end - def allowed_error_codes=(_arg0); end - def auth_store; end - def authenticate_methods; end - def auto_io(name, read_size, input_io); end - def back; end - def ca_file; end - def ca_file=(ca_file); end - def cert_store; end - def cert_store=(cert_store); end - def certificate; end - def certificate=(certificate); end - def conditional_requests; end - def conditional_requests=(_arg0); end - def connection_for(uri); end - def content_encoding_gunzip(body_io); end - def content_encoding_hooks; end - def content_encoding_inflate(body_io); end - def context; end - def context=(_arg0); end - def cookie_jar; end - def cookie_jar=(_arg0); end - def current_page; end - def digest_challenges; end - def disable_keep_alive(request); end - def enable_gzip(request); end - def fetch(uri, method = T.unsafe(nil), headers = T.unsafe(nil), params = T.unsafe(nil), referer = T.unsafe(nil), redirects = T.unsafe(nil)); end - def follow_meta_refresh; end - def follow_meta_refresh=(_arg0); end - def follow_meta_refresh_self; end - def follow_meta_refresh_self=(_arg0); end - def get_meta_refresh(response, uri, page); end - def get_robots(uri); end - def gzip_enabled; end - def gzip_enabled=(_arg0); end - def history; end - def history=(_arg0); end - def hook_content_encoding(response, uri, response_body_io); end - def http; end - def http_request(uri, method, params = T.unsafe(nil)); end - def idle_timeout; end - def idle_timeout=(timeout); end - def ignore_bad_chunking; end - def ignore_bad_chunking=(_arg0); end - def inflate(compressed, window_bits = T.unsafe(nil)); end - def keep_alive; end - def keep_alive=(_arg0); end - def log; end - def make_tempfile(name); end - def max_file_buffer; end - def max_file_buffer=(_arg0); end - def max_history; end - def max_history=(length); end - def open_timeout; end - def open_timeout=(_arg0); end - def pass; end - def pass=(_arg0); end - def post_connect(uri, response, body_io); end - def post_connect_hooks; end - def pre_connect(request); end - def pre_connect_hooks; end - def private_key; end - def private_key=(private_key); end - def proxy_uri; end - def read_timeout; end - def read_timeout=(_arg0); end - def redirect_ok; end - def redirect_ok=(_arg0); end - def redirection_limit; end - def redirection_limit=(_arg0); end - def request_add_headers(request, headers = T.unsafe(nil)); end - def request_auth(request, uri); end - def request_auth_digest(request, uri, realm, base_uri, iis); end - def request_cookies(request, uri); end - def request_headers; end - def request_headers=(_arg0); end - def request_host(request, uri); end - def request_language_charset(request); end - def request_log(request); end - def request_referer(request, uri, referer); end - def request_user_agent(request); end - def reset; end - def resolve(uri, referer = T.unsafe(nil)); end - def resolve_parameters(uri, method, parameters); end - def response_authenticate(response, page, uri, request, headers, params, referer); end - def response_content_encoding(response, body_io); end - def response_cookies(response, uri, page); end - def response_follow_meta_refresh(response, uri, page, redirects); end - def response_log(response); end - def response_parse(response, body_io, uri); end - def response_read(response, request, uri); end - def response_redirect(response, method, page, redirects, headers, referer = T.unsafe(nil)); end - def retry_change_requests; end - def retry_change_requests=(retri); end - def robots; end - def robots=(value); end - def robots_allowed?(uri); end - def robots_disallowed?(url); end - def robots_error(url); end - def robots_error!(url); end - def robots_mutex; end - def robots_reset(url); end - def save_cookies(uri, set_cookie); end - def scheme_handlers; end - def scheme_handlers=(_arg0); end - def secure_resolve!(uri, referer = T.unsafe(nil)); end - def set_proxy(addr, port = T.unsafe(nil), user = T.unsafe(nil), pass = T.unsafe(nil)); end - def shutdown; end - def ssl_version; end - def ssl_version=(ssl_version); end - def use_tempfile?(size); end - def user_agent; end - def user_agent=(user_agent); end - def verify_callback; end - def verify_callback=(verify_callback); end - def verify_mode; end - def verify_mode=(verify_mode); end - def visited_page(url); end - def webrobots; end -end - -Mechanize::HTTP::Agent::COOKIE_HEADERS = T.let(T.unsafe(nil), Array) -Mechanize::HTTP::Agent::CREDENTIAL_HEADERS = T.let(T.unsafe(nil), Array) -Mechanize::HTTP::Agent::POST_HEADERS = T.let(T.unsafe(nil), Array) -Mechanize::HTTP::Agent::RobotsKey = T.let(T.unsafe(nil), Symbol) - -class Mechanize::HTTP::AuthChallenge < ::Struct - def [](param); end - def params; end - def params=(_); end - def raw; end - def raw=(_); end - def realm(uri); end - def realm_name; end - def scheme; end - def scheme=(_); end - def to_s; end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -class Mechanize::HTTP::AuthRealm - def initialize(scheme, uri, realm); end - - def ==(other); end - def eql?(other); end - def hash; end - def inspect; end - def realm; end - def scheme; end - def uri; end -end - -class Mechanize::HTTP::AuthStore - def initialize; end - - def add_auth(uri, user, pass, realm = T.unsafe(nil), domain = T.unsafe(nil)); end - def add_default_auth(user, pass, domain = T.unsafe(nil)); end - def auth_accounts; end - def credentials?(uri, challenges); end - def credentials_for(uri, realm); end - def default_auth; end - def remove_auth(uri, realm = T.unsafe(nil)); end -end - -class Mechanize::HTTP::ContentDisposition < ::Struct - def creation_date; end - def creation_date=(_); end - def filename; end - def filename=(_); end - def modification_date; end - def modification_date=(_); end - def parameters; end - def parameters=(_); end - def read_date; end - def read_date=(_); end - def size; end - def size=(_); end - def type; end - def type=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -class Mechanize::HTTP::ContentDispositionParser - def initialize; end - - def parse(content_disposition, header = T.unsafe(nil)); end - def parse_parameters; end - def rfc_2045_quoted_string; end - def rfc_2045_token; end - def rfc_2045_value; end - def scanner; end - def scanner=(_arg0); end - def spaces; end - - class << self - def parse(content_disposition); end - end -end - -class Mechanize::HTTP::WWWAuthenticateParser - def initialize; end - - def auth_param; end - def auth_scheme; end - def parse(www_authenticate); end - def quoted_string; end - def scan_comma_spaces; end - def scanner; end - def scanner=(_arg0); end - def spaces; end - def token; end -end - -class Mechanize::Headers < ::Hash - def [](key); end - def []=(key, value); end - def canonical_each; end - def key?(key); end -end - -class Mechanize::History < ::Array - def initialize(max_size = T.unsafe(nil)); end - - def <<(page, uri = T.unsafe(nil)); end - def clear; end - def inspect; end - def max_size; end - def max_size=(_arg0); end - def pop; end - def push(page, uri = T.unsafe(nil)); end - def shift; end - def visited?(uri); end - def visited_page(uri); end - - private - - def initialize_copy(orig); end - def remove_from_index(page); end -end - -class Mechanize::Image < ::Mechanize::Download; end - -class Mechanize::Page < ::Mechanize::File - extend ::Forwardable - extend ::Mechanize::ElementMatcher - - def initialize(uri = T.unsafe(nil), response = T.unsafe(nil), body = T.unsafe(nil), code = T.unsafe(nil), mech = T.unsafe(nil)); end - - def %(*args, &block); end - def /(*args, &block); end - def at(*args, &block); end - def at_css(*args, &block); end - def at_xpath(*args, &block); end - def base(criteria = T.unsafe(nil)); end - def base_with(criteria = T.unsafe(nil)); end - def base_with!(criteria = T.unsafe(nil)); end - def bases; end - def bases_with(criteria = T.unsafe(nil)); end - def canonical_uri; end - def content_type; end - def css(*args, &block); end - def detected_encoding; end - def encoding; end - def encoding=(encoding); end - def encoding_error?(parser = T.unsafe(nil)); end - def encodings; end - def form(criteria = T.unsafe(nil)); end - def form_with(criteria = T.unsafe(nil)); end - def form_with!(criteria = T.unsafe(nil)); end - def forms; end - def forms_with(criteria = T.unsafe(nil)); end - def frame(criteria = T.unsafe(nil)); end - def frame_with(criteria = T.unsafe(nil)); end - def frame_with!(criteria = T.unsafe(nil)); end - def frames; end - def frames_with(criteria = T.unsafe(nil)); end - def iframe(criteria = T.unsafe(nil)); end - def iframe_with(criteria = T.unsafe(nil)); end - def iframe_with!(criteria = T.unsafe(nil)); end - def iframes; end - def iframes_with(criteria = T.unsafe(nil)); end - def image(criteria = T.unsafe(nil)); end - def image_urls; end - def image_with(criteria = T.unsafe(nil)); end - def image_with!(criteria = T.unsafe(nil)); end - def images; end - def images_with(criteria = T.unsafe(nil)); end - def inspect; end - def labels; end - def labels_hash; end - def link(criteria = T.unsafe(nil)); end - def link_with(criteria = T.unsafe(nil)); end - def link_with!(criteria = T.unsafe(nil)); end - def links; end - def links_with(criteria = T.unsafe(nil)); end - def mech; end - def mech=(_arg0); end - def meta_charset; end - def meta_refresh; end - def parser; end - def pretty_print(q); end - def reset; end - def response_header_charset; end - def root; end - def search(*args, &block); end - def select_bases(selector, method = T.unsafe(nil)); end - def select_forms(selector, method = T.unsafe(nil)); end - def select_frames(selector, method = T.unsafe(nil)); end - def select_iframes(selector, method = T.unsafe(nil)); end - def select_images(selector, method = T.unsafe(nil)); end - def select_links(selector, method = T.unsafe(nil)); end - def title; end - def xpath(*args, &block); end - - private - - def html_body; end - - class << self - def charset(content_type); end - def charset_from_content_type(content_type); end - def meta_charset(body); end - def meta_content_type(body); end - def response_header_charset(response); end - end -end - -class Mechanize::Page::Base < ::Mechanize::Page::Link; end -Mechanize::Page::DEFAULT_RESPONSE = T.let(T.unsafe(nil), Hash) - -class Mechanize::Page::Frame < ::Mechanize::Page::Link - def initialize(node, mech, referer); end - - def content; end - def name; end - def node; end - def src; end - def text; end -end - -class Mechanize::Page::Image - def initialize(node, page); end - - def alt; end - def caption; end - def dom_class; end - def dom_id; end - def extname; end - def fetch(parameters = T.unsafe(nil), referer = T.unsafe(nil), headers = T.unsafe(nil)); end - def height; end - def image_referer; end - def inspect; end - def mech; end - def mech=(_arg0); end - def mime_type; end - def node; end - def page; end - def page=(_arg0); end - def pretty_print(q); end - def relative?; end - def src; end - def text; end - def title; end - def to_s; end - def uri; end - def url; end - def width; end -end - -class Mechanize::Page::Label - def initialize(node, page); end - - def for; end - def node; end - def page; end - def text; end - def to_s; end -end - -class Mechanize::Page::Link - def initialize(node, mech, page); end - - def attributes; end - def click; end - def dom_class; end - def dom_id; end - def href; end - def inspect; end - def node; end - def noreferrer?; end - def page; end - def pretty_print(q); end - def referer; end - def rel; end - def rel?(kind); end - def resolved_uri; end - def text; end - def to_s; end - def uri; end -end - -class Mechanize::Page::MetaRefresh < ::Mechanize::Page::Link - def initialize(node, page, delay, href, link_self = T.unsafe(nil)); end - - def delay; end - def link_self; end - def noreferrer?; end - - class << self - def from_node(node, page, uri = T.unsafe(nil)); end - def parse(content, base_uri = T.unsafe(nil)); end - end -end - -Mechanize::Page::MetaRefresh::CONTENT_REGEXP = T.let(T.unsafe(nil), Regexp) -Mechanize::Page::MetaRefresh::UNSAFE = T.let(T.unsafe(nil), Regexp) - -module Mechanize::Parser - extend ::Forwardable - - def [](*args, &block); end - def []=(*args, &block); end - def canonical_each(*args, &block); end - def code; end - def code=(_arg0); end - def each(*args, &block); end - def extract_filename(full_path = T.unsafe(nil)); end - def fill_header(response); end - def find_free_name(filename); end - def header; end - def key?(*args, &block); end - def response; end - def response=(_arg0); end - def uri; end - def uri=(_arg0); end -end - -Mechanize::Parser::SPECIAL_FILENAMES = T.let(T.unsafe(nil), Regexp) - -class Mechanize::PluggableParser - def initialize; end - - def [](content_type); end - def []=(content_type, klass); end - def csv=(klass); end - def default; end - def default=(_arg0); end - def html=(klass); end - def parser(content_type); end - def pdf=(klass); end - def register_parser(content_type, klass); end - def xhtml=(klass); end - def xml=(klass); end -end - -Mechanize::PluggableParser::CONTENT_TYPES = T.let(T.unsafe(nil), Hash) -Mechanize::PluggableParser::InvalidContentTypeError = MIME::Type::InvalidContentType - -class Mechanize::RedirectLimitReachedError < ::Mechanize::Error - def initialize(page, redirects); end - - def page; end - def redirects; end - def response_code; end -end - -class Mechanize::RedirectNotGetOrHeadError < ::Mechanize::Error - def initialize(page, verb); end - - def inspect; end - def page; end - def response_code; end - def to_s; end - def uri; end - def verb; end -end - -class Mechanize::ResponseCodeError < ::Mechanize::Error - def initialize(page, message = T.unsafe(nil)); end - - def inspect; end - def page; end - def response_code; end - def to_s; end -end - -class Mechanize::ResponseReadError < ::Mechanize::Error - def initialize(error, response, body_io, uri, mechanize); end - - def body_io; end - def error; end - def force_parse; end - def mechanize; end - def message; end - def response; end - def uri; end -end - -class Mechanize::RobotsDisallowedError < ::Mechanize::Error - def initialize(url); end - - def inspect; end - def to_s; end - def uri; end - def url; end -end - -class Mechanize::UnauthorizedError < ::Mechanize::ResponseCodeError - def initialize(page, challenges, message); end - - def challenges; end - def to_s; end -end - -class Mechanize::UnsupportedSchemeError < ::Mechanize::Error - def initialize(scheme, uri); end - - def scheme; end - def scheme=(_arg0); end - def uri; end - def uri=(_arg0); end -end - -class Mechanize::Util - class << self - def build_query_string(parameters, enc = T.unsafe(nil)); end - def detect_charset(src); end - def each_parameter(parameters, &block); end - def from_native_charset(s, code, ignore_encoding_error = T.unsafe(nil), log = T.unsafe(nil)); end - def guess_encoding(src); end - def html_unescape(s); end - def uri_escape(str, unsafe = T.unsafe(nil)); end - def uri_unescape(str); end - - private - - def each_parameter_1(key, value, &block); end - end -end - -Mechanize::Util::DefaultMimeTypes = T.let(T.unsafe(nil), Hash) -Mechanize::VERSION = T.let(T.unsafe(nil), String) - -class Mechanize::XmlFile < ::Mechanize::File - extend ::Forwardable - - def initialize(uri = T.unsafe(nil), response = T.unsafe(nil), body = T.unsafe(nil), code = T.unsafe(nil)); end - - def at(*args, &block); end - def search(*args, &block); end - def xml; end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/mime-types-data@3.2023.0218.1.rbi b/Library/Homebrew/sorbet/rbi/gems/mime-types-data@3.2023.0218.1.rbi deleted file mode 100644 index 453b40447e..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/mime-types-data@3.2023.0218.1.rbi +++ /dev/null @@ -1,73 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `mime-types-data` gem. -# Please instead update this file by running `bin/tapioca gem mime-types-data`. - -module MIME; end - -class MIME::Types - include ::Enumerable - extend ::Enumerable - - def initialize; end - - def [](type_id, complete: T.unsafe(nil), registered: T.unsafe(nil)); end - def add(*types); end - def add_type(type, quiet = T.unsafe(nil)); end - def count; end - def each; end - def inspect; end - def of(filename); end - def type_for(filename); end - - private - - def add_type_variant!(mime_type); end - def index_extensions!(mime_type); end - def match(pattern); end - def prune_matches(matches, complete, registered); end - def reindex_extensions!(mime_type); end - - class << self - def [](type_id, complete: T.unsafe(nil), registered: T.unsafe(nil)); end - def add(*types); end - def count; end - def each; end - def logger; end - def logger=(_arg0); end - def new(*_arg0); end - def of(filename); end - def type_for(filename); end - - private - - def __instances__; end - def __types__; end - def lazy_load?; end - def load_default_mime_types(mode = T.unsafe(nil)); end - def load_mode; end - def reindex_extensions(type); end - end -end - -class MIME::Types::Cache < ::Struct - def data; end - def data=(_); end - def version; end - def version=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def load(cache_file = T.unsafe(nil)); end - def members; end - def new(*_arg0); end - def save(types = T.unsafe(nil), cache_file = T.unsafe(nil)); end - end -end - -module MIME::Types::Data; end -MIME::Types::Data::PATH = T.let(T.unsafe(nil), String) -MIME::Types::Data::VERSION = T.let(T.unsafe(nil), String) -MIME::Types::VERSION = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/gems/mime-types@3.4.1.rbi b/Library/Homebrew/sorbet/rbi/gems/mime-types@3.4.1.rbi deleted file mode 100644 index af47e4a82d..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/mime-types@3.4.1.rbi +++ /dev/null @@ -1,295 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `mime-types` gem. -# Please instead update this file by running `bin/tapioca gem mime-types`. - -module MIME; end - -class MIME::Type - include ::Comparable - - def initialize(content_type); end - - def <=>(other); end - def add_extensions(*extensions); end - def ascii?; end - def binary?; end - def complete?; end - def content_type; end - def default_encoding; end - def docs; end - def docs=(_arg0); end - def encode_with(coder); end - def encoding; end - def encoding=(enc); end - def eql?(other); end - def extensions; end - def extensions=(value); end - def friendly(lang = T.unsafe(nil)); end - def i18n_key; end - def init_with(coder); end - def inspect; end - def like?(other); end - def media_type; end - def obsolete; end - def obsolete=(_arg0); end - def obsolete?; end - def preferred_extension; end - def preferred_extension=(value); end - def priority_compare(other); end - def provisional; end - def provisional=(_arg0); end - def provisional?; end - def raw_media_type; end - def raw_sub_type; end - def registered; end - def registered=(_arg0); end - def registered?; end - def signature; end - def signature=(_arg0); end - def signature?; end - def simplified; end - def sub_type; end - def to_h; end - def to_json(*args); end - def to_s; end - def to_str; end - def use_instead; end - def use_instead=(_arg0); end - def xref_urls; end - def xrefs; end - def xrefs=(xrefs); end - - private - - def content_type=(type_string); end - def intern_string(string); end - def xref_map(values, helper); end - def xref_url_for_draft(value); end - def xref_url_for_person(value); end - def xref_url_for_rfc(value); end - def xref_url_for_rfc_errata(value); end - def xref_url_for_template(value); end - - class << self - def i18n_key(content_type); end - def match(content_type); end - def simplified(content_type, remove_x_prefix: T.unsafe(nil)); end - - private - - def simplify_matchdata(matchdata, remove_x = T.unsafe(nil), joiner: T.unsafe(nil)); end - end -end - -MIME::Type::ASCII_ENCODINGS = T.let(T.unsafe(nil), Array) -MIME::Type::BINARY_ENCODINGS = T.let(T.unsafe(nil), Array) - -class MIME::Type::Columnar < ::MIME::Type - def initialize(container, content_type, extensions); end - - def docs(*args); end - def docs=(*args); end - def encode_with(coder); end - def encoding(*args); end - def encoding=(*args); end - def friendly(*args); end - def obsolete(*args); end - def obsolete=(*args); end - def obsolete?(*args); end - def preferred_extension(*args); end - def preferred_extension=(*args); end - def provisional(*args); end - def provisional=(*args); end - def provisional?(*args); end - def registered(*args); end - def registered=(*args); end - def registered?(*args); end - def signature(*args); end - def signature=(*args); end - def signature?(*args); end - def use_instead(*args); end - def use_instead=(*args); end - def xref_urls(*args); end - def xrefs(*args); end - def xrefs=(*args); end -end - -MIME::Type::I18N_RE = T.let(T.unsafe(nil), Regexp) - -class MIME::Type::InvalidContentType < ::ArgumentError - def initialize(type_string); end - - def to_s; end -end - -class MIME::Type::InvalidEncoding < ::ArgumentError - def initialize(encoding); end - - def to_s; end -end - -MIME::Type::MEDIA_TYPE_RE = T.let(T.unsafe(nil), Regexp) -MIME::Type::VERSION = T.let(T.unsafe(nil), String) - -class MIME::Types - include ::Enumerable - extend ::Enumerable - - def initialize; end - - def [](type_id, complete: T.unsafe(nil), registered: T.unsafe(nil)); end - def add(*types); end - def add_type(type, quiet = T.unsafe(nil)); end - def count; end - def each; end - def inspect; end - def of(filename); end - def type_for(filename); end - - private - - def add_type_variant!(mime_type); end - def index_extensions!(mime_type); end - def match(pattern); end - def prune_matches(matches, complete, registered); end - def reindex_extensions!(mime_type); end - - class << self - def [](type_id, complete: T.unsafe(nil), registered: T.unsafe(nil)); end - def add(*types); end - def count; end - def each; end - def logger; end - def logger=(_arg0); end - def new(*_arg0); end - def of(filename); end - def type_for(filename); end - - private - - def __instances__; end - def __types__; end - def lazy_load?; end - def load_default_mime_types(mode = T.unsafe(nil)); end - def load_mode; end - def reindex_extensions(type); end - end -end - -class MIME::Types::Cache < ::Struct - def data; end - def data=(_); end - def version; end - def version=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def load(cache_file = T.unsafe(nil)); end - def members; end - def new(*_arg0); end - def save(types = T.unsafe(nil), cache_file = T.unsafe(nil)); end - end -end - -module MIME::Types::Columnar - def load_base_data(path); end - - private - - def arr(line); end - def dict(line, array: T.unsafe(nil)); end - def each_file_line(name, lookup = T.unsafe(nil)); end - def flag(line); end - def load_docs; end - def load_encoding; end - def load_flags; end - def load_friendly; end - def load_preferred_extension; end - def load_use_instead; end - def load_xrefs; end - def opt(line); end - - class << self - def extended(obj); end - end -end - -MIME::Types::Columnar::LOAD_MUTEX = T.let(T.unsafe(nil), Thread::Mutex) - -class MIME::Types::Container - extend ::Forwardable - - def initialize(hash = T.unsafe(nil)); end - - def ==(*args, &block); end - def [](key); end - def []=(key, value); end - def add(key, value); end - def count(*args, &block); end - def each(*args, &block); end - def each_value(*args, &block); end - def empty?(*args, &block); end - def encode_with(coder); end - def flat_map(*args, &block); end - def init_with(coder); end - def keys(*args, &block); end - def marshal_dump; end - def marshal_load(hash); end - def merge(other); end - def merge!(other); end - def select(*args, &block); end - def to_hash; end - def values(*args, &block); end - - protected - - def container; end - def container=(_arg0); end - def normalize; end -end - -MIME::Types::Container::EMPTY_SET = T.let(T.unsafe(nil), Set) - -class MIME::Types::Loader - def initialize(path = T.unsafe(nil), container = T.unsafe(nil)); end - - def container; end - def load(options = T.unsafe(nil)); end - def load_columnar; end - def load_json; end - def load_yaml; end - def path; end - - private - - def columnar_path; end - def json_path; end - def yaml_path; end - - class << self - def load(options = T.unsafe(nil)); end - def load_from_json(filename); end - def load_from_yaml(filename); end - - private - - def old_yaml?; end - def read_file(filename); end - end -end - -MIME::Types::VERSION = T.let(T.unsafe(nil), String) - -class MIME::Types::WarnLogger < ::Logger - def initialize(_one, _two = T.unsafe(nil), _three = T.unsafe(nil)); end -end - -class MIME::Types::WarnLogger::WarnLogDevice < ::Logger::LogDevice - def initialize(*_arg0); end - - def close; end - def write(m); end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/net-http-digest_auth@1.4.1.rbi b/Library/Homebrew/sorbet/rbi/gems/net-http-digest_auth@1.4.1.rbi deleted file mode 100644 index 8b0051b417..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/net-http-digest_auth@1.4.1.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `net-http-digest_auth` gem. -# Please instead update this file by running `bin/tapioca gem net-http-digest_auth`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires diff --git a/Library/Homebrew/sorbet/rbi/gems/net-http-persistent@4.0.2.rbi b/Library/Homebrew/sorbet/rbi/gems/net-http-persistent@4.0.2.rbi deleted file mode 100644 index 8c78f156e9..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/net-http-persistent@4.0.2.rbi +++ /dev/null @@ -1,146 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `net-http-persistent` gem. -# Please instead update this file by running `bin/tapioca gem net-http-persistent`. - -class Net::HTTP::Persistent - def initialize(name: T.unsafe(nil), proxy: T.unsafe(nil), pool_size: T.unsafe(nil)); end - - def ca_file; end - def ca_file=(file); end - def ca_path; end - def ca_path=(path); end - def cert; end - def cert=(certificate); end - def cert_store; end - def cert_store=(store); end - def certificate; end - def certificate=(certificate); end - def ciphers; end - def ciphers=(ciphers); end - def connection_for(uri); end - def debug_output; end - def debug_output=(_arg0); end - def escape(str); end - def expired?(connection); end - def finish(connection); end - def generation; end - def headers; end - def http_version(uri); end - def http_versions; end - def idle_timeout; end - def idle_timeout=(_arg0); end - def keep_alive; end - def keep_alive=(_arg0); end - def key; end - def key=(key); end - def max_requests; end - def max_requests=(_arg0); end - def max_retries; end - def max_retries=(retries); end - def max_version; end - def max_version=(max_version); end - def min_version; end - def min_version=(min_version); end - def name; end - def no_proxy; end - def normalize_uri(uri); end - def open_timeout; end - def open_timeout=(_arg0); end - def override_headers; end - def pipeline(uri, requests, &block); end - def pool; end - def private_key; end - def private_key=(key); end - def proxy=(proxy); end - def proxy_bypass?(host, port); end - def proxy_from_env; end - def proxy_uri; end - def read_timeout; end - def read_timeout=(_arg0); end - def reconnect; end - def reconnect_ssl; end - def request(uri, req = T.unsafe(nil), &block); end - def request_setup(req_or_uri); end - def reset(connection); end - def reuse_ssl_sessions; end - def reuse_ssl_sessions=(_arg0); end - def shutdown; end - def socket_options; end - def ssl(connection); end - def ssl_generation; end - def ssl_timeout; end - def ssl_timeout=(ssl_timeout); end - def ssl_version; end - def ssl_version=(ssl_version); end - def start(http); end - def timeout_key; end - def unescape(str); end - def verify_callback; end - def verify_callback=(callback); end - def verify_depth; end - def verify_depth=(verify_depth); end - def verify_mode; end - def verify_mode=(verify_mode); end - def write_timeout; end - def write_timeout=(_arg0); end - - class << self - def detect_idle_timeout(uri, max = T.unsafe(nil)); end - end -end - -class Net::HTTP::Persistent::Connection - def initialize(http_class, http_args, ssl_generation); end - - def close; end - def finish; end - def http; end - def http=(_arg0); end - def last_use; end - def last_use=(_arg0); end - def requests; end - def requests=(_arg0); end - def reset; end - def ressl(ssl_generation); end - def ssl_generation; end - def ssl_generation=(_arg0); end -end - -Net::HTTP::Persistent::DEFAULT_POOL_SIZE = T.let(T.unsafe(nil), Integer) -Net::HTTP::Persistent::EPOCH = T.let(T.unsafe(nil), Time) -class Net::HTTP::Persistent::Error < ::StandardError; end -Net::HTTP::Persistent::HAVE_OPENSSL = T.let(T.unsafe(nil), String) - -class Net::HTTP::Persistent::Pool < ::ConnectionPool - def initialize(options = T.unsafe(nil), &block); end - - def available; end - def checkin(net_http_args); end - def checkout(net_http_args); end - def key; end - def shutdown; end -end - -class Net::HTTP::Persistent::TimedStackMulti < ::ConnectionPool::TimedStack - def initialize(size = T.unsafe(nil), &block); end - - def empty?; end - def length; end - - private - - def connection_stored?(options = T.unsafe(nil)); end - def fetch_connection(options = T.unsafe(nil)); end - def lru_update(connection_args); end - def shutdown_connections; end - def store_connection(obj, options = T.unsafe(nil)); end - def try_create(options = T.unsafe(nil)); end - - class << self - def hash_of_arrays; end - end -end - -Net::HTTP::Persistent::VERSION = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/gems/nokogiri@1.13.10.rbi b/Library/Homebrew/sorbet/rbi/gems/nokogiri@1.13.10.rbi deleted file mode 100644 index f70656d62c..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/nokogiri@1.13.10.rbi +++ /dev/null @@ -1,1545 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `nokogiri` gem. -# Please instead update this file by running `bin/tapioca gem nokogiri`. - -module Nokogiri - class << self - def HTML(input, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - def HTML4(input, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - def HTML5(input, url = T.unsafe(nil), encoding = T.unsafe(nil), **options, &block); end - def Slop(*args, &block); end - def XML(thing, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - def XSLT(stylesheet, modules = T.unsafe(nil)); end - def install_default_aliases; end - def jruby?; end - def libxml2_patches; end - def make(input = T.unsafe(nil), opts = T.unsafe(nil), &blk); end - def parse(string, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end - def uses_gumbo?; end - def uses_libxml?(requirement = T.unsafe(nil)); end - end -end - -module Nokogiri::CSS - class << self - def parse(selector); end - def xpath_for(selector, options = T.unsafe(nil)); end - end -end - -class Nokogiri::CSS::Node - def initialize(type, value); end - - def accept(visitor); end - def find_by_type(types); end - def to_a; end - def to_type; end - def to_xpath(prefix, visitor); end - def type; end - def type=(_arg0); end - def value; end - def value=(_arg0); end -end - -Nokogiri::CSS::Node::ALLOW_COMBINATOR_ON_SELF = T.let(T.unsafe(nil), Array) - -class Nokogiri::CSS::Parser < ::Racc::Parser - def initialize(namespaces = T.unsafe(nil)); end - - def _reduce_1(val, _values, result); end - def _reduce_10(val, _values, result); end - def _reduce_11(val, _values, result); end - def _reduce_13(val, _values, result); end - def _reduce_14(val, _values, result); end - def _reduce_15(val, _values, result); end - def _reduce_17(val, _values, result); end - def _reduce_18(val, _values, result); end - def _reduce_19(val, _values, result); end - def _reduce_2(val, _values, result); end - def _reduce_21(val, _values, result); end - def _reduce_23(val, _values, result); end - def _reduce_24(val, _values, result); end - def _reduce_25(val, _values, result); end - def _reduce_26(val, _values, result); end - def _reduce_28(val, _values, result); end - def _reduce_29(val, _values, result); end - def _reduce_3(val, _values, result); end - def _reduce_30(val, _values, result); end - def _reduce_31(val, _values, result); end - def _reduce_32(val, _values, result); end - def _reduce_34(val, _values, result); end - def _reduce_35(val, _values, result); end - def _reduce_36(val, _values, result); end - def _reduce_37(val, _values, result); end - def _reduce_38(val, _values, result); end - def _reduce_39(val, _values, result); end - def _reduce_4(val, _values, result); end - def _reduce_40(val, _values, result); end - def _reduce_41(val, _values, result); end - def _reduce_42(val, _values, result); end - def _reduce_45(val, _values, result); end - def _reduce_47(val, _values, result); end - def _reduce_48(val, _values, result); end - def _reduce_49(val, _values, result); end - def _reduce_5(val, _values, result); end - def _reduce_50(val, _values, result); end - def _reduce_51(val, _values, result); end - def _reduce_54(val, _values, result); end - def _reduce_55(val, _values, result); end - def _reduce_56(val, _values, result); end - def _reduce_57(val, _values, result); end - def _reduce_58(val, _values, result); end - def _reduce_6(val, _values, result); end - def _reduce_64(val, _values, result); end - def _reduce_65(val, _values, result); end - def _reduce_66(val, _values, result); end - def _reduce_67(val, _values, result); end - def _reduce_69(val, _values, result); end - def _reduce_7(val, _values, result); end - def _reduce_70(val, _values, result); end - def _reduce_71(val, _values, result); end - def _reduce_72(val, _values, result); end - def _reduce_73(val, _values, result); end - def _reduce_74(val, _values, result); end - def _reduce_75(val, _values, result); end - def _reduce_76(val, _values, result); end - def _reduce_8(val, _values, result); end - def _reduce_9(val, _values, result); end - def _reduce_none(val, _values, result); end - def cache_key(query, prefix, visitor); end - def next_token; end - def on_error(error_token_id, error_value, value_stack); end - def parse(string); end - def unescape_css_identifier(identifier); end - def unescape_css_string(str); end - def xpath_for(string, prefix, visitor); end - - class << self - def [](string); end - def []=(string, value); end - def cache_on?; end - def clear_cache(create_new_object = T.unsafe(nil)); end - def set_cache(value); end - def without_cache(&block); end - end -end - -Nokogiri::CSS::Parser::CACHE_SWITCH_NAME = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::Parser::Racc_arg = T.let(T.unsafe(nil), Array) -Nokogiri::CSS::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) -class Nokogiri::CSS::SyntaxError < ::Nokogiri::SyntaxError; end - -class Nokogiri::CSS::Tokenizer - def _next_token; end - def action; end - def filename; end - def lineno; end - def load_file(filename); end - def next_token; end - def scan(str); end - def scan_file(filename); end - def scan_setup(str); end - def scan_str(str); end - def state; end - def state=(_arg0); end -end - -class Nokogiri::CSS::Tokenizer::ScanError < ::StandardError; end - -class Nokogiri::CSS::XPathVisitor - def initialize(builtins: T.unsafe(nil), doctype: T.unsafe(nil)); end - - def accept(node); end - def config; end - def visit_attrib_name(node); end - def visit_attribute_condition(node); end - def visit_child_selector(node); end - def visit_class_condition(node); end - def visit_combinator(node); end - def visit_conditional_selector(node); end - def visit_descendant_selector(node); end - def visit_direct_adjacent_selector(node); end - def visit_element_name(node); end - def visit_following_selector(node); end - def visit_function(node); end - def visit_id(node); end - def visit_not(node); end - def visit_pseudo_class(node); end - - private - - def css_class(hay, needle); end - def html5_element_name_needs_namespace_handling(node); end - def is_of_type_pseudo_class?(node); end - def nth(node, options = T.unsafe(nil)); end - def read_a_and_positive_b(values); end -end - -module Nokogiri::CSS::XPathVisitor::BuiltinsConfig; end -Nokogiri::CSS::XPathVisitor::BuiltinsConfig::ALWAYS = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::XPathVisitor::BuiltinsConfig::NEVER = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::XPathVisitor::BuiltinsConfig::OPTIMAL = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::XPathVisitor::BuiltinsConfig::VALUES = T.let(T.unsafe(nil), Array) -module Nokogiri::CSS::XPathVisitor::DoctypeConfig; end -Nokogiri::CSS::XPathVisitor::DoctypeConfig::HTML4 = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::XPathVisitor::DoctypeConfig::HTML5 = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::XPathVisitor::DoctypeConfig::VALUES = T.let(T.unsafe(nil), Array) -Nokogiri::CSS::XPathVisitor::DoctypeConfig::XML = T.let(T.unsafe(nil), Symbol) -Nokogiri::CSS::XPathVisitor::WILDCARD_NAMESPACES = T.let(T.unsafe(nil), TrueClass) - -module Nokogiri::CSS::XPathVisitorAlwaysUseBuiltins - class << self - def new; end - end -end - -module Nokogiri::CSS::XPathVisitorOptimallyUseBuiltins - class << self - def new; end - end -end - -module Nokogiri::ClassResolver - def related_class(class_name); end -end - -Nokogiri::ClassResolver::VALID_NAMESPACES = T.let(T.unsafe(nil), Set) -module Nokogiri::Decorators; end - -module Nokogiri::Decorators::Slop - def method_missing(name, *args, &block); end - - private - - def respond_to_missing?(name, include_private = T.unsafe(nil)); end -end - -Nokogiri::Decorators::Slop::XPATH_PREFIX = T.let(T.unsafe(nil), String) - -class Nokogiri::EncodingHandler - def name; end - - class << self - def [](_arg0); end - def alias(_arg0, _arg1); end - def clear_aliases!; end - def delete(_arg0); end - end -end - -module Nokogiri::Gumbo - class << self - def fragment(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5); end - def parse(_arg0, _arg1, _arg2, _arg3, _arg4); end - end -end - -Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES = T.let(T.unsafe(nil), Integer) -Nokogiri::Gumbo::DEFAULT_MAX_ERRORS = T.let(T.unsafe(nil), Integer) -Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH = T.let(T.unsafe(nil), Integer) -Nokogiri::HTML = Nokogiri::HTML4 - -module Nokogiri::HTML4 - class << self - def fragment(string, encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - def parse(input, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - end -end - -class Nokogiri::HTML4::Builder < ::Nokogiri::XML::Builder - def to_html; end -end - -class Nokogiri::HTML4::Document < ::Nokogiri::XML::Document - def fragment(tags = T.unsafe(nil)); end - def meta_encoding; end - def meta_encoding=(encoding); end - def meta_robots(custom_name = T.unsafe(nil)); end - def nofollow?(custom_name = T.unsafe(nil)); end - def noindex?(custom_name = T.unsafe(nil)); end - def serialize(options = T.unsafe(nil)); end - def title; end - def title=(text); end - def type; end - def xpath_doctype; end - - private - - def meta_content_type; end - def parse_meta_robots(custom_name); end - def set_metadata_element(element); end - - class << self - def new(*_arg0); end - def parse(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end - def read_io(_arg0, _arg1, _arg2, _arg3); end - def read_memory(_arg0, _arg1, _arg2, _arg3); end - end -end - -class Nokogiri::HTML4::Document::EncodingFound < ::StandardError - def initialize(encoding); end - - def found_encoding; end -end - -class Nokogiri::HTML4::Document::EncodingReader - def initialize(io); end - - def encoding_found; end - def read(len); end - - class << self - def detect_encoding(chunk); end - end -end - -class Nokogiri::HTML4::Document::EncodingReader::JumpSAXHandler < ::Nokogiri::HTML4::Document::EncodingReader::SAXHandler - def initialize(jumptag); end - - def start_element(name, attrs = T.unsafe(nil)); end -end - -class Nokogiri::HTML4::Document::EncodingReader::SAXHandler < ::Nokogiri::XML::SAX::Document - def initialize; end - - def encoding; end - def start_element(name, attrs = T.unsafe(nil)); end -end - -class Nokogiri::HTML4::DocumentFragment < ::Nokogiri::XML::DocumentFragment - def initialize(document, tags = T.unsafe(nil), ctx = T.unsafe(nil), options = T.unsafe(nil)); end - - class << self - def parse(tags, encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - end -end - -class Nokogiri::HTML4::ElementDescription - def block?; end - def default_sub_element; end - def deprecated?; end - def deprecated_attributes; end - def description; end - def empty?; end - def implied_end_tag?; end - def implied_start_tag?; end - def inline?; end - def inspect; end - def name; end - def optional_attributes; end - def required_attributes; end - def save_end_tag?; end - def sub_elements; end - def to_s; end - - private - - def default_desc; end - - class << self - def [](_arg0); end - end -end - -Nokogiri::HTML4::ElementDescription::ACTION_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::ALIGN_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::ALT_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::APPLET_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::AREA_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::A_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BASEFONT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BGCOLOR_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BLOCK = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BLOCKLI_ELT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BODY_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BODY_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BODY_DEPR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::BUTTON_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::CELLHALIGN = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::CELLVALIGN = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::CLEAR_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::COL_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::COL_ELT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::COMPACT_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::COMPACT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::CONTENT_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::COREATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::CORE_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::CORE_I18N_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::DIR_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::DL_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::DefaultDescriptions = T.let(T.unsafe(nil), Hash) -Nokogiri::HTML4::ElementDescription::Desc = Struct -Nokogiri::HTML4::ElementDescription::EDIT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::EMBED_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::EMPTY = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::EVENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FIELDSET_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FLOW = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FLOW_PARAM = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FONTSTYLE = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FONT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FORMCTRL = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FORM_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FORM_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FRAMESET_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FRAMESET_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::FRAME_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HEADING = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HEAD_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HEAD_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HREF_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HR_DEPR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HTML_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HTML_CDATA = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HTML_CONTENT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HTML_FLOW = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HTML_INLINE = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::HTML_PCDATA = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::I18N = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::I18N_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::IFRAME_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::IMG_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::INLINE = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::INLINE_P = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::INPUT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LABEL_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LABEL_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LANGUAGE_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LEGEND_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LINK_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LIST = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::LI_ELT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::MAP_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::META_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::MODIFIER = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::NAME_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::NOFRAMES_CONTENT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OBJECT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OBJECT_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OBJECT_DEPR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OL_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OPTGROUP_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OPTION_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::OPTION_ELT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::PARAM_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::PCDATA = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::PHRASE = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::PRE_CONTENT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::PROMPT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::QUOTE_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::ROWS_COLS_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::SCRIPT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::SELECT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::SELECT_CONTENT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::SPECIAL = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::SRC_ALT_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::STYLE_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TABLE_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TABLE_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TABLE_DEPR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TALIGN_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TARGET_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TEXTAREA_ATTRS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TH_TD_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TH_TD_DEPR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TR_CONTENTS = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TR_ELT = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::TYPE_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::UL_DEPR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::VERSION_ATTR = T.let(T.unsafe(nil), Array) -Nokogiri::HTML4::ElementDescription::WIDTH_ATTR = T.let(T.unsafe(nil), Array) -class Nokogiri::HTML4::EntityDescription < ::Struct; end - -class Nokogiri::HTML4::EntityLookup - def [](name); end - def get(_arg0); end -end - -Nokogiri::HTML4::NamedCharacters = T.let(T.unsafe(nil), Nokogiri::HTML4::EntityLookup) -module Nokogiri::HTML4::SAX; end - -class Nokogiri::HTML4::SAX::Parser < ::Nokogiri::XML::SAX::Parser - def parse_file(filename, encoding = T.unsafe(nil)); end - def parse_io(io, encoding = T.unsafe(nil)); end - def parse_memory(data, encoding = T.unsafe(nil)); end -end - -class Nokogiri::HTML4::SAX::ParserContext < ::Nokogiri::XML::SAX::ParserContext - def parse_with(_arg0); end - - class << self - def file(_arg0, _arg1); end - def memory(_arg0, _arg1); end - def new(thing, encoding = T.unsafe(nil)); end - end -end - -class Nokogiri::HTML4::SAX::PushParser < ::Nokogiri::XML::SAX::PushParser - def initialize(doc = T.unsafe(nil), file_name = T.unsafe(nil), encoding = T.unsafe(nil)); end - - def <<(chunk, last_chunk = T.unsafe(nil)); end - def document; end - def document=(_arg0); end - def finish; end - def write(chunk, last_chunk = T.unsafe(nil)); end - - private - - def initialize_native(_arg0, _arg1, _arg2); end - def native_write(_arg0, _arg1); end -end - -module Nokogiri::HTML5 - class << self - def escape_text(text, encoding, attribute_mode); end - def fragment(string, encoding = T.unsafe(nil), **options); end - def get(uri, options = T.unsafe(nil)); end - def get_impl(uri, options = T.unsafe(nil)); end - def parse(string, url = T.unsafe(nil), encoding = T.unsafe(nil), **options, &block); end - def prepend_newline?(node); end - def read_and_encode(string, encoding); end - def reencode(body, content_type = T.unsafe(nil)); end - def serialize_node_internal(current_node, io, encoding, options); end - end -end - -class Nokogiri::HTML5::Document < ::Nokogiri::HTML4::Document - def fragment(tags = T.unsafe(nil)); end - def to_xml(options = T.unsafe(nil), &block); end - def xpath_doctype; end - - class << self - def do_parse(string_or_io, url, encoding, options); end - def parse(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), **options, &block); end - def read_io(io, url = T.unsafe(nil), encoding = T.unsafe(nil), **options); end - def read_memory(string, url = T.unsafe(nil), encoding = T.unsafe(nil), **options); end - end -end - -class Nokogiri::HTML5::DocumentFragment < ::Nokogiri::HTML4::DocumentFragment - def initialize(doc, tags = T.unsafe(nil), ctx = T.unsafe(nil), options = T.unsafe(nil)); end - - def document; end - def document=(_arg0); end - def errors; end - def errors=(_arg0); end - def extract_params(params); end - def serialize(options = T.unsafe(nil), &block); end - - class << self - def parse(tags, encoding = T.unsafe(nil), options = T.unsafe(nil)); end - end -end - -Nokogiri::HTML5::HTML_NAMESPACE = T.let(T.unsafe(nil), String) -Nokogiri::HTML5::MATHML_NAMESPACE = T.let(T.unsafe(nil), String) - -module Nokogiri::HTML5::Node - def fragment(tags); end - def inner_html(options = T.unsafe(nil)); end - def write_to(io, *options); end - - private - - def add_child_node_and_reparent_attrs(node); end -end - -Nokogiri::HTML5::SVG_NAMESPACE = T.let(T.unsafe(nil), String) -Nokogiri::HTML5::XLINK_NAMESPACE = T.let(T.unsafe(nil), String) -Nokogiri::HTML5::XMLNS_NAMESPACE = T.let(T.unsafe(nil), String) -Nokogiri::HTML5::XML_NAMESPACE = T.let(T.unsafe(nil), String) -Nokogiri::LIBXML2_PATCHES = T.let(T.unsafe(nil), Array) -Nokogiri::LIBXML_COMPILED_VERSION = T.let(T.unsafe(nil), String) -Nokogiri::LIBXML_ICONV_ENABLED = T.let(T.unsafe(nil), TrueClass) -Nokogiri::LIBXML_LOADED_VERSION = T.let(T.unsafe(nil), String) -Nokogiri::LIBXML_MEMORY_MANAGEMENT = T.let(T.unsafe(nil), String) -Nokogiri::LIBXSLT_COMPILED_VERSION = T.let(T.unsafe(nil), String) -Nokogiri::LIBXSLT_DATETIME_ENABLED = T.let(T.unsafe(nil), TrueClass) -Nokogiri::LIBXSLT_LOADED_VERSION = T.let(T.unsafe(nil), String) -Nokogiri::LIBXSLT_PATCHES = T.let(T.unsafe(nil), Array) -Nokogiri::OTHER_LIBRARY_VERSIONS = T.let(T.unsafe(nil), String) -Nokogiri::PACKAGED_LIBRARIES = T.let(T.unsafe(nil), TrueClass) -Nokogiri::PRECOMPILED_LIBRARIES = T.let(T.unsafe(nil), TrueClass) -class Nokogiri::SyntaxError < ::StandardError; end - -module Nokogiri::Test - class << self - def __foreign_error_handler; end - end -end - -Nokogiri::VERSION = T.let(T.unsafe(nil), String) -Nokogiri::VERSION_INFO = T.let(T.unsafe(nil), Hash) - -class Nokogiri::VersionInfo - include ::Singleton - extend ::Singleton::SingletonClassMethods - - def compiled_libxml_version; end - def compiled_libxslt_version; end - def engine; end - def jruby?; end - def libxml2?; end - def libxml2_has_iconv?; end - def libxml2_precompiled?; end - def libxml2_using_packaged?; end - def libxml2_using_system?; end - def libxslt_has_datetime?; end - def loaded_libxml_version; end - def loaded_libxslt_version; end - def ruby_minor; end - def to_hash; end - def to_markdown; end - def warnings; end - def windows?; end - - class << self - def instance; end - end -end - -module Nokogiri::XML - class << self - def Reader(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end - def RelaxNG(string_or_io, options = T.unsafe(nil)); end - def Schema(string_or_io, options = T.unsafe(nil)); end - def fragment(string, options = T.unsafe(nil), &block); end - def parse(thing, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end - end -end - -class Nokogiri::XML::Attr < ::Nokogiri::XML::Node - def content=(_arg0); end - def to_s; end - def value; end - def value=(_arg0); end - - private - - def inspect_attributes; end - - class << self - def new(*_arg0); end - end -end - -class Nokogiri::XML::AttributeDecl < ::Nokogiri::XML::Node - def attribute_type; end - def default; end - def enumeration; end - def inspect; end -end - -class Nokogiri::XML::Builder - include ::Nokogiri::ClassResolver - - def initialize(options = T.unsafe(nil), root = T.unsafe(nil), &block); end - - def <<(string); end - def [](ns); end - def arity; end - def arity=(_arg0); end - def cdata(string); end - def comment(string); end - def context; end - def context=(_arg0); end - def doc; end - def doc=(_arg0); end - def method_missing(method, *args, &block); end - def parent; end - def parent=(_arg0); end - def text(string); end - def to_xml(*args); end - - private - - def insert(node, &block); end - - class << self - def with(root, &block); end - end -end - -Nokogiri::XML::Builder::DEFAULT_DOCUMENT_OPTIONS = T.let(T.unsafe(nil), Hash) - -class Nokogiri::XML::Builder::NodeBuilder - def initialize(node, doc_builder); end - - def [](k); end - def []=(k, v); end - def method_missing(method, *args, &block); end -end - -class Nokogiri::XML::CDATA < ::Nokogiri::XML::Text - def name; end - - class << self - def new(*_arg0); end - end -end - -class Nokogiri::XML::CharacterData < ::Nokogiri::XML::Node - include ::Nokogiri::XML::PP::CharacterData -end - -class Nokogiri::XML::Comment < ::Nokogiri::XML::CharacterData - class << self - def new(*_arg0); end - end -end - -class Nokogiri::XML::DTD < ::Nokogiri::XML::Node - def attributes; end - def each; end - def elements; end - def entities; end - def external_id; end - def html5_dtd?; end - def html_dtd?; end - def keys; end - def notations; end - def system_id; end - def validate(_arg0); end -end - -class Nokogiri::XML::Document < ::Nokogiri::XML::Node - def initialize(*args); end - - def <<(node_or_tags); end - def add_child(node_or_tags); end - def canonicalize(*_arg0); end - def clone(*_arg0); end - def collect_namespaces; end - def create_cdata(string, &block); end - def create_comment(string, &block); end - def create_element(name, *contents_or_attrs, &block); end - def create_entity(*_arg0); end - def create_text_node(string, &block); end - def decorate(node); end - def decorators(key); end - def document; end - def dup(*_arg0); end - def encoding; end - def encoding=(_arg0); end - def errors; end - def errors=(_arg0); end - def fragment(tags = T.unsafe(nil)); end - def name; end - def namespace_inheritance; end - def namespace_inheritance=(_arg0); end - def namespaces; end - def remove_namespaces!; end - def root; end - def root=(_arg0); end - def slop!; end - def to_xml(*args, &block); end - def url; end - def validate; end - def version; end - def xpath_doctype; end - - private - - def inspect_attributes; end - - class << self - def empty_doc?(string_or_io); end - def new(*_arg0); end - def parse(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end - def read_io(_arg0, _arg1, _arg2, _arg3); end - def read_memory(_arg0, _arg1, _arg2, _arg3); end - end -end - -Nokogiri::XML::Document::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array) -Nokogiri::XML::Document::NCNAME_CHAR = T.let(T.unsafe(nil), String) -Nokogiri::XML::Document::NCNAME_RE = T.let(T.unsafe(nil), Regexp) -Nokogiri::XML::Document::NCNAME_START_CHAR = T.let(T.unsafe(nil), String) - -class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node - def initialize(document, tags = T.unsafe(nil), ctx = T.unsafe(nil), options = T.unsafe(nil)); end - - def css(*args); end - def dup; end - def errors; end - def errors=(things); end - def fragment(data); end - def name; end - def search(*rules); end - def serialize; end - def to_html(*args); end - def to_s; end - def to_xhtml(*args); end - def to_xml(*args); end - - private - - def namespace_declarations(ctx); end - - class << self - def new(*_arg0); end - def parse(tags, options = T.unsafe(nil), &block); end - end -end - -class Nokogiri::XML::Element < ::Nokogiri::XML::Node; end - -class Nokogiri::XML::ElementContent - def children; end - def document; end - def name; end - def occur; end - def prefix; end - def type; end - - private - - def c1; end - def c2; end -end - -Nokogiri::XML::ElementContent::ELEMENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::MULT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::ONCE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::OPT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::OR = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::PCDATA = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::PLUS = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ElementContent::SEQ = T.let(T.unsafe(nil), Integer) - -class Nokogiri::XML::ElementDecl < ::Nokogiri::XML::Node - def content; end - def element_type; end - def inspect; end - def prefix; end -end - -class Nokogiri::XML::EntityDecl < ::Nokogiri::XML::Node - def content; end - def entity_type; end - def external_id; end - def inspect; end - def original_content; end - def system_id; end - - class << self - def new(name, doc, *args); end - end -end - -Nokogiri::XML::EntityDecl::EXTERNAL_GENERAL_PARSED = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::EntityDecl::EXTERNAL_GENERAL_UNPARSED = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::EntityDecl::EXTERNAL_PARAMETER = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::EntityDecl::INTERNAL_GENERAL = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::EntityDecl::INTERNAL_PARAMETER = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::EntityDecl::INTERNAL_PREDEFINED = T.let(T.unsafe(nil), Integer) - -class Nokogiri::XML::EntityReference < ::Nokogiri::XML::Node - def children; end - def inspect_attributes; end - - class << self - def new(*_arg0); end - end -end - -class Nokogiri::XML::Namespace - include ::Nokogiri::XML::PP::Node - - def document; end - def href; end - def prefix; end - - private - - def inspect_attributes; end -end - -class Nokogiri::XML::Node - include ::Nokogiri::HTML5::Node - include ::Nokogiri::XML::PP::Node - include ::Nokogiri::XML::Searchable - include ::Nokogiri::ClassResolver - include ::Enumerable - - def initialize(name, document); end - - def <<(node_or_tags); end - def <=>(other); end - def ==(other); end - def [](name); end - def []=(name, value); end - def accept(visitor); end - def add_child(node_or_tags); end - def add_class(names); end - def add_namespace(_arg0, _arg1); end - def add_namespace_definition(_arg0, _arg1); end - def add_next_sibling(node_or_tags); end - def add_previous_sibling(node_or_tags); end - def after(node_or_tags); end - def ancestors(selector = T.unsafe(nil)); end - def append_class(names); end - def attr(name); end - def attribute(_arg0); end - def attribute_nodes; end - def attribute_with_ns(_arg0, _arg1); end - def attributes; end - def before(node_or_tags); end - def blank?; end - def canonicalize(mode = T.unsafe(nil), inclusive_namespaces = T.unsafe(nil), with_comments = T.unsafe(nil)); end - def cdata?; end - def child; end - def children; end - def children=(node_or_tags); end - def classes; end - def clone(*_arg0); end - def comment?; end - def content; end - def content=(string); end - def create_external_subset(_arg0, _arg1, _arg2); end - def create_internal_subset(_arg0, _arg1, _arg2); end - def css_path; end - def decorate!; end - def default_namespace=(url); end - def delete(name); end - def description; end - def do_xinclude(options = T.unsafe(nil)); end - def document; end - def document?; end - def dup(*_arg0); end - def each; end - def elem?; end - def element?; end - def element_children; end - def elements; end - def encode_special_chars(_arg0); end - def external_subset; end - def first_element_child; end - def fragment?; end - def get_attribute(name); end - def has_attribute?(_arg0); end - def html?; end - def inner_html=(node_or_tags); end - def inner_text; end - def internal_subset; end - def key?(_arg0); end - def keys; end - def kwattr_add(attribute_name, keywords); end - def kwattr_append(attribute_name, keywords); end - def kwattr_remove(attribute_name, keywords); end - def kwattr_values(attribute_name); end - def lang; end - def lang=(_arg0); end - def last_element_child; end - def line; end - def line=(_arg0); end - def matches?(selector); end - def name; end - def name=(_arg0); end - def namespace; end - def namespace=(ns); end - def namespace_definitions; end - def namespace_scopes; end - def namespaced_key?(_arg0, _arg1); end - def namespaces; end - def native_content=(_arg0); end - def next; end - def next=(node_or_tags); end - def next_element; end - def next_sibling; end - def node_name; end - def node_name=(_arg0); end - def node_type; end - def parent; end - def parent=(parent_node); end - def parse(string_or_io, options = T.unsafe(nil)); end - def path; end - def pointer_id; end - def prepend_child(node_or_tags); end - def previous; end - def previous=(node_or_tags); end - def previous_element; end - def previous_sibling; end - def processing_instruction?; end - def read_only?; end - def remove; end - def remove_attribute(name); end - def remove_class(names = T.unsafe(nil)); end - def replace(node_or_tags); end - def serialize(*args, &block); end - def set_attribute(name, value); end - def swap(node_or_tags); end - def text; end - def text?; end - def to_html(options = T.unsafe(nil)); end - def to_s; end - def to_str; end - def to_xhtml(options = T.unsafe(nil)); end - def to_xml(options = T.unsafe(nil)); end - def traverse(&block); end - def type; end - def unlink; end - def value?(value); end - def values; end - def wrap(html); end - def write_html_to(io, options = T.unsafe(nil)); end - def write_xhtml_to(io, options = T.unsafe(nil)); end - def write_xml_to(io, options = T.unsafe(nil)); end - def xml?; end - - protected - - def coerce(data); end - - private - - def add_child_node(_arg0); end - def add_next_sibling_node(_arg0); end - def add_previous_sibling_node(_arg0); end - def add_sibling(next_or_previous, node_or_tags); end - def compare(_arg0); end - def dump_html; end - def get(_arg0); end - def in_context(_arg0, _arg1); end - def inspect_attributes; end - def keywordify(keywords); end - def native_write_to(_arg0, _arg1, _arg2, _arg3); end - def process_xincludes(_arg0); end - def replace_node(_arg0); end - def set(_arg0, _arg1); end - def set_namespace(_arg0); end - def to_format(save_option, options); end - def write_format_to(save_option, io, options); end - - class << self - def new(*_arg0); end - end -end - -Nokogiri::XML::Node::ATTRIBUTE_DECL = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::ATTRIBUTE_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::CDATA_SECTION_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::COMMENT_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::DOCB_DOCUMENT_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::DOCUMENT_FRAG_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::DOCUMENT_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::DOCUMENT_TYPE_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::DTD_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::ELEMENT_DECL = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::ELEMENT_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::ENTITY_DECL = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::ENTITY_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::ENTITY_REF_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::HTML_DOCUMENT_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array) -Nokogiri::XML::Node::NAMESPACE_DECL = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::NOTATION_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::PI_NODE = T.let(T.unsafe(nil), Integer) - -class Nokogiri::XML::Node::SaveOptions - def initialize(options = T.unsafe(nil)); end - - def as_html; end - def as_html?; end - def as_xhtml; end - def as_xhtml?; end - def as_xml; end - def as_xml?; end - def default_html; end - def default_html?; end - def default_xhtml; end - def default_xhtml?; end - def default_xml; end - def default_xml?; end - def format; end - def format?; end - def no_declaration; end - def no_declaration?; end - def no_empty_tags; end - def no_empty_tags?; end - def no_xhtml; end - def no_xhtml?; end - def options; end - def to_i; end -end - -Nokogiri::XML::Node::SaveOptions::AS_HTML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::AS_XHTML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::AS_XML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::DEFAULT_HTML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::DEFAULT_XML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::FORMAT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::NO_DECLARATION = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::SaveOptions::NO_XHTML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::TEXT_NODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::XINCLUDE_END = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Node::XINCLUDE_START = T.let(T.unsafe(nil), Integer) - -class Nokogiri::XML::NodeSet - include ::Nokogiri::XML::Searchable - include ::Enumerable - - def initialize(document, list = T.unsafe(nil)); end - - def %(*args); end - def &(_arg0); end - def +(_arg0); end - def -(_arg0); end - def <<(_arg0); end - def ==(other); end - def [](*_arg0); end - def add_class(name); end - def after(datum); end - def append_class(name); end - def at(*args); end - def attr(key, value = T.unsafe(nil), &block); end - def attribute(key, value = T.unsafe(nil), &block); end - def before(datum); end - def children; end - def clone; end - def css(*args); end - def delete(_arg0); end - def document; end - def document=(_arg0); end - def dup; end - def each; end - def empty?; end - def filter(expr); end - def first(n = T.unsafe(nil)); end - def include?(_arg0); end - def index(node = T.unsafe(nil)); end - def inner_html(*args); end - def inner_text; end - def inspect; end - def last; end - def length; end - def pop; end - def push(_arg0); end - def remove; end - def remove_attr(name); end - def remove_attribute(name); end - def remove_class(name = T.unsafe(nil)); end - def reverse; end - def set(key, value = T.unsafe(nil), &block); end - def shift; end - def size; end - def slice(*_arg0); end - def text; end - def to_a; end - def to_ary; end - def to_html(*args); end - def to_s; end - def to_xhtml(*args); end - def to_xml(*args); end - def unlink; end - def wrap(html); end - def xpath(*args); end - def |(_arg0); end -end - -Nokogiri::XML::NodeSet::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array) -class Nokogiri::XML::Notation < ::Struct; end -module Nokogiri::XML::PP; end - -module Nokogiri::XML::PP::CharacterData - def inspect; end - def pretty_print(pp); end -end - -module Nokogiri::XML::PP::Node - def inspect; end - def pretty_print(pp); end -end - -class Nokogiri::XML::ParseOptions - def initialize(options = T.unsafe(nil)); end - - def ==(other); end - def big_lines; end - def big_lines?; end - def compact; end - def compact?; end - def default_html; end - def default_html?; end - def default_schema; end - def default_schema?; end - def default_xml; end - def default_xml?; end - def default_xslt; end - def default_xslt?; end - def dtdattr; end - def dtdattr?; end - def dtdload; end - def dtdload?; end - def dtdvalid; end - def dtdvalid?; end - def huge; end - def huge?; end - def inspect; end - def nobasefix; end - def nobasefix?; end - def nobig_lines; end - def noblanks; end - def noblanks?; end - def nocdata; end - def nocdata?; end - def nocompact; end - def nodefault_html; end - def nodefault_schema; end - def nodefault_xml; end - def nodefault_xslt; end - def nodict; end - def nodict?; end - def nodtdattr; end - def nodtdload; end - def nodtdvalid; end - def noent; end - def noent?; end - def noerror; end - def noerror?; end - def nohuge; end - def nonet; end - def nonet?; end - def nonobasefix; end - def nonoblanks; end - def nonocdata; end - def nonodict; end - def nonoent; end - def nonoerror; end - def nononet; end - def nonowarning; end - def nonoxincnode; end - def nonsclean; end - def noold10; end - def nopedantic; end - def norecover; end - def nosax1; end - def nowarning; end - def nowarning?; end - def noxinclude; end - def noxincnode; end - def noxincnode?; end - def nsclean; end - def nsclean?; end - def old10; end - def old10?; end - def options; end - def options=(_arg0); end - def pedantic; end - def pedantic?; end - def recover; end - def recover?; end - def sax1; end - def sax1?; end - def strict; end - def strict?; end - def to_i; end - def xinclude; end - def xinclude?; end -end - -Nokogiri::XML::ParseOptions::BIG_LINES = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::COMPACT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DEFAULT_HTML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DEFAULT_XML = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DEFAULT_XSLT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DTDATTR = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DTDLOAD = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::DTDVALID = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::HUGE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOBASEFIX = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOBLANKS = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOCDATA = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NODICT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOERROR = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NONET = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOWARNING = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NOXINCNODE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::NSCLEAN = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::OLD10 = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::PEDANTIC = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::RECOVER = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::SAX1 = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::STRICT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::ParseOptions::XINCLUDE = T.let(T.unsafe(nil), Integer) - -class Nokogiri::XML::ProcessingInstruction < ::Nokogiri::XML::Node - def initialize(document, name, content); end - - class << self - def new(*_arg0); end - end -end - -class Nokogiri::XML::Reader - include ::Enumerable - - def initialize(source, url = T.unsafe(nil), encoding = T.unsafe(nil)); end - - def attribute(_arg0); end - def attribute_at(_arg0); end - def attribute_count; end - def attribute_hash; end - def attribute_nodes; end - def attributes; end - def attributes?; end - def base_uri; end - def default?; end - def depth; end - def each; end - def empty_element?; end - def encoding; end - def errors; end - def errors=(_arg0); end - def inner_xml; end - def lang; end - def local_name; end - def name; end - def namespace_uri; end - def namespaces; end - def node_type; end - def outer_xml; end - def prefix; end - def read; end - def self_closing?; end - def source; end - def state; end - def value; end - def value?; end - def xml_version; end - - class << self - def from_io(*_arg0); end - def from_memory(*_arg0); end - end -end - -Nokogiri::XML::Reader::TYPE_ATTRIBUTE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_CDATA = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_COMMENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_DOCUMENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_DOCUMENT_FRAGMENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_DOCUMENT_TYPE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_ELEMENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_END_ELEMENT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_END_ENTITY = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_ENTITY = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_ENTITY_REFERENCE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_NONE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_NOTATION = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_PROCESSING_INSTRUCTION = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_SIGNIFICANT_WHITESPACE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_TEXT = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_WHITESPACE = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::Reader::TYPE_XML_DECLARATION = T.let(T.unsafe(nil), Integer) - -class Nokogiri::XML::RelaxNG < ::Nokogiri::XML::Schema - private - - def validate_document(_arg0); end - - class << self - def from_document(*_arg0); end - def read_memory(*_arg0); end - end -end - -module Nokogiri::XML::SAX; end - -class Nokogiri::XML::SAX::Document - def cdata_block(string); end - def characters(string); end - def comment(string); end - def end_document; end - def end_element(name); end - def end_element_namespace(name, prefix = T.unsafe(nil), uri = T.unsafe(nil)); end - def error(string); end - def processing_instruction(name, content); end - def start_document; end - def start_element(name, attrs = T.unsafe(nil)); end - def start_element_namespace(name, attrs = T.unsafe(nil), prefix = T.unsafe(nil), uri = T.unsafe(nil), ns = T.unsafe(nil)); end - def warning(string); end - def xmldecl(version, encoding, standalone); end -end - -class Nokogiri::XML::SAX::Parser - def initialize(doc = T.unsafe(nil), encoding = T.unsafe(nil)); end - - def document; end - def document=(_arg0); end - def encoding; end - def encoding=(_arg0); end - def parse(thing, &block); end - def parse_file(filename); end - def parse_io(io, encoding = T.unsafe(nil)); end - def parse_memory(data); end - - private - - def check_encoding(encoding); end -end - -class Nokogiri::XML::SAX::Parser::Attribute < ::Struct; end -Nokogiri::XML::SAX::Parser::ENCODINGS = T.let(T.unsafe(nil), Hash) - -class Nokogiri::XML::SAX::ParserContext - def column; end - def line; end - def parse_with(_arg0); end - def recovery; end - def recovery=(_arg0); end - def replace_entities; end - def replace_entities=(_arg0); end - - class << self - def file(_arg0); end - def io(_arg0, _arg1); end - def memory(_arg0); end - def new(thing, encoding = T.unsafe(nil)); end - end -end - -class Nokogiri::XML::SAX::PushParser - def initialize(doc = T.unsafe(nil), file_name = T.unsafe(nil), encoding = T.unsafe(nil)); end - - def <<(chunk, last_chunk = T.unsafe(nil)); end - def document; end - def document=(_arg0); end - def finish; end - def options; end - def options=(_arg0); end - def replace_entities; end - def replace_entities=(_arg0); end - def write(chunk, last_chunk = T.unsafe(nil)); end - - private - - def initialize_native(_arg0, _arg1); end - def native_write(_arg0, _arg1); end -end - -class Nokogiri::XML::Schema - def errors; end - def errors=(_arg0); end - def parse_options; end - def parse_options=(_arg0); end - def valid?(thing); end - def validate(thing); end - - private - - def validate_document(_arg0); end - def validate_file(_arg0); end - - class << self - def from_document(*_arg0); end - def new(string_or_io, options = T.unsafe(nil)); end - def read_memory(*_arg0); end - end -end - -module Nokogiri::XML::Searchable - def %(*args); end - def /(*args); end - def >(selector); end - def at(*args); end - def at_css(*args); end - def at_xpath(*args); end - def css(*args); end - def search(*args); end - def xpath(*args); end - - private - - def css_internal(node, rules, handler, ns); end - def css_rules_to_xpath(rules, ns); end - def extract_params(params); end - def xpath_impl(node, path, handler, ns, binds); end - def xpath_internal(node, paths, handler, ns, binds); end - def xpath_query_from_css_rule(rule, ns); end -end - -Nokogiri::XML::Searchable::LOOKS_LIKE_XPATH = T.let(T.unsafe(nil), Regexp) - -class Nokogiri::XML::SyntaxError < ::Nokogiri::SyntaxError - def code; end - def column; end - def domain; end - def error?; end - def fatal?; end - def file; end - def int1; end - def level; end - def line; end - def none?; end - def str1; end - def str2; end - def str3; end - def to_s; end - def warning?; end - - private - - def level_to_s; end - def location_to_s; end - def nil_or_zero?(attribute); end -end - -class Nokogiri::XML::Text < ::Nokogiri::XML::CharacterData - def content=(string); end - - class << self - def new(*_arg0); end - end -end - -Nokogiri::XML::XML_C14N_1_0 = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::XML_C14N_1_1 = T.let(T.unsafe(nil), Integer) -Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 = T.let(T.unsafe(nil), Integer) -module Nokogiri::XML::XPath; end -Nokogiri::XML::XPath::CURRENT_SEARCH_PREFIX = T.let(T.unsafe(nil), String) -Nokogiri::XML::XPath::GLOBAL_SEARCH_PREFIX = T.let(T.unsafe(nil), String) -Nokogiri::XML::XPath::ROOT_SEARCH_PREFIX = T.let(T.unsafe(nil), String) -Nokogiri::XML::XPath::SUBTREE_SEARCH_PREFIX = T.let(T.unsafe(nil), String) - -class Nokogiri::XML::XPath::SyntaxError < ::Nokogiri::XML::SyntaxError - def to_s; end -end - -class Nokogiri::XML::XPathContext - def evaluate(*_arg0); end - def register_namespaces(namespaces); end - def register_ns(_arg0, _arg1); end - def register_variable(_arg0, _arg1); end - - class << self - def new(_arg0); end - end -end - -module Nokogiri::XSLT - class << self - def parse(string, modules = T.unsafe(nil)); end - def quote_params(params); end - def register(_arg0, _arg1); end - end -end - -class Nokogiri::XSLT::Stylesheet - def apply_to(document, params = T.unsafe(nil)); end - def serialize(_arg0); end - def transform(*_arg0); end - - class << self - def parse_stylesheet_doc(_arg0); end - end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/parallel@1.22.1.rbi b/Library/Homebrew/sorbet/rbi/gems/parallel@1.23.0.rbi similarity index 95% rename from Library/Homebrew/sorbet/rbi/gems/parallel@1.22.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/parallel@1.23.0.rbi index 5b00e8261a..dfd5b4fcb0 100644 --- a/Library/Homebrew/sorbet/rbi/gems/parallel@1.22.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/parallel@1.23.0.rbi @@ -5,18 +5,19 @@ # Please instead update this file by running `bin/tapioca gem parallel`. module Parallel - extend ::Parallel::ProcessorCount - class << self def all?(*args, &block); end def any?(*args, &block); end def each(array, options = T.unsafe(nil), &block); end def each_with_index(array, options = T.unsafe(nil), &block); end + def filter_map(*args, &block); end def flat_map(*args, &block); end def in_processes(options = T.unsafe(nil), &block); end def in_threads(options = T.unsafe(nil)); end def map(source, options = T.unsafe(nil), &block); end def map_with_index(array, options = T.unsafe(nil), &block); end + def physical_processor_count; end + def processor_count; end def worker_number; end def worker_number=(worker_num); end @@ -68,12 +69,6 @@ class Parallel::JobFactory end class Parallel::Kill < ::Parallel::Break; end - -module Parallel::ProcessorCount - def physical_processor_count; end - def processor_count; end -end - Parallel::Stop = T.let(T.unsafe(nil), Object) class Parallel::UndumpableException < ::StandardError diff --git a/Library/Homebrew/sorbet/rbi/gems/parser@3.2.2.0.rbi b/Library/Homebrew/sorbet/rbi/gems/parser@3.2.2.1.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/parser@3.2.2.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/parser@3.2.2.1.rbi diff --git a/Library/Homebrew/sorbet/rbi/gems/racc@1.6.2.rbi b/Library/Homebrew/sorbet/rbi/gems/racc@1.6.2.rbi deleted file mode 100644 index bdf82b1698..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/racc@1.6.2.rbi +++ /dev/null @@ -1,642 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `racc` gem. -# Please instead update this file by running `bin/tapioca gem racc`. - -::APPLE_GEM_HOME = T.let(T.unsafe(nil), String) -::RUBY19 = T.let(T.unsafe(nil), TrueClass) -::RUBY_FRAMEWORK = T.let(T.unsafe(nil), TrueClass) -::RUBY_FRAMEWORK_VERSION = T.let(T.unsafe(nil), String) - -class Object < ::BasicObject - include ::ActiveSupport::ToJsonWithActiveSupportEncoder - include ::ActiveSupport::ForkTracker::CoreExt - include ::ActiveSupport::ForkTracker::CoreExtPrivate - include ::Kernel - include ::JSON::Ext::Generator::GeneratorMethods::Object - include ::PP::ObjectMixin - include ::ActiveSupport::Dependencies::Loadable - include ::ActiveSupport::Tryable -end - -ParseError = Racc::ParseError - -class Racc::Accept - def inspect; end -end - -class Racc::ActionTable - def initialize(rt, st); end - - def accept; end - def each_reduce(&block); end - def each_shift(&block); end - def error; end - def init; end - def reduce(i); end - def reduce_n; end - def shift(i); end - def shift_n; end -end - -class Racc::CompileError < ::Racc::Error; end -Racc::Copyright = T.let(T.unsafe(nil), String) - -class Racc::DebugFlags - def initialize(parse = T.unsafe(nil), rule = T.unsafe(nil), token = T.unsafe(nil), state = T.unsafe(nil), la = T.unsafe(nil), prec = T.unsafe(nil), conf = T.unsafe(nil)); end - - def any?; end - def la; end - def parse; end - def prec; end - def rule; end - def state; end - def status_logging; end - def token; end - - class << self - def parse_option_string(s); end - end -end - -class Racc::Error < ::StandardError - def inspect; end -end - -class Racc::Goto - def initialize(ident, sym, from, to); end - - def from_state; end - def ident; end - def inspect; end - def symbol; end - def to_state; end -end - -class Racc::Grammar - extend ::Forwardable - - def initialize(debug_flags = T.unsafe(nil)); end - - def [](x); end - def add(rule); end - def added?(sym); end - def declare_precedence(assoc, syms); end - def dfa; end - def each(&block); end - def each_index(&block); end - def each_nonterminal(*args, &block); end - def each_rule(&block); end - def each_symbol(*args, &block); end - def each_terminal(*args, &block); end - def each_useless_nonterminal; end - def each_useless_rule; end - def each_with_index(&block); end - def end_precedence_declaration(reverse); end - def init; end - def intern(value, dummy = T.unsafe(nil)); end - def n_expected_srconflicts; end - def n_expected_srconflicts=(_arg0); end - def n_useless_nonterminals; end - def n_useless_rules; end - def nfa; end - def nonterminal_base; end - def parser_class; end - def size; end - def start; end - def start_symbol=(s); end - def state_transition_table; end - def states; end - def symbols; end - def symboltable; end - def to_s; end - def useless_nonterminal_exist?; end - def useless_rule_exist?; end - def write_log(path); end - - private - - def _compute_expand(t, set, lock); end - def add_start_rule; end - def check_rules_nullable(rules); end - def check_rules_useless(rules); end - def check_symbols_nullable(symbols); end - def check_symbols_useless(s); end - def compute_expand(t); end - def compute_hash; end - def compute_heads; end - def compute_locate; end - def compute_nullable; end - def compute_nullable_0; end - def compute_useless; end - def determine_terminals; end - def fix_ident; end - - class << self - def define(&block); end - end -end - -class Racc::Grammar::DefinitionEnv - def initialize; end - - def _(&block); end - def _add(target, x); end - def _added?(sym); end - def _delayed_add(rule); end - def _intern(x); end - def action(&block); end - def flush_delayed; end - def grammar; end - def many(sym, &block); end - def many1(sym, &block); end - def method_missing(mid, *args, &block); end - def null(&block); end - def option(sym, default = T.unsafe(nil), &block); end - def precedence_table(&block); end - def separated_by(sep, sym, &block); end - def separated_by1(sep, sym, &block); end - def seq(*list, &block); end - - private - - def _defmetasyntax(type, id, action, &block); end - def _register(target_name); end - def _wrap(target_name, sym, block); end -end - -class Racc::Grammar::PrecedenceDefinitionEnv - def initialize(g); end - - def higher; end - def left(*syms); end - def lower; end - def nonassoc(*syms); end - def reverse; end - def right(*syms); end -end - -class Racc::ISet - def initialize(a = T.unsafe(nil)); end - - def [](key); end - def []=(key, val); end - def add(i); end - def clear; end - def delete(key); end - def dup; end - def each(&block); end - def empty?; end - def include?(key); end - def inspect; end - def key?(key); end - def set; end - def size; end - def to_a; end - def to_s; end - def update(other); end - def update_a(a); end -end - -class Racc::Item - def initialize(rule, la); end - - def each_la(tbl); end - def la; end - def rule; end -end - -class Racc::LocationPointer - def initialize(rule, i, sym); end - - def ==(ot); end - def before(len); end - def dereference; end - def eql?(ot); end - def hash; end - def head?; end - def ident; end - def increment; end - def index; end - def inspect; end - def next; end - def reduce; end - def reduce?; end - def rule; end - def symbol; end - def to_s; end - - private - - def ptr_bug!; end -end - -class Racc::LogFileGenerator - def initialize(states, debug_flags = T.unsafe(nil)); end - - def action_out(f, state); end - def outact(f, t, act); end - def output(out); end - def output_conflict(out); end - def output_rule(out); end - def output_state(out); end - def output_token(out); end - def output_useless(out); end - def outrrconf(f, confs); end - def outsrconf(f, confs); end - def pointer_out(out, ptr); end - def symbol_locations(locs); end -end - -class Racc::OrMark - def initialize(lineno); end - - def inspect; end - def lineno; end - def name; end -end - -class Racc::Parser - def _racc_do_parse_rb(arg, in_debug); end - def _racc_do_reduce(arg, act); end - def _racc_evalact(act, arg); end - def _racc_init_sysvars; end - def _racc_setup; end - def _racc_yyparse_rb(recv, mid, arg, c_debug); end - def next_token; end - def on_error(t, val, vstack); end - def racc_accept; end - def racc_e_pop(state, tstack, vstack); end - def racc_next_state(curstate, state); end - def racc_print_stacks(t, v); end - def racc_print_states(s); end - def racc_read_token(t, tok, val); end - def racc_reduce(toks, sim, tstack, vstack); end - def racc_shift(tok, tstack, vstack); end - def racc_token2str(tok); end - def token_to_str(t); end - def yyaccept; end - def yyerrok; end - def yyerror; end - - class << self - def racc_runtime_type; end - end -end - -Racc::Parser::Racc_Main_Parsing_Routine = T.let(T.unsafe(nil), Symbol) -Racc::Parser::Racc_Runtime_Core_Id_C = T.let(T.unsafe(nil), String) -Racc::Parser::Racc_Runtime_Core_Version = T.let(T.unsafe(nil), String) -Racc::Parser::Racc_Runtime_Core_Version_C = T.let(T.unsafe(nil), String) -Racc::Parser::Racc_Runtime_Core_Version_R = T.let(T.unsafe(nil), String) -Racc::Parser::Racc_Runtime_Type = T.let(T.unsafe(nil), String) -Racc::Parser::Racc_Runtime_Version = T.let(T.unsafe(nil), String) -Racc::Parser::Racc_YY_Parse_Method = T.let(T.unsafe(nil), Symbol) - -class Racc::ParserClassGenerator - def initialize(states); end - - def generate; end - - private - - def define_actions(c); end -end - -class Racc::Prec - def initialize(symbol, lineno); end - - def inspect; end - def lineno; end - def name; end - def symbol; end -end - -class Racc::RRconflict - def initialize(sid, high, low, tok); end - - def high_prec; end - def low_prec; end - def stateid; end - def to_s; end - def token; end -end - -class Racc::Reduce - def initialize(rule); end - - def decref; end - def incref; end - def inspect; end - def refn; end - def rule; end - def ruleid; end -end - -class Racc::Rule - def initialize(target, syms, act); end - - def ==(other); end - def [](idx); end - def accept?; end - def action; end - def each(&block); end - def each_rule(&block); end - def empty?; end - def hash; end - def hash=(n); end - def ident; end - def ident=(_arg0); end - def inspect; end - def null=(n); end - def nullable?; end - def prec(sym, &block); end - def precedence; end - def precedence=(sym); end - def ptrs; end - def replace(src, dest); end - def rule; end - def size; end - def specified_prec; end - def specified_prec=(_arg0); end - def symbols; end - def target; end - def target=(_arg0); end - def to_s; end - def useless=(u); end - def useless?; end - def |(x); end -end - -class Racc::SRconflict - def initialize(sid, shift, reduce); end - - def reduce; end - def shift; end - def stateid; end - def to_s; end -end - -class Racc::Shift - def initialize(goto); end - - def goto_id; end - def goto_state; end - def inspect; end -end - -class Racc::SourceText - def initialize(text, filename, lineno); end - - def filename; end - def lineno; end - def location; end - def text; end - def to_s; end -end - -class Racc::State - def initialize(ident, core); end - - def ==(oth); end - def action; end - def check_la(la_rules); end - def closure; end - def conflict?; end - def core; end - def defact; end - def defact=(_arg0); end - def eql?(oth); end - def goto_table; end - def gotos; end - def hash; end - def ident; end - def inspect; end - def la=(la); end - def make_closure(core); end - def n_rrconflicts; end - def n_srconflicts; end - def ritems; end - def rr_conflict(high, low, ctok); end - def rrconf; end - def rruleid(rule); end - def rrules; end - def sr_conflict(shift, reduce); end - def srconf; end - def stateid; end - def stokens; end - def to_s; end -end - -class Racc::StateTransitionTable < ::Struct - def initialize(states); end - - def action_check; end - def action_check=(_); end - def action_default; end - def action_default=(_); end - def action_pointer; end - def action_pointer=(_); end - def action_table; end - def action_table=(_); end - def debug_parser; end - def debug_parser=(_); end - def goto_check; end - def goto_check=(_); end - def goto_default; end - def goto_default=(_); end - def goto_pointer; end - def goto_pointer=(_); end - def goto_table; end - def goto_table=(_); end - def grammar; end - def nt_base; end - def nt_base=(_); end - def parser_class; end - def reduce_n; end - def reduce_n=(_); end - def reduce_table; end - def reduce_table=(_); end - def shift_n; end - def shift_n=(_); end - def states; end - def token_table; end - def token_table=(_); end - def token_to_s_table; end - def token_to_s_table=(_); end - def token_value_table; end - def use_result_var; end - def use_result_var=(_); end - - class << self - def [](*_arg0); end - def generate(states); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -class Racc::StateTransitionTableGenerator - def initialize(states); end - - def act2actid(act); end - def addent(all, arr, chkval, ptr); end - def gen_action_tables(t, states); end - def gen_goto_tables(t, grammar); end - def generate; end - def mkmapexp(arr); end - def reduce_table(grammar); end - def set_table(entries, dummy, tbl, chk, ptr); end - def token_table(grammar); end -end - -Racc::StateTransitionTableGenerator::RE_DUP_MAX = T.let(T.unsafe(nil), Integer) - -class Racc::States - include ::Enumerable - extend ::Forwardable - - def initialize(grammar, debug_flags = T.unsafe(nil)); end - - def [](i); end - def actions; end - def dfa; end - def each(&block); end - def each_index(&block); end - def each_state(&block); end - def grammar; end - def inspect; end - def n_rrconflicts; end - def n_srconflicts; end - def nfa; end - def nt_base(*args, &block); end - def reduce_n(*args, &block); end - def rrconflict_exist?; end - def shift_n(*args, &block); end - def should_report_srconflict?; end - def size; end - def srconflict_exist?; end - def state_transition_table; end - def to_s; end - - private - - def addrel(tbl, i, item); end - def addsym(table, sym, ptr); end - def check_useless; end - def compute_dfa; end - def compute_nfa; end - def core_to_state(core); end - def create_tmap(size); end - def digraph(map, relation); end - def do_resolve_sr(stok, rtok); end - def each_t(tbl, set); end - def fingerprint(arr); end - def generate_states(state); end - def lookahead; end - def pack(state); end - def print_atab(idx, tab); end - def print_tab(idx, rel, tab); end - def print_tab_i(idx, rel, tab, i); end - def printb(i); end - def record_path(begst, rule); end - def resolve(state); end - def resolve_rr(state, r); end - def resolve_sr(state, s); end - def set_accept; end - def transpose(rel); end - def traverse(i, index, vertices, map, relation); end -end - -Racc::States::ASSOC = T.let(T.unsafe(nil), Hash) - -class Racc::Sym - def initialize(value, dummyp); end - - def assoc; end - def assoc=(_arg0); end - def dummy?; end - def expand; end - def expand=(v); end - def hash; end - def heads; end - def ident; end - def ident=(v); end - def inspect; end - def locate; end - def nonterminal?; end - def null=(n); end - def nullable?; end - def precedence; end - def precedence=(_arg0); end - def rule; end - def self_null?; end - def serialize; end - def serialized=(_arg0); end - def should_terminal; end - def should_terminal?; end - def snull=(v); end - def string_symbol?; end - def term=(t); end - def terminal?; end - def to_s; end - def useless=(f); end - def useless?; end - def value; end - def |(x); end - - class << self - def once_writer(nm); end - end -end - -class Racc::SymbolTable - include ::Enumerable - - def initialize; end - - def [](id); end - def anchor; end - def delete(sym); end - def dummy; end - def each(&block); end - def each_nonterminal(&block); end - def each_terminal(&block); end - def error; end - def fix; end - def intern(val, dummy = T.unsafe(nil)); end - def nonterminals; end - def nt_base; end - def nt_max; end - def symbols; end - def terminals(&block); end - def to_a; end - - private - - def check_terminals; end - def fix_ident; end -end - -class Racc::UserAction - def initialize(src, proc); end - - def empty?; end - def inspect; end - def name; end - def proc; end - def proc?; end - def source; end - def source?; end - - class << self - def empty; end - def proc(pr = T.unsafe(nil), &block); end - def source_text(src); end - end -end - -Racc::VERSION = T.let(T.unsafe(nil), String) -Racc::Version = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.7.0.rbi b/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.8.0.rbi similarity index 94% rename from Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.7.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.8.0.rbi index 8a102b65b7..98a9bd062b 100644 --- a/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.8.0.rbi @@ -84,17 +84,21 @@ class Regexp::Expression::Assertion::NegativeLookbehind < ::Regexp::Expression:: def human_name; end end +Regexp::Expression::Backref = Regexp::Expression::Backreference module Regexp::Expression::Backreference; end class Regexp::Expression::Backreference::Base < ::Regexp::Expression::Base def match_length; end def referenced_expression; end def referenced_expression=(_arg0); end - def referential?; end private def initialize_copy(orig); end + + class << self + def referential?; end + end end class Regexp::Expression::Backreference::Name < ::Regexp::Expression::Backreference::Base @@ -158,6 +162,8 @@ class Regexp::Expression::Base def case_insensitive?; end def conditional_level; end def conditional_level=(_arg0); end + def custom_to_s_handling; end + def custom_to_s_handling=(_arg0); end def d?; end def default_classes?; end def extended?; end @@ -176,7 +182,11 @@ class Regexp::Expression::Base def nesting_level; end def options; end def options=(_arg0); end + def parent; end + def parent=(_arg0); end def possessive?; end + def pre_quantifier_decorations; end + def pre_quantifier_decorations=(_arg0); end def quantifier; end def quantify(*args); end def quantity; end @@ -202,10 +212,6 @@ class Regexp::Expression::Base def unicode_classes?; end def unquantified_clone; end def x?; end - - private - - def initialize_copy(orig); end end class Regexp::Expression::CharacterSet < ::Regexp::Expression::Subexpression @@ -244,7 +250,6 @@ class Regexp::Expression::CharacterSet::Range < ::Regexp::Expression::Subexpress def human_name; end def match_length; end def parts; end - def starts_at; end def ts; end end @@ -271,6 +276,10 @@ class Regexp::Expression::CharacterType::Word < ::Regexp::Expression::CharacterT class Regexp::Expression::Comment < ::Regexp::Expression::FreeSpace def human_name; end + + class << self + def comment?; end + end end module Regexp::Expression::Conditional; end @@ -285,17 +294,20 @@ class Regexp::Expression::Conditional::Condition < ::Regexp::Expression::Base def reference; end def referenced_expression; end def referenced_expression=(_arg0); end - def referential?; end private def initialize_copy(orig); end + + class << self + def referential?; end + end end class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexpression def <<(exp); end - def add_sequence(active_opts = T.unsafe(nil)); end - def branch(active_opts = T.unsafe(nil)); end + def add_sequence(active_opts = T.unsafe(nil), params = T.unsafe(nil)); end + def branch(active_opts = T.unsafe(nil), params = T.unsafe(nil)); end def branches; end def condition; end def condition=(exp); end @@ -305,17 +317,21 @@ class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexp def reference; end def referenced_expression; end def referenced_expression=(_arg0); end - def referential?; end private def initialize_copy(orig); end + + class << self + def referential?; end + end end class Regexp::Expression::Conditional::TooManyBranches < ::Regexp::Parser::Error def initialize; end end +Regexp::Expression::Escape = Regexp::Expression::EscapeSequence module Regexp::Expression::EscapeSequence; end class Regexp::Expression::EscapeSequence::AbstractMetaControlSequence < ::Regexp::Expression::EscapeSequence::Base @@ -379,6 +395,10 @@ class Regexp::Expression::EscapeSequence::VerticalTab < ::Regexp::Expression::Es class Regexp::Expression::FreeSpace < ::Regexp::Expression::Base def match_length; end def quantify(*_args); end + + class << self + def decorative?; end + end end module Regexp::Expression::Group; end @@ -390,24 +410,29 @@ end class Regexp::Expression::Group::Atomic < ::Regexp::Expression::Group::Base; end class Regexp::Expression::Group::Base < ::Regexp::Expression::Subexpression - def capturing?; end - def comment?; end def parts; end end class Regexp::Expression::Group::Capture < ::Regexp::Expression::Group::Base - def capturing?; end def human_name; end def identifier; end def number; end def number=(_arg0); end def number_at_level; end def number_at_level=(_arg0); end + + class << self + def capturing?; end + end end class Regexp::Expression::Group::Comment < ::Regexp::Expression::Group::Base - def comment?; end def parts; end + + class << self + def comment?; end + def decorative?; end + end end class Regexp::Expression::Group::Named < ::Regexp::Expression::Group::Capture @@ -453,6 +478,8 @@ class Regexp::Expression::Literal < ::Regexp::Expression::Base end Regexp::Expression::MatchLength = Regexp::MatchLength +Regexp::Expression::Nonposixclass = Regexp::Expression::PosixClass +Regexp::Expression::Nonproperty = Regexp::Expression::UnicodeProperty class Regexp::Expression::PosixClass < ::Regexp::Expression::Base def match_length; end @@ -460,6 +487,9 @@ class Regexp::Expression::PosixClass < ::Regexp::Expression::Base def negative?; end end +Regexp::Expression::Posixclass = Regexp::Expression::PosixClass +Regexp::Expression::Property = Regexp::Expression::UnicodeProperty + class Regexp::Expression::Quantifier include ::Regexp::Expression::Shared extend ::Regexp::Expression::Shared::ClassMethods @@ -468,6 +498,8 @@ class Regexp::Expression::Quantifier def conditional_level; end def conditional_level=(_arg0); end + def custom_to_s_handling; end + def custom_to_s_handling=(_arg0); end def greedy?; end def lazy?; end def level; end @@ -478,7 +510,11 @@ class Regexp::Expression::Quantifier def nesting_level; end def options; end def options=(_arg0); end + def parent; end + def parent=(_arg0); end def possessive?; end + def pre_quantifier_decorations; end + def pre_quantifier_decorations=(_arg0); end def quantifier; end def reluctant?; end def set_level; end @@ -497,8 +533,8 @@ class Regexp::Expression::Quantifier private - def deprecated_old_init(token, text, min, max, mode = T.unsafe(nil)); end - def minmax; end + def deprecated_old_init(token, text, _min, _max, _mode = T.unsafe(nil)); end + def derived_data; end end Regexp::Expression::Quantifier::MODES = T.let(T.unsafe(nil), Array) @@ -512,8 +548,7 @@ class Regexp::Expression::Root < ::Regexp::Expression::Subexpression end class Regexp::Expression::Sequence < ::Regexp::Expression::Subexpression - def quantify(*args); end - def starts_at; end + def quantify(token, *args); end def ts; end class << self @@ -523,34 +558,43 @@ end class Regexp::Expression::SequenceOperation < ::Regexp::Expression::Subexpression def <<(exp); end - def add_sequence(active_opts = T.unsafe(nil)); end + def add_sequence(active_opts = T.unsafe(nil), params = T.unsafe(nil)); end def operands; end def operator; end def parts; end def sequences; end - def starts_at; end def ts; end end +Regexp::Expression::Set = Regexp::Expression::CharacterSet + module Regexp::Expression::Shared mixes_in_class_methods ::Regexp::Expression::Shared::ClassMethods def ==(other); end def ===(other); end def base_length; end + def capturing?; end def coded_offset; end + def comment?; end + def decorative?; end + def ends_at(include_quantifier = T.unsafe(nil)); end def eql?(other); end def full_length; end def human_name; end + def inspect; end def is?(test_token, test_type = T.unsafe(nil)); end def nesting_level=(lvl); end def offset; end def one_of?(scope, top = T.unsafe(nil)); end def optional?; end def parts; end + def pre_quantifier_decoration(expression_format = T.unsafe(nil)); end + def pretty_print(q); end + def pretty_print_instance_variables; end def quantified?; end def quantifier=(qtf); end - def quantifier_affix(expression_format); end + def quantifier_affix(expression_format = T.unsafe(nil)); end def referential?; end def starts_at; end def terminal?; end @@ -563,6 +607,7 @@ module Regexp::Expression::Shared def init_from_token_and_options(token, options = T.unsafe(nil)); end def initialize_copy(orig); end + def intersperse(expressions, separator); end class << self def included(mod); end @@ -570,8 +615,13 @@ module Regexp::Expression::Shared end module Regexp::Expression::Shared::ClassMethods + def capturing?; end + def comment?; end def construct(params = T.unsafe(nil)); end def construct_defaults; end + def decorative?; end + def referential?; end + def terminal?; end def token_class; end end @@ -589,8 +639,9 @@ class Regexp::Expression::Subexpression < ::Regexp::Expression::Base def empty?(*args, &block); end def expressions; end def expressions=(_arg0); end + def extract_quantifier_target(quantifier_description); end def fetch(*args, &block); end - def flat_map(include_self = T.unsafe(nil)); end + def flat_map(include_self = T.unsafe(nil), &block); end def index(*args, &block); end def inner_match_length; end def join(*args, &block); end @@ -601,16 +652,23 @@ class Regexp::Expression::Subexpression < ::Regexp::Expression::Base def strfre_tree(format = T.unsafe(nil), include_self = T.unsafe(nil), separator = T.unsafe(nil)); end def strfregexp_tree(format = T.unsafe(nil), include_self = T.unsafe(nil), separator = T.unsafe(nil)); end def te; end - def terminal?; end def to_h; end def traverse(include_self = T.unsafe(nil), &block); end def values_at(*args, &block); end def walk(include_self = T.unsafe(nil), &block); end + protected + + def each_expression_with_index(&block); end + def each_expression_without_index(&block); end + private def initialize_copy(orig); end - def intersperse(expressions, separator); end + + class << self + def terminal?; end + end end module Regexp::Expression::UnicodeProperty; end @@ -782,7 +840,6 @@ end class Regexp::Parser include ::Regexp::Expression - include ::Regexp::Expression::UnicodeProperty def parse(input, syntax = T.unsafe(nil), options: T.unsafe(nil), &block); end @@ -848,6 +905,7 @@ Regexp::Parser::ENC_FLAGS = T.let(T.unsafe(nil), Array) class Regexp::Parser::Error < ::StandardError; end Regexp::Parser::MOD_FLAGS = T.let(T.unsafe(nil), Array) class Regexp::Parser::ParserError < ::Regexp::Parser::Error; end +Regexp::Parser::UP = Regexp::Expression::UnicodeProperty Regexp::Parser::UPTokens = Regexp::Syntax::Token::UnicodeProperty class Regexp::Parser::UnknownTokenError < ::Regexp::Parser::ParserError @@ -896,7 +954,6 @@ class Regexp::Scanner def spacing_stack=(_arg0); end def tokens; end def tokens=(_arg0); end - def validation_error(type, what, reason = T.unsafe(nil)); end class << self def long_prop_map; end @@ -930,15 +987,18 @@ end class Regexp::Scanner::ScannerError < ::Regexp::Parser::Error; end class Regexp::Scanner::UnknownPosixClassError < ::Regexp::Scanner::ValidationError - def initialize(text); end + def initialize(text, _); end end class Regexp::Scanner::UnknownUnicodePropertyError < ::Regexp::Scanner::ValidationError - def initialize(name); end + def initialize(name, _); end end -class Regexp::Scanner::ValidationError < ::Regexp::Parser::Error - def initialize(reason); end +class Regexp::Scanner::ValidationError < ::Regexp::Scanner::ScannerError + class << self + def for(type, problem, reason = T.unsafe(nil)); end + def types; end + end end module Regexp::Syntax @@ -1014,6 +1074,9 @@ end class Regexp::Syntax::SyntaxError < ::Regexp::Parser::Error; end module Regexp::Syntax::Token; end Regexp::Syntax::Token::All = T.let(T.unsafe(nil), Array) +module Regexp::Syntax::Token::Alternation; end +Regexp::Syntax::Token::Alternation::All = T.let(T.unsafe(nil), Array) +Regexp::Syntax::Token::Alternation::Type = T.let(T.unsafe(nil), Symbol) module Regexp::Syntax::Token::Anchor; end Regexp::Syntax::Token::Anchor::All = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Anchor::Basic = T.let(T.unsafe(nil), Array) @@ -1026,6 +1089,7 @@ Regexp::Syntax::Token::Assertion::All = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Assertion::Lookahead = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Assertion::Lookbehind = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Assertion::Type = T.let(T.unsafe(nil), Symbol) +Regexp::Syntax::Token::Backref = Regexp::Syntax::Token::Backreference module Regexp::Syntax::Token::Backreference; end Regexp::Syntax::Token::Backreference::All = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Backreference::Name = T.let(T.unsafe(nil), Array) @@ -1064,6 +1128,7 @@ Regexp::Syntax::Token::Escape::Meta = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Escape::Octal = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Escape::Type = T.let(T.unsafe(nil), Symbol) Regexp::Syntax::Token::Escape::Unicode = T.let(T.unsafe(nil), Array) +Regexp::Syntax::Token::EscapeSequence = Regexp::Syntax::Token::Escape module Regexp::Syntax::Token::FreeSpace; end Regexp::Syntax::Token::FreeSpace::All = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::FreeSpace::Type = T.let(T.unsafe(nil), Symbol) @@ -1088,6 +1153,7 @@ Regexp::Syntax::Token::Literal::Type = T.let(T.unsafe(nil), Symbol) Regexp::Syntax::Token::Map = T.let(T.unsafe(nil), Hash) module Regexp::Syntax::Token::Meta; end Regexp::Syntax::Token::Meta::All = T.let(T.unsafe(nil), Array) +Regexp::Syntax::Token::Meta::Alternation = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Meta::Basic = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Meta::Extended = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Meta::Type = T.let(T.unsafe(nil), Symbol) @@ -1097,6 +1163,7 @@ Regexp::Syntax::Token::PosixClass::Extensions = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::PosixClass::NonType = T.let(T.unsafe(nil), Symbol) Regexp::Syntax::Token::PosixClass::Standard = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::PosixClass::Type = T.let(T.unsafe(nil), Symbol) +Regexp::Syntax::Token::Property = Regexp::Syntax::Token::UnicodeProperty module Regexp::Syntax::Token::Quantifier; end Regexp::Syntax::Token::Quantifier::All = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Quantifier::Greedy = T.let(T.unsafe(nil), Array) @@ -1108,6 +1175,7 @@ Regexp::Syntax::Token::Quantifier::Possessive = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Quantifier::Reluctant = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::Quantifier::Type = T.let(T.unsafe(nil), Symbol) Regexp::Syntax::Token::Quantifier::V1_8_6 = T.let(T.unsafe(nil), Array) +Regexp::Syntax::Token::Set = Regexp::Syntax::Token::CharacterSet module Regexp::Syntax::Token::SubexpressionCall; end Regexp::Syntax::Token::SubexpressionCall::All = T.let(T.unsafe(nil), Array) Regexp::Syntax::Token::SubexpressionCall::Name = T.let(T.unsafe(nil), Array) diff --git a/Library/Homebrew/sorbet/rbi/gems/rspec-core@3.12.1.rbi b/Library/Homebrew/sorbet/rbi/gems/rspec-core@3.12.2.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/rspec-core@3.12.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/rspec-core@3.12.2.rbi diff --git a/Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.12.2.rbi b/Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.12.3.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.12.2.rbi rename to Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.12.3.rbi diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-capybara@2.17.1.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-capybara@2.18.0.rbi similarity index 98% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-capybara@2.17.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-capybara@2.18.0.rbi index 1da0bb0b65..1f83f6d20f 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-capybara@2.17.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-capybara@2.18.0.rbi @@ -63,6 +63,7 @@ module RuboCop::Cop::Capybara::CssSelector end class RuboCop::Cop::Capybara::CurrentPathExpectation < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector def as_is_matcher(param0 = T.unsafe(nil)); end @@ -72,9 +73,11 @@ class RuboCop::Cop::Capybara::CurrentPathExpectation < ::RuboCop::Cop::Base private + def add_argument_parentheses(corrector, arg_node); end def add_ignore_query_options(corrector, node); end def autocorrect(corrector, node); end def convert_regexp_node_to_literal(corrector, matcher_node, regexp_node); end + def method_call_with_no_parentheses?(arg_node); end def regexp_node_to_regexp_expr(regexp_node); end def rewrite_expectation(corrector, node, to_symbol, matcher_node); end diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.0.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.1.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.19.1.rbi diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.19.0.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.20.0.rbi similarity index 96% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.19.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.20.0.rbi index 994cc2b9b3..fce0977c1b 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.19.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.20.0.rbi @@ -85,6 +85,16 @@ end RuboCop::Cop::RSpec::Be::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::RSpec::Be::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::RSpec::BeEmpty < ::RuboCop::Cop::RSpec::Base + extend ::RuboCop::Cop::AutoCorrector + + def expect_array_matcher?(param0 = T.unsafe(nil)); end + def on_send(node); end +end + +RuboCop::Cop::RSpec::BeEmpty::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::RSpec::BeEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::RSpec::BeEq < ::RuboCop::Cop::RSpec::Base extend ::RuboCop::Cop::AutoCorrector @@ -219,7 +229,8 @@ class RuboCop::Cop::RSpec::ContainExactly < ::RuboCop::Cop::RSpec::Base private - def autocorrect(node, corrector); end + def autocorrect_for_populated_array(node, corrector); end + def check_populated_collection(node); end end RuboCop::Cop::RSpec::ContainExactly::MSG = T.let(T.unsafe(nil), String) @@ -325,7 +336,7 @@ RuboCop::Cop::RSpec::DescribedClass::DESCRIBED_CLASS = T.let(T.unsafe(nil), Stri RuboCop::Cop::RSpec::DescribedClass::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::DescribedClassModuleWrapping < ::RuboCop::Cop::RSpec::Base - def find_rspec_blocks(param0); end + def include_rspec_blocks?(param0); end def on_module(node); end end @@ -662,6 +673,7 @@ class RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle < ::RuboCop::C end end +RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::AMBIGUOUS_TYPES = T.let(T.unsafe(nil), Array) RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::FACTORY_CALLS = T.let(T.unsafe(nil), Set) RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::MSG_OMIT_PARENS = T.let(T.unsafe(nil), String) RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::MSG_REQUIRE_PARENS = T.let(T.unsafe(nil), String) @@ -938,6 +950,19 @@ RuboCop::Cop::RSpec::ImplicitSubject::MSG_REQUIRE_EXPLICIT = T.let(T.unsafe(nil) RuboCop::Cop::RSpec::ImplicitSubject::MSG_REQUIRE_IMPLICIT = T.let(T.unsafe(nil), String) RuboCop::Cop::RSpec::ImplicitSubject::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::RSpec::IndexedLet < ::RuboCop::Cop::RSpec::Base + def let_name(param0 = T.unsafe(nil)); end + def on_block(node); end + + private + + def filter_indexed_lets(candidates); end + def indexed_let?(node); end +end + +RuboCop::Cop::RSpec::IndexedLet::INDEX_REGEX = T.let(T.unsafe(nil), Regexp) +RuboCop::Cop::RSpec::IndexedLet::MSG = T.let(T.unsafe(nil), String) + module RuboCop::Cop::RSpec::InflectedHelper include ::RuboCop::RSpec::Language extend ::RuboCop::AST::NodePattern::Macros @@ -1107,7 +1132,12 @@ end class RuboCop::Cop::RSpec::MatchArray < ::RuboCop::Cop::RSpec::Base extend ::RuboCop::Cop::AutoCorrector + def match_array_with_empty_array?(param0 = T.unsafe(nil)); end def on_send(node); end + + private + + def check_populated_array(node); end end RuboCop::Cop::RSpec::MatchArray::MSG = T.let(T.unsafe(nil), String) @@ -1346,6 +1376,7 @@ class RuboCop::Cop::RSpec::PendingWithoutReason < ::RuboCop::Cop::RSpec::Base def pending_step_without_reason?(param0 = T.unsafe(nil)); end def skipped_by_example_group_method?(param0 = T.unsafe(nil)); end def skipped_by_example_method?(param0 = T.unsafe(nil)); end + def skipped_by_example_method_with_block?(param0 = T.unsafe(nil)); end def skipped_in_example?(param0 = T.unsafe(nil)); end private @@ -1354,7 +1385,7 @@ class RuboCop::Cop::RSpec::PendingWithoutReason < ::RuboCop::Cop::RSpec::Base def on_pending_by_metadata(node); end def on_skipped_by_example_group_method(node); end def on_skipped_by_example_method(node); end - def on_skipped_by_in_example_method(node, _direct_parent); end + def on_skipped_by_in_example_method(node); end def parent_node(node); end end @@ -1405,42 +1436,55 @@ class RuboCop::Cop::RSpec::Rails::HttpStatus < ::RuboCop::Cop::RSpec::Base def checker_class; end end -class RuboCop::Cop::RSpec::Rails::HttpStatus::NumericStyleChecker - def initialize(node); end - - def message; end - def node; end +class RuboCop::Cop::RSpec::Rails::HttpStatus::BeStatusStyleChecker < ::RuboCop::Cop::RSpec::Rails::HttpStatus::StyleCheckerBase + def current; end + def offense_range; end def offensive?; end - def preferred_style; end + def prefer; end + + private + + def number; end + def symbol; end +end + +class RuboCop::Cop::RSpec::Rails::HttpStatus::NumericStyleChecker < ::RuboCop::Cop::RSpec::Rails::HttpStatus::StyleCheckerBase + def current; end + def offensive?; end + def prefer; end private - def allowed_symbol?; end def number; end def symbol; end end -RuboCop::Cop::RSpec::Rails::HttpStatus::NumericStyleChecker::ALLOWED_STATUSES = T.let(T.unsafe(nil), Array) -RuboCop::Cop::RSpec::Rails::HttpStatus::NumericStyleChecker::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::RSpec::Rails::HttpStatus::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -class RuboCop::Cop::RSpec::Rails::HttpStatus::SymbolicStyleChecker +class RuboCop::Cop::RSpec::Rails::HttpStatus::StyleCheckerBase def initialize(node); end + def allowed_symbol?; end + def custom_http_status_code?; end def message; end def node; end + def offense_range; end +end + +RuboCop::Cop::RSpec::Rails::HttpStatus::StyleCheckerBase::ALLOWED_STATUSES = T.let(T.unsafe(nil), Array) +RuboCop::Cop::RSpec::Rails::HttpStatus::StyleCheckerBase::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::RSpec::Rails::HttpStatus::SymbolicStyleChecker < ::RuboCop::Cop::RSpec::Rails::HttpStatus::StyleCheckerBase + def current; end def offensive?; end - def preferred_style; end + def prefer; end private - def custom_http_status_code?; end def number; end def symbol; end end -RuboCop::Cop::RSpec::Rails::HttpStatus::SymbolicStyleChecker::MSG = T.let(T.unsafe(nil), String) - class RuboCop::Cop::RSpec::Rails::InferredSpecType < ::RuboCop::Cop::RSpec::Base extend ::RuboCop::Cop::AutoCorrector @@ -1683,11 +1727,16 @@ end RuboCop::Cop::RSpec::ScatteredLet::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::ScatteredSetup < ::RuboCop::Cop::RSpec::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + def on_block(node); end private + def autocorrect(corrector, first_occurrence, occurrence); end def lines_msg(numbers); end + def message(occurrences, occurrence); end def repeated_hooks(node); end end diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.50.1.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.50.2.rbi similarity index 99% rename from Library/Homebrew/sorbet/rbi/gems/rubocop@1.50.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop@1.50.2.rbi index 36a03bc123..afe493653d 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.50.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.50.2.rbi @@ -8467,6 +8467,7 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_send(node); end def reject_method?(param0 = T.unsafe(nil)); end diff --git a/Library/Homebrew/sorbet/rbi/gems/rubyntlm@0.6.3.rbi b/Library/Homebrew/sorbet/rbi/gems/rubyntlm@0.6.3.rbi deleted file mode 100644 index 3d559d3c3f..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/rubyntlm@0.6.3.rbi +++ /dev/null @@ -1,332 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `rubyntlm` gem. -# Please instead update this file by running `bin/tapioca gem rubyntlm`. - -module Net::NTLM - class << self - def apply_des(plain, keys); end - def gen_keys(str); end - def is_ntlm_hash?(data); end - def lm_hash(password); end - def lm_response(arg); end - def lmv2_response(arg, opt = T.unsafe(nil)); end - def ntlm2_session(arg, opt = T.unsafe(nil)); end - def ntlm_hash(password, opt = T.unsafe(nil)); end - def ntlm_response(arg); end - def ntlmv2_hash(user, password, target, opt = T.unsafe(nil)); end - def ntlmv2_response(arg, opt = T.unsafe(nil)); end - def pack_int64le(val); end - def split7(str); end - end -end - -class Net::NTLM::Blob < ::Net::NTLM::FieldSet - def blob_signature; end - def blob_signature=(val); end - def challenge; end - def challenge=(val); end - def parse(str, offset = T.unsafe(nil)); end - def reserved; end - def reserved=(val); end - def target_info; end - def target_info=(val); end - def timestamp; end - def timestamp=(val); end - def unknown1; end - def unknown1=(val); end - def unknown2; end - def unknown2=(val); end -end - -class Net::NTLM::ChannelBinding - def initialize(outer_channel); end - - def acceptor_address_length; end - def acceptor_addrtype; end - def application_data; end - def channel; end - def channel_binding_token; end - def channel_hash; end - def gss_channel_bindings_struct; end - def initiator_address_length; end - def initiator_addtype; end - def unique_prefix; end - - class << self - def create(outer_channel); end - end -end - -class Net::NTLM::Client - def initialize(username, password, opts = T.unsafe(nil)); end - - def domain; end - def flags; end - def init_context(resp = T.unsafe(nil), channel_binding = T.unsafe(nil)); end - def password; end - def session; end - def session_key; end - def username; end - def workstation; end - - private - - def type1_message; end -end - -class Net::NTLM::Client::Session - def initialize(client, challenge_message, channel_binding = T.unsafe(nil)); end - - def authenticate!; end - def challenge_message; end - def channel_binding; end - def client; end - def exported_session_key; end - def seal_message(message); end - def sign_message(message); end - def unseal_message(emessage); end - def verify_signature(signature, message); end - - private - - def blob; end - def calculate_user_session_key!; end - def client_challenge; end - def client_cipher; end - def client_seal_key; end - def client_sign_key; end - def domain; end - def lmv2_resp; end - def negotiate_key_exchange?; end - def nt_proof_str; end - def ntlmv2_hash; end - def ntlmv2_resp; end - def oem_or_unicode_str(str); end - def password; end - def raw_sequence; end - def sequence; end - def server_challenge; end - def server_cipher; end - def server_seal_key; end - def server_sign_key; end - def target_info; end - def timestamp; end - def use_oem_strings?; end - def user_session_key; end - def username; end - def workstation; end -end - -class Net::NTLM::EncodeUtil - class << self - def decode_utf16le(str); end - def encode_utf16le(str); end - end -end - -class Net::NTLM::Field - def initialize(opts); end - - def active; end - def active=(_arg0); end - def parse(str, offset = T.unsafe(nil)); end - def serialize; end - def size; end - def value; end - def value=(_arg0); end -end - -class Net::NTLM::FieldSet - def initialize; end - - def [](name); end - def []=(name, val); end - def disable(name); end - def enable(name); end - def has_disabled_fields?; end - def parse(str, offset = T.unsafe(nil)); end - def serialize; end - def size; end - - class << self - def int16LE(name, opts); end - def int32LE(name, opts); end - def int64LE(name, opts); end - def names; end - def opts; end - def prototypes; end - def security_buffer(name, opts); end - def string(name, opts); end - def types; end - - private - - def add_field(name, type, opts); end - def define_accessor(name); end - end -end - -class Net::NTLM::Int16LE < ::Net::NTLM::Field - def initialize(opt); end - - def parse(str, offset = T.unsafe(nil)); end - def serialize; end -end - -class Net::NTLM::Int32LE < ::Net::NTLM::Field - def initialize(opt); end - - def parse(str, offset = T.unsafe(nil)); end - def serialize; end -end - -class Net::NTLM::Int64LE < ::Net::NTLM::Field - def initialize(opt); end - - def parse(str, offset = T.unsafe(nil)); end - def serialize; end -end - -class Net::NTLM::InvalidTargetDataError < ::Net::NTLM::NtlmError - def initialize(msg, data); end - - def data; end -end - -class Net::NTLM::Message < ::Net::NTLM::FieldSet - def data_edge; end - def data_size; end - def decode64(str); end - def deflag; end - def dump_flags; end - def encode64; end - def has_flag?(flag); end - def head_size; end - def parse(str); end - def security_buffers; end - def serialize; end - def set_flag(flag); end - def size; end - - class << self - def decode64(str); end - def parse(str); end - end -end - -class Net::NTLM::Message::Type0 < ::Net::NTLM::Message - def sign; end - def sign=(val); end - def type; end - def type=(val); end -end - -class Net::NTLM::Message::Type1 < ::Net::NTLM::Message - def domain; end - def domain=(val); end - def flag; end - def flag=(val); end - def os_version; end - def os_version=(val); end - def sign; end - def sign=(val); end - def type; end - def type=(val); end - def workstation; end - def workstation=(val); end -end - -class Net::NTLM::Message::Type2 < ::Net::NTLM::Message - def challenge; end - def challenge=(val); end - def context; end - def context=(val); end - def flag; end - def flag=(val); end - def os_version; end - def os_version=(val); end - def response(arg, opt = T.unsafe(nil)); end - def sign; end - def sign=(val); end - def target_info; end - def target_info=(val); end - def target_name; end - def target_name=(val); end - def type; end - def type=(val); end -end - -class Net::NTLM::Message::Type3 < ::Net::NTLM::Message - def blank_password?(server_challenge); end - def domain; end - def domain=(val); end - def flag; end - def flag=(val); end - def lm_response; end - def lm_response=(val); end - def ntlm_response; end - def ntlm_response=(val); end - def ntlm_version; end - def os_version; end - def os_version=(val); end - def password?(password, server_challenge); end - def session_key; end - def session_key=(val); end - def sign; end - def sign=(val); end - def type; end - def type=(val); end - def user; end - def user=(val); end - def workstation; end - def workstation=(val); end - - private - - def ntlm2_session_password?(password, server_challenge); end - def ntlmv2_password?(password, server_challenge); end - - class << self - def create(arg, opt = T.unsafe(nil)); end - end -end - -class Net::NTLM::SecurityBuffer < ::Net::NTLM::FieldSet - def initialize(opts = T.unsafe(nil)); end - - def active; end - def active=(_arg0); end - def allocated; end - def allocated=(val); end - def data_size; end - def length; end - def length=(val); end - def offset; end - def offset=(val); end - def parse(str, offset = T.unsafe(nil)); end - def serialize; end - def value; end - def value=(val); end -end - -class Net::NTLM::String < ::Net::NTLM::Field - def initialize(opts); end - - def parse(str, offset = T.unsafe(nil)); end - def serialize; end - def value=(val); end -end - -class Net::NTLM::TargetInfo - def initialize(av_pair_sequence); end - - def av_pairs; end - def to_s; end - - private - - def read_pairs(av_pair_sequence); end - def to_hex(str); end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/unf@0.1.4.rbi b/Library/Homebrew/sorbet/rbi/gems/unf@0.1.4.rbi deleted file mode 100644 index 4ae42ce42e..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/unf@0.1.4.rbi +++ /dev/null @@ -1,23 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `unf` gem. -# Please instead update this file by running `bin/tapioca gem unf`. - -module UNF; end - -class UNF::Normalizer - include ::Singleton - extend ::Singleton::SingletonClassMethods - - def initialize; end - - def normalize(_arg0, _arg1); end - - class << self - def instance; end - def normalize(string, form); end - end -end - -UNF::VERSION = T.let(T.unsafe(nil), String) diff --git a/Library/Homebrew/sorbet/rbi/gems/unf_ext@0.0.8.2.rbi b/Library/Homebrew/sorbet/rbi/gems/unf_ext@0.0.8.2.rbi deleted file mode 100644 index bebb1d3938..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/unf_ext@0.0.8.2.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `unf_ext` gem. -# Please instead update this file by running `bin/tapioca gem unf_ext`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires diff --git a/Library/Homebrew/sorbet/rbi/gems/webrick@1.8.1.rbi b/Library/Homebrew/sorbet/rbi/gems/webrick@1.8.1.rbi deleted file mode 100644 index 8bff972a30..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/webrick@1.8.1.rbi +++ /dev/null @@ -1,614 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `webrick` gem. -# Please instead update this file by running `bin/tapioca gem webrick`. - -module WEBrick::AccessLog - private - - def escape(data); end - def format(format_string, params); end - def setup_params(config, req, res); end - - class << self - def escape(data); end - def format(format_string, params); end - def setup_params(config, req, res); end - end -end - -class WEBrick::BasicLog - def initialize(log_file = T.unsafe(nil), level = T.unsafe(nil)); end - - def <<(obj); end - def close; end - def debug(msg); end - def debug?; end - def error(msg); end - def error?; end - def fatal(msg); end - def fatal?; end - def info(msg); end - def info?; end - def level; end - def level=(_arg0); end - def log(level, data); end - def warn(msg); end - def warn?; end - - private - - def format(arg); end -end - -class WEBrick::GenericServer - def initialize(config = T.unsafe(nil), default = T.unsafe(nil)); end - - def [](key); end - def config; end - def listen(address, port); end - def listeners; end - def logger; end - def run(sock); end - def shutdown; end - def start(&block); end - def status; end - def stop; end - def tokens; end - - private - - def accept_client(svr); end - def alarm_shutdown_pipe; end - def call_callback(callback_name, *args); end - def cleanup_listener; end - def cleanup_shutdown_pipe(shutdown_pipe); end - def setup_shutdown_pipe; end - def start_thread(sock, &block); end -end - -module WEBrick::HTMLUtils - private - - def escape(string); end - - class << self - def escape(string); end - end -end - -module WEBrick::HTTPAuth - private - - def _basic_auth(req, res, realm, req_field, res_field, err_type, block); end - def basic_auth(req, res, realm, &block); end - def proxy_basic_auth(req, res, realm, &block); end - - class << self - def _basic_auth(req, res, realm, req_field, res_field, err_type, block); end - def basic_auth(req, res, realm, &block); end - def proxy_basic_auth(req, res, realm, &block); end - end -end - -module WEBrick::HTTPAuth::Authenticator - def logger; end - def realm; end - def userdb; end - - private - - def check_init(config); end - def check_scheme(req); end - def error(fmt, *args); end - def info(fmt, *args); end - def log(meth, fmt, *args); end -end - -WEBrick::HTTPAuth::Authenticator::AuthException = WEBrick::HTTPStatus::Unauthorized - -class WEBrick::HTTPAuth::BasicAuth - include ::WEBrick::HTTPAuth::Authenticator - - def initialize(config, default = T.unsafe(nil)); end - - def authenticate(req, res); end - def challenge(req, res); end - def logger; end - def realm; end - def userdb; end - - class << self - def make_passwd(realm, user, pass); end - end -end - -class WEBrick::HTTPAuth::DigestAuth - include ::WEBrick::HTTPAuth::Authenticator - - def initialize(config, default = T.unsafe(nil)); end - - def algorithm; end - def authenticate(req, res); end - def challenge(req, res, stale = T.unsafe(nil)); end - def qop; end - - private - - def _authenticate(req, res); end - def check_nonce(req, auth_req); end - def check_opaque(opaque_struct, req, auth_req); end - def check_uri(req, auth_req); end - def generate_next_nonce(req); end - def generate_opaque(req); end - def hexdigest(*args); end - def split_param_value(string); end - - class << self - def make_passwd(realm, user, pass); end - end -end - -class WEBrick::HTTPAuth::DigestAuth::OpaqueInfo < ::Struct - def nc=(_); end - def nonce=(_); end - def time=(_); end -end - -class WEBrick::HTTPAuth::Htdigest - include ::WEBrick::HTTPAuth::UserDB - - def initialize(path); end - - def delete_passwd(realm, user); end - def each; end - def flush(output = T.unsafe(nil)); end - def get_passwd(realm, user, reload_db); end - def reload; end - def set_passwd(realm, user, pass); end -end - -class WEBrick::HTTPAuth::Htgroup - def initialize(path); end - - def add(group, members); end - def flush(output = T.unsafe(nil)); end - def members(group); end - def reload; end -end - -class WEBrick::HTTPAuth::Htpasswd - include ::WEBrick::HTTPAuth::UserDB - - def initialize(path, password_hash: T.unsafe(nil)); end - - def delete_passwd(realm, user); end - def each; end - def flush(output = T.unsafe(nil)); end - def get_passwd(realm, user, reload_db); end - def reload; end - def set_passwd(realm, user, pass); end -end - -WEBrick::HTTPAuth::ProxyAuthenticator::AuthException = WEBrick::HTTPStatus::ProxyAuthenticationRequired - -class WEBrick::HTTPAuth::ProxyBasicAuth < ::WEBrick::HTTPAuth::BasicAuth - include ::WEBrick::HTTPAuth::ProxyAuthenticator -end - -class WEBrick::HTTPAuth::ProxyDigestAuth < ::WEBrick::HTTPAuth::DigestAuth - include ::WEBrick::HTTPAuth::ProxyAuthenticator - - private - - def check_uri(req, auth_req); end -end - -module WEBrick::HTTPAuth::UserDB - def auth_type; end - def auth_type=(_arg0); end - def get_passwd(realm, user, reload_db = T.unsafe(nil)); end - def make_passwd(realm, user, pass); end - def set_passwd(realm, user, pass); end -end - -class WEBrick::HTTPRequest - def initialize(config); end - - def [](header_name); end - def accept; end - def accept_charset; end - def accept_encoding; end - def accept_language; end - def addr; end - def attributes; end - def body(&block); end - def body_reader; end - def content_length; end - def content_type; end - def continue; end - def cookies; end - def each; end - def fixup; end - def header; end - def host; end - def http_version; end - def keep_alive; end - def keep_alive?; end - def meta_vars; end - def parse(socket = T.unsafe(nil)); end - def path; end - def path_info; end - def path_info=(_arg0); end - def peeraddr; end - def port; end - def query; end - def query_string; end - def query_string=(_arg0); end - def raw_header; end - def readpartial(size, buf = T.unsafe(nil)); end - def remote_ip; end - def request_line; end - def request_method; end - def request_time; end - def request_uri; end - def script_name; end - def script_name=(_arg0); end - def server_name; end - def ssl?; end - def to_s; end - def unparsed_uri; end - def user; end - def user=(_arg0); end - - private - - def _read_data(io, method, *arg); end - def parse_host_request_line(host); end - def parse_query; end - def parse_uri(str, scheme = T.unsafe(nil)); end - def read_body(socket, block); end - def read_chunk_size(socket); end - def read_chunked(socket, block); end - def read_data(io, size); end - def read_header(socket); end - def read_line(io, size = T.unsafe(nil)); end - def read_request_line(socket); end - def setup_forwarded_info; end -end - -WEBrick::HTTPRequest::MAX_HEADER_LENGTH = T.let(T.unsafe(nil), Integer) - -class WEBrick::HTTPResponse - def initialize(config); end - - def [](field); end - def []=(field, value); end - def body; end - def body=(_arg0); end - def chunked=(val); end - def chunked?; end - def config; end - def content_length; end - def content_length=(len); end - def content_type; end - def content_type=(type); end - def cookies; end - def each; end - def filename; end - def filename=(_arg0); end - def header; end - def http_version; end - def keep_alive; end - def keep_alive=(_arg0); end - def keep_alive?; end - def make_body_tempfile; end - def reason_phrase; end - def reason_phrase=(_arg0); end - def remove_body_tempfile; end - def request_http_version; end - def request_http_version=(_arg0); end - def request_method; end - def request_method=(_arg0); end - def request_uri; end - def request_uri=(_arg0); end - def send_body(socket); end - def send_header(socket); end - def send_response(socket); end - def sent_size; end - def set_error(ex, backtrace = T.unsafe(nil)); end - def set_redirect(status, url); end - def setup_header; end - def status; end - def status=(status); end - def status_line; end - def upgrade; end - def upgrade!(protocol); end - def upgrade=(_arg0); end - - private - - def _write_data(socket, data); end - def check_header(header_value); end - def error_body(backtrace, ex, host, port); end - def send_body_io(socket); end - def send_body_proc(socket); end - def send_body_string(socket); end -end - -class WEBrick::HTTPResponse::ChunkedWrapper - def initialize(socket, resp); end - - def <<(*buf); end - def write(buf); end -end - -class WEBrick::HTTPServer < ::WEBrick::GenericServer - def initialize(config = T.unsafe(nil), default = T.unsafe(nil)); end - - def access_log(config, req, res); end - def create_request(with_webrick_config); end - def create_response(with_webrick_config); end - def do_OPTIONS(req, res); end - def lookup_server(req); end - def mount(dir, servlet, *options); end - def mount_proc(dir, proc = T.unsafe(nil), &block); end - def run(sock); end - def search_servlet(path); end - def service(req, res); end - def umount(dir); end - def unmount(dir); end - def virtual_host(server); end -end - -class WEBrick::HTTPServer::MountTable - def initialize; end - - def [](dir); end - def []=(dir, val); end - def delete(dir); end - def scan(path); end - - private - - def compile; end - def normalize(dir); end -end - -class WEBrick::HTTPServlet::AbstractServlet - def initialize(server, *options); end - - def do_GET(req, res); end - def do_HEAD(req, res); end - def do_OPTIONS(req, res); end - def service(req, res); end - - private - - def redirect_to_directory_uri(req, res); end - - class << self - def get_instance(server, *options); end - end -end - -class WEBrick::HTTPServlet::CGIHandler < ::WEBrick::HTTPServlet::AbstractServlet - def initialize(server, name); end - - def do_GET(req, res); end - def do_POST(req, res); end -end - -WEBrick::HTTPServlet::CGIHandler::CGIRunnerArray = T.let(T.unsafe(nil), Array) - -class WEBrick::HTTPServlet::DefaultFileHandler < ::WEBrick::HTTPServlet::AbstractServlet - def initialize(server, local_path); end - - def do_GET(req, res); end - def make_partial_content(req, res, filename, filesize); end - def multipart_body(body, parts, boundary, mtype, filesize); end - def not_modified?(req, res, mtime, etag); end - def prepare_range(range, filesize); end -end - -class WEBrick::HTTPServlet::ERBHandler < ::WEBrick::HTTPServlet::AbstractServlet - def initialize(server, name); end - - def do_GET(req, res); end - def do_POST(req, res); end - - private - - def evaluate(erb, servlet_request, servlet_response); end -end - -class WEBrick::HTTPServlet::FileHandler < ::WEBrick::HTTPServlet::AbstractServlet - def initialize(server, root, options = T.unsafe(nil), default = T.unsafe(nil)); end - - def do_GET(req, res); end - def do_OPTIONS(req, res); end - def do_POST(req, res); end - def service(req, res); end - def set_filesystem_encoding(str); end - - private - - def call_callback(callback_name, req, res); end - def check_filename(req, res, name); end - def exec_handler(req, res); end - def get_handler(req, res); end - def nondisclosure_name?(name); end - def prevent_directory_traversal(req, res); end - def search_file(req, res, basename); end - def search_index_file(req, res); end - def set_dir_list(req, res); end - def set_filename(req, res); end - def shift_path_info(req, res, path_info, base = T.unsafe(nil)); end - def trailing_pathsep?(path); end - def windows_ambiguous_name?(name); end - - class << self - def add_handler(suffix, handler); end - def remove_handler(suffix); end - end -end - -class WEBrick::HTTPServlet::ProcHandler < ::WEBrick::HTTPServlet::AbstractServlet - def initialize(proc); end - - def do_GET(request, response); end - def do_POST(request, response); end - def do_PUT(request, response); end - def get_instance(server, *options); end -end - -module WEBrick::HTTPStatus - private - - def client_error?(code); end - def error?(code); end - def info?(code); end - def reason_phrase(code); end - def redirect?(code); end - def server_error?(code); end - def success?(code); end - - class << self - def [](code); end - def client_error?(code); end - def error?(code); end - def info?(code); end - def reason_phrase(code); end - def redirect?(code); end - def server_error?(code); end - def success?(code); end - end -end - -class WEBrick::HTTPStatus::Status < ::StandardError - def code; end - def reason_phrase; end - def to_i; end - - class << self - def code; end - def reason_phrase; end - end -end - -module WEBrick::HTTPUtils - private - - def _escape(str, regex); end - def _make_regex(str); end - def _make_regex!(str); end - def _unescape(str, regex); end - def dequote(str); end - def escape(str); end - def escape8bit(str); end - def escape_form(str); end - def escape_path(str); end - def load_mime_types(file); end - def mime_type(filename, mime_tab); end - def normalize_path(path); end - def parse_form_data(io, boundary); end - def parse_header(raw); end - def parse_query(str); end - def parse_qvalues(value); end - def parse_range_header(ranges_specifier); end - def quote(str); end - def split_header_value(str); end - def unescape(str); end - def unescape_form(str); end - - class << self - def _escape(str, regex); end - def _make_regex(str); end - def _make_regex!(str); end - def _unescape(str, regex); end - def dequote(str); end - def escape(str); end - def escape8bit(str); end - def escape_form(str); end - def escape_path(str); end - def load_mime_types(file); end - def mime_type(filename, mime_tab); end - def normalize_path(path); end - def parse_form_data(io, boundary); end - def parse_header(raw); end - def parse_query(str); end - def parse_qvalues(value); end - def parse_range_header(ranges_specifier); end - def quote(str); end - def split_header_value(str); end - def unescape(str); end - def unescape_form(str); end - end -end - -class WEBrick::HTTPUtils::FormData < ::String - def initialize(*args); end - - def <<(str); end - def [](*key); end - def append_data(data); end - def each_data; end - def filename; end - def filename=(_arg0); end - def list; end - def name; end - def name=(_arg0); end - def next_data=(_arg0); end - def to_ary; end - def to_s; end - - protected - - def next_data; end -end - -module WEBrick::Utils - private - - def create_listeners(address, port); end - def getservername; end - def random_string(len); end - def set_close_on_exec(io); end - def set_non_blocking(io); end - def su(user); end - def timeout(seconds, exception = T.unsafe(nil)); end - - class << self - def create_listeners(address, port); end - def getservername; end - def random_string(len); end - def set_close_on_exec(io); end - def set_non_blocking(io); end - def su(user); end - def timeout(seconds, exception = T.unsafe(nil)); end - end -end - -class WEBrick::Utils::TimeoutHandler - include ::Singleton - extend ::Singleton::SingletonClassMethods - - def initialize; end - - def cancel(thread, id); end - def interrupt(thread, id, exception); end - def register(thread, time, exception); end - def terminate; end - - private - - def watch; end - def watcher; end - - class << self - def cancel(id); end - def register(seconds, exception); end - def terminate; end - end -end diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index c264f1ab81..26cf58835f 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -4247,10 +4247,6 @@ class GitHubRunner def self.inherited(s); end end -class HTTP::Cookie - def self.parse(set_cookie, origin, options=T.unsafe(nil), &block); end -end - class Hardware::CPU def self.lm?(); end end @@ -4725,6 +4721,68 @@ module MachOShim def rpaths(*args, &block); end end +class Mechanize::HTTP +end + +class Mechanize::HTTP::ContentDisposition + def creation_date(); end + + def creation_date=(_); end + + def filename(); end + + def filename=(_); end + + def modification_date(); end + + def modification_date=(_); end + + def parameters(); end + + def parameters=(_); end + + def read_date(); end + + def read_date=(_); end + + def size=(_); end + + def type(); end + + def type=(_); end +end + +class Mechanize::HTTP::ContentDisposition + def self.[](*arg); end + + def self.members(); end +end + +class Mechanize::HTTP::ContentDispositionParser + def parse(content_disposition, header=T.unsafe(nil)); end + + def parse_parameters(); end + + def rfc_2045_quoted_string(); end + + def rfc_2045_token(); end + + def rfc_2045_value(); end + + def scanner(); end + + def scanner=(scanner); end + + def spaces(); end +end + +class Mechanize::HTTP::ContentDispositionParser + def self.parse(content_disposition); end +end + +class Mechanize::HTTP +end + class MessagePack::Packer def reset(); end @@ -4992,12 +5050,6 @@ module Mutex_m VERSION = ::T.let(nil, ::T.untyped) end -module NKF - AUTO = ::T.let(nil, ::T.untyped) - NOCONV = ::T.let(nil, ::T.untyped) - UNKNOWN = ::T.let(nil, ::T.untyped) -end - class Net::BufferedIO def write_timeout(); end @@ -5153,10 +5205,6 @@ class NilClass def to_d(); end end -class Nokogiri::CSS::Parser - Racc_debug_parser = ::T.let(nil, ::T.untyped) -end - class OS::Mac::BaseSDKLocator def initialize(*args, &blk); end end @@ -5170,10 +5218,6 @@ class Object include ::Minitest::Expectations include ::Utils::Curl include ::SystemCommand::Mixin - def __send(*arg); end - - def __send!(*arg); end - def deep_dup(); end def duplicable?(); end @@ -5494,6 +5538,8 @@ class Parlour::Types::Type extend ::T::InterfaceWrapper::Helpers end +ParseError = Racc::ParseError + class Parser::Ruby26 Racc_debug_parser = ::T.let(nil, ::T.untyped) end @@ -5789,6 +5835,21 @@ end class Racc::CparseParams end +class Racc::Parser + Racc_Main_Parsing_Routine = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Id_C = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Revision = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Revision_C = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Revision_R = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Version = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Version_C = ::T.let(nil, ::T.untyped) + Racc_Runtime_Core_Version_R = ::T.let(nil, ::T.untyped) + Racc_Runtime_Revision = ::T.let(nil, ::T.untyped) + Racc_Runtime_Type = ::T.let(nil, ::T.untyped) + Racc_Runtime_Version = ::T.let(nil, ::T.untyped) + Racc_YY_Parse_Method = ::T.let(nil, ::T.untyped) +end + class Random def self.bytes(arg); end end @@ -6520,6 +6581,7 @@ module RuboCop::AST::NodePattern::Sets SET_MAC_LINUX = ::T.let(nil, ::T.untyped) SET_ON_INTEL_ON_ARM = ::T.let(nil, ::T.untyped) SET_OR_NEWER_OR_OLDER = ::T.let(nil, ::T.untyped) + SET_STATUS_CODE = ::T.let(nil, ::T.untyped) SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped) SET_T_TRANSLATE_L_LOCALIZE = ::T.let(nil, ::T.untyped) SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped) @@ -8235,14 +8297,6 @@ class String def shellescape(); end def shellsplit(); end - - def to_nfc(); end - - def to_nfd(); end - - def to_nfkc(); end - - def to_nfkd(); end end class StringScanner @@ -8469,213 +8523,6 @@ class WeakRef def initialize(orig); end end -class WebRobots - def allowed?(url); end - - def crawl_delay(url); end - - def create_cache(); end - - def disallowed?(url); end - - def error(url); end - - def error!(url); end - - def flush_cache(); end - - def initialize(user_agent, options=T.unsafe(nil)); end - - def option(url, token); end - - def options(url); end - - def reset(url); end - - def sitemaps(url); end - - def user_agent(); end -end - -class WebRobots::Error -end - -class WebRobots::Error -end - -class WebRobots::ParseError - def initialize(message, site); end - - def site(); end -end - -class WebRobots::ParseError -end - -class WebRobots::RobotsTxt - def allow?(request_uri, user_agent=T.unsafe(nil)); end - - def crawl_delay(user_agent=T.unsafe(nil)); end - - def error(); end - - def error!(); end - - def error=(error); end - - def initialize(site, records, options=T.unsafe(nil)); end - - def options(user_agent=T.unsafe(nil)); end - - def site(); end - - def sitemaps(); end - - def timestamp(); end - DISALLOW_ALL = ::T.let(nil, ::T.untyped) -end - -class WebRobots::RobotsTxt::AccessControlLine - def match?(request_uri); end -end - -class WebRobots::RobotsTxt::AccessControlLine -end - -class WebRobots::RobotsTxt::AgentLine - def pattern(); end -end - -class WebRobots::RobotsTxt::AgentLine -end - -class WebRobots::RobotsTxt::AllowLine - def allow?(); end -end - -class WebRobots::RobotsTxt::AllowLine -end - -class WebRobots::RobotsTxt::CrawlDelayLine - def delay(); end -end - -class WebRobots::RobotsTxt::CrawlDelayLine -end - -class WebRobots::RobotsTxt::DisallowLine - def allow?(); end -end - -class WebRobots::RobotsTxt::DisallowLine -end - -class WebRobots::RobotsTxt::ExtentionLine -end - -class WebRobots::RobotsTxt::ExtentionLine -end - -class WebRobots::RobotsTxt::Line - def compile(); end - - def initialize(token, value); end - - def token(); end - - def value(); end -end - -class WebRobots::RobotsTxt::Line -end - -class WebRobots::RobotsTxt::Parser - def _reduce_1(val, _values, result); end - - def _reduce_17(val, _values, result); end - - def _reduce_18(val, _values, result); end - - def _reduce_19(val, _values, result); end - - def _reduce_2(val, _values, result); end - - def _reduce_20(val, _values, result); end - - def _reduce_21(val, _values, result); end - - def _reduce_24(val, _values, result); end - - def _reduce_25(val, _values, result); end - - def _reduce_26(val, _values, result); end - - def _reduce_28(val, _values, result); end - - def _reduce_31(val, _values, result); end - - def _reduce_32(val, _values, result); end - - def _reduce_38(val, _values, result); end - - def _reduce_39(val, _values, result); end - - def _reduce_40(val, _values, result); end - - def _reduce_41(val, _values, result); end - - def _reduce_none(val, _values, result); end - - def initialize(target, crawl_delay_handler=T.unsafe(nil)); end - - def on_error(token_id, value, stack); end - - def parse(input, site); end - - def parse!(input, site); end - - def parse_error(message); end - KNOWN_TOKENS = ::T.let(nil, ::T.untyped) - RE_KNOWN_TOKENS = ::T.let(nil, ::T.untyped) - Racc_arg = ::T.let(nil, ::T.untyped) - Racc_debug_parser = ::T.let(nil, ::T.untyped) - Racc_token_to_s_table = ::T.let(nil, ::T.untyped) -end - -class WebRobots::RobotsTxt::Parser -end - -class WebRobots::RobotsTxt::Record - def allow?(request_uri); end - - def default?(); end - - def delay(); end - - def initialize(agentlines, rulelines); end - - def match?(user_agent); end - - def options(); end -end - -class WebRobots::RobotsTxt::Record -end - -class WebRobots::RobotsTxt - def self.unfetchable(site, reason, target=T.unsafe(nil)); end -end - -class WebRobots -end - -module Webrobots - VERSION = ::T.let(nil, ::T.untyped) -end - -module Webrobots -end - module YARDSorbet::Directives extend ::T::Sig end diff --git a/Library/Homebrew/sorbet/rbi/todo.rbi b/Library/Homebrew/sorbet/rbi/todo.rbi index 73f2bbd607..8b0c26fed4 100644 --- a/Library/Homebrew/sorbet/rbi/todo.rbi +++ b/Library/Homebrew/sorbet/rbi/todo.rbi @@ -4,6 +4,7 @@ # typed: false +module ::Nokogiri; end module T::InterfaceWrapper::Helpers; end module T::Private::Abstract::Hooks; end module T::Private::Methods::MethodHooks; end diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index c0de31b8c8..79d1a56ed2 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -325,8 +325,6 @@ module Homebrew # Source location of a style offense. class LineLocation - extend T::Sig - attr_reader :line, :column def initialize(json) diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index e7dea83a8f..9e7e98fabe 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -14,14 +14,10 @@ require "extend/time" # # @api private class SystemCommand - extend T::Sig - using TimeRemaining # Helper functions for calling {SystemCommand.run}. module Mixin - extend T::Sig - def system_command(executable, **options) SystemCommand.run(executable, **options) end @@ -197,10 +193,13 @@ class SystemCommand } options[:chdir] = chdir if chdir - pid = T.let(nil, T.nilable(Integer)) raw_stdin, raw_stdout, raw_stderr, raw_wait_thr = ignore_interrupts do - Open3.popen3(env, [executable, executable], *args, **options) - .tap { |*, wait_thr| pid = wait_thr.pid } + Open3.popen3( + env.merge({ "COLUMNS" => Tty.width.to_s }), + [executable, executable], + *args, + **options, + ) end write_input_to(raw_stdin) @@ -228,7 +227,7 @@ class SystemCommand thread_done_queue << true line_thread.join rescue Interrupt - Process.kill("INT", pid) if pid && !sudo? + Process.kill("INT", raw_wait_thr.pid) if raw_wait_thr && !sudo? raise Interrupt rescue SystemCallError => e @status = $CHILD_STATUS @@ -279,8 +278,6 @@ class SystemCommand # Result containing the output and exit status of a finished sub-process. class Result - extend T::Sig - include Context attr_accessor :command, :status, :exit_status diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index 349b1e1288..36ce8c2ee5 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -1,4 +1,4 @@ -# typed: false +# typed: true # frozen_string_literal: true require "hardware" @@ -12,8 +12,6 @@ require "system_command" # @api private module SystemConfig class << self - extend T::Sig - include SystemCommand::Mixin def clang @@ -32,24 +30,24 @@ module SystemConfig end end - sig { returns(Pathname) } + sig { returns(GitRepository) } def homebrew_repo - HOMEBREW_REPOSITORY.dup.extend(GitRepositoryExtension) + GitRepository.new(HOMEBREW_REPOSITORY) end sig { returns(String) } def head - homebrew_repo.git_head || "(none)" + homebrew_repo.head_ref || "(none)" end sig { returns(String) } def last_commit - homebrew_repo.git_last_commit || "never" + homebrew_repo.last_committed || "never" end sig { returns(String) } def origin - homebrew_repo.git_origin || "(none)" + homebrew_repo.origin_url || "(none)" end sig { returns(String) } @@ -69,7 +67,7 @@ module SystemConfig sig { returns(String) } def core_tap_origin - CoreTap.instance.remote || "(none)" + CoreTap.instance.remote end sig { returns(String) } @@ -132,8 +130,9 @@ module SystemConfig def describe_curl out, = system_command(curl_executable, args: ["--version"], verbose: false) - if /^curl (?[\d.]+)/ =~ out - "#{curl_version} => #{curl_path}" + match_data = /^curl (?[\d.]+)/.match(out) + if match_data + "#{match_data[:curl_version]} => #{curl_path}" else "N/A" end diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index b0cec2ec8c..544db29247 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -9,8 +9,6 @@ require "extend/cachable" # Rather than calling `new` directly, use one of the class methods like {Tab.create}. class Tab - extend T::Sig - extend Cachable FILENAME = "INSTALL_RECEIPT.json" diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index f263af6053..f72624c07e 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -14,8 +14,6 @@ require "settings" # {#user} represents the GitHub username and {#repo} represents the repository # name without the leading `homebrew-`. class Tap - extend T::Sig - extend Cachable TAP_DIRECTORY = (HOMEBREW_LIBRARY/"Taps").freeze @@ -93,8 +91,13 @@ class Tap # The local path to this {Tap}. # e.g. `/usr/local/Library/Taps/user/homebrew-repo` + sig { returns(Pathname) } attr_reader :path + # The git repository of this {Tap}. + sig { returns(GitRepository) } + attr_reader :git_repo + # @private def initialize(user, repo) @user = user @@ -102,7 +105,7 @@ class Tap @name = "#{@user}/#{@repo}".downcase @full_name = "#{@user}/homebrew-#{@repo}" @path = TAP_DIRECTORY/@full_name.downcase - @path.extend(GitRepositoryExtension) + @git_repo = GitRepository.new(@path) @alias_table = nil @alias_reverse_table = nil end @@ -136,7 +139,7 @@ class Tap def remote return default_remote unless installed? - @remote ||= path.git_origin + @remote ||= git_repo.origin_url end # The remote repository name of this {Tap}. @@ -164,28 +167,28 @@ class Tap # True if this {Tap} is a Git repository. def git? - path.git? + git_repo.git_repo? end # git branch for this {Tap}. def git_branch raise TapUnavailableError, name unless installed? - path.git_branch + git_repo.branch_name end # git HEAD for this {Tap}. def git_head raise TapUnavailableError, name unless installed? - @git_head ||= path.git_head + @git_head ||= git_repo.head_ref end # Time since last git commit for this {Tap}. def git_last_commit raise TapUnavailableError, name unless installed? - path.git_last_commit + git_repo.last_committed end # The issues URL of this {Tap}. @@ -386,20 +389,20 @@ class Tap $stderr.ohai "#{name}: changed remote from #{remote} to #{requested_remote}" unless quiet end - current_upstream_head = path.git_origin_branch - return if requested_remote.blank? && path.git_origin_has_branch?(current_upstream_head) + current_upstream_head = T.must(git_repo.origin_branch_name) + return if requested_remote.blank? && git_repo.origin_has_branch?(current_upstream_head) args = %w[fetch] args << "--quiet" if quiet args << "origin" safe_system "git", "-C", path, *args - path.git_origin_set_head_auto + git_repo.set_head_origin_auto - new_upstream_head = path.git_origin_branch + new_upstream_head = T.must(git_repo.origin_branch_name) return if new_upstream_head == current_upstream_head - path.git_rename_branch old: current_upstream_head, new: new_upstream_head - path.git_branch_set_upstream local: new_upstream_head, origin: new_upstream_head + git_repo.rename_branch old: current_upstream_head, new: new_upstream_head + git_repo.set_upstream_branch local: new_upstream_head, origin: new_upstream_head return if quiet @@ -844,8 +847,6 @@ end # A specialized {Tap} class for the core formulae. class CoreTap < Tap - extend T::Sig - # @private sig { void } def initialize @@ -1005,8 +1006,6 @@ end # Permanent configuration per {Tap} using `git-config(1)`. class TapConfig - extend T::Sig - attr_reader :tap sig { params(tap: Tap).void } diff --git a/Library/Homebrew/tap_auditor.rb b/Library/Homebrew/tap_auditor.rb index 16bd6e1444..64d0f66a14 100644 --- a/Library/Homebrew/tap_auditor.rb +++ b/Library/Homebrew/tap_auditor.rb @@ -6,8 +6,6 @@ module Homebrew # # @api private class TapAuditor - extend T::Sig - attr_reader :name, :path, :formula_names, :formula_aliases, :cask_tokens, :tap_audit_exceptions, :tap_style_exceptions, :tap_pypi_formula_mappings, :problems diff --git a/Library/Homebrew/test/ENV_spec.rb b/Library/Homebrew/test/ENV_spec.rb index 15781df83d..7106fd4311 100644 --- a/Library/Homebrew/test/ENV_spec.rb +++ b/Library/Homebrew/test/ENV_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "extend/ENV" diff --git a/Library/Homebrew/test/PATH_spec.rb b/Library/Homebrew/test/PATH_spec.rb index efd7fdfc88..e9eedcee91 100644 --- a/Library/Homebrew/test/PATH_spec.rb +++ b/Library/Homebrew/test/PATH_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "PATH" diff --git a/Library/Homebrew/test/api/cask_spec.rb b/Library/Homebrew/test/api/cask_spec.rb index 3d476483a4..15f0f64170 100644 --- a/Library/Homebrew/test/api/cask_spec.rb +++ b/Library/Homebrew/test/api/cask_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "api" diff --git a/Library/Homebrew/test/api/formula_spec.rb b/Library/Homebrew/test/api/formula_spec.rb index f8e3130a04..e0ed230ae5 100644 --- a/Library/Homebrew/test/api/formula_spec.rb +++ b/Library/Homebrew/test/api/formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "api" diff --git a/Library/Homebrew/test/api_spec.rb b/Library/Homebrew/test/api_spec.rb index 2ff4ff5c32..2be080ad28 100644 --- a/Library/Homebrew/test/api_spec.rb +++ b/Library/Homebrew/test/api_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "api" diff --git a/Library/Homebrew/test/bash_spec.rb b/Library/Homebrew/test/bash_spec.rb index 0a3a80fe72..6e59243b15 100644 --- a/Library/Homebrew/test/bash_spec.rb +++ b/Library/Homebrew/test/bash_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "open3" diff --git a/Library/Homebrew/test/bottle_filename_spec.rb b/Library/Homebrew/test/bottle_filename_spec.rb index 798edf21c7..9eef4089c9 100644 --- a/Library/Homebrew/test/bottle_filename_spec.rb +++ b/Library/Homebrew/test/bottle_filename_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/build_environment_spec.rb b/Library/Homebrew/test/build_environment_spec.rb index 51ae23af7e..fa14acbe59 100644 --- a/Library/Homebrew/test/build_environment_spec.rb +++ b/Library/Homebrew/test/build_environment_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "build_environment" diff --git a/Library/Homebrew/test/build_options_spec.rb b/Library/Homebrew/test/build_options_spec.rb index a36d8314d6..cee085c83d 100644 --- a/Library/Homebrew/test/build_options_spec.rb +++ b/Library/Homebrew/test/build_options_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "build_options" diff --git a/Library/Homebrew/test/bundle_version_spec.rb b/Library/Homebrew/test/bundle_version_spec.rb index 3836fa1fa3..3ee120f913 100644 --- a/Library/Homebrew/test/bundle_version_spec.rb +++ b/Library/Homebrew/test/bundle_version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "bundle_version" diff --git a/Library/Homebrew/test/cache_store_spec.rb b/Library/Homebrew/test/cache_store_spec.rb index 583268285b..a583ebbf53 100644 --- a/Library/Homebrew/test/cache_store_spec.rb +++ b/Library/Homebrew/test/cache_store_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cache_store" diff --git a/Library/Homebrew/test/cask/artifact/abstract_artifact_spec.rb b/Library/Homebrew/test/cask/artifact/abstract_artifact_spec.rb index 24e35e969d..9de70da153 100644 --- a/Library/Homebrew/test/cask/artifact/abstract_artifact_spec.rb +++ b/Library/Homebrew/test/cask/artifact/abstract_artifact_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::AbstractArtifact, :cask do diff --git a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb index 6539c80ce3..b6d801e914 100644 --- a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb +++ b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::App, :cask do diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index aa401e345e..796f03f19f 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::App, :cask do diff --git a/Library/Homebrew/test/cask/artifact/binary_spec.rb b/Library/Homebrew/test/cask/artifact/binary_spec.rb index 96dedec863..61436700ff 100644 --- a/Library/Homebrew/test/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/test/cask/artifact/binary_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Binary, :cask do diff --git a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb index 69115466cf..0e9104f64d 100644 --- a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb +++ b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Artifact, :cask do diff --git a/Library/Homebrew/test/cask/artifact/installer_spec.rb b/Library/Homebrew/test/cask/artifact/installer_spec.rb index 3aada8197f..d03d55fb6e 100644 --- a/Library/Homebrew/test/cask/artifact/installer_spec.rb +++ b/Library/Homebrew/test/cask/artifact/installer_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Installer, :cask do diff --git a/Library/Homebrew/test/cask/artifact/manpage_spec.rb b/Library/Homebrew/test/cask/artifact/manpage_spec.rb index 61e78a07f9..a803cf7586 100644 --- a/Library/Homebrew/test/cask/artifact/manpage_spec.rb +++ b/Library/Homebrew/test/cask/artifact/manpage_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Manpage, :cask do diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index 9e41b7fa7d..5a617fe2dd 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Pkg, :cask do diff --git a/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb b/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb index f8f589cb2d..6a070ba48a 100644 --- a/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb +++ b/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::PostflightBlock, :cask do diff --git a/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb b/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb index f10b22ed8b..f6832dde7f 100644 --- a/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb +++ b/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::PreflightBlock, :cask do diff --git a/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb b/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb index ebcf8cab59..77a4ec099c 100644 --- a/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb +++ b/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "benchmark" diff --git a/Library/Homebrew/test/cask/artifact/suite_spec.rb b/Library/Homebrew/test/cask/artifact/suite_spec.rb index af36e47afc..009d790ed4 100644 --- a/Library/Homebrew/test/cask/artifact/suite_spec.rb +++ b/Library/Homebrew/test/cask/artifact/suite_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Suite, :cask do diff --git a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb index e30304de8f..53e2c4eccb 100644 --- a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb +++ b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::App, :cask do diff --git a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb index 3eb7bd31cf..1328ed7de1 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Artifact::Zap, :cask do diff --git a/Library/Homebrew/test/cask/artifact/uninstall_spec.rb b/Library/Homebrew/test/cask/artifact/uninstall_spec.rb index de09f6f850..5e4550fe97 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples/uninstall_zap" diff --git a/Library/Homebrew/test/cask/artifact/zap_spec.rb b/Library/Homebrew/test/cask/artifact/zap_spec.rb index 2d7387727b..c1ee2b0f59 100644 --- a/Library/Homebrew/test/cask/artifact/zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/zap_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples/uninstall_zap" diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index e71514440c..768ff4c122 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/audit" @@ -483,7 +482,7 @@ describe Cask::Audit, :cask do cask 'signing-cask-test' do version '1.0' url "https://brew.sh/index.html" - binary 'Audit.app' + artifact "example.pdf", target: "/Library/Application Support/example" end RUBY end diff --git a/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb index 358016c9db..90b6d91d56 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::CaskLoader::FromAPILoader, :cask do diff --git a/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb index c956d089e0..41836b9a1c 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::CaskLoader::FromContentLoader do diff --git a/Library/Homebrew/test/cask/cask_loader/from_path_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_path_loader_spec.rb index c9a33916a5..aceb017534 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_path_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_path_loader_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::CaskLoader::FromPathLoader do diff --git a/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb index 4d077cdc8d..2f1ca8bf77 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::CaskLoader::FromTapLoader do diff --git a/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb index c1708d6946..cb8e021523 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::CaskLoader::FromURILoader do diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb index d0cc259949..148596a234 100644 --- a/Library/Homebrew/test/cask/cask_spec.rb +++ b/Library/Homebrew/test/cask/cask_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Cask, :cask do diff --git a/Library/Homebrew/test/cask/cmd/audit_spec.rb b/Library/Homebrew/test/cask/cmd/audit_spec.rb deleted file mode 100644 index 604f281f02..0000000000 --- a/Library/Homebrew/test/cask/cmd/audit_spec.rb +++ /dev/null @@ -1,161 +0,0 @@ -# typed: false -# frozen_string_literal: true - -require "cask/auditor" - -describe Cask::Cmd::Audit, :cask do - let(:cask) { Cask::Cask.new("cask") } - let(:cask_with_many_languages) { Cask::CaskLoader.load(cask_path("with-many-languages")) } - let(:result) { Set.new } - - describe "selection of Casks to audit" do - it "audits all Casks if no tokens are given" do - allow(Cask::Cask).to receive(:to_a).and_return([cask, cask]) - - expect(Cask::Auditor).to receive(:audit).twice.and_return(result) - - described_class.run - end - - it "audits specified Casks if tokens are given" do - cask_token = "nice-app" - expect(Cask::CaskLoader).to receive(:load).with(cask_token, any_args).and_return(cask) - - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_new_cask: false, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run(cask_token) - end - end - - it "does not pass anything if no flags are specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_new_cask: false, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken") - end - - it "passes `audit_download` if the `--download` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_download: true, audit_new_cask: false, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--download") - end - - it "passes `audit_token_conflicts` if the `--token-conflicts` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_token_conflicts: true, audit_new_cask: false, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--token-conflicts") - end - - it "passes `audit_strict` if the `--strict` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_strict: true, audit_new_cask: false, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--strict") - end - - it "passes `audit_online` if the `--online` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_online: true, audit_new_cask: false, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--online") - end - - it "passes `audit_new_cask` if the `--new-cask` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_new_cask: true, quarantine: true, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--new-cask") - end - - it "passes `language` if the `--language` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_new_cask: false, quarantine: true, language: ["de-AT"], any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--language=de-AT") - end - - it "passes `quarantine` if the `--no-quarantine` flag is specified" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_new_cask: false, quarantine: false, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken", "--no-quarantine") - end - - it "passes `quarantine` if the `--no-quarantine` flag is in HOMEBREW_CASK_OPTS" do - ENV["HOMEBREW_CASK_OPTS"] = "--no-quarantine" - - allow(Cask::CaskLoader).to receive(:load).and_return(cask) - expect(Cask::Auditor).to receive(:audit) - .with( - cask, - audit_new_cask: false, quarantine: false, any_named_args: true, - only: [], except: [] - ) - .and_return(result) - - described_class.run("casktoken") - end - - it "audits a sample of language when cask contains more than 10 languages" do - allow(Cask::CaskLoader).to receive(:load).and_return(cask_with_many_languages) - expect do - described_class.run("with-many-languages") - end.to output(/==> auditing a sample of available languages/im).to_stdout - end -end diff --git a/Library/Homebrew/test/cask/cmd/install_spec.rb b/Library/Homebrew/test/cask/cmd/install_spec.rb deleted file mode 100644 index 19a2a1cf1a..0000000000 --- a/Library/Homebrew/test/cask/cmd/install_spec.rb +++ /dev/null @@ -1,131 +0,0 @@ -# typed: false -# frozen_string_literal: true - -describe Cask::Cmd::Install, :cask do - it "displays the installation progress" do - output = Regexp.new <<~EOS - ==> Downloading file:.*caffeine.zip - ==> Installing Cask local-caffeine - ==> Moving App 'Caffeine.app' to '.*Caffeine.app' - .*local-caffeine was successfully installed! - EOS - - expect do - described_class.run("local-caffeine") - end.to output(output).to_stdout - end - - it "allows staging and activation of multiple Casks at once" do - described_class.run("local-transmission", "local-caffeine") - transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) - expect(transmission).to be_installed - expect(transmission.config.appdir.join("Transmission.app")).to be_a_directory - expect(caffeine).to be_installed - expect(caffeine.config.appdir.join("Caffeine.app")).to be_a_directory - end - - it "recognizes the --appdir flag" do - appdir = mktmpdir - - expect(Cask::CaskLoader).to receive(:load) - .with("local-caffeine", any_args) - .and_wrap_original { |f, *args| - caffeine = f.call(*args) - expect(caffeine.config.appdir).to eq appdir - caffeine - } - - described_class.run("local-caffeine", "--appdir=#{appdir}") - end - - it "recognizes the --appdir flag from HOMEBREW_CASK_OPTS" do - appdir = mktmpdir - - expect(Cask::CaskLoader).to receive(:load) - .with("local-caffeine", any_args) - .and_wrap_original { |f, *args| - caffeine = f.call(*args) - expect(caffeine.config.appdir).to eq appdir - caffeine - } - - ENV["HOMEBREW_CASK_OPTS"] = "--appdir=#{appdir}" - - described_class.run("local-caffeine") - end - - it "prefers an explicit --appdir flag to one from HOMEBREW_CASK_OPTS" do - global_appdir = mktmpdir - appdir = mktmpdir - - expect(Cask::CaskLoader).to receive(:load) - .with("local-caffeine", any_args) - .and_wrap_original { |f, *args| - caffeine = f.call(*args) - expect(caffeine.config.appdir).to eq appdir - caffeine - } - - ENV["HOMEBREW_CASK_OPTS"] = "--appdir=#{global_appdir}" - - described_class.run("local-caffeine", "--appdir=#{appdir}") - end - - it "skips double install (without nuking existing installation)" do - described_class.run("local-transmission") - described_class.run("local-transmission") - expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed - end - - it "prints a warning message on double install" do - described_class.run("local-transmission") - - expect do - described_class.run("local-transmission") - end.to output(/Warning: Cask 'local-transmission' is already installed./).to_stderr - end - - it "allows double install with --force" do - described_class.run("local-transmission") - - expect do - expect do - described_class.run("local-transmission", "--force") - end.to output(/It seems there is already an App at.*overwriting\./).to_stderr - end.to output(/local-transmission was successfully installed!/).to_stdout - end - - it "skips dependencies with --skip-cask-deps" do - described_class.run("with-depends-on-cask-multiple", "--skip-cask-deps") - expect(Cask::CaskLoader.load(cask_path("with-depends-on-cask-multiple"))).to be_installed - expect(Cask::CaskLoader.load(cask_path("local-caffeine"))).not_to be_installed - expect(Cask::CaskLoader.load(cask_path("local-transmission"))).not_to be_installed - end - - it "properly handles Casks that are not present" do - expect do - described_class.run("notacask") - end.to raise_error(Cask::CaskUnavailableError) - end - - it "returns a suggestion for a misspelled Cask" do - expect do - described_class.run("localcaffeine") - end.to raise_error( - Cask::CaskUnavailableError, - "Cask 'localcaffeine' is unavailable: No Cask with this name exists. " \ - "Did you mean 'local-caffeine'?", - ) - end - - it "returns multiple suggestions for a Cask fragment" do - expect do - described_class.run("local") - end.to raise_error( - Cask::CaskUnavailableError, - "Cask 'local' is unavailable: No Cask with this name exists. " \ - "Did you mean one of these?\nlocal-caffeine\nlocal-transmission\n", - ) - end -end diff --git a/Library/Homebrew/test/cask/config_spec.rb b/Library/Homebrew/test/cask/config_spec.rb index ea5480a1f9..58a60a711a 100644 --- a/Library/Homebrew/test/cask/config_spec.rb +++ b/Library/Homebrew/test/cask/config_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Config, :cask do diff --git a/Library/Homebrew/test/cask/conflicts_with_spec.rb b/Library/Homebrew/test/cask/conflicts_with_spec.rb index fc659ef28f..fe3387003d 100644 --- a/Library/Homebrew/test/cask/conflicts_with_spec.rb +++ b/Library/Homebrew/test/cask/conflicts_with_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "conflicts_with", :cask do diff --git a/Library/Homebrew/test/cask/denylist_spec.rb b/Library/Homebrew/test/cask/denylist_spec.rb index 6bb3d15218..c4ad8e3bf6 100644 --- a/Library/Homebrew/test/cask/denylist_spec.rb +++ b/Library/Homebrew/test/cask/denylist_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/denylist" diff --git a/Library/Homebrew/test/cask/depends_on_spec.rb b/Library/Homebrew/test/cask/depends_on_spec.rb index 4455751b68..7d7eaa3429 100644 --- a/Library/Homebrew/test/cask/depends_on_spec.rb +++ b/Library/Homebrew/test/cask/depends_on_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true # TODO: this test should be named after the corresponding class, once diff --git a/Library/Homebrew/test/cask/download_spec.rb b/Library/Homebrew/test/cask/download_spec.rb index 43ffbd8906..d49410d9bb 100644 --- a/Library/Homebrew/test/cask/download_spec.rb +++ b/Library/Homebrew/test/cask/download_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true module Cask diff --git a/Library/Homebrew/test/cask/dsl/caveats_spec.rb b/Library/Homebrew/test/cask/dsl/caveats_spec.rb index 6af17577f6..3108ace46c 100644 --- a/Library/Homebrew/test/cask/dsl/caveats_spec.rb +++ b/Library/Homebrew/test/cask/dsl/caveats_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" diff --git a/Library/Homebrew/test/cask/dsl/container_spec.rb b/Library/Homebrew/test/cask/dsl/container_spec.rb index e291bf0b24..844cac897f 100644 --- a/Library/Homebrew/test/cask/dsl/container_spec.rb +++ b/Library/Homebrew/test/cask/dsl/container_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" diff --git a/Library/Homebrew/test/cask/dsl/postflight_spec.rb b/Library/Homebrew/test/cask/dsl/postflight_spec.rb index bc36ff4367..30a18ca562 100644 --- a/Library/Homebrew/test/cask/dsl/postflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/postflight_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" diff --git a/Library/Homebrew/test/cask/dsl/preflight_spec.rb b/Library/Homebrew/test/cask/dsl/preflight_spec.rb index 12cbf50b17..a229c91019 100644 --- a/Library/Homebrew/test/cask/dsl/preflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/preflight_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" diff --git a/Library/Homebrew/test/cask/dsl/shared_examples/base.rb b/Library/Homebrew/test/cask/dsl/shared_examples/base.rb index f97d2c29db..c46715d516 100644 --- a/Library/Homebrew/test/cask/dsl/shared_examples/base.rb +++ b/Library/Homebrew/test/cask/dsl/shared_examples/base.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/dsl/base" diff --git a/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb b/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb index 0036751501..db8a145522 100644 --- a/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb +++ b/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/staged" diff --git a/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb b/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb index c188142015..60dabc7bcb 100644 --- a/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" diff --git a/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb b/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb index e8d7d5c4ff..97970f0e0e 100644 --- a/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" diff --git a/Library/Homebrew/test/cask/dsl/version_spec.rb b/Library/Homebrew/test/cask/dsl/version_spec.rb index 207594c446..68cf59d024 100644 --- a/Library/Homebrew/test/cask/dsl/version_spec.rb +++ b/Library/Homebrew/test/cask/dsl/version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::DSL::Version, :cask do diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index 0289ce608a..da2d5425dd 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::DSL, :cask do diff --git a/Library/Homebrew/test/cask/info_spec.rb b/Library/Homebrew/test/cask/info_spec.rb index d2da333e37..f17226ea6f 100644 --- a/Library/Homebrew/test/cask/info_spec.rb +++ b/Library/Homebrew/test/cask/info_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils" diff --git a/Library/Homebrew/test/cask/installer_spec.rb b/Library/Homebrew/test/cask/installer_spec.rb index f1ea510ce8..d63a8c1d46 100644 --- a/Library/Homebrew/test/cask/installer_spec.rb +++ b/Library/Homebrew/test/cask/installer_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Installer, :cask do diff --git a/Library/Homebrew/test/cask/list_spec.rb b/Library/Homebrew/test/cask/list_spec.rb index 7936464895..dd6d3a83c9 100644 --- a/Library/Homebrew/test/cask/list_spec.rb +++ b/Library/Homebrew/test/cask/list_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/list" diff --git a/Library/Homebrew/test/cask/macos_spec.rb b/Library/Homebrew/test/cask/macos_spec.rb index 92f5c332ef..2635e67f17 100644 --- a/Library/Homebrew/test/cask/macos_spec.rb +++ b/Library/Homebrew/test/cask/macos_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe MacOS, :cask do diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index 7556040f69..ba60408a43 100644 --- a/Library/Homebrew/test/cask/pkg_spec.rb +++ b/Library/Homebrew/test/cask/pkg_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Cask::Pkg, :cask do diff --git a/Library/Homebrew/test/cask/quarantine_spec.rb b/Library/Homebrew/test/cask/quarantine_spec.rb deleted file mode 100644 index b5c49772da..0000000000 --- a/Library/Homebrew/test/cask/quarantine_spec.rb +++ /dev/null @@ -1,250 +0,0 @@ -# typed: false -# frozen_string_literal: true - -require "cask/cmd/audit" -require "cask/cmd/install" -require "cask/cask_loader" -require "cask/download" -require "cask/quarantine" - -describe Cask::Quarantine, :cask do - matcher :be_quarantined do - match do |path| - expect( - described_class.detect(path), - ).to be true - end - end - - describe "by default" do - it "quarantines a nice fresh Cask" do - Cask::Cmd::Install.run("local-transmission") - - cask = Cask::CaskLoader.load(cask_path("local-transmission")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("Transmission.app")).to be_quarantined - end - - it "quarantines Cask fetches" do - download = Cask::Download.new(Cask::CaskLoader.load("local-transmission"), quarantine: true) - download.fetch - local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - cached_location = Cask::Download.new(local_transmission).fetch - - expect(cached_location).to be_quarantined - end - - it "quarantines Cask audits" do - expect do - Cask::Cmd::Audit.run("local-transmission", "--download") - end.to not_raise_error.and not_to_output.to_stderr - - local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - cached_location = Cask::Download.new(local_transmission).fetch - - expect(cached_location).to be_quarantined - end - - it "quarantines Cask installs even if the fetch was not" do - download = Cask::Download.new(Cask::CaskLoader.load("local-transmission"), quarantine: false) - download.fetch - - Cask::Cmd::Install.run("local-transmission") - - cask = Cask::CaskLoader.load(cask_path("local-transmission")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("Transmission.app")).to be_quarantined - end - - it "quarantines dmg-based Casks" do - Cask::Cmd::Install.run("container-dmg") - - cask = Cask::CaskLoader.load(cask_path("container-dmg")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).to be_quarantined - end - - it "quarantines tar-gz-based Casks" do - Cask::Cmd::Install.run("container-tar-gz") - - cask = Cask::CaskLoader.load(cask_path("container-tar-gz")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).to be_quarantined - end - - it "quarantines xar-based Casks" do - Cask::Cmd::Install.run("container-xar") - - cask = Cask::CaskLoader.load(cask_path("container-xar")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).to be_quarantined - end - - it "quarantines pure bzip2-based Casks" do - Cask::Cmd::Install.run("container-bzip2") - - cask = Cask::CaskLoader.load(cask_path("container-bzip2")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).to be_quarantined - end - - it "quarantines pure gzip-based Casks" do - Cask::Cmd::Install.run("container-gzip") - - cask = Cask::CaskLoader.load(cask_path("container-gzip")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).to be_quarantined - end - - it "quarantines the pkg in naked-pkg-based Casks" do - Cask::Cmd::Install.run("container-pkg") - - cask = Cask::CaskLoader.load(cask_path("container-pkg")) - - expect(cask).to be_installed - - expect(cask.staged_path/"container.pkg").to be_quarantined - end - - it "quarantines a nested container" do - Cask::Cmd::Install.run("nested-app") - - cask = Cask::CaskLoader.load(cask_path("nested-app")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("MyNestedApp.app")).to be_quarantined - end - end - - describe "when disabled" do - it "does not quarantine even a nice, fresh Cask" do - Cask::Cmd::Install.run("local-transmission", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("local-transmission")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("Transmission.app")).not_to be_quarantined - end - - it "does not quarantine Cask fetches" do - download = Cask::Download.new(Cask::CaskLoader.load("local-transmission"), quarantine: false) - download.fetch - local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - cached_location = Cask::Download.new(local_transmission).fetch - - expect(cached_location).not_to be_quarantined - end - - it "does not quarantine Cask audits" do - expect do - Cask::Cmd::Audit.run("local-transmission", "--download", "--no-quarantine") - end.to not_raise_error.and not_to_output.to_stderr - - local_transmission = Cask::CaskLoader.load(cask_path("local-transmission")) - cached_location = Cask::Download.new(local_transmission).fetch - - expect(cached_location).not_to be_quarantined - end - - it "does not quarantine Cask installs even if the fetch was" do - download = Cask::Download.new(Cask::CaskLoader.load("local-transmission"), quarantine: true) - download.fetch - - Cask::Cmd::Install.run("local-transmission", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("local-transmission")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("Transmission.app")).not_to be_quarantined - end - - it "does not quarantine dmg-based Casks" do - Cask::Cmd::Install.run("container-dmg", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("container-dmg")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).not_to be_quarantined - end - - it "does not quarantine tar-gz-based Casks" do - Cask::Cmd::Install.run("container-tar-gz", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("container-tar-gz")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).not_to be_quarantined - end - - it "does not quarantine xar-based Casks" do - Cask::Cmd::Install.run("container-xar", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("container-xar")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).not_to be_quarantined - end - - it "does not quarantine pure bzip2-based Casks" do - Cask::Cmd::Install.run("container-bzip2", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("container-bzip2")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).not_to be_quarantined - end - - it "does not quarantine pure gzip-based Casks" do - Cask::Cmd::Install.run("container-gzip", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("container-gzip")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("container")).not_to be_quarantined - end - - it "does not quarantine the pkg in naked-pkg-based Casks" do - Cask::Cmd::Install.run("container-pkg", "--no-quarantine") - - naked_pkg = Cask::CaskLoader.load(cask_path("container-pkg")) - - expect(naked_pkg).to be_installed - - expect( - Cask::Caskroom.path.join("container-pkg", naked_pkg.version, "container.pkg"), - ).not_to be_quarantined - end - - it "does not quarantine a nested container" do - Cask::Cmd::Install.run("nested-app", "--no-quarantine") - - cask = Cask::CaskLoader.load(cask_path("nested-app")) - - expect(cask).to be_installed - - expect(cask.config.appdir.join("MyNestedApp.app")).not_to be_quarantined - end - end -end diff --git a/Library/Homebrew/test/cask/reinstall_spec.rb b/Library/Homebrew/test/cask/reinstall_spec.rb index 1a7d8ee8ad..2ca6fff9d9 100644 --- a/Library/Homebrew/test/cask/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/reinstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/installer" @@ -53,7 +52,7 @@ describe Cask::Reinstall, :cask do end it "allows reinstalling a Cask" do - Cask::Cmd::Install.run("local-transmission") + Cask::Installer.new(Cask::CaskLoader.load(cask_path("local-transmission"))).install expect(Cask::CaskLoader.load(cask_path("local-transmission"))).to be_installed diff --git a/Library/Homebrew/test/cask/uninstall_spec.rb b/Library/Homebrew/test/cask/uninstall_spec.rb index b7f712c4fd..d0df5c0e7e 100644 --- a/Library/Homebrew/test/cask/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/uninstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/uninstall" diff --git a/Library/Homebrew/test/cask/upgrade_spec.rb b/Library/Homebrew/test/cask/upgrade_spec.rb index d10b53be54..d9c9471256 100644 --- a/Library/Homebrew/test/cask/upgrade_spec.rb +++ b/Library/Homebrew/test/cask/upgrade_spec.rb @@ -1,11 +1,10 @@ -# typed: false # frozen_string_literal: true require "cask/upgrade" describe Cask::Upgrade, :cask do - let(:version_latest_path_2) { version_latest.config.appdir.join("Caffeine Pro.app") } - let(:version_latest_path_1) { version_latest.config.appdir.join("Caffeine Mini.app") } + let(:version_latest_path_second) { version_latest.config.appdir.join("Caffeine Pro.app") } + let(:version_latest_path_first) { version_latest.config.appdir.join("Caffeine Mini.app") } let(:version_latest) { Cask::CaskLoader.load("version-latest") } let(:auto_updates_path) { auto_updates.config.appdir.join("MyFancyApp.app") } let(:auto_updates) { Cask::CaskLoader.load("auto-updates") } @@ -30,7 +29,7 @@ describe Cask::Upgrade, :cask do end before do - installed.each { |cask| Cask::Cmd::Install.run(cask) } + installed.each { |cask| Cask::Installer.new(Cask::CaskLoader.load(cask_path(cask))).install } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end @@ -137,7 +136,7 @@ describe Cask::Upgrade, :cask do expect(renamed_app.versions).to include("1.0.0") expect(version_latest).to be_installed - expect(version_latest_path_1).to be_a_directory + expect(version_latest_path_first).to be_a_directory expect(version_latest.versions).to include("latest") # Change download sha so that :latest cask decides to update itself version_latest.download_sha_path.write("fake download sha") @@ -163,7 +162,7 @@ describe Cask::Upgrade, :cask do expect(renamed_app.versions).to include("2.0.0") expect(version_latest).to be_installed - expect(version_latest_path_2).to be_a_directory + expect(version_latest_path_second).to be_a_directory expect(version_latest.versions).to include("latest") expect(version_latest.outdated_download_sha?).to be(false) end @@ -188,8 +187,8 @@ describe Cask::Upgrade, :cask do it 'does not include the Casks with "version latest" when the version did not change' do expect(version_latest).to be_installed - expect(version_latest_path_1).to be_a_directory - expect(version_latest_path_2).to be_a_directory + expect(version_latest_path_first).to be_a_directory + expect(version_latest_path_second).to be_a_directory expect(version_latest.versions).to include("latest") # Change download sha so that :latest cask decides to update itself version_latest.download_sha_path.write("fake download sha") @@ -198,16 +197,16 @@ describe Cask::Upgrade, :cask do described_class.upgrade_casks(version_latest, greedy: true, args: args) expect(version_latest).to be_installed - expect(version_latest_path_1).to be_a_directory - expect(version_latest_path_2).to be_a_directory + expect(version_latest_path_first).to be_a_directory + expect(version_latest_path_second).to be_a_directory expect(version_latest.versions).to include("latest") expect(version_latest.outdated_download_sha?).to be(false) described_class.upgrade_casks(version_latest, greedy: true, args: args) expect(version_latest).to be_installed - expect(version_latest_path_1).to be_a_directory - expect(version_latest_path_2).to be_a_directory + expect(version_latest_path_first).to be_a_directory + expect(version_latest_path_second).to be_a_directory expect(version_latest.versions).to include("latest") expect(version_latest.outdated_download_sha?).to be(false) end @@ -226,7 +225,7 @@ describe Cask::Upgrade, :cask do end before do - installed.each { |cask| Cask::Cmd::Install.run(cask) } + installed.each { |cask| Cask::Installer.new(Cask::CaskLoader.load(cask_path(cask))).install } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end @@ -399,8 +398,8 @@ describe Cask::Upgrade, :cask do expect(described_class).not_to receive(:upgrade_cask) expect(version_latest).to be_installed - expect(version_latest_path_1).to be_a_directory - expect(version_latest_path_2).to be_a_directory + expect(version_latest_path_first).to be_a_directory + expect(version_latest_path_second).to be_a_directory expect(version_latest.versions).to include("latest") # Change download sha so that :latest cask decides to update itself version_latest.download_sha_path.write("fake download sha") @@ -409,8 +408,8 @@ describe Cask::Upgrade, :cask do described_class.upgrade_casks(version_latest, dry_run: true, greedy: true, args: args) expect(version_latest).to be_installed - expect(version_latest_path_1).to be_a_directory - expect(version_latest_path_2).to be_a_directory + expect(version_latest_path_first).to be_a_directory + expect(version_latest_path_second).to be_a_directory expect(version_latest.versions).to include("latest") expect(version_latest.outdated_download_sha?).to be(true) end @@ -426,7 +425,7 @@ describe Cask::Upgrade, :cask do end before do - installed.each { |cask| Cask::Cmd::Install.run(cask) } + installed.each { |cask| Cask::Installer.new(Cask::CaskLoader.load(cask_path(cask))).install } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end @@ -482,7 +481,7 @@ describe Cask::Upgrade, :cask do end before do - installed.each { |cask| Cask::Cmd::Install.run(cask) } + installed.each { |cask| Cask::Installer.new(Cask::CaskLoader.load(cask_path(cask))).install } allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end diff --git a/Library/Homebrew/test/cask_dependent_spec.rb b/Library/Homebrew/test/cask_dependent_spec.rb index 9e6d041ae5..1d54b8064d 100644 --- a/Library/Homebrew/test/cask_dependent_spec.rb +++ b/Library/Homebrew/test/cask_dependent_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/cask_loader" diff --git a/Library/Homebrew/test/caveats_spec.rb b/Library/Homebrew/test/caveats_spec.rb index e8b394683c..8dd70569a0 100644 --- a/Library/Homebrew/test/caveats_spec.rb +++ b/Library/Homebrew/test/caveats_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/checksum_spec.rb b/Library/Homebrew/test/checksum_spec.rb index 9216126dd0..be60737e4d 100644 --- a/Library/Homebrew/test/checksum_spec.rb +++ b/Library/Homebrew/test/checksum_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "checksum" diff --git a/Library/Homebrew/test/checksum_verification_spec.rb b/Library/Homebrew/test/checksum_verification_spec.rb index 8f7ade1bbd..f0420adac9 100644 --- a/Library/Homebrew/test/checksum_verification_spec.rb +++ b/Library/Homebrew/test/checksum_verification_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/cleaner_spec.rb b/Library/Homebrew/test/cleaner_spec.rb index 9e2c76e5f1..b7ba8082de 100644 --- a/Library/Homebrew/test/cleaner_spec.rb +++ b/Library/Homebrew/test/cleaner_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cleaner" diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb index ae843e2384..345a6c5c99 100644 --- a/Library/Homebrew/test/cleanup_spec.rb +++ b/Library/Homebrew/test/cleanup_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/support/fixtures/testball" @@ -67,11 +66,11 @@ describe Homebrew::Cleanup do end context "when it can't remove a keg" do - let(:f1) { Class.new(Testball) { version "0.1" }.new } - let(:f2) { Class.new(Testball) { version "0.2" }.new } + let(:formula_zero_dot_one) { Class.new(Testball) { version "0.1" }.new } + let(:formula_zero_dot_two) { Class.new(Testball) { version "0.2" }.new } before do - [f1, f2].each do |f| + [formula_zero_dot_one, formula_zero_dot_two].each do |f| f.brew do f.install end @@ -85,13 +84,13 @@ describe Homebrew::Cleanup do end it "doesn't remove any kegs" do - cleanup.cleanup_formula f2 - expect(f1.installed_kegs.size).to eq(2) + cleanup.cleanup_formula formula_zero_dot_one + expect(formula_zero_dot_one.installed_kegs.size).to eq(2) end it "lists the unremovable kegs" do - cleanup.cleanup_formula f2 - expect(cleanup.unremovable_kegs).to contain_exactly(f1.installed_kegs[0]) + cleanup.cleanup_formula formula_zero_dot_two + expect(cleanup.unremovable_kegs).to contain_exactly(formula_zero_dot_one.installed_kegs[0]) end end end diff --git a/Library/Homebrew/test/cli/named_args_spec.rb b/Library/Homebrew/test/cli/named_args_spec.rb index e69eb4bb2b..bf1b2729b6 100644 --- a/Library/Homebrew/test/cli/named_args_spec.rb +++ b/Library/Homebrew/test/cli/named_args_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cli/named_args" diff --git a/Library/Homebrew/test/cli/parser_spec.rb b/Library/Homebrew/test/cli/parser_spec.rb index 8c9571228e..5e1f20f784 100644 --- a/Library/Homebrew/test/cli/parser_spec.rb +++ b/Library/Homebrew/test/cli/parser_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "../../cli/parser" diff --git a/Library/Homebrew/test/cmd/--cache_spec.rb b/Library/Homebrew/test/cmd/--cache_spec.rb index ca221f626a..cb371b577a 100644 --- a/Library/Homebrew/test/cmd/--cache_spec.rb +++ b/Library/Homebrew/test/cmd/--cache_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/--caskroom_spec.rb b/Library/Homebrew/test/cmd/--caskroom_spec.rb index c69005b758..bd8ec0fbd0 100644 --- a/Library/Homebrew/test/cmd/--caskroom_spec.rb +++ b/Library/Homebrew/test/cmd/--caskroom_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/--cellar_spec.rb b/Library/Homebrew/test/cmd/--cellar_spec.rb index 63c78854a0..d57bb89ed4 100644 --- a/Library/Homebrew/test/cmd/--cellar_spec.rb +++ b/Library/Homebrew/test/cmd/--cellar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/--env_spec.rb b/Library/Homebrew/test/cmd/--env_spec.rb index fd8a94fb5f..a0a848dd11 100644 --- a/Library/Homebrew/test/cmd/--env_spec.rb +++ b/Library/Homebrew/test/cmd/--env_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/--prefix_spec.rb b/Library/Homebrew/test/cmd/--prefix_spec.rb index 71940090b2..b55826b2d3 100644 --- a/Library/Homebrew/test/cmd/--prefix_spec.rb +++ b/Library/Homebrew/test/cmd/--prefix_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/--repository_spec.rb b/Library/Homebrew/test/cmd/--repository_spec.rb index 33547f7575..c435414e81 100644 --- a/Library/Homebrew/test/cmd/--repository_spec.rb +++ b/Library/Homebrew/test/cmd/--repository_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/--version_spec.rb b/Library/Homebrew/test/cmd/--version_spec.rb index 944ff2981f..94f99b3bf9 100644 --- a/Library/Homebrew/test/cmd/--version_spec.rb +++ b/Library/Homebrew/test/cmd/--version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/analytics_spec.rb b/Library/Homebrew/test/cmd/analytics_spec.rb index dc4605bec7..8cf425d95d 100644 --- a/Library/Homebrew/test/cmd/analytics_spec.rb +++ b/Library/Homebrew/test/cmd/analytics_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/autoremove_spec.rb b/Library/Homebrew/test/cmd/autoremove_spec.rb index 1644fbf009..84f9eb8970 100644 --- a/Library/Homebrew/test/cmd/autoremove_spec.rb +++ b/Library/Homebrew/test/cmd/autoremove_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/bundle_spec.rb b/Library/Homebrew/test/cmd/bundle_spec.rb index 7021ea70eb..63bb8f509f 100644 --- a/Library/Homebrew/test/cmd/bundle_spec.rb +++ b/Library/Homebrew/test/cmd/bundle_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "brew bundle", :integration_test do diff --git a/Library/Homebrew/test/cmd/cleanup_spec.rb b/Library/Homebrew/test/cmd/cleanup_spec.rb index d9b8752e3b..38068c41df 100644 --- a/Library/Homebrew/test/cmd/cleanup_spec.rb +++ b/Library/Homebrew/test/cmd/cleanup_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/commands_spec.rb b/Library/Homebrew/test/cmd/commands_spec.rb index 55742996f9..4a63056f8d 100644 --- a/Library/Homebrew/test/cmd/commands_spec.rb +++ b/Library/Homebrew/test/cmd/commands_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/commands" diff --git a/Library/Homebrew/test/cmd/completions_spec.rb b/Library/Homebrew/test/cmd/completions_spec.rb index a1ab341d50..a92a73df4c 100644 --- a/Library/Homebrew/test/cmd/completions_spec.rb +++ b/Library/Homebrew/test/cmd/completions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/config_spec.rb b/Library/Homebrew/test/cmd/config_spec.rb index e4afba0353..946e6ac841 100644 --- a/Library/Homebrew/test/cmd/config_spec.rb +++ b/Library/Homebrew/test/cmd/config_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/custom-external-command_spec.rb b/Library/Homebrew/test/cmd/custom-external-command_spec.rb index c4bec250ac..31d90752fd 100644 --- a/Library/Homebrew/test/cmd/custom-external-command_spec.rb +++ b/Library/Homebrew/test/cmd/custom-external-command_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "brew custom-external-command", :integration_test do diff --git a/Library/Homebrew/test/cmd/deps_spec.rb b/Library/Homebrew/test/cmd/deps_spec.rb index e04e698479..308e9d88f1 100644 --- a/Library/Homebrew/test/cmd/deps_spec.rb +++ b/Library/Homebrew/test/cmd/deps_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/desc_spec.rb b/Library/Homebrew/test/cmd/desc_spec.rb index bbc35d702c..f21ece3877 100644 --- a/Library/Homebrew/test/cmd/desc_spec.rb +++ b/Library/Homebrew/test/cmd/desc_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/developer_spec.rb b/Library/Homebrew/test/cmd/developer_spec.rb index 00ca2f5739..cfc2f24a9f 100644 --- a/Library/Homebrew/test/cmd/developer_spec.rb +++ b/Library/Homebrew/test/cmd/developer_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/docs_spec.rb b/Library/Homebrew/test/cmd/docs_spec.rb index eade3c152b..72488b5619 100644 --- a/Library/Homebrew/test/cmd/docs_spec.rb +++ b/Library/Homebrew/test/cmd/docs_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "brew docs" do diff --git a/Library/Homebrew/test/cmd/doctor_spec.rb b/Library/Homebrew/test/cmd/doctor_spec.rb index 000cd79072..8cb1add72d 100644 --- a/Library/Homebrew/test/cmd/doctor_spec.rb +++ b/Library/Homebrew/test/cmd/doctor_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/fetch_spec.rb b/Library/Homebrew/test/cmd/fetch_spec.rb index cdc4b870fb..08e58c4864 100644 --- a/Library/Homebrew/test/cmd/fetch_spec.rb +++ b/Library/Homebrew/test/cmd/fetch_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/gist-logs_spec.rb b/Library/Homebrew/test/cmd/gist-logs_spec.rb index f1d628f9e1..c6965e4a6d 100644 --- a/Library/Homebrew/test/cmd/gist-logs_spec.rb +++ b/Library/Homebrew/test/cmd/gist-logs_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/help_spec.rb b/Library/Homebrew/test/cmd/help_spec.rb index 6694b4b4b2..0166969dc9 100644 --- a/Library/Homebrew/test/cmd/help_spec.rb +++ b/Library/Homebrew/test/cmd/help_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "brew", :integration_test do diff --git a/Library/Homebrew/test/cmd/home_spec.rb b/Library/Homebrew/test/cmd/home_spec.rb index 9d97d07a61..a622f9d2b3 100644 --- a/Library/Homebrew/test/cmd/home_spec.rb +++ b/Library/Homebrew/test/cmd/home_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/info_spec.rb b/Library/Homebrew/test/cmd/info_spec.rb index 9189b106d9..94911348fe 100644 --- a/Library/Homebrew/test/cmd/info_spec.rb +++ b/Library/Homebrew/test/cmd/info_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/info" diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index c3aef27000..2cf96730dc 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/leaves_spec.rb b/Library/Homebrew/test/cmd/leaves_spec.rb index e8afbabed6..49fc18d045 100644 --- a/Library/Homebrew/test/cmd/leaves_spec.rb +++ b/Library/Homebrew/test/cmd/leaves_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/link_spec.rb b/Library/Homebrew/test/cmd/link_spec.rb index 021294dd4d..79c527059e 100644 --- a/Library/Homebrew/test/cmd/link_spec.rb +++ b/Library/Homebrew/test/cmd/link_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/list_spec.rb b/Library/Homebrew/test/cmd/list_spec.rb index 7c8d55610f..771db61f0d 100644 --- a/Library/Homebrew/test/cmd/list_spec.rb +++ b/Library/Homebrew/test/cmd/list_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/log_spec.rb b/Library/Homebrew/test/cmd/log_spec.rb index 909109bd8a..164df47cb7 100644 --- a/Library/Homebrew/test/cmd/log_spec.rb +++ b/Library/Homebrew/test/cmd/log_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/migrate_spec.rb b/Library/Homebrew/test/cmd/migrate_spec.rb index a562f4b9fc..8b0b6610a6 100644 --- a/Library/Homebrew/test/cmd/migrate_spec.rb +++ b/Library/Homebrew/test/cmd/migrate_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/missing_spec.rb b/Library/Homebrew/test/cmd/missing_spec.rb index ab93d64ea2..e245d9b5ba 100644 --- a/Library/Homebrew/test/cmd/missing_spec.rb +++ b/Library/Homebrew/test/cmd/missing_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/options_spec.rb b/Library/Homebrew/test/cmd/options_spec.rb index 7205437d85..f35b9c5a23 100644 --- a/Library/Homebrew/test/cmd/options_spec.rb +++ b/Library/Homebrew/test/cmd/options_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index 4f90fa2d58..bc52f6a4d9 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/pin_spec.rb b/Library/Homebrew/test/cmd/pin_spec.rb index efaf4755ff..c7ca4eb6b1 100644 --- a/Library/Homebrew/test/cmd/pin_spec.rb +++ b/Library/Homebrew/test/cmd/pin_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/postinstall_spec.rb b/Library/Homebrew/test/cmd/postinstall_spec.rb index a705e44db8..827d0bd9d6 100644 --- a/Library/Homebrew/test/cmd/postinstall_spec.rb +++ b/Library/Homebrew/test/cmd/postinstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/readall_spec.rb b/Library/Homebrew/test/cmd/readall_spec.rb index 845acd1058..19c6727dd1 100644 --- a/Library/Homebrew/test/cmd/readall_spec.rb +++ b/Library/Homebrew/test/cmd/readall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/reinstall_spec.rb b/Library/Homebrew/test/cmd/reinstall_spec.rb index 764f9db9bb..cd63a8cba1 100644 --- a/Library/Homebrew/test/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cmd/reinstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "extend/ENV" diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb index 0b0f7cc567..c3d8bee8aa 100644 --- a/Library/Homebrew/test/cmd/search_spec.rb +++ b/Library/Homebrew/test/cmd/search_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/search" diff --git a/Library/Homebrew/test/cmd/services_spec.rb b/Library/Homebrew/test/cmd/services_spec.rb index a534f65cf0..81f2ef0a84 100644 --- a/Library/Homebrew/test/cmd/services_spec.rb +++ b/Library/Homebrew/test/cmd/services_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "brew services", :integration_test, :needs_network do diff --git a/Library/Homebrew/test/cmd/shared_examples/args_parse.rb b/Library/Homebrew/test/cmd/shared_examples/args_parse.rb index 064e20ea7f..cc854c9edb 100644 --- a/Library/Homebrew/test/cmd/shared_examples/args_parse.rb +++ b/Library/Homebrew/test/cmd/shared_examples/args_parse.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true shared_examples "parseable arguments" do diff --git a/Library/Homebrew/test/cmd/tap-info_spec.rb b/Library/Homebrew/test/cmd/tap-info_spec.rb index fa2914678c..144c7d4c36 100644 --- a/Library/Homebrew/test/cmd/tap-info_spec.rb +++ b/Library/Homebrew/test/cmd/tap-info_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/tap_spec.rb b/Library/Homebrew/test/cmd/tap_spec.rb index 021dd6677f..42137d1995 100644 --- a/Library/Homebrew/test/cmd/tap_spec.rb +++ b/Library/Homebrew/test/cmd/tap_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/uninstall_spec.rb b/Library/Homebrew/test/cmd/uninstall_spec.rb index c7947d5058..89aef3b423 100644 --- a/Library/Homebrew/test/cmd/uninstall_spec.rb +++ b/Library/Homebrew/test/cmd/uninstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/uninstall" diff --git a/Library/Homebrew/test/cmd/unlink_spec.rb b/Library/Homebrew/test/cmd/unlink_spec.rb index 7c6248d103..40c389d7c8 100644 --- a/Library/Homebrew/test/cmd/unlink_spec.rb +++ b/Library/Homebrew/test/cmd/unlink_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/unpin_spec.rb b/Library/Homebrew/test/cmd/unpin_spec.rb index 4bf0de0419..6750104369 100644 --- a/Library/Homebrew/test/cmd/unpin_spec.rb +++ b/Library/Homebrew/test/cmd/unpin_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/untap_spec.rb b/Library/Homebrew/test/cmd/untap_spec.rb index 2762d110d3..abf6b17484 100644 --- a/Library/Homebrew/test/cmd/untap_spec.rb +++ b/Library/Homebrew/test/cmd/untap_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/update-report_spec.rb b/Library/Homebrew/test/cmd/update-report_spec.rb index 34f685d2eb..081cebdc57 100644 --- a/Library/Homebrew/test/cmd/update-report_spec.rb +++ b/Library/Homebrew/test/cmd/update-report_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/update-report" diff --git a/Library/Homebrew/test/cmd/upgrade_spec.rb b/Library/Homebrew/test/cmd/upgrade_spec.rb index b87dc988d4..9711e41804 100644 --- a/Library/Homebrew/test/cmd/upgrade_spec.rb +++ b/Library/Homebrew/test/cmd/upgrade_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index 7ba3786342..10977ba113 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/commands_spec.rb b/Library/Homebrew/test/commands_spec.rb index be8f748a6a..f055485071 100644 --- a/Library/Homebrew/test/commands_spec.rb +++ b/Library/Homebrew/test/commands_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "commands" diff --git a/Library/Homebrew/test/compiler_failure_spec.rb b/Library/Homebrew/test/compiler_failure_spec.rb index 75bcc5f415..ab214e20f2 100644 --- a/Library/Homebrew/test/compiler_failure_spec.rb +++ b/Library/Homebrew/test/compiler_failure_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "compilers" diff --git a/Library/Homebrew/test/compiler_selector_spec.rb b/Library/Homebrew/test/compiler_selector_spec.rb index 8862d921db..25a768947b 100644 --- a/Library/Homebrew/test/compiler_selector_spec.rb +++ b/Library/Homebrew/test/compiler_selector_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "compilers" diff --git a/Library/Homebrew/test/completions_spec.rb b/Library/Homebrew/test/completions_spec.rb index 528b0ced1c..ce7b3bdd5b 100644 --- a/Library/Homebrew/test/completions_spec.rb +++ b/Library/Homebrew/test/completions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "completions" diff --git a/Library/Homebrew/test/cxxstdlib_spec.rb b/Library/Homebrew/test/cxxstdlib_spec.rb index 9da0a32b29..b9f3c56dcc 100644 --- a/Library/Homebrew/test/cxxstdlib_spec.rb +++ b/Library/Homebrew/test/cxxstdlib_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/dependable_spec.rb b/Library/Homebrew/test/dependable_spec.rb index 9c6eb939b0..6f8ff901af 100644 --- a/Library/Homebrew/test/dependable_spec.rb +++ b/Library/Homebrew/test/dependable_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependable" diff --git a/Library/Homebrew/test/dependencies_helpers_spec.rb b/Library/Homebrew/test/dependencies_helpers_spec.rb index 4f3ab714db..4686084bce 100644 --- a/Library/Homebrew/test/dependencies_helpers_spec.rb +++ b/Library/Homebrew/test/dependencies_helpers_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependencies_helpers" diff --git a/Library/Homebrew/test/dependencies_spec.rb b/Library/Homebrew/test/dependencies_spec.rb index 23119824fa..3ea90f6482 100644 --- a/Library/Homebrew/test/dependencies_spec.rb +++ b/Library/Homebrew/test/dependencies_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependencies" diff --git a/Library/Homebrew/test/dependency_collector_spec.rb b/Library/Homebrew/test/dependency_collector_spec.rb index a12c3c6127..3f0a674eea 100644 --- a/Library/Homebrew/test/dependency_collector_spec.rb +++ b/Library/Homebrew/test/dependency_collector_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependency_collector" diff --git a/Library/Homebrew/test/dependency_expansion_spec.rb b/Library/Homebrew/test/dependency_expansion_spec.rb index 56491ea4ca..096202e27b 100644 --- a/Library/Homebrew/test/dependency_expansion_spec.rb +++ b/Library/Homebrew/test/dependency_expansion_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependency" diff --git a/Library/Homebrew/test/dependency_spec.rb b/Library/Homebrew/test/dependency_spec.rb index b20c1ef6a7..431006cb57 100644 --- a/Library/Homebrew/test/dependency_spec.rb +++ b/Library/Homebrew/test/dependency_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependency" diff --git a/Library/Homebrew/test/description_cache_store_spec.rb b/Library/Homebrew/test/description_cache_store_spec.rb index c019752512..e4abc807fa 100644 --- a/Library/Homebrew/test/description_cache_store_spec.rb +++ b/Library/Homebrew/test/description_cache_store_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/update-report" diff --git a/Library/Homebrew/test/descriptions_spec.rb b/Library/Homebrew/test/descriptions_spec.rb index 0ea978c455..05b35b1d8a 100644 --- a/Library/Homebrew/test/descriptions_spec.rb +++ b/Library/Homebrew/test/descriptions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "descriptions" diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 44722929a9..3e0156aa43 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dev-cmd/audit" diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index 35dc05c710..b8a6835a60 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb b/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb index 1843f20d89..d72d80786f 100644 --- a/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb b/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb index d785384142..e8c0137b3a 100644 --- a/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/bump-revision_spec.rb b/Library/Homebrew/test/dev-cmd/bump-revision_spec.rb index 13f8cbe136..f4c76e60d3 100644 --- a/Library/Homebrew/test/dev-cmd/bump-revision_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-revision_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb b/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb index 50b45159a7..b1f018564b 100644 --- a/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/bump_spec.rb b/Library/Homebrew/test/dev-cmd/bump_spec.rb index 66cec02776..1732192954 100644 --- a/Library/Homebrew/test/dev-cmd/bump_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/cat_spec.rb b/Library/Homebrew/test/dev-cmd/cat_spec.rb index 6a5d6a6d79..0d5702094a 100644 --- a/Library/Homebrew/test/dev-cmd/cat_spec.rb +++ b/Library/Homebrew/test/dev-cmd/cat_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/command_spec.rb b/Library/Homebrew/test/dev-cmd/command_spec.rb index 7608269e1b..49418cbb99 100644 --- a/Library/Homebrew/test/dev-cmd/command_spec.rb +++ b/Library/Homebrew/test/dev-cmd/command_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/contributions_spec.rb b/Library/Homebrew/test/dev-cmd/contributions_spec.rb index bd60333dc0..98db0c73a3 100644 --- a/Library/Homebrew/test/dev-cmd/contributions_spec.rb +++ b/Library/Homebrew/test/dev-cmd/contributions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/create_spec.rb b/Library/Homebrew/test/dev-cmd/create_spec.rb index 396bb950fa..68589217f9 100644 --- a/Library/Homebrew/test/dev-cmd/create_spec.rb +++ b/Library/Homebrew/test/dev-cmd/create_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb b/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb index 769a66a65b..c593d3cd0a 100644 --- a/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb +++ b/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dev-cmd/determine-test-runners" @@ -17,6 +16,7 @@ describe "brew determine-test-runners" do { "HOMEBREW_LINUX_RUNNER" => linux_runner, "HOMEBREW_LINUX_CLEANUP" => "false", + "HOMEBREW_MACOS_TIMEOUT" => "90", "GITHUB_RUN_ID" => ephemeral_suffix.split("-").second, "GITHUB_RUN_ATTEMPT" => ephemeral_suffix.split("-").third, }.freeze diff --git a/Library/Homebrew/test/dev-cmd/dispatch-build-bottle_spec.rb b/Library/Homebrew/test/dev-cmd/dispatch-build-bottle_spec.rb index 18363e6777..cfc4c21c64 100644 --- a/Library/Homebrew/test/dev-cmd/dispatch-build-bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/dispatch-build-bottle_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/edit_spec.rb b/Library/Homebrew/test/dev-cmd/edit_spec.rb index eb926a93e1..d406086b00 100644 --- a/Library/Homebrew/test/dev-cmd/edit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/edit_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/extract_spec.rb b/Library/Homebrew/test/dev-cmd/extract_spec.rb index 20f745e49a..e1d93846c4 100644 --- a/Library/Homebrew/test/dev-cmd/extract_spec.rb +++ b/Library/Homebrew/test/dev-cmd/extract_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/formula_spec.rb b/Library/Homebrew/test/dev-cmd/formula_spec.rb index 90af8e18be..efe9d3daa6 100644 --- a/Library/Homebrew/test/dev-cmd/formula_spec.rb +++ b/Library/Homebrew/test/dev-cmd/formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/generate-cask-api_spec.rb b/Library/Homebrew/test/dev-cmd/generate-cask-api_spec.rb index b60a443b5d..39a29b7385 100644 --- a/Library/Homebrew/test/dev-cmd/generate-cask-api_spec.rb +++ b/Library/Homebrew/test/dev-cmd/generate-cask-api_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/generate-formula-api_spec.rb b/Library/Homebrew/test/dev-cmd/generate-formula-api_spec.rb index 8c98e26b87..7afd9a13c9 100644 --- a/Library/Homebrew/test/dev-cmd/generate-formula-api_spec.rb +++ b/Library/Homebrew/test/dev-cmd/generate-formula-api_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb b/Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb index 91dc0f473a..6b913fb43a 100644 --- a/Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb +++ b/Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/irb_spec.rb b/Library/Homebrew/test/dev-cmd/irb_spec.rb index 5476ce47c3..24478f5b13 100644 --- a/Library/Homebrew/test/dev-cmd/irb_spec.rb +++ b/Library/Homebrew/test/dev-cmd/irb_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/linkage_spec.rb b/Library/Homebrew/test/dev-cmd/linkage_spec.rb index 544042408b..4e1902d671 100644 --- a/Library/Homebrew/test/dev-cmd/linkage_spec.rb +++ b/Library/Homebrew/test/dev-cmd/linkage_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/livecheck_spec.rb b/Library/Homebrew/test/dev-cmd/livecheck_spec.rb index 5166add577..2aaad5cd0e 100644 --- a/Library/Homebrew/test/dev-cmd/livecheck_spec.rb +++ b/Library/Homebrew/test/dev-cmd/livecheck_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/pr-automerge_spec.rb b/Library/Homebrew/test/dev-cmd/pr-automerge_spec.rb index 251f08c6ae..188917cf83 100644 --- a/Library/Homebrew/test/dev-cmd/pr-automerge_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pr-automerge_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/pr-publish_spec.rb b/Library/Homebrew/test/dev-cmd/pr-publish_spec.rb index 0d4c288f68..59262cd010 100644 --- a/Library/Homebrew/test/dev-cmd/pr-publish_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pr-publish_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb b/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb index 9366befe34..5b57b96a13 100644 --- a/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dev-cmd/pr-pull" @@ -81,7 +80,7 @@ describe "brew pr-pull" do let(:tap) { Tap.fetch("Homebrew", "foo") } let(:formula_file) { tap.path/"Formula/foo.rb" } let(:cask_file) { tap.cask_dir/"food.rb" } - let(:path) { (Tap::TAP_DIRECTORY/"homebrew/homebrew-foo").extend(GitRepositoryExtension) } + let(:path) { Pathname(Tap::TAP_DIRECTORY/"homebrew/homebrew-foo") } describe "#autosquash!" do it "squashes a formula or cask correctly" do @@ -98,8 +97,8 @@ describe "brew pr-pull" do File.write(formula_file, formula_version) safe_system Utils::Git.git, "commit", formula_file, "-m", "version", "--author=#{secondary_author}" described_class.autosquash!(original_hash, tap: tap) - expect(tap.path.git_commit_message).to include("foo 2.0") - expect(tap.path.git_commit_message).to include("Co-authored-by: #{secondary_author}") + expect(tap.git_repo.commit_message).to include("foo 2.0") + expect(tap.git_repo.commit_message).to include("Co-authored-by: #{secondary_author}") end (path/"Casks").mkpath @@ -113,8 +112,9 @@ describe "brew pr-pull" do File.write(cask_file, cask_version) safe_system Utils::Git.git, "commit", cask_file, "-m", "version", "--author=#{secondary_author}" described_class.autosquash!(original_hash, tap: tap) - expect(path.git_commit_message).to include("food 2.0") - expect(path.git_commit_message).to include("Co-authored-by: #{secondary_author}") + git_repo = GitRepository.new(path) + expect(git_repo.commit_message).to include("food 2.0") + expect(git_repo.commit_message).to include("Co-authored-by: #{secondary_author}") end end end @@ -128,8 +128,8 @@ describe "brew pr-pull" do safe_system Utils::Git.git, "add", formula_file safe_system Utils::Git.git, "commit", "-m", "foo 1.0 (new formula)" end - described_class.signoff!(tap.path) - expect(tap.path.git_commit_message).to include("Signed-off-by:") + described_class.signoff!(tap.git_repo) + expect(tap.git_repo.commit_message).to include("Signed-off-by:") (path/"Casks").mkpath cask_file.write(cask) @@ -137,8 +137,8 @@ describe "brew pr-pull" do safe_system Utils::Git.git, "add", cask_file safe_system Utils::Git.git, "commit", "-m", "food 1.0 (new cask)" end - described_class.signoff!(tap.path) - expect(tap.path.git_commit_message).to include("Signed-off-by:") + described_class.signoff!(tap.git_repo) + expect(tap.git_repo.commit_message).to include("Signed-off-by:") end end diff --git a/Library/Homebrew/test/dev-cmd/pr-upload_spec.rb b/Library/Homebrew/test/dev-cmd/pr-upload_spec.rb index 62dc5e7164..35de7d2b16 100644 --- a/Library/Homebrew/test/dev-cmd/pr-upload_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pr-upload_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/prof_spec.rb b/Library/Homebrew/test/dev-cmd/prof_spec.rb index cdbe09687d..eaf0e18ab0 100644 --- a/Library/Homebrew/test/dev-cmd/prof_spec.rb +++ b/Library/Homebrew/test/dev-cmd/prof_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/release_spec.rb b/Library/Homebrew/test/dev-cmd/release_spec.rb index 613f48f150..0031116bd4 100644 --- a/Library/Homebrew/test/dev-cmd/release_spec.rb +++ b/Library/Homebrew/test/dev-cmd/release_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/ruby_spec.rb b/Library/Homebrew/test/dev-cmd/ruby_spec.rb index 582c35dd7d..1d5397ca4d 100644 --- a/Library/Homebrew/test/dev-cmd/ruby_spec.rb +++ b/Library/Homebrew/test/dev-cmd/ruby_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/sh_spec.rb b/Library/Homebrew/test/dev-cmd/sh_spec.rb index 682114d07b..7761cb9964 100644 --- a/Library/Homebrew/test/dev-cmd/sh_spec.rb +++ b/Library/Homebrew/test/dev-cmd/sh_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/style_spec.rb b/Library/Homebrew/test/dev-cmd/style_spec.rb index 4cc0a879e7..b4d9f67d11 100644 --- a/Library/Homebrew/test/dev-cmd/style_spec.rb +++ b/Library/Homebrew/test/dev-cmd/style_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb index a1a24af6ed..64fe7326cd 100644 --- a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb +++ b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/test_spec.rb b/Library/Homebrew/test/dev-cmd/test_spec.rb index 4466262501..fccb80a374 100644 --- a/Library/Homebrew/test/dev-cmd/test_spec.rb +++ b/Library/Homebrew/test/dev-cmd/test_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/typecheck_spec.rb b/Library/Homebrew/test/dev-cmd/typecheck_spec.rb index 8f886bf81d..a7c09740b5 100644 --- a/Library/Homebrew/test/dev-cmd/typecheck_spec.rb +++ b/Library/Homebrew/test/dev-cmd/typecheck_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/unbottled_spec.rb b/Library/Homebrew/test/dev-cmd/unbottled_spec.rb index d4b973cbd5..438f2fa00c 100644 --- a/Library/Homebrew/test/dev-cmd/unbottled_spec.rb +++ b/Library/Homebrew/test/dev-cmd/unbottled_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/unpack_spec.rb b/Library/Homebrew/test/dev-cmd/unpack_spec.rb index 5ead154d5d..7c65583652 100644 --- a/Library/Homebrew/test/dev-cmd/unpack_spec.rb +++ b/Library/Homebrew/test/dev-cmd/unpack_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/update-license-data_spec.rb b/Library/Homebrew/test/dev-cmd/update-license-data_spec.rb index e6ff0edb19..7c292cbabc 100644 --- a/Library/Homebrew/test/dev-cmd/update-license-data_spec.rb +++ b/Library/Homebrew/test/dev-cmd/update-license-data_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb b/Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb index 8e8ad57369..122e60f43b 100644 --- a/Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb +++ b/Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/update-python-resources_spec.rb b/Library/Homebrew/test/dev-cmd/update-python-resources_spec.rb index 4cf8610971..372d0f88fe 100644 --- a/Library/Homebrew/test/dev-cmd/update-python-resources_spec.rb +++ b/Library/Homebrew/test/dev-cmd/update-python-resources_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb b/Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb index 80e57b309f..58323e5975 100644 --- a/Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb +++ b/Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb b/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb index 276026d4c4..5ca8837f28 100644 --- a/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb +++ b/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index f47c627619..8ab27219aa 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "diagnostic" diff --git a/Library/Homebrew/test/download_strategies/abstract_spec.rb b/Library/Homebrew/test/download_strategies/abstract_spec.rb index c964074fe0..c943c2131e 100644 --- a/Library/Homebrew/test/download_strategies/abstract_spec.rb +++ b/Library/Homebrew/test/download_strategies/abstract_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/curl_github_packages_spec.rb b/Library/Homebrew/test/download_strategies/curl_github_packages_spec.rb index 1cda9b052b..35d82e6dd4 100644 --- a/Library/Homebrew/test/download_strategies/curl_github_packages_spec.rb +++ b/Library/Homebrew/test/download_strategies/curl_github_packages_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/curl_post_spec.rb b/Library/Homebrew/test/download_strategies/curl_post_spec.rb index cdb73bf917..33bc2ba94c 100644 --- a/Library/Homebrew/test/download_strategies/curl_post_spec.rb +++ b/Library/Homebrew/test/download_strategies/curl_post_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/curl_spec.rb b/Library/Homebrew/test/download_strategies/curl_spec.rb index 1739ebe7f9..fc3dfb1df7 100644 --- a/Library/Homebrew/test/download_strategies/curl_spec.rb +++ b/Library/Homebrew/test/download_strategies/curl_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/detector_spec.rb b/Library/Homebrew/test/download_strategies/detector_spec.rb index 22f74faa94..24e1a42db7 100644 --- a/Library/Homebrew/test/download_strategies/detector_spec.rb +++ b/Library/Homebrew/test/download_strategies/detector_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/git_spec.rb b/Library/Homebrew/test/download_strategies/git_spec.rb index 812ca3a046..ad68fbcd7d 100644 --- a/Library/Homebrew/test/download_strategies/git_spec.rb +++ b/Library/Homebrew/test/download_strategies/git_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/github_git_spec.rb b/Library/Homebrew/test/download_strategies/github_git_spec.rb index 26948c5b1f..63c6a4789e 100644 --- a/Library/Homebrew/test/download_strategies/github_git_spec.rb +++ b/Library/Homebrew/test/download_strategies/github_git_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/subversion_spec.rb b/Library/Homebrew/test/download_strategies/subversion_spec.rb index 04eed96b85..21ac18c865 100644 --- a/Library/Homebrew/test/download_strategies/subversion_spec.rb +++ b/Library/Homebrew/test/download_strategies/subversion_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/download_strategies/vcs_spec.rb b/Library/Homebrew/test/download_strategies/vcs_spec.rb index d4406088b7..24dea6758a 100644 --- a/Library/Homebrew/test/download_strategies/vcs_spec.rb +++ b/Library/Homebrew/test/download_strategies/vcs_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "download_strategy" diff --git a/Library/Homebrew/test/env_config_spec.rb b/Library/Homebrew/test/env_config_spec.rb index 184fb12bce..814f8f2ca8 100644 --- a/Library/Homebrew/test/env_config_spec.rb +++ b/Library/Homebrew/test/env_config_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "diagnostic" diff --git a/Library/Homebrew/test/error_during_execution_spec.rb b/Library/Homebrew/test/error_during_execution_spec.rb index 51a3d306ed..ea8e3cc7d4 100644 --- a/Library/Homebrew/test/error_during_execution_spec.rb +++ b/Library/Homebrew/test/error_during_execution_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe ErrorDuringExecution do diff --git a/Library/Homebrew/test/exceptions_spec.rb b/Library/Homebrew/test/exceptions_spec.rb index 5092b0c509..984a520cf1 100644 --- a/Library/Homebrew/test/exceptions_spec.rb +++ b/Library/Homebrew/test/exceptions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "exceptions" @@ -203,10 +202,10 @@ describe "Exception" do end describe ChecksumMismatchError do - subject { described_class.new("/file.tar.gz", hash1, hash2) } + subject { described_class.new("/file.tar.gz", expected_checksum, actual_checksum) } - let(:hash1) { instance_double(Checksum, to_s: "deadbeef") } - let(:hash2) { instance_double(Checksum, to_s: "deadcafe") } + let(:expected_checksum) { instance_double(Checksum, to_s: "deadbeef") } + let(:actual_checksum) { instance_double(Checksum, to_s: "deadcafe") } its(:to_s) { is_expected.to match(/SHA256 mismatch/) } end diff --git a/Library/Homebrew/test/extend/array_spec.rb b/Library/Homebrew/test/extend/array_spec.rb index 7d422389ad..385c27a546 100644 --- a/Library/Homebrew/test/extend/array_spec.rb +++ b/Library/Homebrew/test/extend/array_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "extend/array" diff --git a/Library/Homebrew/test/extend/kernel_spec.rb b/Library/Homebrew/test/extend/kernel_spec.rb index bcd63aed12..0dbaae1fd2 100644 --- a/Library/Homebrew/test/extend/kernel_spec.rb +++ b/Library/Homebrew/test/extend/kernel_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "globally-scoped helper methods" do @@ -146,16 +145,16 @@ describe "globally-scoped helper methods" do end describe "#which_all" do - let(:cmd1) { dir/"foo" } - let(:cmd2) { dir/"bar/foo" } - let(:cmd3) { dir/"bar/baz/foo" } + let(:cmd_foo) { dir/"foo" } + let(:cmd_foo_bar) { dir/"bar/foo" } + let(:cmd_bar_baz_foo) { dir/"bar/baz/foo" } before do (dir/"bar/baz").mkpath - FileUtils.touch cmd2 + FileUtils.touch cmd_foo_bar - [cmd1, cmd3].each do |cmd| + [cmd_foo, cmd_bar_baz_foo].each do |cmd| FileUtils.touch cmd cmd.chmod 0744 end @@ -167,7 +166,7 @@ describe "globally-scoped helper methods" do "#{dir}/baz:#{dir}", "~baduserpath", ].join(File::PATH_SEPARATOR) - expect(which_all("foo", path)).to eq([cmd3, cmd1]) + expect(which_all("foo", path)).to eq([cmd_bar_baz_foo, cmd_foo]) end end diff --git a/Library/Homebrew/test/formatter_spec.rb b/Library/Homebrew/test/formatter_spec.rb index 01e929768a..84637459fe 100644 --- a/Library/Homebrew/test/formatter_spec.rb +++ b/Library/Homebrew/test/formatter_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/formatter" diff --git a/Library/Homebrew/test/formula_free_port_spec.rb b/Library/Homebrew/test/formula_free_port_spec.rb index 8aecab4f8d..834346c649 100644 --- a/Library/Homebrew/test/formula_free_port_spec.rb +++ b/Library/Homebrew/test/formula_free_port_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "socket" diff --git a/Library/Homebrew/test/formula_info_spec.rb b/Library/Homebrew/test/formula_info_spec.rb index c9c1c7a366..f9eb8b3d9b 100644 --- a/Library/Homebrew/test/formula_info_spec.rb +++ b/Library/Homebrew/test/formula_info_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula_info" diff --git a/Library/Homebrew/test/formula_installer_bottle_spec.rb b/Library/Homebrew/test/formula_installer_bottle_spec.rb index a4c969a5ff..befc23d388 100644 --- a/Library/Homebrew/test/formula_installer_bottle_spec.rb +++ b/Library/Homebrew/test/formula_installer_bottle_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/formula_installer_spec.rb b/Library/Homebrew/test/formula_installer_spec.rb index fc9701bdb3..812e0741a4 100644 --- a/Library/Homebrew/test/formula_installer_spec.rb +++ b/Library/Homebrew/test/formula_installer_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/formula_pin_spec.rb b/Library/Homebrew/test/formula_pin_spec.rb index ff133b298a..e0c0ca676b 100644 --- a/Library/Homebrew/test/formula_pin_spec.rb +++ b/Library/Homebrew/test/formula_pin_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula_pin" diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 056004cab1..e4f46b3107 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/support/fixtures/testball" diff --git a/Library/Homebrew/test/formula_spec_selection_spec.rb b/Library/Homebrew/test/formula_spec_selection_spec.rb index 587d0d1ff6..a03f11b96b 100644 --- a/Library/Homebrew/test/formula_spec_selection_spec.rb +++ b/Library/Homebrew/test/formula_spec_selection_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/formula_support/keg_only_reason_spec.rb b/Library/Homebrew/test/formula_support/keg_only_reason_spec.rb index 1186e5851f..3574e93dfc 100644 --- a/Library/Homebrew/test/formula_support/keg_only_reason_spec.rb +++ b/Library/Homebrew/test/formula_support/keg_only_reason_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula_support" diff --git a/Library/Homebrew/test/formula_validation_spec.rb b/Library/Homebrew/test/formula_validation_spec.rb index 8568d3a6a8..8e2a08bd11 100644 --- a/Library/Homebrew/test/formula_validation_spec.rb +++ b/Library/Homebrew/test/formula_validation_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 85cf0c6ae0..5e3ac4950d 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" @@ -271,7 +270,7 @@ describe Formulary do "conflicts_with" => ["conflicting_formula"], "conflicts_with_reasons" => ["it does"], "link_overwrite" => ["bin/abc"], - "caveats" => "example caveat string", + "caveats" => "example caveat string\n/$HOME\n$HOMEBREW_PREFIX", "service" => { "run" => ["$HOMEBREW_PREFIX/opt/formula_name/bin/beanstalkd", "test"], "run_type" => "immediate", @@ -357,7 +356,7 @@ describe Formulary do expect(formula.conflicts.map(&:reason)).to include "it does" expect(formula.class.link_overwrite_paths).to include "bin/abc" - expect(formula.caveats).to eq "example caveat string" + expect(formula.caveats).to eq "example caveat string\n#{Dir.home}\n#{HOMEBREW_PREFIX}" expect(formula).to be_a_service expect(formula.service.command).to eq(["#{HOMEBREW_PREFIX}/opt/formula_name/bin/beanstalkd", "test"]) diff --git a/Library/Homebrew/test/github_runner_matrix_spec.rb b/Library/Homebrew/test/github_runner_matrix_spec.rb index 37e8260f9d..92201d3693 100644 --- a/Library/Homebrew/test/github_runner_matrix_spec.rb +++ b/Library/Homebrew/test/github_runner_matrix_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "github_runner_matrix" @@ -8,6 +7,7 @@ describe GitHubRunnerMatrix do before do allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_RUNNER").and_return("ubuntu-latest") allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_CLEANUP").and_return("false") + allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_TIMEOUT").and_return("90") allow(ENV).to receive(:fetch).with("GITHUB_RUN_ID").and_return("12345") allow(ENV).to receive(:fetch).with("GITHUB_RUN_ATTEMPT").and_return("1") end diff --git a/Library/Homebrew/test/github_runner_spec.rb b/Library/Homebrew/test/github_runner_spec.rb index 04cfa8d595..f869363f21 100644 --- a/Library/Homebrew/test/github_runner_spec.rb +++ b/Library/Homebrew/test/github_runner_spec.rb @@ -1,11 +1,10 @@ -# typed: false # frozen_string_literal: true require "github_runner" describe GitHubRunner do let(:runner) do - spec = MacOSRunnerSpec.new(name: "macOS 11-arm64", runner: "11-arm64", cleanup: true) + spec = MacOSRunnerSpec.new(name: "macOS 11-arm64", runner: "11-arm64", timeout: 90, cleanup: true) version = OS::Mac::Version.new("11") described_class.new(platform: :macos, arch: :arm64, spec: spec, macos_version: version) end diff --git a/Library/Homebrew/test/global_spec.rb b/Library/Homebrew/test/global_spec.rb index a8469f9b58..5ed21a6196 100644 --- a/Library/Homebrew/test/global_spec.rb +++ b/Library/Homebrew/test/global_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "brew", :integration_test do @@ -18,4 +17,9 @@ describe "brew", :integration_test do # ActiveSupport inflections are slow to load, so we don't use them. expect { ActiveSupport::Inflector }.to raise_error(NameError) end + + it "does not require Nokogiri" do + # The latest version of Nokogiri for Ruby 2.6 has multiple CVEs. + expect { Nokogiri }.to raise_error(NameError) + end end diff --git a/Library/Homebrew/test/hardware/cpu_spec.rb b/Library/Homebrew/test/hardware/cpu_spec.rb index aa432e0ff3..f727409616 100644 --- a/Library/Homebrew/test/hardware/cpu_spec.rb +++ b/Library/Homebrew/test/hardware/cpu_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "hardware" diff --git a/Library/Homebrew/test/installed_dependents_spec.rb b/Library/Homebrew/test/installed_dependents_spec.rb index f6721bd895..04c5f5beaa 100644 --- a/Library/Homebrew/test/installed_dependents_spec.rb +++ b/Library/Homebrew/test/installed_dependents_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "installed_dependents" diff --git a/Library/Homebrew/test/keg_relocate/binary_relocation_spec.rb b/Library/Homebrew/test/keg_relocate/binary_relocation_spec.rb index 29bf25703a..d9eb2d5baa 100644 --- a/Library/Homebrew/test/keg_relocate/binary_relocation_spec.rb +++ b/Library/Homebrew/test/keg_relocate/binary_relocation_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "keg_relocate" diff --git a/Library/Homebrew/test/keg_relocate/grep_spec.rb b/Library/Homebrew/test/keg_relocate/grep_spec.rb index 889ed7904c..63e98f7429 100644 --- a/Library/Homebrew/test/keg_relocate/grep_spec.rb +++ b/Library/Homebrew/test/keg_relocate/grep_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "keg_relocate" diff --git a/Library/Homebrew/test/keg_relocate/relocation_spec.rb b/Library/Homebrew/test/keg_relocate/relocation_spec.rb index 36cdbdc18a..42b824dc33 100644 --- a/Library/Homebrew/test/keg_relocate/relocation_spec.rb +++ b/Library/Homebrew/test/keg_relocate/relocation_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "keg_relocate" diff --git a/Library/Homebrew/test/keg_relocate/text_spec.rb b/Library/Homebrew/test/keg_relocate/text_spec.rb index 71e5ccdd6e..122d8fa4e8 100644 --- a/Library/Homebrew/test/keg_relocate/text_spec.rb +++ b/Library/Homebrew/test/keg_relocate/text_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "keg_relocate" diff --git a/Library/Homebrew/test/keg_spec.rb b/Library/Homebrew/test/keg_spec.rb index cbe845f3ce..b0578ae43f 100644 --- a/Library/Homebrew/test/keg_spec.rb +++ b/Library/Homebrew/test/keg_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "keg" diff --git a/Library/Homebrew/test/language/go_spec.rb b/Library/Homebrew/test/language/go_spec.rb index b2c3212ad9..ac631f38cc 100644 --- a/Library/Homebrew/test/language/go_spec.rb +++ b/Library/Homebrew/test/language/go_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/go" diff --git a/Library/Homebrew/test/language/java_spec.rb b/Library/Homebrew/test/language/java_spec.rb index 24cd5aa052..af73ada543 100644 --- a/Library/Homebrew/test/language/java_spec.rb +++ b/Library/Homebrew/test/language/java_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/java" diff --git a/Library/Homebrew/test/language/node_spec.rb b/Library/Homebrew/test/language/node_spec.rb index 36f1eefd8c..0dddf376f8 100644 --- a/Library/Homebrew/test/language/node_spec.rb +++ b/Library/Homebrew/test/language/node_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/node" diff --git a/Library/Homebrew/test/language/perl/shebang_spec.rb b/Library/Homebrew/test/language/perl/shebang_spec.rb index 4d6a1fd579..a6dee15226 100644 --- a/Library/Homebrew/test/language/perl/shebang_spec.rb +++ b/Library/Homebrew/test/language/perl/shebang_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/perl" @@ -35,7 +34,7 @@ describe Language::Perl::Shebang do it "can be used to replace Perl shebangs" do allow(Formulary).to receive(:factory) allow(Formulary).to receive(:factory).with(perl_f.name).and_return(perl_f) - Utils::Shebang.rewrite_shebang described_class.detected_perl_shebang(f), file + Utils::Shebang.rewrite_shebang described_class.detected_perl_shebang(f), file.path expected_shebang = if OS.mac? "/usr/bin/perl#{MacOS.preferred_perl_version}" diff --git a/Library/Homebrew/test/language/python/shebang_spec.rb b/Library/Homebrew/test/language/python/shebang_spec.rb index 9d191f1b92..33a553a4d7 100644 --- a/Library/Homebrew/test/language/python/shebang_spec.rb +++ b/Library/Homebrew/test/language/python/shebang_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/python" @@ -35,7 +34,9 @@ describe Language::Python::Shebang do it "can be used to replace Python shebangs" do allow(Formulary).to receive(:factory) allow(Formulary).to receive(:factory).with(python_f.name).and_return(python_f) - Utils::Shebang.rewrite_shebang described_class.detected_python_shebang(f, use_python_from_path: false), file + Utils::Shebang.rewrite_shebang( + described_class.detected_python_shebang(f, use_python_from_path: false), file.path + ) expect(File.read(file)).to eq <<~EOS #!#{HOMEBREW_PREFIX}/opt/python@3.11/bin/python3.11 @@ -46,7 +47,9 @@ describe Language::Python::Shebang do end it "can be pointed to a `python3` in PATH" do - Utils::Shebang.rewrite_shebang described_class.detected_python_shebang(f, use_python_from_path: true), file + Utils::Shebang.rewrite_shebang( + described_class.detected_python_shebang(f, use_python_from_path: true), file.path + ) expect(File.read(file)).to eq <<~EOS #!/usr/bin/env python3 diff --git a/Library/Homebrew/test/language/python/virtualenv_spec.rb b/Library/Homebrew/test/language/python/virtualenv_spec.rb index f5e03653db..4569654dd8 100644 --- a/Library/Homebrew/test/language/python/virtualenv_spec.rb +++ b/Library/Homebrew/test/language/python/virtualenv_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/python" diff --git a/Library/Homebrew/test/language/python_spec.rb b/Library/Homebrew/test/language/python_spec.rb index 6446b40d56..49943f2923 100644 --- a/Library/Homebrew/test/language/python_spec.rb +++ b/Library/Homebrew/test/language/python_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "language/python" diff --git a/Library/Homebrew/test/lazy_object_spec.rb b/Library/Homebrew/test/lazy_object_spec.rb index fabbe610e7..8afb69e3cc 100644 --- a/Library/Homebrew/test/lazy_object_spec.rb +++ b/Library/Homebrew/test/lazy_object_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "lazy_object" diff --git a/Library/Homebrew/test/linkage_cache_store_spec.rb b/Library/Homebrew/test/linkage_cache_store_spec.rb index 37ca32078e..23fc2a9229 100644 --- a/Library/Homebrew/test/linkage_cache_store_spec.rb +++ b/Library/Homebrew/test/linkage_cache_store_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "linkage_cache_store" diff --git a/Library/Homebrew/test/linux_runner_spec_spec.rb b/Library/Homebrew/test/linux_runner_spec_spec.rb index 0f3add6594..1c63d63615 100644 --- a/Library/Homebrew/test/linux_runner_spec_spec.rb +++ b/Library/Homebrew/test/linux_runner_spec_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "linux_runner_spec" diff --git a/Library/Homebrew/test/livecheck/livecheck_spec.rb b/Library/Homebrew/test/livecheck/livecheck_spec.rb index bf436ab1aa..9f3d090c9d 100644 --- a/Library/Homebrew/test/livecheck/livecheck_spec.rb +++ b/Library/Homebrew/test/livecheck/livecheck_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/livecheck" diff --git a/Library/Homebrew/test/livecheck/livecheck_version_spec.rb b/Library/Homebrew/test/livecheck/livecheck_version_spec.rb index 6e7bc4d880..4307780418 100644 --- a/Library/Homebrew/test/livecheck/livecheck_version_spec.rb +++ b/Library/Homebrew/test/livecheck/livecheck_version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/livecheck_version" diff --git a/Library/Homebrew/test/livecheck/skip_conditions_spec.rb b/Library/Homebrew/test/livecheck/skip_conditions_spec.rb index 5b34d12c75..8e7bde04e9 100644 --- a/Library/Homebrew/test/livecheck/skip_conditions_spec.rb +++ b/Library/Homebrew/test/livecheck/skip_conditions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/skip_conditions" diff --git a/Library/Homebrew/test/livecheck/strategy/apache_spec.rb b/Library/Homebrew/test/livecheck/strategy/apache_spec.rb index 1450df0eae..624ddaedfb 100644 --- a/Library/Homebrew/test/livecheck/strategy/apache_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/apache_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/bitbucket_spec.rb b/Library/Homebrew/test/livecheck/strategy/bitbucket_spec.rb index 7f9108daa3..70bd2cfe83 100644 --- a/Library/Homebrew/test/livecheck/strategy/bitbucket_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/bitbucket_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/cpan_spec.rb b/Library/Homebrew/test/livecheck/strategy/cpan_spec.rb index 39c8327115..db0fc54909 100644 --- a/Library/Homebrew/test/livecheck/strategy/cpan_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/cpan_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb b/Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb index 98d615b264..6534d6d5e2 100644 --- a/Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/extract_plist_spec.rb b/Library/Homebrew/test/livecheck/strategy/extract_plist_spec.rb index 2d0436d392..3cf72bd072 100644 --- a/Library/Homebrew/test/livecheck/strategy/extract_plist_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/extract_plist_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/git_spec.rb b/Library/Homebrew/test/livecheck/strategy/git_spec.rb index b141624d29..901cea21a4 100644 --- a/Library/Homebrew/test/livecheck/strategy/git_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/git_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/github_latest_spec.rb b/Library/Homebrew/test/livecheck/strategy/github_latest_spec.rb index a6338272bf..d5307c5c35 100644 --- a/Library/Homebrew/test/livecheck/strategy/github_latest_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/github_latest_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/github_latest" diff --git a/Library/Homebrew/test/livecheck/strategy/gnome_spec.rb b/Library/Homebrew/test/livecheck/strategy/gnome_spec.rb index 65c6e43167..1062e1f6fd 100644 --- a/Library/Homebrew/test/livecheck/strategy/gnome_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/gnome_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/gnome" diff --git a/Library/Homebrew/test/livecheck/strategy/gnu_spec.rb b/Library/Homebrew/test/livecheck/strategy/gnu_spec.rb index b73535e67f..482e6c10b9 100644 --- a/Library/Homebrew/test/livecheck/strategy/gnu_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/gnu_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/gnu" diff --git a/Library/Homebrew/test/livecheck/strategy/hackage_spec.rb b/Library/Homebrew/test/livecheck/strategy/hackage_spec.rb index fbf0e7b4c8..8535107198 100644 --- a/Library/Homebrew/test/livecheck/strategy/hackage_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/hackage_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/hackage" diff --git a/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb b/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb index b389020af4..d48813b6b2 100644 --- a/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/header_match_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/json_spec.rb b/Library/Homebrew/test/livecheck/strategy/json_spec.rb index 3bc4f603b2..bdb4c59b96 100644 --- a/Library/Homebrew/test/livecheck/strategy/json_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/json_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/launchpad_spec.rb b/Library/Homebrew/test/livecheck/strategy/launchpad_spec.rb index c5bfbd3b98..4ae1bfb2ec 100644 --- a/Library/Homebrew/test/livecheck/strategy/launchpad_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/launchpad_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/launchpad" diff --git a/Library/Homebrew/test/livecheck/strategy/npm_spec.rb b/Library/Homebrew/test/livecheck/strategy/npm_spec.rb index fe48d01ff4..5267b0bddc 100644 --- a/Library/Homebrew/test/livecheck/strategy/npm_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/npm_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/npm" diff --git a/Library/Homebrew/test/livecheck/strategy/page_match_spec.rb b/Library/Homebrew/test/livecheck/strategy/page_match_spec.rb index 659c8ea1ac..a5f43f14f8 100644 --- a/Library/Homebrew/test/livecheck/strategy/page_match_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/page_match_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/pypi_spec.rb b/Library/Homebrew/test/livecheck/strategy/pypi_spec.rb index fc13f61b06..a0bba3a8df 100644 --- a/Library/Homebrew/test/livecheck/strategy/pypi_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/pypi_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/sourceforge_spec.rb b/Library/Homebrew/test/livecheck/strategy/sourceforge_spec.rb index e57fecce71..5940cd9818 100644 --- a/Library/Homebrew/test/livecheck/strategy/sourceforge_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/sourceforge_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/sourceforge" diff --git a/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb b/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb index eaf2742eb5..29701a0d17 100644 --- a/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/xml_spec.rb b/Library/Homebrew/test/livecheck/strategy/xml_spec.rb index 4d43252fe0..51cc36f923 100644 --- a/Library/Homebrew/test/livecheck/strategy/xml_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/xml_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy/xorg_spec.rb b/Library/Homebrew/test/livecheck/strategy/xorg_spec.rb index f74cc2197a..45cf73a28a 100644 --- a/Library/Homebrew/test/livecheck/strategy/xorg_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/xorg_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy/xorg" diff --git a/Library/Homebrew/test/livecheck/strategy/yaml_spec.rb b/Library/Homebrew/test/livecheck/strategy/yaml_spec.rb index 06b0535124..87dcf019d4 100644 --- a/Library/Homebrew/test/livecheck/strategy/yaml_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy/yaml_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck/strategy_spec.rb b/Library/Homebrew/test/livecheck/strategy_spec.rb index 7dd926fb40..7721757798 100644 --- a/Library/Homebrew/test/livecheck/strategy_spec.rb +++ b/Library/Homebrew/test/livecheck/strategy_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "livecheck/strategy" diff --git a/Library/Homebrew/test/livecheck_spec.rb b/Library/Homebrew/test/livecheck_spec.rb index 79c621bef8..be7d9249a1 100644 --- a/Library/Homebrew/test/livecheck_spec.rb +++ b/Library/Homebrew/test/livecheck_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/locale_spec.rb b/Library/Homebrew/test/locale_spec.rb index b20d275ced..fea66e26b1 100644 --- a/Library/Homebrew/test/locale_spec.rb +++ b/Library/Homebrew/test/locale_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "locale" diff --git a/Library/Homebrew/test/lock_file_spec.rb b/Library/Homebrew/test/lock_file_spec.rb index f58d424313..08881fd38d 100644 --- a/Library/Homebrew/test/lock_file_spec.rb +++ b/Library/Homebrew/test/lock_file_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "lock_file" diff --git a/Library/Homebrew/test/macos_runner_spec_spec.rb b/Library/Homebrew/test/macos_runner_spec_spec.rb index 3c56c72805..e0711b1909 100644 --- a/Library/Homebrew/test/macos_runner_spec_spec.rb +++ b/Library/Homebrew/test/macos_runner_spec_spec.rb @@ -1,13 +1,12 @@ -# typed: false # frozen_string_literal: true require "macos_runner_spec" describe MacOSRunnerSpec do - let(:spec) { described_class.new(name: "macOS 11-arm64", runner: "11-arm64", cleanup: true) } + let(:spec) { described_class.new(name: "macOS 11-arm64", runner: "11-arm64", timeout: 90, cleanup: true) } it "has immutable attributes" do - [:name, :runner, :cleanup].each do |attribute| + [:name, :runner, :timeout, :cleanup].each do |attribute| expect(spec.respond_to?("#{attribute}=")).to be(false) end end diff --git a/Library/Homebrew/test/messages_spec.rb b/Library/Homebrew/test/messages_spec.rb index ad41e01b5c..390883c6a2 100644 --- a/Library/Homebrew/test/messages_spec.rb +++ b/Library/Homebrew/test/messages_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "messages" diff --git a/Library/Homebrew/test/migrator_spec.rb b/Library/Homebrew/test/migrator_spec.rb index f6f3a97bf0..86d830db16 100644 --- a/Library/Homebrew/test/migrator_spec.rb +++ b/Library/Homebrew/test/migrator_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "migrator" diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index 84e96336bd..4bbdf58325 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "missing_formula" diff --git a/Library/Homebrew/test/options/deprecated_option_spec.rb b/Library/Homebrew/test/options/deprecated_option_spec.rb index 78eaec475f..4915e3bfdd 100644 --- a/Library/Homebrew/test/options/deprecated_option_spec.rb +++ b/Library/Homebrew/test/options/deprecated_option_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "options" diff --git a/Library/Homebrew/test/options/option_spec.rb b/Library/Homebrew/test/options/option_spec.rb index 0300763188..ce35690415 100644 --- a/Library/Homebrew/test/options/option_spec.rb +++ b/Library/Homebrew/test/options/option_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "options" diff --git a/Library/Homebrew/test/options_spec.rb b/Library/Homebrew/test/options_spec.rb index e97c4a7b4a..3138e05456 100644 --- a/Library/Homebrew/test/options_spec.rb +++ b/Library/Homebrew/test/options_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "options" diff --git a/Library/Homebrew/test/os/linux/dependency_collector_spec.rb b/Library/Homebrew/test/os/linux/dependency_collector_spec.rb index 8943f93ac4..b213e77e6c 100644 --- a/Library/Homebrew/test/os/linux/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/linux/dependency_collector_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependency_collector" diff --git a/Library/Homebrew/test/os/linux/diagnostic_spec.rb b/Library/Homebrew/test/os/linux/diagnostic_spec.rb index b97268677a..076604fb3b 100644 --- a/Library/Homebrew/test/os/linux/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/linux/diagnostic_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "diagnostic" diff --git a/Library/Homebrew/test/os/linux/formula_spec.rb b/Library/Homebrew/test/os/linux/formula_spec.rb index 7b585ab2f7..3b85a88400 100644 --- a/Library/Homebrew/test/os/linux/formula_spec.rb +++ b/Library/Homebrew/test/os/linux/formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/support/fixtures/testball" diff --git a/Library/Homebrew/test/os/linux/pathname_spec.rb b/Library/Homebrew/test/os/linux/pathname_spec.rb index 45d41849af..7dec7b60dd 100644 --- a/Library/Homebrew/test/os/linux/pathname_spec.rb +++ b/Library/Homebrew/test/os/linux/pathname_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "extend/pathname" diff --git a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb index e28e5ace58..fe0af3a0a4 100644 --- a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "dependency_collector" diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index b51ac02193..314dd7ef78 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "diagnostic" diff --git a/Library/Homebrew/test/os/mac/formula_spec.rb b/Library/Homebrew/test/os/mac/formula_spec.rb index 9cb4685493..593c5fdebf 100644 --- a/Library/Homebrew/test/os/mac/formula_spec.rb +++ b/Library/Homebrew/test/os/mac/formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test/support/fixtures/testball" diff --git a/Library/Homebrew/test/os/mac/keg_spec.rb b/Library/Homebrew/test/os/mac/keg_spec.rb index 267d510135..cb577f76ab 100644 --- a/Library/Homebrew/test/os/mac/keg_spec.rb +++ b/Library/Homebrew/test/os/mac/keg_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "keg" diff --git a/Library/Homebrew/test/os/mac/mach_spec.rb b/Library/Homebrew/test/os/mac/mach_spec.rb index a5c35eef73..f33db3d78d 100644 --- a/Library/Homebrew/test/os/mac/mach_spec.rb +++ b/Library/Homebrew/test/os/mac/mach_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe "Mach-O" do diff --git a/Library/Homebrew/test/os/mac/pkgconfig_spec.rb b/Library/Homebrew/test/os/mac/pkgconfig_spec.rb index af624d9c86..c3ad3f3ec3 100644 --- a/Library/Homebrew/test/os/mac/pkgconfig_spec.rb +++ b/Library/Homebrew/test/os/mac/pkgconfig_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true # These tests assume the needed SDKs are correctly installed, i.e. `brew doctor` passes. diff --git a/Library/Homebrew/test/os/mac/sdk_spec.rb b/Library/Homebrew/test/os/mac/sdk_spec.rb index 55c18aa221..ad3c731d75 100644 --- a/Library/Homebrew/test/os/mac/sdk_spec.rb +++ b/Library/Homebrew/test/os/mac/sdk_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe OS::Mac::CLTSDKLocator do diff --git a/Library/Homebrew/test/os/mac/version_spec.rb b/Library/Homebrew/test/os/mac/version_spec.rb index fd49a4c173..20c7734c05 100644 --- a/Library/Homebrew/test/os/mac/version_spec.rb +++ b/Library/Homebrew/test/os/mac/version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "version" diff --git a/Library/Homebrew/test/os/mac_spec.rb b/Library/Homebrew/test/os/mac_spec.rb index 1379cc3993..97f7c71043 100644 --- a/Library/Homebrew/test/os/mac_spec.rb +++ b/Library/Homebrew/test/os/mac_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "locale" diff --git a/Library/Homebrew/test/os/os_spec.rb b/Library/Homebrew/test/os/os_spec.rb index 6d60525810..1e671f67a5 100644 --- a/Library/Homebrew/test/os/os_spec.rb +++ b/Library/Homebrew/test/os/os_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe OS do diff --git a/Library/Homebrew/test/patch_spec.rb b/Library/Homebrew/test/patch_spec.rb index 676b7d60f8..bb62001488 100644 --- a/Library/Homebrew/test/patch_spec.rb +++ b/Library/Homebrew/test/patch_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "patch" diff --git a/Library/Homebrew/test/patching_spec.rb b/Library/Homebrew/test/patching_spec.rb index 10309fdbde..4f7ee93bb4 100644 --- a/Library/Homebrew/test/patching_spec.rb +++ b/Library/Homebrew/test/patching_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/pathname_spec.rb b/Library/Homebrew/test/pathname_spec.rb index 4c3499ad6f..0e587068db 100644 --- a/Library/Homebrew/test/pathname_spec.rb +++ b/Library/Homebrew/test/pathname_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "extend/pathname" diff --git a/Library/Homebrew/test/pkg_version_spec.rb b/Library/Homebrew/test/pkg_version_spec.rb index f1e49c7769..e4bedd09e0 100644 --- a/Library/Homebrew/test/pkg_version_spec.rb +++ b/Library/Homebrew/test/pkg_version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "pkg_version" @@ -77,15 +76,14 @@ describe PkgVersion do end describe "#hash" do - let(:p1) { described_class.new(Version.create("1.0"), 1) } - let(:p2) { described_class.new(Version.create("1.0"), 1) } - let(:p3) { described_class.new(Version.create("1.1"), 1) } - let(:p4) { described_class.new(Version.create("1.0"), 0) } + let(:version_one_revision_one) { described_class.new(Version.create("1.0"), 1) } + let(:version_one_dot_one_revision_one) { described_class.new(Version.create("1.1"), 1) } + let(:version_one_revision_zero) { described_class.new(Version.create("1.0"), 0) } it "returns a hash based on the version and revision" do - expect(p1.hash).to eq(p2.hash) - expect(p1.hash).not_to eq(p3.hash) - expect(p1.hash).not_to eq(p4.hash) + expect(version_one_revision_one.hash).to eq(described_class.new(Version.create("1.0"), 1).hash) + expect(version_one_revision_one.hash).not_to eq(version_one_dot_one_revision_one.hash) + expect(version_one_revision_one.hash).not_to eq(version_one_revision_zero.hash) end end diff --git a/Library/Homebrew/test/requirement_spec.rb b/Library/Homebrew/test/requirement_spec.rb index 0daefeecef..19771dd995 100644 --- a/Library/Homebrew/test/requirement_spec.rb +++ b/Library/Homebrew/test/requirement_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "extend/ENV" diff --git a/Library/Homebrew/test/requirements/arch_requirement_spec.rb b/Library/Homebrew/test/requirements/arch_requirement_spec.rb index 0eb369c07c..1dcbbf87a4 100644 --- a/Library/Homebrew/test/requirements/arch_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/arch_requirement_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "requirements/arch_requirement" diff --git a/Library/Homebrew/test/requirements/codesign_requirement_spec.rb b/Library/Homebrew/test/requirements/codesign_requirement_spec.rb index d2ffe5c36b..02da1bff60 100644 --- a/Library/Homebrew/test/requirements/codesign_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/codesign_requirement_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "requirements/codesign_requirement" diff --git a/Library/Homebrew/test/requirements/linux_requirement_spec.rb b/Library/Homebrew/test/requirements/linux_requirement_spec.rb index 9187f5b542..cb8d3a34d5 100644 --- a/Library/Homebrew/test/requirements/linux_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/linux_requirement_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "requirements/linux_requirement" diff --git a/Library/Homebrew/test/requirements/macos_requirement_spec.rb b/Library/Homebrew/test/requirements/macos_requirement_spec.rb index 28e32b0d8c..c4dc2affbf 100644 --- a/Library/Homebrew/test/requirements/macos_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/macos_requirement_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "requirements/macos_requirement" diff --git a/Library/Homebrew/test/requirements_spec.rb b/Library/Homebrew/test/requirements_spec.rb index e271a0073e..6002eea055 100644 --- a/Library/Homebrew/test/requirements_spec.rb +++ b/Library/Homebrew/test/requirements_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "requirements" diff --git a/Library/Homebrew/test/resource_spec.rb b/Library/Homebrew/test/resource_spec.rb index f2de39aa79..9b618980fb 100644 --- a/Library/Homebrew/test/resource_spec.rb +++ b/Library/Homebrew/test/resource_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "resource" diff --git a/Library/Homebrew/test/rubocop_spec.rb b/Library/Homebrew/test/rubocop_spec.rb index 707d936e0d..39892b7e70 100644 --- a/Library/Homebrew/test/rubocop_spec.rb +++ b/Library/Homebrew/test/rubocop_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "open3" diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb index 2567d8c4f8..a611a35ee2 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/bottle" diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb index 27cf4f7b20..eca0786bb8 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/bottle" diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb index 56669eb009..6f2be88b9e 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/bottle" diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb index f40b2e5ad8..c90508a855 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/bottle" diff --git a/Library/Homebrew/test/rubocops/cask/desc_spec.rb b/Library/Homebrew/test/rubocops/cask/desc_spec.rb index c6fa850edf..77688913f6 100644 --- a/Library/Homebrew/test/rubocops/cask/desc_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/desc_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb index 13962ddcf1..d7c9acaa75 100644 --- a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb b/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb index 812f2e3844..d54e2e3b89 100644 --- a/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb b/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb index 0bd4639a5d..187ee582fb 100644 --- a/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb b/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb index 9a298d4a63..4bf93898d6 100644 --- a/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb b/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb index 49b09a0d83..6436b09c95 100644 --- a/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb +++ b/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true module CaskCop diff --git a/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb index 46e8bc6973..bc5fea59b0 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" @@ -579,38 +578,5 @@ describe RuboCop::Cop::Cask::StanzaGrouping do include_examples "autocorrects source" end - - # TODO: Maybe this should be fixed too? - describe "inner erroneously grouped nested livecheck block contents are ignored" do - let(:source) do - <<~CASK - cask 'foo' do - on_arm do - version "1.0.2" - sha256 :no_check - - url "https://foo.brew.sh/foo-arm.zip" - - livecheck do - url "https://foo.brew.sh/foo-arm-versions.html" - end - end - on_intel do - version "0.9.8" - sha256 :no_check - - url "https://foo.brew.sh/foo-intel.zip" - - livecheck do - regex(/RegExhibit\s+(\d+(?:.\d+)+)/i) - url "https://foo.brew.sh/foo-intel-versions.html" - end - end - end - CASK - end - - include_examples "does not report any offenses" - end end end diff --git a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb index 1d1eebdd22..b7357cd744 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb b/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb index e6206a5b53..6c8f155d75 100644 --- a/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/url_spec.rb b/Library/Homebrew/test/rubocops/cask/url_spec.rb index 9518d7127d..80e716ae4d 100644 --- a/Library/Homebrew/test/rubocops/cask/url_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/url_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/cask/variables_spec.rb b/Library/Homebrew/test/rubocops/cask/variables_spec.rb index 816f9793d2..6ae8895940 100644 --- a/Library/Homebrew/test/rubocops/cask/variables_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/variables_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/test/rubocops/caveats_spec.rb b/Library/Homebrew/test/rubocops/caveats_spec.rb index e37536e4a0..ceed20bfa3 100644 --- a/Library/Homebrew/test/rubocops/caveats_spec.rb +++ b/Library/Homebrew/test/rubocops/caveats_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/caveats" diff --git a/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb b/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb index bbad493d6b..d2905f3de5 100644 --- a/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/checksum" diff --git a/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb b/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb index b8b791cb06..4b9f65c680 100644 --- a/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/checksum" diff --git a/Library/Homebrew/test/rubocops/class/class_name_spec.rb b/Library/Homebrew/test/rubocops/class/class_name_spec.rb index 05eda81a29..b280107898 100644 --- a/Library/Homebrew/test/rubocops/class/class_name_spec.rb +++ b/Library/Homebrew/test/rubocops/class/class_name_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/class" diff --git a/Library/Homebrew/test/rubocops/class/test_present.rb b/Library/Homebrew/test/rubocops/class/test_present.rb index 2728fcc074..ad3e1b7601 100644 --- a/Library/Homebrew/test/rubocops/class/test_present.rb +++ b/Library/Homebrew/test/rubocops/class/test_present.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/class" diff --git a/Library/Homebrew/test/rubocops/class/test_spec.rb b/Library/Homebrew/test/rubocops/class/test_spec.rb index b9a8388c8e..1d16648f1c 100644 --- a/Library/Homebrew/test/rubocops/class/test_spec.rb +++ b/Library/Homebrew/test/rubocops/class/test_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/class" diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index f031ddc69e..b09bd88cf4 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/components_order" diff --git a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb index 9ed06cb4e4..364f73f785 100644 --- a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb +++ b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/components_redundancy" diff --git a/Library/Homebrew/test/rubocops/conflicts_spec.rb b/Library/Homebrew/test/rubocops/conflicts_spec.rb index c9cc07dfa7..7dcc422e1e 100644 --- a/Library/Homebrew/test/rubocops/conflicts_spec.rb +++ b/Library/Homebrew/test/rubocops/conflicts_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/conflicts" diff --git a/Library/Homebrew/test/rubocops/dependency_order_spec.rb b/Library/Homebrew/test/rubocops/dependency_order_spec.rb index e6e0ddbbec..2c6a05a490 100644 --- a/Library/Homebrew/test/rubocops/dependency_order_spec.rb +++ b/Library/Homebrew/test/rubocops/dependency_order_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/dependency_order" diff --git a/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb b/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb index 25733196f2..4293d4d04e 100644 --- a/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb +++ b/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/deprecate_disable" diff --git a/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb b/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb index dd87498ae2..4ca2b73ff2 100644 --- a/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb +++ b/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/deprecate_disable" diff --git a/Library/Homebrew/test/rubocops/desc_spec.rb b/Library/Homebrew/test/rubocops/desc_spec.rb index 48652246ff..e8ad4c8e65 100644 --- a/Library/Homebrew/test/rubocops/desc_spec.rb +++ b/Library/Homebrew/test/rubocops/desc_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/desc" diff --git a/Library/Homebrew/test/rubocops/files_spec.rb b/Library/Homebrew/test/rubocops/files_spec.rb index 1f25c51a85..49eea3fddf 100644 --- a/Library/Homebrew/test/rubocops/files_spec.rb +++ b/Library/Homebrew/test/rubocops/files_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/files" diff --git a/Library/Homebrew/test/rubocops/homepage_spec.rb b/Library/Homebrew/test/rubocops/homepage_spec.rb index 587758cf86..470940f1a4 100644 --- a/Library/Homebrew/test/rubocops/homepage_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/homepage" diff --git a/Library/Homebrew/test/rubocops/io_read_spec.rb b/Library/Homebrew/test/rubocops/io_read_spec.rb index 743bc557aa..18038164c4 100644 --- a/Library/Homebrew/test/rubocops/io_read_spec.rb +++ b/Library/Homebrew/test/rubocops/io_read_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/io_read" diff --git a/Library/Homebrew/test/rubocops/keg_only_spec.rb b/Library/Homebrew/test/rubocops/keg_only_spec.rb index 1a1b0e674b..9bbb933fa8 100644 --- a/Library/Homebrew/test/rubocops/keg_only_spec.rb +++ b/Library/Homebrew/test/rubocops/keg_only_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/keg_only" diff --git a/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb b/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb index 47fdc95135..a8d92cf5b2 100644 --- a/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb +++ b/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/lines/generate_completions_spec.rb b/Library/Homebrew/test/rubocops/lines/generate_completions_spec.rb index 3318bf5fa6..1981290e29 100644 --- a/Library/Homebrew/test/rubocops/lines/generate_completions_spec.rb +++ b/Library/Homebrew/test/rubocops/lines/generate_completions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/lines_spec.rb b/Library/Homebrew/test/rubocops/lines_spec.rb index e722c5215f..66e8f19c15 100644 --- a/Library/Homebrew/test/rubocops/lines_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/livecheck/regex_case_insensitive_spec.rb b/Library/Homebrew/test/rubocops/livecheck/regex_case_insensitive_spec.rb index 5765997127..95c55b52d0 100644 --- a/Library/Homebrew/test/rubocops/livecheck/regex_case_insensitive_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/regex_case_insensitive_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/livecheck/regex_extension_spec.rb b/Library/Homebrew/test/rubocops/livecheck/regex_extension_spec.rb index 8eef516f4f..d64656be05 100644 --- a/Library/Homebrew/test/rubocops/livecheck/regex_extension_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/regex_extension_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/livecheck/regex_if_page_match_spec.rb b/Library/Homebrew/test/rubocops/livecheck/regex_if_page_match_spec.rb index 32580147a6..9c6e0dc6c6 100644 --- a/Library/Homebrew/test/rubocops/livecheck/regex_if_page_match_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/regex_if_page_match_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb b/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb index 91439855f6..f30f511fd7 100644 --- a/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb b/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb index 99981572b3..756e4b0a58 100644 --- a/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb b/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb index 6bffd58418..119097608a 100644 --- a/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb b/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb index d1882ca70e..df82ad4587 100644 --- a/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/livecheck" diff --git a/Library/Homebrew/test/rubocops/move_to_extend_os_spec.rb b/Library/Homebrew/test/rubocops/move_to_extend_os_spec.rb index d54e98cdd2..a03f045860 100644 --- a/Library/Homebrew/test/rubocops/move_to_extend_os_spec.rb +++ b/Library/Homebrew/test/rubocops/move_to_extend_os_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/move_to_extend_os" diff --git a/Library/Homebrew/test/rubocops/options_spec.rb b/Library/Homebrew/test/rubocops/options_spec.rb index 5655924c13..36f088f6cf 100644 --- a/Library/Homebrew/test/rubocops/options_spec.rb +++ b/Library/Homebrew/test/rubocops/options_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/options" diff --git a/Library/Homebrew/test/rubocops/patches_spec.rb b/Library/Homebrew/test/rubocops/patches_spec.rb index 5d4c07f4e6..3da13ba4a8 100644 --- a/Library/Homebrew/test/rubocops/patches_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/patches" diff --git a/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb b/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb index b04020029f..ed798f3ee8 100644 --- a/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/uses_from_macos" diff --git a/Library/Homebrew/test/rubocops/service_spec.rb b/Library/Homebrew/test/rubocops/service_spec.rb index db2729fb00..afba90d477 100644 --- a/Library/Homebrew/test/rubocops/service_spec.rb +++ b/Library/Homebrew/test/rubocops/service_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/service" diff --git a/Library/Homebrew/test/rubocops/shell_commands_spec.rb b/Library/Homebrew/test/rubocops/shell_commands_spec.rb index faf0606b57..4011d19968 100644 --- a/Library/Homebrew/test/rubocops/shell_commands_spec.rb +++ b/Library/Homebrew/test/rubocops/shell_commands_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/shell_commands" diff --git a/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb b/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb index 7a06d7ef26..adb26aab4a 100644 --- a/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb +++ b/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/comments_spec.rb b/Library/Homebrew/test/rubocops/text/comments_spec.rb index 6384a61a30..9f0b891124 100644 --- a/Library/Homebrew/test/rubocops/text/comments_spec.rb +++ b/Library/Homebrew/test/rubocops/text/comments_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb b/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb index 30866a6a8c..ee51293b72 100644 --- a/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb +++ b/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/licenses_spec.rb b/Library/Homebrew/test/rubocops/text/licenses_spec.rb index 6a44bd6a74..abb1e9fce0 100644 --- a/Library/Homebrew/test/rubocops/text/licenses_spec.rb +++ b/Library/Homebrew/test/rubocops/text/licenses_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/make_check_spec.rb b/Library/Homebrew/test/rubocops/text/make_check_spec.rb index c60be6b8db..cd46299fed 100644 --- a/Library/Homebrew/test/rubocops/text/make_check_spec.rb +++ b/Library/Homebrew/test/rubocops/text/make_check_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb index fda2096c4c..68bbc9fd4e 100644 --- a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb +++ b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb b/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb index c3986fdc40..e696904ed3 100644 --- a/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb +++ b/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb b/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb index 4172932c65..54b6510faf 100644 --- a/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb +++ b/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb index 13257dd7e9..ad6feb1031 100644 --- a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb +++ b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/python_versions_spec.rb b/Library/Homebrew/test/rubocops/text/python_versions_spec.rb index 14d6d1be2e..cdcdf1bdcd 100644 --- a/Library/Homebrew/test/rubocops/text/python_versions_spec.rb +++ b/Library/Homebrew/test/rubocops/text/python_versions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb b/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb index 3ec64167ba..989f069ee0 100644 --- a/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb +++ b/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb b/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb index 2c8a274794..60d4f16c71 100644 --- a/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb +++ b/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/lines" diff --git a/Library/Homebrew/test/rubocops/text/strict_spec.rb b/Library/Homebrew/test/rubocops/text/strict_spec.rb index 4a48d1dc69..89f9ef7f12 100644 --- a/Library/Homebrew/test/rubocops/text/strict_spec.rb +++ b/Library/Homebrew/test/rubocops/text/strict_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/text" diff --git a/Library/Homebrew/test/rubocops/text_spec.rb b/Library/Homebrew/test/rubocops/text_spec.rb index 22e5327bdc..29074d087a 100644 --- a/Library/Homebrew/test/rubocops/text_spec.rb +++ b/Library/Homebrew/test/rubocops/text_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/text" diff --git a/Library/Homebrew/test/rubocops/urls/git_spec.rb b/Library/Homebrew/test/rubocops/urls/git_spec.rb index 319e5b4e01..dd33ac1be6 100644 --- a/Library/Homebrew/test/rubocops/urls/git_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/git_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/urls" diff --git a/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb b/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb index 3451c18aa8..eb4c644c7a 100644 --- a/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/urls" diff --git a/Library/Homebrew/test/rubocops/urls/pypi_spec.rb b/Library/Homebrew/test/rubocops/urls/pypi_spec.rb index 50ac8ea8f2..e4793b30c4 100644 --- a/Library/Homebrew/test/rubocops/urls/pypi_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/pypi_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/urls" diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index 058dd2abae..4e88c108a4 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/urls" diff --git a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb index ba64ccda4d..b4177bc781 100644 --- a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/uses_from_macos" diff --git a/Library/Homebrew/test/rubocops/version_spec.rb b/Library/Homebrew/test/rubocops/version_spec.rb index e411abac50..a30544dcaf 100644 --- a/Library/Homebrew/test/rubocops/version_spec.rb +++ b/Library/Homebrew/test/rubocops/version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "rubocops/version" diff --git a/Library/Homebrew/test/sandbox_spec.rb b/Library/Homebrew/test/sandbox_spec.rb index 23e84508b3..f657d1ebf5 100644 --- a/Library/Homebrew/test/sandbox_spec.rb +++ b/Library/Homebrew/test/sandbox_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "sandbox" diff --git a/Library/Homebrew/test/search_spec.rb b/Library/Homebrew/test/search_spec.rb index ef11e5130a..3509119f85 100644 --- a/Library/Homebrew/test/search_spec.rb +++ b/Library/Homebrew/test/search_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "search" diff --git a/Library/Homebrew/test/service_spec.rb b/Library/Homebrew/test/service_spec.rb index 35fde30940..9878839181 100644 --- a/Library/Homebrew/test/service_spec.rb +++ b/Library/Homebrew/test/service_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/test/settings_spec.rb b/Library/Homebrew/test/settings_spec.rb index 2b29d2f9b6..40ef77f683 100644 --- a/Library/Homebrew/test/settings_spec.rb +++ b/Library/Homebrew/test/settings_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "settings" diff --git a/Library/Homebrew/test/simulate_system_spec.rb b/Library/Homebrew/test/simulate_system_spec.rb index 3923680064..352549f9fe 100644 --- a/Library/Homebrew/test/simulate_system_spec.rb +++ b/Library/Homebrew/test/simulate_system_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "settings" diff --git a/Library/Homebrew/test/software_spec/bottle_spec.rb b/Library/Homebrew/test/software_spec/bottle_spec.rb index 08910f8a96..3c9c015768 100644 --- a/Library/Homebrew/test/software_spec/bottle_spec.rb +++ b/Library/Homebrew/test/software_spec/bottle_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "software_spec" diff --git a/Library/Homebrew/test/software_spec/head_spec.rb b/Library/Homebrew/test/software_spec/head_spec.rb index 0f92ba4be6..aa53279223 100644 --- a/Library/Homebrew/test/software_spec/head_spec.rb +++ b/Library/Homebrew/test/software_spec/head_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "software_spec" diff --git a/Library/Homebrew/test/software_spec_spec.rb b/Library/Homebrew/test/software_spec_spec.rb index 2a5cce30b5..959627298a 100644 --- a/Library/Homebrew/test/software_spec_spec.rb +++ b/Library/Homebrew/test/software_spec_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "software_spec" diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 408e370d7b..f6ca54bf38 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true if ENV["HOMEBREW_TESTS_COVERAGE"] diff --git a/Library/Homebrew/test/style_spec.rb b/Library/Homebrew/test/style_spec.rb index 227b09b840..e5c0f7eb0a 100644 --- a/Library/Homebrew/test/style_spec.rb +++ b/Library/Homebrew/test/style_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "style" diff --git a/Library/Homebrew/test/support/fixtures/cask/caffeine.json b/Library/Homebrew/test/support/fixtures/cask/caffeine.json index 0907739b63..a344a52d5a 100644 --- a/Library/Homebrew/test/support/fixtures/cask/caffeine.json +++ b/Library/Homebrew/test/support/fixtures/cask/caffeine.json @@ -10,8 +10,6 @@ "url": "https://www.example.com/cask/caffeine.zip", "appcast": null, "version": "1.2.3", - "versions": { - }, "installed": null, "outdated": false, "sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94", diff --git a/Library/Homebrew/test/support/fixtures/cask/everything.json b/Library/Homebrew/test/support/fixtures/cask/everything.json index 6a2c354d44..8d3b86f5a6 100644 --- a/Library/Homebrew/test/support/fixtures/cask/everything.json +++ b/Library/Homebrew/test/support/fixtures/cask/everything.json @@ -16,8 +16,6 @@ }, "appcast": null, "version": "1.2.3", - "versions": { - }, "installed": null, "outdated": false, "sha256": "c64c05bdc0be845505d6e55e69e696a7f50d40846e76155f0c85d5ff5e7bbb84", diff --git a/Library/Homebrew/test/support/helper/cask.rb b/Library/Homebrew/test/support/helper/cask.rb index 6dd863daab..940e80a4f9 100644 --- a/Library/Homebrew/test/support/helper/cask.rb +++ b/Library/Homebrew/test/support/helper/cask.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/cask_loader" diff --git a/Library/Homebrew/test/support/helper/formula.rb b/Library/Homebrew/test/support/helper/formula.rb index 256ef05e54..caf4a1c73a 100644 --- a/Library/Homebrew/test/support/helper/formula.rb +++ b/Library/Homebrew/test/support/helper/formula.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "formulary" diff --git a/Library/Homebrew/test/support/helper/mktmpdir.rb b/Library/Homebrew/test/support/helper/mktmpdir.rb index f6cc4282c9..6cb369c414 100644 --- a/Library/Homebrew/test/support/helper/mktmpdir.rb +++ b/Library/Homebrew/test/support/helper/mktmpdir.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true module Test diff --git a/Library/Homebrew/test/support/helper/output_as_tty.rb b/Library/Homebrew/test/support/helper/output_as_tty.rb index 1e1dea10da..7fd4b97c7a 100644 --- a/Library/Homebrew/test/support/helper/output_as_tty.rb +++ b/Library/Homebrew/test/support/helper/output_as_tty.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "delegate" diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb index bd9cc4d5c2..c0067277a2 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "cask/config" diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb index bf672a2fa3..1ae7e966bd 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "open3" diff --git a/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb b/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb index e52610016f..b005657977 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true shared_examples "formulae exist" do |array| diff --git a/Library/Homebrew/test/system_command_result_spec.rb b/Library/Homebrew/test/system_command_result_spec.rb index c163c33a91..739888791c 100644 --- a/Library/Homebrew/test/system_command_result_spec.rb +++ b/Library/Homebrew/test/system_command_result_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "system_command" diff --git a/Library/Homebrew/test/system_command_spec.rb b/Library/Homebrew/test/system_command_spec.rb index a142576ad7..ab2e4d139a 100644 --- a/Library/Homebrew/test/system_command_spec.rb +++ b/Library/Homebrew/test/system_command_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe SystemCommand do diff --git a/Library/Homebrew/test/tab_spec.rb b/Library/Homebrew/test/tab_spec.rb index 0251c95f84..d31bf0d27b 100644 --- a/Library/Homebrew/test/tab_spec.rb +++ b/Library/Homebrew/test/tab_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "tab" diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index c41da3b0e6..7da80b9d80 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Tap do diff --git a/Library/Homebrew/test/test_runner_formula_spec.rb b/Library/Homebrew/test/test_runner_formula_spec.rb index 54fcd36477..7b1667a917 100644 --- a/Library/Homebrew/test/test_runner_formula_spec.rb +++ b/Library/Homebrew/test/test_runner_formula_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "test_runner_formula" diff --git a/Library/Homebrew/test/uninstall_spec.rb b/Library/Homebrew/test/uninstall_spec.rb index b132af2146..a1d2822ecc 100644 --- a/Library/Homebrew/test/uninstall_spec.rb +++ b/Library/Homebrew/test/uninstall_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "uninstall" diff --git a/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb b/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb index 63184b24a6..94ae447efa 100644 --- a/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb b/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb index 126985010d..a81f15bab1 100644 --- a/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/cvs_spec.rb b/Library/Homebrew/test/unpack_strategy/cvs_spec.rb index 9947312ac3..854b76c0f0 100644 --- a/Library/Homebrew/test/unpack_strategy/cvs_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/cvs_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/directory_spec.rb b/Library/Homebrew/test/unpack_strategy/directory_spec.rb index 720ed99040..669d040764 100644 --- a/Library/Homebrew/test/unpack_strategy/directory_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/directory_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/dmg_spec.rb b/Library/Homebrew/test/unpack_strategy/dmg_spec.rb index 7b30d119c4..8a3594f144 100644 --- a/Library/Homebrew/test/unpack_strategy/dmg_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/dmg_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/git_spec.rb b/Library/Homebrew/test/unpack_strategy/git_spec.rb index 1e02ada7b3..869df2e091 100644 --- a/Library/Homebrew/test/unpack_strategy/git_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/git_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/gzip_spec.rb b/Library/Homebrew/test/unpack_strategy/gzip_spec.rb index 0f85ad24db..ebf4a493bd 100644 --- a/Library/Homebrew/test/unpack_strategy/gzip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/gzip_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/jar_spec.rb b/Library/Homebrew/test/unpack_strategy/jar_spec.rb index 042f9bf01a..f6da64b973 100644 --- a/Library/Homebrew/test/unpack_strategy/jar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/jar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/lha_spec.rb b/Library/Homebrew/test/unpack_strategy/lha_spec.rb index 18921910b8..e24a60a655 100644 --- a/Library/Homebrew/test/unpack_strategy/lha_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/lha_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/lzip_spec.rb b/Library/Homebrew/test/unpack_strategy/lzip_spec.rb index cd4932c915..a74b68add5 100644 --- a/Library/Homebrew/test/unpack_strategy/lzip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/lzip_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb b/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb index c48e9d90ad..721af10b62 100644 --- a/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb b/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb index 09386a1771..c612b13f03 100644 --- a/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/rar_spec.rb b/Library/Homebrew/test/unpack_strategy/rar_spec.rb index 9ddea401fb..5e5e593339 100644 --- a/Library/Homebrew/test/unpack_strategy/rar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/rar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/shared_examples.rb b/Library/Homebrew/test/unpack_strategy/shared_examples.rb index 3c034d0086..6f3caa475c 100644 --- a/Library/Homebrew/test/unpack_strategy/shared_examples.rb +++ b/Library/Homebrew/test/unpack_strategy/shared_examples.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "unpack_strategy" diff --git a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb index d1baca44bb..78795f94cc 100644 --- a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/tar_spec.rb b/Library/Homebrew/test/unpack_strategy/tar_spec.rb index cf9f7b6184..2c8fac9549 100644 --- a/Library/Homebrew/test/unpack_strategy/tar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/tar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb b/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb index 555aebfad3..efd99dc90f 100644 --- a/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/xar_spec.rb b/Library/Homebrew/test/unpack_strategy/xar_spec.rb index 28870a2d78..f4f11389d1 100644 --- a/Library/Homebrew/test/unpack_strategy/xar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/xar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/xz_spec.rb b/Library/Homebrew/test/unpack_strategy/xz_spec.rb index f6befa95af..ffc41369ae 100644 --- a/Library/Homebrew/test/unpack_strategy/xz_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/xz_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/zip_spec.rb b/Library/Homebrew/test/unpack_strategy/zip_spec.rb index b86237bc0d..10a0983a50 100644 --- a/Library/Homebrew/test/unpack_strategy/zip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/zip_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy/zstd_spec.rb b/Library/Homebrew/test/unpack_strategy/zstd_spec.rb index 270db9ce40..706ec4dad1 100644 --- a/Library/Homebrew/test/unpack_strategy/zstd_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/zstd_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require_relative "shared_examples" diff --git a/Library/Homebrew/test/unpack_strategy_spec.rb b/Library/Homebrew/test/unpack_strategy_spec.rb index 3529427d00..4aff39e054 100644 --- a/Library/Homebrew/test/unpack_strategy_spec.rb +++ b/Library/Homebrew/test/unpack_strategy_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe UnpackStrategy do diff --git a/Library/Homebrew/test/utils/analytics_spec.rb b/Library/Homebrew/test/utils/analytics_spec.rb index 93b69a7dd3..82181fea78 100644 --- a/Library/Homebrew/test/utils/analytics_spec.rb +++ b/Library/Homebrew/test/utils/analytics_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/analytics" diff --git a/Library/Homebrew/test/utils/ast/ast_spec.rb b/Library/Homebrew/test/utils/ast/ast_spec.rb index 1f9dc30ffc..6eaf5f94f7 100644 --- a/Library/Homebrew/test/utils/ast/ast_spec.rb +++ b/Library/Homebrew/test/utils/ast/ast_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/ast" diff --git a/Library/Homebrew/test/utils/ast/formula_ast_spec.rb b/Library/Homebrew/test/utils/ast/formula_ast_spec.rb index 32fb13bcfe..386729b2c5 100644 --- a/Library/Homebrew/test/utils/ast/formula_ast_spec.rb +++ b/Library/Homebrew/test/utils/ast/formula_ast_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/ast" diff --git a/Library/Homebrew/test/utils/autoremove_spec.rb b/Library/Homebrew/test/utils/autoremove_spec.rb index 300dbd3418..258eb2b85c 100644 --- a/Library/Homebrew/test/utils/autoremove_spec.rb +++ b/Library/Homebrew/test/utils/autoremove_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/autoremove" @@ -13,13 +12,13 @@ describe Utils::Autoremove do end end - let(:formula_is_dep1) do + let(:first_formula_dep) do formula "one" do url "one-1.1" end end - let(:formula_is_dep2) do + let(:second_formula_dep) do formula "two" do url "two-1.1" end @@ -34,8 +33,8 @@ describe Utils::Autoremove do let(:formulae) do [ formula_with_deps, - formula_is_dep1, - formula_is_dep2, + first_formula_dep, + second_formula_dep, formula_is_build_dep, ] end @@ -43,9 +42,9 @@ describe Utils::Autoremove do let(:tab_from_keg) { double } before do - allow(formula_with_deps).to receive(:runtime_formula_dependencies).and_return([formula_is_dep1, - formula_is_dep2]) - allow(formula_is_dep1).to receive(:runtime_formula_dependencies).and_return([formula_is_dep2]) + allow(formula_with_deps).to receive(:runtime_formula_dependencies).and_return([first_formula_dep, + second_formula_dep]) + allow(first_formula_dep).to receive(:runtime_formula_dependencies).and_return([second_formula_dep]) allow(Tab).to receive(:for_keg).and_return(tab_from_keg) end @@ -116,28 +115,28 @@ describe Utils::Autoremove do RUBY end - let(:cask_no_deps1) do + let(:first_cask_no_deps) do Cask::CaskLoader.load(+<<-RUBY) cask "green" do end RUBY end - let(:cask_no_deps2) do + let(:second_cask_no_deps) do Cask::CaskLoader.load(+<<-RUBY) cask "purple" do end RUBY end - let(:casks_no_deps) { [cask_no_deps1, cask_no_deps2] } - let(:casks_one_dep) { [cask_no_deps1, cask_no_deps2, cask_one_dep] } - let(:casks_multiple_deps) { [cask_no_deps1, cask_no_deps2, cask_multiple_deps] } + let(:casks_no_deps) { [first_cask_no_deps, second_cask_no_deps] } + let(:casks_one_dep) { [first_cask_no_deps, second_cask_no_deps, cask_one_dep] } + let(:casks_multiple_deps) { [first_cask_no_deps, second_cask_no_deps, cask_multiple_deps] } before do allow(Formula).to receive("[]").with("zero").and_return(formula_with_deps) - allow(Formula).to receive("[]").with("one").and_return(formula_is_dep1) - allow(Formula).to receive("[]").with("two").and_return(formula_is_dep2) + allow(Formula).to receive("[]").with("one").and_return(first_formula_dep) + allow(Formula).to receive("[]").with("two").and_return(second_formula_dep) end end @@ -151,12 +150,12 @@ describe Utils::Autoremove do specify "one dependent" do expect(described_class.send(:formulae_with_cask_dependents, casks_one_dep)) - .to eq([formula_is_dep2]) + .to eq([second_formula_dep]) end specify "multiple dependents" do expect(described_class.send(:formulae_with_cask_dependents, casks_multiple_deps)) - .to contain_exactly(formula_with_deps, formula_is_dep1, formula_is_dep2) + .to contain_exactly(formula_with_deps, first_formula_dep, second_formula_dep) end end end diff --git a/Library/Homebrew/test/utils/bottles/bottles_spec.rb b/Library/Homebrew/test/utils/bottles/bottles_spec.rb index c7a0cf9af3..fb492384f0 100644 --- a/Library/Homebrew/test/utils/bottles/bottles_spec.rb +++ b/Library/Homebrew/test/utils/bottles/bottles_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/bottles" diff --git a/Library/Homebrew/test/utils/bottles/collector_spec.rb b/Library/Homebrew/test/utils/bottles/collector_spec.rb index 79a571fc4b..12c7019deb 100644 --- a/Library/Homebrew/test/utils/bottles/collector_spec.rb +++ b/Library/Homebrew/test/utils/bottles/collector_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/bottles" diff --git a/Library/Homebrew/test/utils/bottles/tag_spec.rb b/Library/Homebrew/test/utils/bottles/tag_spec.rb index 256c592635..1d6b60fd03 100644 --- a/Library/Homebrew/test/utils/bottles/tag_spec.rb +++ b/Library/Homebrew/test/utils/bottles/tag_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/bottles" diff --git a/Library/Homebrew/test/utils/curl_spec.rb b/Library/Homebrew/test/utils/curl_spec.rb index f810973afb..1a72ce525c 100644 --- a/Library/Homebrew/test/utils/curl_spec.rb +++ b/Library/Homebrew/test/utils/curl_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/curl" diff --git a/Library/Homebrew/test/utils/fork_spec.rb b/Library/Homebrew/test/utils/fork_spec.rb index bafb484af6..317f17b0ba 100644 --- a/Library/Homebrew/test/utils/fork_spec.rb +++ b/Library/Homebrew/test/utils/fork_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/fork" diff --git a/Library/Homebrew/test/utils/git_repository_spec.rb b/Library/Homebrew/test/utils/git_repository_spec.rb index 2f609295e9..ae6d7a9998 100644 --- a/Library/Homebrew/test/utils/git_repository_spec.rb +++ b/Library/Homebrew/test/utils/git_repository_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/git_repository" diff --git a/Library/Homebrew/test/utils/git_spec.rb b/Library/Homebrew/test/utils/git_spec.rb index 1570a001c0..a7129cd1af 100644 --- a/Library/Homebrew/test/utils/git_spec.rb +++ b/Library/Homebrew/test/utils/git_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/git" @@ -47,11 +46,11 @@ describe Utils::Git do let(:file) { "README.md" } # Allow instance variables here for a simpler `before do` block. # rubocop:disable RSpec/InstanceVariable - let(:file_hash1) { @h1[0..6] } - let(:file_hash2) { @h2[0..6] } + let(:file_hash_one) { @h1[0..6] } + let(:file_hash_two) { @h2[0..6] } let(:files) { ["README.md", "LICENSE.txt"] } - let(:files_hash1) { [@h3[0..6], ["LICENSE.txt"]] } - let(:files_hash2) { [@h2[0..6], ["README.md"]] } + let(:files_hash_one) { [@h3[0..6], ["LICENSE.txt"]] } + let(:files_hash_two) { [@h2[0..6], ["README.md"]] } let(:cherry_pick_commit) { @cherry_pick_commit[0..6] } # rubocop:enable RSpec/InstanceVariable @@ -63,7 +62,7 @@ describe Utils::Git do it "aborts when cherry picking an existing hash" do ENV["GIT_MERGE_VERBOSITY"] = "5" # Consistent output across git versions expect do - described_class.cherry_pick!(HOMEBREW_CACHE, file_hash1) + described_class.cherry_pick!(HOMEBREW_CACHE, file_hash_one) end.to raise_error(ErrorDuringExecution, /Merge conflict in README.md/) end end @@ -72,26 +71,26 @@ describe Utils::Git do it "gives last revision commit when before_commit is nil" do expect( described_class.last_revision_commit_of_file(HOMEBREW_CACHE, file), - ).to eq(file_hash1) + ).to eq(file_hash_one) end it "gives revision commit based on before_commit when it is not nil" do expect( described_class.last_revision_commit_of_file(HOMEBREW_CACHE, file, - before_commit: file_hash2), - ).to eq(file_hash2) + before_commit: file_hash_two), + ).to eq(file_hash_two) end end describe "#file_at_commit" do it "returns file contents when file exists" do - expect(described_class.file_at_commit(HOMEBREW_CACHE, file, file_hash1)).to eq("README") + expect(described_class.file_at_commit(HOMEBREW_CACHE, file, file_hash_one)).to eq("README") end it "returns empty when file doesn't exist" do - expect(described_class.file_at_commit(HOMEBREW_CACHE, "foo.txt", file_hash1)).to eq("") - expect(described_class.file_at_commit(HOMEBREW_CACHE, "LICENSE.txt", file_hash1)).to eq("") + expect(described_class.file_at_commit(HOMEBREW_CACHE, "foo.txt", file_hash_one)).to eq("") + expect(described_class.file_at_commit(HOMEBREW_CACHE, "LICENSE.txt", file_hash_one)).to eq("") end end @@ -100,7 +99,7 @@ describe Utils::Git do it "gives last revision commit" do expect( described_class.last_revision_commit_of_files(HOMEBREW_CACHE, files), - ).to eq(files_hash1) + ).to eq(files_hash_one) end end @@ -109,8 +108,8 @@ describe Utils::Git do expect( described_class.last_revision_commit_of_files(HOMEBREW_CACHE, files, - before_commit: file_hash2), - ).to eq(files_hash2) + before_commit: file_hash_two), + ).to eq(files_hash_two) end end end diff --git a/Library/Homebrew/test/utils/github/actions_spec.rb b/Library/Homebrew/test/utils/github/actions_spec.rb index 365b2e1994..9a40bcd739 100644 --- a/Library/Homebrew/test/utils/github/actions_spec.rb +++ b/Library/Homebrew/test/utils/github/actions_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/github/actions" diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb index 52db77d05a..b6cd685650 100644 --- a/Library/Homebrew/test/utils/github_spec.rb +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/github" diff --git a/Library/Homebrew/test/utils/gzip_spec.rb b/Library/Homebrew/test/utils/gzip_spec.rb index af2d2d9f28..ceb3ea864a 100644 --- a/Library/Homebrew/test/utils/gzip_spec.rb +++ b/Library/Homebrew/test/utils/gzip_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/gzip" diff --git a/Library/Homebrew/test/utils/inreplace_spec.rb b/Library/Homebrew/test/utils/inreplace_spec.rb index 3fe95f856b..79217d0840 100644 --- a/Library/Homebrew/test/utils/inreplace_spec.rb +++ b/Library/Homebrew/test/utils/inreplace_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "tempfile" diff --git a/Library/Homebrew/test/utils/popen_spec.rb b/Library/Homebrew/test/utils/popen_spec.rb index fae53c62c9..67c37ac9b8 100644 --- a/Library/Homebrew/test/utils/popen_spec.rb +++ b/Library/Homebrew/test/utils/popen_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/popen" diff --git a/Library/Homebrew/test/utils/pypi_spec.rb b/Library/Homebrew/test/utils/pypi_spec.rb index c0ba3ed88e..8193c15b69 100644 --- a/Library/Homebrew/test/utils/pypi_spec.rb +++ b/Library/Homebrew/test/utils/pypi_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/pypi" diff --git a/Library/Homebrew/test/utils/ruby_check_version_script_spec.rb b/Library/Homebrew/test/utils/ruby_check_version_script_spec.rb index 543a421d64..6141fbe634 100644 --- a/Library/Homebrew/test/utils/ruby_check_version_script_spec.rb +++ b/Library/Homebrew/test/utils/ruby_check_version_script_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Utils do diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index 2cc2e0a5d8..c735a9da57 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/shell" diff --git a/Library/Homebrew/test/utils/spdx_spec.rb b/Library/Homebrew/test/utils/spdx_spec.rb index 7d01a330a0..ad9aa82852 100644 --- a/Library/Homebrew/test/utils/spdx_spec.rb +++ b/Library/Homebrew/test/utils/spdx_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/spdx" diff --git a/Library/Homebrew/test/utils/string_inreplace_extension_spec.rb b/Library/Homebrew/test/utils/string_inreplace_extension_spec.rb index 999e55c67d..5a73b525e2 100644 --- a/Library/Homebrew/test/utils/string_inreplace_extension_spec.rb +++ b/Library/Homebrew/test/utils/string_inreplace_extension_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/string_inreplace_extension" diff --git a/Library/Homebrew/test/utils/svn_spec.rb b/Library/Homebrew/test/utils/svn_spec.rb index ff1014af3d..0c4b039b36 100644 --- a/Library/Homebrew/test/utils/svn_spec.rb +++ b/Library/Homebrew/test/utils/svn_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/svn" diff --git a/Library/Homebrew/test/utils/tar_spec.rb b/Library/Homebrew/test/utils/tar_spec.rb index 0b7ff0ee58..b3569cad80 100644 --- a/Library/Homebrew/test/utils/tar_spec.rb +++ b/Library/Homebrew/test/utils/tar_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/tar" diff --git a/Library/Homebrew/test/utils/topological_hash_spec.rb b/Library/Homebrew/test/utils/topological_hash_spec.rb index 8292a9f7cf..ef4290f967 100644 --- a/Library/Homebrew/test/utils/topological_hash_spec.rb +++ b/Library/Homebrew/test/utils/topological_hash_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/topological_hash" diff --git a/Library/Homebrew/test/utils/tty_spec.rb b/Library/Homebrew/test/utils/tty_spec.rb index b9db607c98..c60f188e02 100644 --- a/Library/Homebrew/test/utils/tty_spec.rb +++ b/Library/Homebrew/test/utils/tty_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true describe Tty do diff --git a/Library/Homebrew/test/utils/user_spec.rb b/Library/Homebrew/test/utils/user_spec.rb index 5d95fc08fd..4b01c3fd02 100644 --- a/Library/Homebrew/test/utils/user_spec.rb +++ b/Library/Homebrew/test/utils/user_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils/user" diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index 744014ad94..1ec12d645d 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "utils" diff --git a/Library/Homebrew/test/version/parser_spec.rb b/Library/Homebrew/test/version/parser_spec.rb index fe2afde9bc..7f2041be82 100644 --- a/Library/Homebrew/test/version/parser_spec.rb +++ b/Library/Homebrew/test/version/parser_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "version/parser" diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb index 647fb5dcca..ec55cc35bf 100644 --- a/Library/Homebrew/test/version_spec.rb +++ b/Library/Homebrew/test/version_spec.rb @@ -1,4 +1,3 @@ -# typed: false # frozen_string_literal: true require "version" diff --git a/Library/Homebrew/test_runner_formula.rb b/Library/Homebrew/test_runner_formula.rb index b3e2dded65..163e30dc7d 100644 --- a/Library/Homebrew/test_runner_formula.rb +++ b/Library/Homebrew/test_runner_formula.rb @@ -4,8 +4,6 @@ require "formula" class TestRunnerFormula - extend T::Sig - sig { returns(String) } attr_reader :name @@ -91,7 +89,7 @@ class TestRunnerFormula def dependents(platform:, arch:, macos_version:) cache_key = :"#{platform}_#{arch}_#{macos_version}" - @dependent_hash.fetch(cache_key) do + @dependent_hash[cache_key] ||= begin all = eval_all || Homebrew::EnvConfig.eval_all? formula_selector, eval_all_env = if all [:all, "1"] @@ -112,5 +110,7 @@ class TestRunnerFormula Homebrew::SimulateSystem.clear end end + + @dependent_hash.fetch(cache_key) end end diff --git a/Library/Homebrew/uninstall.rb b/Library/Homebrew/uninstall.rb index a6f366f448..73578c5ce2 100644 --- a/Library/Homebrew/uninstall.rb +++ b/Library/Homebrew/uninstall.rb @@ -8,9 +8,7 @@ module Homebrew # # @api private module Uninstall - module_function - - def uninstall_kegs(kegs_by_rack, casks: [], force: false, ignore_dependencies: false, named_args: []) + def self.uninstall_kegs(kegs_by_rack, casks: [], force: false, ignore_dependencies: false, named_args: []) handle_unsatisfied_dependents(kegs_by_rack, casks: casks, ignore_dependencies: ignore_dependencies, @@ -97,7 +95,7 @@ module Homebrew end end - def handle_unsatisfied_dependents(kegs_by_rack, casks: [], ignore_dependencies: false, named_args: []) + def self.handle_unsatisfied_dependents(kegs_by_rack, casks: [], ignore_dependencies: false, named_args: []) return if ignore_dependencies all_kegs = kegs_by_rack.values.flatten(1) @@ -107,7 +105,7 @@ module Homebrew nil end - def check_for_dependents(kegs, casks: [], named_args: []) + def self.check_for_dependents(kegs, casks: [], named_args: []) return false unless (result = InstalledDependents.find_some_installed_dependents(kegs, casks: casks)) if Homebrew::EnvConfig.developer? @@ -164,7 +162,7 @@ module Homebrew end end - def rm_pin(rack) + def self.rm_pin(rack) Formulary.from_rack(rack).unpin rescue nil diff --git a/Library/Homebrew/uninstall.rbi b/Library/Homebrew/uninstall.rbi deleted file mode 100644 index f801c23a87..0000000000 --- a/Library/Homebrew/uninstall.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Homebrew - module Uninstall - include Kernel - end -end diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index 8a29604b93..3f6f93d61f 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -7,7 +7,6 @@ require "system_command" # # @api private module UnpackStrategy - extend T::Sig extend T::Helpers include SystemCommand::Mixin diff --git a/Library/Homebrew/unpack_strategy/air.rb b/Library/Homebrew/unpack_strategy/air.rb index aac0881fa8..ca0137e872 100644 --- a/Library/Homebrew/unpack_strategy/air.rb +++ b/Library/Homebrew/unpack_strategy/air.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking Adobe Air archives. class Air - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/bazaar.rb b/Library/Homebrew/unpack_strategy/bazaar.rb index 62eb0c4946..f73902b3aa 100644 --- a/Library/Homebrew/unpack_strategy/bazaar.rb +++ b/Library/Homebrew/unpack_strategy/bazaar.rb @@ -6,8 +6,6 @@ require_relative "directory" module UnpackStrategy # Strategy for unpacking Bazaar archives. class Bazaar < Directory - extend T::Sig - def self.can_extract?(path) super && (path/".bzr").directory? end diff --git a/Library/Homebrew/unpack_strategy/bzip2.rb b/Library/Homebrew/unpack_strategy/bzip2.rb index 82e9501b6a..26eeaa784e 100644 --- a/Library/Homebrew/unpack_strategy/bzip2.rb +++ b/Library/Homebrew/unpack_strategy/bzip2.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking bzip2 archives. class Bzip2 - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/cab.rb b/Library/Homebrew/unpack_strategy/cab.rb index de2258af88..a7038df4d0 100644 --- a/Library/Homebrew/unpack_strategy/cab.rb +++ b/Library/Homebrew/unpack_strategy/cab.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking Cabinet archives. class Cab - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/compress.rb b/Library/Homebrew/unpack_strategy/compress.rb index 0cc11abbd7..0082312214 100644 --- a/Library/Homebrew/unpack_strategy/compress.rb +++ b/Library/Homebrew/unpack_strategy/compress.rb @@ -6,8 +6,6 @@ require_relative "tar" module UnpackStrategy # Strategy for unpacking compress archives. class Compress < Tar - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".Z"] diff --git a/Library/Homebrew/unpack_strategy/directory.rb b/Library/Homebrew/unpack_strategy/directory.rb index f20b9a566e..4a36198426 100644 --- a/Library/Homebrew/unpack_strategy/directory.rb +++ b/Library/Homebrew/unpack_strategy/directory.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking directories. class Directory - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/dmg.rb b/Library/Homebrew/unpack_strategy/dmg.rb index cb3ee47d12..21cc3326f7 100644 --- a/Library/Homebrew/unpack_strategy/dmg.rb +++ b/Library/Homebrew/unpack_strategy/dmg.rb @@ -6,14 +6,10 @@ require "tempfile" module UnpackStrategy # Strategy for unpacking disk images. class Dmg - extend T::Sig - include UnpackStrategy # Helper module for listing the contents of a volume mounted from a disk image. module Bom - extend T::Sig - DMG_METADATA = Set.new(%w[ .background .com.apple.timemachine.donotpresent @@ -79,8 +75,6 @@ module UnpackStrategy # Strategy for unpacking a volume mounted from a disk image. class Mount - extend T::Sig - include UnpackStrategy def eject(verbose: false) diff --git a/Library/Homebrew/unpack_strategy/executable.rb b/Library/Homebrew/unpack_strategy/executable.rb index 6bf45599ed..4c5e712da8 100644 --- a/Library/Homebrew/unpack_strategy/executable.rb +++ b/Library/Homebrew/unpack_strategy/executable.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking executables. class Executable < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".sh", ".bash"] diff --git a/Library/Homebrew/unpack_strategy/fossil.rb b/Library/Homebrew/unpack_strategy/fossil.rb index a09218cf77..beeeae8f9b 100644 --- a/Library/Homebrew/unpack_strategy/fossil.rb +++ b/Library/Homebrew/unpack_strategy/fossil.rb @@ -6,8 +6,6 @@ require "system_command" module UnpackStrategy # Strategy for unpacking Fossil repositories. class Fossil - extend T::Sig - include UnpackStrategy extend SystemCommand::Mixin diff --git a/Library/Homebrew/unpack_strategy/generic_unar.rb b/Library/Homebrew/unpack_strategy/generic_unar.rb index a860f8ec6b..c537f5efca 100644 --- a/Library/Homebrew/unpack_strategy/generic_unar.rb +++ b/Library/Homebrew/unpack_strategy/generic_unar.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking archives with `unar`. class GenericUnar - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/gzip.rb b/Library/Homebrew/unpack_strategy/gzip.rb index dbc70d2766..22bdf33881 100644 --- a/Library/Homebrew/unpack_strategy/gzip.rb +++ b/Library/Homebrew/unpack_strategy/gzip.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking gzip archives. class Gzip - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/jar.rb b/Library/Homebrew/unpack_strategy/jar.rb index 21153d1c2b..892357b48b 100644 --- a/Library/Homebrew/unpack_strategy/jar.rb +++ b/Library/Homebrew/unpack_strategy/jar.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking Java archives. class Jar < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".apk", ".jar"] diff --git a/Library/Homebrew/unpack_strategy/lha.rb b/Library/Homebrew/unpack_strategy/lha.rb index a8cdfdb4cf..ee26437eaa 100644 --- a/Library/Homebrew/unpack_strategy/lha.rb +++ b/Library/Homebrew/unpack_strategy/lha.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking LHa archives. class Lha - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/lua_rock.rb b/Library/Homebrew/unpack_strategy/lua_rock.rb index d5ce7de33e..a01fcd2f88 100644 --- a/Library/Homebrew/unpack_strategy/lua_rock.rb +++ b/Library/Homebrew/unpack_strategy/lua_rock.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking LuaRock archives. class LuaRock < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".rock"] diff --git a/Library/Homebrew/unpack_strategy/lzip.rb b/Library/Homebrew/unpack_strategy/lzip.rb index d1f2c432af..8925de24e3 100644 --- a/Library/Homebrew/unpack_strategy/lzip.rb +++ b/Library/Homebrew/unpack_strategy/lzip.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking lzip archives. class Lzip - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/lzma.rb b/Library/Homebrew/unpack_strategy/lzma.rb index bfe04be2c9..11e7bdc664 100644 --- a/Library/Homebrew/unpack_strategy/lzma.rb +++ b/Library/Homebrew/unpack_strategy/lzma.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking LZMA archives. class Lzma - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb b/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb index ad3940d86e..2ad2a40644 100644 --- a/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb +++ b/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking Microsoft Office documents. class MicrosoftOfficeXml < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [ diff --git a/Library/Homebrew/unpack_strategy/otf.rb b/Library/Homebrew/unpack_strategy/otf.rb index 61ac40a249..7a75f78c4c 100644 --- a/Library/Homebrew/unpack_strategy/otf.rb +++ b/Library/Homebrew/unpack_strategy/otf.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking OpenType fonts. class Otf < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".otf"] diff --git a/Library/Homebrew/unpack_strategy/p7zip.rb b/Library/Homebrew/unpack_strategy/p7zip.rb index 715c816076..fb32908f2d 100644 --- a/Library/Homebrew/unpack_strategy/p7zip.rb +++ b/Library/Homebrew/unpack_strategy/p7zip.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking P7ZIP archives. class P7Zip - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/pax.rb b/Library/Homebrew/unpack_strategy/pax.rb index c454b57ab4..cd16295c5b 100644 --- a/Library/Homebrew/unpack_strategy/pax.rb +++ b/Library/Homebrew/unpack_strategy/pax.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking pax archives. class Pax - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/pkg.rb b/Library/Homebrew/unpack_strategy/pkg.rb index 7151ba6078..b48a55244b 100644 --- a/Library/Homebrew/unpack_strategy/pkg.rb +++ b/Library/Homebrew/unpack_strategy/pkg.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking macOS package installers. class Pkg < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".pkg", ".mkpg"] diff --git a/Library/Homebrew/unpack_strategy/rar.rb b/Library/Homebrew/unpack_strategy/rar.rb index 9a2be11326..c9e7d3679b 100644 --- a/Library/Homebrew/unpack_strategy/rar.rb +++ b/Library/Homebrew/unpack_strategy/rar.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking RAR archives. class Rar - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/self_extracting_executable.rb b/Library/Homebrew/unpack_strategy/self_extracting_executable.rb index a3ea1e8de1..b32cfa825c 100644 --- a/Library/Homebrew/unpack_strategy/self_extracting_executable.rb +++ b/Library/Homebrew/unpack_strategy/self_extracting_executable.rb @@ -6,8 +6,6 @@ require_relative "generic_unar" module UnpackStrategy # Strategy for unpacking self-extracting executables. class SelfExtractingExecutable < GenericUnar - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [] diff --git a/Library/Homebrew/unpack_strategy/sit.rb b/Library/Homebrew/unpack_strategy/sit.rb index d747cb3178..7d447eaf69 100644 --- a/Library/Homebrew/unpack_strategy/sit.rb +++ b/Library/Homebrew/unpack_strategy/sit.rb @@ -6,8 +6,6 @@ require_relative "generic_unar" module UnpackStrategy # Strategy for unpacking Stuffit archives. class Sit < GenericUnar - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".sit"] diff --git a/Library/Homebrew/unpack_strategy/tar.rb b/Library/Homebrew/unpack_strategy/tar.rb index 42ca323d33..0290a02dd8 100644 --- a/Library/Homebrew/unpack_strategy/tar.rb +++ b/Library/Homebrew/unpack_strategy/tar.rb @@ -6,8 +6,6 @@ require "system_command" module UnpackStrategy # Strategy for unpacking tar archives. class Tar - extend T::Sig - include UnpackStrategy extend SystemCommand::Mixin diff --git a/Library/Homebrew/unpack_strategy/ttf.rb b/Library/Homebrew/unpack_strategy/ttf.rb index bd0da5ea76..d741378d29 100644 --- a/Library/Homebrew/unpack_strategy/ttf.rb +++ b/Library/Homebrew/unpack_strategy/ttf.rb @@ -6,8 +6,6 @@ require_relative "uncompressed" module UnpackStrategy # Strategy for unpacking TrueType fonts. class Ttf < Uncompressed - extend T::Sig - sig { returns(T::Array[String]) } def self.extensions [".ttc", ".ttf"] diff --git a/Library/Homebrew/unpack_strategy/uncompressed.rb b/Library/Homebrew/unpack_strategy/uncompressed.rb index 08b72eeb83..6cb24becaa 100644 --- a/Library/Homebrew/unpack_strategy/uncompressed.rb +++ b/Library/Homebrew/unpack_strategy/uncompressed.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking uncompressed files. class Uncompressed - extend T::Sig - include UnpackStrategy sig { diff --git a/Library/Homebrew/unpack_strategy/xar.rb b/Library/Homebrew/unpack_strategy/xar.rb index 4707a602d5..e1f0649ccb 100644 --- a/Library/Homebrew/unpack_strategy/xar.rb +++ b/Library/Homebrew/unpack_strategy/xar.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking xar archives. class Xar - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/xz.rb b/Library/Homebrew/unpack_strategy/xz.rb index cc450d51d6..be6b7ca55f 100644 --- a/Library/Homebrew/unpack_strategy/xz.rb +++ b/Library/Homebrew/unpack_strategy/xz.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking xz archives. class Xz - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/zip.rb b/Library/Homebrew/unpack_strategy/zip.rb index 85ef33cbbb..de7c8b532e 100644 --- a/Library/Homebrew/unpack_strategy/zip.rb +++ b/Library/Homebrew/unpack_strategy/zip.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking ZIP archives. class Zip - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unpack_strategy/zstd.rb b/Library/Homebrew/unpack_strategy/zstd.rb index c5f0b2a6b9..0e51960472 100644 --- a/Library/Homebrew/unpack_strategy/zstd.rb +++ b/Library/Homebrew/unpack_strategy/zstd.rb @@ -4,8 +4,6 @@ module UnpackStrategy # Strategy for unpacking zstd archives. class Zstd - extend T::Sig - include UnpackStrategy sig { returns(T::Array[String]) } diff --git a/Library/Homebrew/unversioned_cask_checker.rb b/Library/Homebrew/unversioned_cask_checker.rb index 9da27738c1..b66c1f6139 100644 --- a/Library/Homebrew/unversioned_cask_checker.rb +++ b/Library/Homebrew/unversioned_cask_checker.rb @@ -11,9 +11,7 @@ module Homebrew # # @api private class UnversionedCaskChecker - extend T::Sig - - sig { returns(Cask::Cask) } + sig { returns(Cask::Cask) } attr_reader :cask sig { params(cask: Cask::Cask).void } diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index a620e38c69..e685e1e20b 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -24,7 +24,6 @@ require "extend/kernel" module Homebrew extend Context - extend T::Sig def self._system(cmd, *args, **options) pid = fork do @@ -87,8 +86,6 @@ module Homebrew end module Utils - extend T::Sig - # Removes the rightmost segment from the constant expression in the string. # # deconstantize('Net::HTTP') # => "Net" diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index 4ce8599335..f3ed90ede7 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -17,8 +17,6 @@ module Utils INFLUX_ORG = "9a707721bb47fc02" class << self - extend T::Sig - include Context sig { params(type: Symbol, metadata: T::Hash[Symbol, T.untyped]).void } diff --git a/Library/Homebrew/utils/ast.rb b/Library/Homebrew/utils/ast.rb index 5531fa376e..116853d0f7 100644 --- a/Library/Homebrew/utils/ast.rb +++ b/Library/Homebrew/utils/ast.rb @@ -9,8 +9,6 @@ module Utils # # @api private module AST - extend T::Sig - Node = RuboCop::AST::Node SendNode = RuboCop::AST::SendNode BlockNode = RuboCop::AST::BlockNode @@ -79,7 +77,6 @@ module Utils # # @api private class FormulaAST - extend T::Sig extend Forwardable include AST diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb index 77e28b2fbe..1ef0334cea 100644 --- a/Library/Homebrew/utils/bottles.rb +++ b/Library/Homebrew/utils/bottles.rb @@ -9,8 +9,6 @@ module Utils # @api private module Bottles class << self - extend T::Sig - # Gets the tag for the running OS. def tag(symbol = nil) return Tag.from_symbol(symbol) if symbol.present? @@ -124,8 +122,6 @@ module Utils # Denotes the arch and OS of a bottle. class Tag - extend T::Sig - attr_reader :system, :arch sig { params(value: Symbol).returns(T.attached_class) } @@ -245,8 +241,6 @@ module Utils # The specification for a specific tag class TagSpecification - extend T::Sig - sig { returns(Utils::Bottles::Tag) } attr_reader :tag @@ -265,8 +259,6 @@ module Utils # Collector for bottle specifications. class Collector - extend T::Sig - sig { void } def initialize @tag_specs = T.let({}, T::Hash[Utils::Bottles::Tag, Utils::Bottles::TagSpecification]) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 2687ad268d..faf8a423a5 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -10,8 +10,6 @@ module Utils # # @api private module Curl - extend T::Sig - using TimeRemaining # This regex is used to extract the part of an ETag within quotation marks, diff --git a/Library/Homebrew/utils/formatter.rb b/Library/Homebrew/utils/formatter.rb index 870364c142..33b8909ea3 100644 --- a/Library/Homebrew/utils/formatter.rb +++ b/Library/Homebrew/utils/formatter.rb @@ -7,33 +7,31 @@ require "utils/tty" # # @api private module Formatter - module_function - - def arrow(string, color: nil) + def self.arrow(string, color: nil) prefix("==>", string, color) end - def headline(string, color: nil) + def self.headline(string, color: nil) arrow("#{Tty.bold}#{string}#{Tty.reset}", color: color) end - def identifier(string) + def self.identifier(string) "#{Tty.green}#{string}#{Tty.default}" end - def option(string) + def self.option(string) "#{Tty.bold}#{string}#{Tty.reset}" end - def success(string, label: nil) + def self.success(string, label: nil) label(label, string, :green) end - def warning(string, label: nil) + def self.warning(string, label: nil) label(label, string, :yellow) end - def error(string, label: nil) + def self.error(string, label: nil) label(label, string, :red) end @@ -50,7 +48,7 @@ module Formatter # so we always wrap one word before an option. # @see https://github.com/Homebrew/brew/pull/12672 # @see https://macromates.com/blog/2006/wrapping-text-with-regular-expressions/ - def format_help_text(string, width: 172) + def self.format_help_text(string, width: 172) desc = OPTION_DESC_WIDTH indent = width - desc string.gsub(/(?<=\S) *\n(?=\S)/, " ") @@ -60,17 +58,17 @@ module Formatter .gsub(/(.{1,#{width}})( +|$)(?!-)\n?/, "\\1\n") end - def url(string) + def self.url(string) "#{Tty.underline}#{string}#{Tty.no_underline}" end - def label(label, string, color) + def self.label(label, string, color) label = "#{label}:" unless label.nil? prefix(label, string, color) end private_class_method :label - def prefix(prefix, string, color) + def self.prefix(prefix, string, color) if prefix.nil? && color.nil? string elsif prefix.nil? @@ -83,7 +81,7 @@ module Formatter end private_class_method :prefix - def columns(*objects, gap_size: 2) + def self.columns(*objects, gap_size: 2) objects = objects.flatten.map(&:to_s) fallback = proc do diff --git a/Library/Homebrew/utils/formatter.rbi b/Library/Homebrew/utils/formatter.rbi deleted file mode 100644 index e9038dd0f3..0000000000 --- a/Library/Homebrew/utils/formatter.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module Formatter - include Kernel -end diff --git a/Library/Homebrew/utils/gems.rb b/Library/Homebrew/utils/gems.rb index 1a15f9e29d..e8d7eb356e 100644 --- a/Library/Homebrew/utils/gems.rb +++ b/Library/Homebrew/utils/gems.rb @@ -155,6 +155,12 @@ module Homebrew invalid_groups = groups - valid_gem_groups raise ArgumentError, "Invalid gem groups: #{invalid_groups.join(", ")}" unless invalid_groups.empty? + # tests should not modify the state of the repo + if ENV["HOMEBREW_TESTS"] + setup_gem_environment! + return + end + install_bundler! require "settings" @@ -194,8 +200,18 @@ module Homebrew end false end - else + elsif system bundle, "clean" # even if we have nothing to install, we may have removed gems true + else + message = <<~EOS + failed to run `#{bundle} clean`! + EOS + if only_warn_on_failure + opoo_if_defined message + else + odie_if_defined message + end + false end if bundle_installed diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb index 54007e24b8..16044b6d24 100644 --- a/Library/Homebrew/utils/git.rb +++ b/Library/Homebrew/utils/git.rb @@ -4,11 +4,9 @@ module Utils # Helper functions for querying Git information. # - # @see GitRepositoryExtension + # @see GitRepository # @api private module Git - extend T::Sig - def self.available? version.present? end diff --git a/Library/Homebrew/utils/git_repository.rb b/Library/Homebrew/utils/git_repository.rb index 6c0e983a89..8ad326348c 100644 --- a/Library/Homebrew/utils/git_repository.rb +++ b/Library/Homebrew/utils/git_repository.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Utils - extend T::Sig - # Gets the full commit hash of the HEAD commit. sig { params( @@ -13,10 +11,9 @@ module Utils ).returns(T.nilable(String)) } def self.git_head(repo = Pathname.pwd, length: nil, safe: true) - return git_short_head(repo, length: length) if length.present? + return git_short_head(repo, length: length) if length - repo = Pathname(repo).extend(GitRepositoryExtension) - repo.git_head(safe: safe) + GitRepository.new(Pathname(repo)).head_ref(safe: safe) end # Gets a short commit hash of the HEAD commit. @@ -28,8 +25,7 @@ module Utils ).returns(T.nilable(String)) } def self.git_short_head(repo = Pathname.pwd, length: nil, safe: true) - repo = Pathname(repo).extend(GitRepositoryExtension) - repo.git_short_head(length: length, safe: safe) + GitRepository.new(Pathname(repo)).short_head_ref(length: length, safe: safe) end # Gets the name of the currently checked-out branch, or HEAD if the repository is in a detached HEAD state. @@ -40,8 +36,7 @@ module Utils ).returns(T.nilable(String)) } def self.git_branch(repo = Pathname.pwd, safe: true) - repo = Pathname(repo).extend(GitRepositoryExtension) - repo.git_branch(safe: safe) + GitRepository.new(Pathname(repo)).branch_name(safe: safe) end # Gets the full commit message of the specified commit, or of the HEAD commit if unspecified. @@ -53,7 +48,6 @@ module Utils ).returns(T.nilable(String)) } def self.git_commit_message(repo = Pathname.pwd, commit: "HEAD", safe: true) - repo = Pathname(repo).extend(GitRepositoryExtension) - repo.git_commit_message(commit, safe: safe) + GitRepository.new(Pathname(repo)).commit_message(commit, safe: safe) end end diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index eda003b560..830c6c5a81 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -11,8 +11,6 @@ require "system_command" # # @api private module GitHub - extend T::Sig - include SystemCommand::Mixin def self.check_runs(repo: nil, commit: nil, pull_request: nil) @@ -576,7 +574,7 @@ module GitHub old_contents = info[:old_contents] additional_files = info[:additional_files] || [] remote = info[:remote] || "origin" - remote_branch = info[:remote_branch] || tap.path.git_origin_branch + remote_branch = info[:remote_branch] || tap.git_repo.origin_branch_name branch = info[:branch_name] commit_message = info[:commit_message] previous_branch = info[:previous_branch] || "-" diff --git a/Library/Homebrew/utils/github/actions.rb b/Library/Homebrew/utils/github/actions.rb index ed27283bb3..b6e3d6b768 100644 --- a/Library/Homebrew/utils/github/actions.rb +++ b/Library/Homebrew/utils/github/actions.rb @@ -9,8 +9,6 @@ module GitHub # # @api private module Actions - extend T::Sig - sig { params(string: String).returns(String) } def self.escape(string) # See https://github.community/t/set-output-truncates-multiline-strings/16852/3. @@ -39,8 +37,6 @@ module GitHub # Helper class for formatting annotations on GitHub Actions. class Annotation - extend T::Sig - ANNOTATION_TYPES = [:notice, :warning, :error].freeze sig { params(path: T.any(String, Pathname)).returns(T.nilable(Pathname)) } diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index 0d122975a9..120d9a2507 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -31,10 +31,6 @@ module GitHub # # @api private module API - extend T::Sig - - module_function - # Generic API error. class Error < RuntimeError attr_reader :github_message @@ -119,7 +115,7 @@ module GitHub # Gets the password field from `git-credential-osxkeychain` for github.com, # but only if that password looks like a GitHub Personal Access Token. sig { returns(T.nilable(String)) } - def keychain_username_password + def self.keychain_username_password github_credentials = Utils.popen_write("git", "credential-osxkeychain", "get") do |pipe| pipe.write "protocol=https\nhost=github.com\n" end @@ -141,12 +137,12 @@ module GitHub nil end - def credentials + def self.credentials @credentials ||= Homebrew::EnvConfig.github_api_token || keychain_username_password end sig { returns(Symbol) } - def credentials_type + def self.credentials_type if Homebrew::EnvConfig.github_api_token :env_token elsif keychain_username_password @@ -158,7 +154,7 @@ module GitHub # Given an API response from GitHub, warn the user if their credentials # have insufficient permissions. - def credentials_error_message(response_headers, needed_scopes) + def self.credentials_error_message(response_headers, needed_scopes) return if response_headers.empty? scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ") @@ -184,7 +180,9 @@ module GitHub EOS end - def open_rest(url, data: nil, data_binary_path: nil, request_method: nil, scopes: [].freeze, parse_json: true) + def self.open_rest( + url, data: nil, data_binary_path: nil, request_method: nil, scopes: [].freeze, parse_json: true + ) # This is a no-op if the user is opting out of using the GitHub API. return block_given? ? yield({}) : {} if Homebrew::EnvConfig.no_github_api? @@ -253,7 +251,7 @@ module GitHub end end - def paginate_rest(url, additional_query_params: nil, per_page: 100) + def self.paginate_rest(url, additional_query_params: nil, per_page: 100) (1..API_MAX_PAGES).each do |page| result = API.open_rest("#{url}?per_page=#{per_page}&page=#{page}&#{additional_query_params}") break if result.blank? @@ -262,7 +260,7 @@ module GitHub end end - def open_graphql(query, variables: nil, scopes: [].freeze, raise_errors: true) + def self.open_graphql(query, variables: nil, scopes: [].freeze, raise_errors: true) data = { query: query, variables: variables } result = open_rest("#{API_URL}/graphql", scopes: scopes, data: data, request_method: "POST") @@ -277,7 +275,7 @@ module GitHub end end - def raise_error(output, errors, http_code, headers, scopes) + def self.raise_error(output, errors, http_code, headers, scopes) json = begin JSON.parse(output) rescue diff --git a/Library/Homebrew/utils/github/api.rbi b/Library/Homebrew/utils/github/api.rbi deleted file mode 100644 index bb72675c19..0000000000 --- a/Library/Homebrew/utils/github/api.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module GitHub::API - include Kernel -end diff --git a/Library/Homebrew/utils/gzip.rb b/Library/Homebrew/utils/gzip.rb index b5cbd04fa7..a7df3e6db4 100644 --- a/Library/Homebrew/utils/gzip.rb +++ b/Library/Homebrew/utils/gzip.rb @@ -8,10 +8,6 @@ GZIP_BUFFER_SIZE = 64 * 1024 module Utils # Helper functions for creating gzip files. module Gzip - extend T::Sig - - module_function - sig { params( path: T.any(String, Pathname), @@ -20,8 +16,8 @@ module Utils output: T.any(String, Pathname), ).returns(Pathname) } - def compress_with_options(path, mtime: ENV["SOURCE_DATE_EPOCH"].to_i, orig_name: File.basename(path), - output: "#{path}.gz") + def self.compress_with_options(path, mtime: ENV["SOURCE_DATE_EPOCH"].to_i, orig_name: File.basename(path), + output: "#{path}.gz") # Ideally, we would just set mtime = 0 if SOURCE_DATE_EPOCH is absent, but Ruby's # Zlib::GzipWriter does not properly handle the case of setting mtime = 0: # https://bugs.ruby-lang.org/issues/16285 @@ -55,7 +51,7 @@ module Utils mtime: T.any(Integer, Time), ).returns(T::Array[Pathname]) } - def compress(*paths, reproducible: true, mtime: ENV["SOURCE_DATE_EPOCH"].to_i) + def self.compress(*paths, reproducible: true, mtime: ENV["SOURCE_DATE_EPOCH"].to_i) if reproducible paths.map do |path| compress_with_options(path, mtime: mtime) diff --git a/Library/Homebrew/utils/gzip.rbi b/Library/Homebrew/utils/gzip.rbi deleted file mode 100644 index 7b7201eaca..0000000000 --- a/Library/Homebrew/utils/gzip.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Utils - module Gzip - include Kernel - end -end diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 50ff78f80b..9e3118a430 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -8,8 +8,6 @@ module Utils # # @api private module Inreplace - extend T::Sig - # Error during text replacement. class Error < RuntimeError def initialize(errors) diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index c33d5ca335..d166878bc3 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -6,9 +6,7 @@ module Utils # # @api private module Link - module_function - - def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) + def self.link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) return unless src_dir.exist? conflicts = [] @@ -42,7 +40,7 @@ module Utils end private_class_method :link_src_dst_dirs - def unlink_src_dst_dirs(src_dir, dst_dir, unlink_dir: false) + def self.unlink_src_dst_dirs(src_dir, dst_dir, unlink_dir: false) return unless src_dir.exist? src_paths = unlink_dir ? [src_dir] : src_dir.find @@ -56,27 +54,27 @@ module Utils end private_class_method :unlink_src_dst_dirs - def link_manpages(path, command) + def self.link_manpages(path, command) link_src_dst_dirs(path/"manpages", HOMEBREW_PREFIX/"share/man/man1", command) end - def unlink_manpages(path) + def self.unlink_manpages(path) unlink_src_dst_dirs(path/"manpages", HOMEBREW_PREFIX/"share/man/man1") end - def link_completions(path, command) + def self.link_completions(path, command) link_src_dst_dirs(path/"completions/bash", HOMEBREW_PREFIX/"etc/bash_completion.d", command) link_src_dst_dirs(path/"completions/zsh", HOMEBREW_PREFIX/"share/zsh/site-functions", command) link_src_dst_dirs(path/"completions/fish", HOMEBREW_PREFIX/"share/fish/vendor_completions.d", command) end - def unlink_completions(path) + def self.unlink_completions(path) unlink_src_dst_dirs(path/"completions/bash", HOMEBREW_PREFIX/"etc/bash_completion.d") unlink_src_dst_dirs(path/"completions/zsh", HOMEBREW_PREFIX/"share/zsh/site-functions") unlink_src_dst_dirs(path/"completions/fish", HOMEBREW_PREFIX/"share/fish/vendor_completions.d") end - def link_docs(path, command) + def self.link_docs(path, command) link_src_dst_dirs(path/"docs", HOMEBREW_PREFIX/"share/doc/homebrew", command, link_dir: true) end end diff --git a/Library/Homebrew/utils/link.rbi b/Library/Homebrew/utils/link.rbi deleted file mode 100644 index 0b88a48d16..0000000000 --- a/Library/Homebrew/utils/link.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Utils - module Link - include Kernel - end -end diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index c65576a186..105922576d 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -5,8 +5,6 @@ # # @api private module PyPI - extend T::Sig - PYTHONHOSTED_URL_PREFIX = "https://files.pythonhosted.org/packages/" private_constant :PYTHONHOSTED_URL_PREFIX @@ -14,8 +12,6 @@ module PyPI # # @api private class Package - extend T::Sig - attr_accessor :name, :extras, :version sig { params(package_string: String, is_url: T::Boolean).void } @@ -28,7 +24,7 @@ module PyPI end raise ArgumentError, "Package should be a valid PyPI URL" if match.blank? - @name = match[1] + @name = PyPI.normalize_python_package(match[1]) @version = match[2] return end @@ -212,12 +208,13 @@ module PyPI end end - ensure_formula_installed!("pipgrip") + ensure_formula_installed!("python") ohai "Retrieving PyPI dependencies for \"#{input_packages.join(" ")}\"..." if !print_only && !silent command = - [Formula["pipgrip"].opt_bin/"pipgrip", "--json", "--tree", "--no-cache-dir", *input_packages.map(&:to_s)] - pipgrip_output = Utils.popen_read(*command) + [Formula["python"].bin/"python3", "-m", "pip", "install", "-q", "--dry-run", "--ignore-installed", "--report", + "/dev/stdout", *input_packages.map(&:to_s)] + pip_output = Utils.popen_read({ "PIP_REQUIRE_VIRTUALENV" => "false" }, *command) unless $CHILD_STATUS.success? odie <<~EOS Unable to determine dependencies for "#{input_packages.join(" ")}" because of a failure when running @@ -226,7 +223,7 @@ module PyPI EOS end - found_packages = json_to_packages(JSON.parse(pipgrip_output), main_package, exclude_packages).uniq + found_packages = pip_report_to_packages(JSON.parse(pip_output), exclude_packages).uniq new_resource_blocks = "" found_packages.sort.each do |package| @@ -284,17 +281,22 @@ module PyPI true end - def self.json_to_packages(json_tree, main_package, exclude_packages) - return [] if json_tree.blank? + def self.normalize_python_package(name) + # This normalization is defined in the PyPA packaging specifications; + # https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization + name.gsub(/[-_.]+/, "-").downcase + end - json_tree.flat_map do |package_json| - package = Package.new("#{package_json["name"]}==#{package_json["version"]}") - dependencies = if package == main_package || exclude_packages.exclude?(package) - json_to_packages(package_json["dependencies"], main_package, exclude_packages) - else - [] - end - [package] + dependencies - end + def self.pip_report_to_packages(report, exclude_packages) + return [] if report.blank? + + report["install"].map do |package| + name = normalize_python_package(package["metadata"]["name"]) + version = package["metadata"]["version"] + + package = Package.new "#{name}==#{version}" + + package if exclude_packages.exclude? package + end.compact end end diff --git a/Library/Homebrew/utils/repology.rb b/Library/Homebrew/utils/repology.rb index dc9fc61cec..b40a05cc03 100644 --- a/Library/Homebrew/utils/repology.rb +++ b/Library/Homebrew/utils/repology.rb @@ -9,13 +9,10 @@ require "utils/curl" module Repology HOMEBREW_CORE = "homebrew" HOMEBREW_CASK = "homebrew_casks" - - module_function - MAX_PAGINATION = 15 private_constant :MAX_PAGINATION - def query_api(last_package_in_response = "", repository:) + def self.query_api(last_package_in_response = "", repository:) last_package_in_response += "/" if last_package_in_response.present? url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1" @@ -31,7 +28,7 @@ module Repology raise end - def single_package_query(name, repository:) + def self.single_package_query(name, repository:) url = "https://repology.org/tools/project-by?repo=#{repository}&" \ "name_type=srcname&target_page=api_v1_project&name=#{name}" @@ -50,7 +47,7 @@ module Repology nil end - def parse_api_response(limit = nil, last_package = "", repository:) + def self.parse_api_response(limit = nil, last_package = "", repository:) package_term = case repository when HOMEBREW_CORE "formulae" @@ -83,7 +80,7 @@ module Repology outdated_packages.sort.to_h end - def latest_version(repositories) + def self.latest_version(repositories) # The status is "unique" when the package is present only in Homebrew, so # Repology has no way of knowing if the package is up-to-date. is_unique = repositories.find do |repo| diff --git a/Library/Homebrew/utils/repology.rbi b/Library/Homebrew/utils/repology.rbi deleted file mode 100644 index 57ed1c467f..0000000000 --- a/Library/Homebrew/utils/repology.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: strict - -module Repology - include Kernel - requires_ancestor { Utils::Curl } -end diff --git a/Library/Homebrew/utils/shebang.rb b/Library/Homebrew/utils/shebang.rb index edf36e0f0c..95daadcd6d 100644 --- a/Library/Homebrew/utils/shebang.rb +++ b/Library/Homebrew/utils/shebang.rb @@ -6,16 +6,12 @@ module Utils # # @api private module Shebang - extend T::Sig - module_function # Specification on how to rewrite a given shebang. # # @api private class RewriteInfo - extend T::Sig - attr_reader :regex, :max_length, :replacement sig { params(regex: Regexp, max_length: Integer, replacement: T.any(String, Pathname)).void } @@ -32,7 +28,7 @@ module Utils # rewrite_shebang detected_python_shebang, bin/"script.py" # # @api public - sig { params(rewrite_info: RewriteInfo, paths: T::Array[T.any(String, Pathname)]).void } + sig { params(rewrite_info: RewriteInfo, paths: T.any(String, Pathname)).void } def rewrite_shebang(rewrite_info, *paths) paths.each do |f| f = Pathname(f) diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 4fe444be02..6a903d4c88 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -3,8 +3,6 @@ module Utils module Shell - extend T::Sig - module_function # Take a path and heuristically convert it to a shell name, diff --git a/Library/Homebrew/utils/string_inreplace_extension.rb b/Library/Homebrew/utils/string_inreplace_extension.rb index ab49f00a92..d04ed40dfd 100644 --- a/Library/Homebrew/utils/string_inreplace_extension.rb +++ b/Library/Homebrew/utils/string_inreplace_extension.rb @@ -5,8 +5,6 @@ # # @api private class StringInreplaceExtension - extend T::Sig - attr_accessor :errors, :inreplace_string sig { params(string: String).void } diff --git a/Library/Homebrew/utils/svn.rb b/Library/Homebrew/utils/svn.rb index 5c4269ddd6..71a1d9ddf2 100644 --- a/Library/Homebrew/utils/svn.rb +++ b/Library/Homebrew/utils/svn.rb @@ -9,8 +9,6 @@ module Utils # @api private module Svn class << self - extend T::Sig - include SystemCommand::Mixin sig { returns(T::Boolean) } diff --git a/Library/Homebrew/utils/topological_hash.rb b/Library/Homebrew/utils/topological_hash.rb index cac774c857..726eab599e 100644 --- a/Library/Homebrew/utils/topological_hash.rb +++ b/Library/Homebrew/utils/topological_hash.rb @@ -6,8 +6,6 @@ require "tsort" module Utils # Topologically sortable hash map. class TopologicalHash < Hash - extend T::Sig - include TSort sig { diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index 97ee940256..4897c92fb3 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -40,8 +40,6 @@ module Tty CODES = COLOR_CODES.merge(STYLE_CODES).freeze class << self - extend T::Sig - sig { params(stream: T.any(IO, StringIO), _block: T.proc.params(arg0: T.any(IO, StringIO)).void).void } def with(stream, &_block) previous_stream = @stream diff --git a/Library/Homebrew/utils/user.rb b/Library/Homebrew/utils/user.rb index c2db57e637..cb758ef47e 100644 --- a/Library/Homebrew/utils/user.rb +++ b/Library/Homebrew/utils/user.rb @@ -10,8 +10,6 @@ require "system_command" # # @api private class User < SimpleDelegator - extend T::Sig - include SystemCommand::Mixin # Return whether the user has an active GUI session. diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 05d5dccabe..d9fa2062ec 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -42,41 +42,24 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/highline-2.0.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/commander-4.6.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/connection_pool-2.4.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/did_you_mean-1.6.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.5.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/docile-1.4.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/unf_ext-0.0.8.2") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unf_ext-0.0.8.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unf-0.1.4/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/domain_name-0.5.20190701/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.7.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.8.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ecma-re-validator-0.4.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/elftools-1.2.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hana-1.3.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/hpricot-0.8.6") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hpricot-0.8.6/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/http-cookie-1.0.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/json-2.6.3") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.6.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/uri_template-0.7.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-0.2.24/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/mime-types-data-3.2023.0218.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/mime-types-3.4.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/net-http-digest_auth-1.4.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/net-http-persistent-4.0.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/racc-1.6.2") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.6.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/nokogiri-1.13.10-x86_64-darwin/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubyntlm-0.6.3/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/webrick-1.8.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/webrobots-0.1.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/mechanize-2.9.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/method_source-1.0.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/mustache-1.1.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel-1.22.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel-1.23.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel_tests-3.13.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.2.2.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.2.2.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rainbow-3.1.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.10461/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parlour-8.1.0/lib") @@ -91,8 +74,8 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rexml-3.2.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ronn-0.7.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-support-3.12.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-core-3.12.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-expectations-3.12.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-core-3.12.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-expectations-3.12.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-mocks-3.12.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-3.12.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-github-2.4.0/lib") @@ -103,11 +86,11 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-ast-1.28.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-2.4.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.50.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-capybara-2.17.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.50.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-capybara-2.18.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.17.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rails-2.19.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-2.19.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rails-2.19.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-2.20.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.7.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-macho-3.0.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/ruby-prof-1.4.3") diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop-capybara.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop-capybara.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop-capybara.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop-capybara.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/config_formatter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/config_formatter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/config_formatter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/config_formatter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/description_extractor.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/description_extractor.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/description_extractor.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/description_extractor.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/version.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/version.rb index 2d3fb5597f..94846727a4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/capybara/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/capybara/version.rb @@ -4,7 +4,7 @@ module RuboCop module Capybara # Version information for the Capybara RuboCop plugin. module Version - STRING = '2.17.1' + STRING = '2.18.0' end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/current_path_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/current_path_expectation.rb similarity index 82% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/current_path_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/current_path_expectation.rb index f5fd6fb95d..5ac7a91150 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/current_path_expectation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/current_path_expectation.rb @@ -6,10 +6,10 @@ module RuboCop # Checks that no expectations are set on Capybara's `current_path`. # # The - # https://www.rubydoc.info/github/teamcapybara/capybara/main/Capybara/RSpecMatchers#have_current_path-instance_method[`have_current_path` matcher] + # https://www.rubydoc.info/github/teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-instance_method[`have_current_path` matcher] # should be used on `page` to set expectations on Capybara's # current path, since it uses - # https://github.com/teamcapybara/capybara/blob/main/README.md#asynchronous-javascript-ajax-and-friends[Capybara's waiting functionality] + # https://github.com/teamcapybara/capybara/blob/master/README.md#asynchronous-javascript-ajax-and-friends[Capybara's waiting functionality] # which ensures that preceding actions (like `click_link`) have # completed. # @@ -30,6 +30,7 @@ module RuboCop # class CurrentPathExpectation < ::RuboCop::Cop::Base extend AutoCorrector + include RangeHelp MSG = 'Do not set an RSpec expectation on `current_path` in ' \ 'Capybara feature specs - instead, use the ' \ @@ -85,8 +86,7 @@ module RuboCop end def rewrite_expectation(corrector, node, to_symbol, matcher_node) - current_path_node = node.first_argument - corrector.replace(current_path_node, 'page') + corrector.replace(node.first_argument, 'page') corrector.replace(node.parent.loc.selector, 'to') matcher_method = if to_symbol == :to 'have_current_path' @@ -94,6 +94,7 @@ module RuboCop 'have_no_current_path' end corrector.replace(matcher_node.loc.selector, matcher_method) + add_argument_parentheses(corrector, matcher_node.first_argument) add_ignore_query_options(corrector, node) end @@ -111,6 +112,20 @@ module RuboCop end end + def add_argument_parentheses(corrector, arg_node) + return unless method_call_with_no_parentheses?(arg_node) + + first_argument_range = range_with_surrounding_space( + arg_node.first_argument.source_range, side: :left + ) + corrector.insert_before(first_argument_range, '(') + corrector.insert_after(arg_node.last_argument, ')') + end + + def method_call_with_no_parentheses?(arg_node) + arg_node.send_type? && arg_node.arguments? && !arg_node.parenthesized? + end + # `have_current_path` with no options will include the querystring # while `page.current_path` does not. # This ensures the option `ignore_query: true` is added diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/match_style.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/match_style.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/match_style.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/match_style.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/mixin/capybara_help.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/mixin/capybara_help.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/mixin/capybara_help.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/mixin/capybara_help.rb index 08efb75ad2..d18fab689a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/mixin/capybara_help.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/mixin/capybara_help.rb @@ -4,6 +4,7 @@ module RuboCop module Cop module Capybara # Help methods for capybara. + # @api private module CapybaraHelp COMMON_OPTIONS = %w[ id class style diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/mixin/css_selector.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/mixin/css_selector.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/mixin/css_selector.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/mixin/css_selector.rb index ebf3773187..66b0bfd8ff 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/mixin/css_selector.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/mixin/css_selector.rb @@ -4,6 +4,7 @@ module RuboCop module Cop module Capybara # Helps parsing css selector. + # @api private module CssSelector module_function diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/negation_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/negation_matcher.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/negation_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/negation_matcher.rb index 1adcce4887..f02afe5fa7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/negation_matcher.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/negation_matcher.rb @@ -31,7 +31,7 @@ module RuboCop CAPYBARA_MATCHERS = %w[ selector css xpath text title current_path link button field checked_field unchecked_field select table - sibling ancestor + sibling ancestor content ].freeze POSITIVE_MATCHERS = Set.new(CAPYBARA_MATCHERS) { |element| :"have_#{element}" }.freeze diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_actions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_actions.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_actions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_actions.rb index e2b97fa053..01afbe6b13 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_actions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_actions.rb @@ -75,7 +75,7 @@ module RuboCop end def offense_range(node, receiver) - receiver.loc.selector.with(end_pos: node.loc.expression.end_pos) + receiver.loc.selector.with(end_pos: node.source_range.end_pos) end def message(action, selector) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_finders.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_finders.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_finders.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_finders.rb index 117d03e444..95d4ae7793 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_finders.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_finders.rb @@ -19,7 +19,7 @@ module RuboCop include RangeHelp - MSG = 'Prefer `find_by` over `find`.' + MSG = 'Prefer `find_by_id` over `find`.' RESTRICT_ON_SEND = %i[find].freeze # @!method find_argument(node) @@ -68,7 +68,7 @@ module RuboCop def register_offense(node, id, classes = []) add_offense(offense_range(node)) do |corrector| corrector.replace(node.loc.selector, 'find_by_id') - corrector.replace(node.first_argument.loc.expression, + corrector.replace(node.first_argument, id.delete('\\')) unless classes.compact.empty? autocorrect_classes(corrector, node, classes) @@ -117,7 +117,7 @@ module RuboCop if node.loc.end node.loc.end.end_pos else - node.loc.expression.end_pos + node.source_range.end_pos end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/specific_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/specific_matcher.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/visibility_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/visibility_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara/visibility_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara/visibility_matcher.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara_cops.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib/rubocop/cop/capybara_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.18.0/lib/rubocop/cop/capybara_cops.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/config/default.yml similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/config/default.yml index 5fe5788785..477bcd7c1d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/config/default.yml @@ -1139,6 +1139,7 @@ Rails/WhereNot: Rails/WhereNotWithMultipleConditions: Description: 'Do not use `where.not(...)` with multiple conditions.' + StyleGuide: 'https://rails.rubystyle.guide/#where-not-with-multiple-attributes' Enabled: 'pending' Severity: warning VersionAdded: '2.17' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/config/obsoletion.yml similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/config/obsoletion.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/config/obsoletion.yml diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop-rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop-rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop-rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop-rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/active_record_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/active_record_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_migrations_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/active_record_migrations_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/active_record_migrations_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/active_record_migrations_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/class_send_node_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/class_send_node_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/class_send_node_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/class_send_node_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/enforce_superclass.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/enforce_superclass.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/enforce_superclass.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/enforce_superclass.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/index_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/index_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/index_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/index_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/migrations_helper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/migrations_helper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/migrations_helper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/migrations_helper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/target_rails_version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/target_rails_version.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/mixin/target_rails_version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/mixin/target_rails_version.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_flash_before_render.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_controller_flash_before_render.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_flash_before_render.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_controller_flash_before_render.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_test_case.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_controller_test_case.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_controller_test_case.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_controller_test_case.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_filter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_order.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/action_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/action_order.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_record_aliases.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_record_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_record_callbacks_order.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_callbacks_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_record_callbacks_order.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_record_override.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_record_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_record_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_aliases.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_support_aliases.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_aliases.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_support_aliases.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_on_load.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_support_on_load.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/active_support_on_load.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/active_support_on_load.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/add_column_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/add_column_index.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/add_column_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/add_column_index.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/after_commit_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/after_commit_override.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/after_commit_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/after_commit_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_controller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_controller.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_controller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_controller.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_job.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_job.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_job.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_job.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_mailer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_mailer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_mailer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_mailer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_record.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_record.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/application_record.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/application_record.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/arel_star.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/arel_star.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/arel_star.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/arel_star.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/assert_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/assert_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/assert_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/assert_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/attribute_default_block_value.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/attribute_default_block_value.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/attribute_default_block_value.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/attribute_default_block_value.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/belongs_to.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/belongs_to.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/bulk_change_table.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/bulk_change_table.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/bulk_change_table.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/bulk_change_table.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/compact_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/compact_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/compact_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/compact_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/content_tag.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/content_tag.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/content_tag.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/content_tag.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/create_table_with_timestamps.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/create_table_with_timestamps.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/create_table_with_timestamps.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/date.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/date.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/date.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/date.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/default_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/default_scope.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/default_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/default_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/delegate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/delegate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate_allow_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/delegate_allow_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/delegate_allow_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/delegate_allow_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dot_separated_keys.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/dot_separated_keys.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dot_separated_keys.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/dot_separated_keys.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_association.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/duplicate_association.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_association.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/duplicate_association.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_scope.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/duplicate_scope.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duplicate_scope.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/duplicate_scope.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duration_arithmetic.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/duration_arithmetic.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/duration_arithmetic.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/duration_arithmetic.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dynamic_find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/dynamic_find_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/dynamic_find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/dynamic_find_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/eager_evaluation_log_message.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/eager_evaluation_log_message.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/eager_evaluation_log_message.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/enum_hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/enum_hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_uniqueness.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/enum_uniqueness.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/enum_uniqueness.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/enum_uniqueness.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_comparison.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/environment_comparison.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_comparison.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/environment_comparison.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_variable_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/environment_variable_access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/environment_variable_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/environment_variable_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/exit.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/exit.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/exit.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/exit.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/expanded_date_range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/expanded_date_range.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/expanded_date_range.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/expanded_date_range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/file_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/file_path.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/find_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/find_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/find_by_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/find_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/find_each.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/find_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/find_each.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/freeze_time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/freeze_time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/freeze_time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/freeze_time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/has_and_belongs_to_many.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/has_and_belongs_to_many.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/helper_instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/helper_instance_variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/helper_instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/helper_instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_positional_arguments.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/http_positional_arguments.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_positional_arguments.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/http_positional_arguments.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/http_status.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/http_status.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/i18n_lazy_lookup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_lazy_lookup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/i18n_lazy_lookup.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/i18n_locale_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/i18n_locale_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_texts.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/i18n_locale_texts.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/i18n_locale_texts.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/i18n_locale_texts.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/ignored_columns_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/ignored_columns_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/ignored_columns_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/ignored_columns_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/index_by.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/index_by.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/index_by.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/index_by.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/index_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/index_with.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/index_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/index_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inverse_of.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/inverse_of.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/inverse_of.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/inverse_of.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/link_to_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/link_to_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/link_to_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/link_to_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/mailer_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/mailer_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/mailer_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/mailer_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/match_route.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/match_route.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/match_route.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/match_route.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/migration_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/migration_class_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/migration_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/migration_class_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/negate_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/negate_include.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/negate_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/negate_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/not_null_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/not_null_column.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/not_null_column.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/not_null_column.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/order_by_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/order_by_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/order_by_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/order_by_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/output.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output_safety.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/output_safety.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/output_safety.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/output_safety.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pick.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pick.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pick.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pick.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluck.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_id.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluck_id.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_id.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluck_id.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_in_where.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluck_in_where.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluck_in_where.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluck_in_where.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluralization_grammar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluralization_grammar.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/pluralization_grammar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/pluralization_grammar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/presence.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/presence.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/presence.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/presence.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/present.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/present.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/present.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/present.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/rake_environment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/rake_environment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/rake_environment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/rake_environment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/read_write_attribute.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/read_write_attribute.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/read_write_attribute.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/read_write_attribute.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_allow_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_allow_nil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_allow_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_allow_nil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_foreign_key.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_foreign_key.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_foreign_key.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_foreign_key.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_travel_back.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_travel_back.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/redundant_travel_back.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/redundant_travel_back.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reflection_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/reflection_class_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reflection_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/reflection_class_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/refute_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/refute_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/refute_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/refute_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/relative_date_constant.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/relative_date_constant.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/relative_date_constant.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/relative_date_constant.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/render_inline.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/render_inline.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/render_inline.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/render_inline.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/render_plain_text.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/render_plain_text.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/render_plain_text.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/render_plain_text.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/request_referer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/request_referer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/request_referer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/request_referer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/require_dependency.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/require_dependency.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/require_dependency.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/require_dependency.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/response_parsed_body.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/response_parsed_body.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/response_parsed_body.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/response_parsed_body.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/reversible_migration.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/reversible_migration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/reversible_migration_method_definition.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/reversible_migration_method_definition.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/reversible_migration_method_definition.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_join_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/root_join_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_join_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/root_join_chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_pathname_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/root_pathname_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_pathname_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/root_pathname_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_public_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/root_public_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/root_public_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/root_public_path.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/safe_navigation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/safe_navigation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation_with_blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/safe_navigation_with_blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/safe_navigation_with_blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/safe_navigation_with_blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/save_bang.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/save_bang.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/save_bang.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/save_bang.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/schema_comment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/schema_comment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/schema_comment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/schema_comment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/scope_args.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/scope_args.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/scope_args.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/scope_args.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/short_i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/short_i18n.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/short_i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/short_i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/skips_model_validations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/skips_model_validations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/skips_model_validations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/skips_model_validations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/squished_sql_heredocs.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/squished_sql_heredocs.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/squished_sql_heredocs.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/strip_heredoc.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/strip_heredoc.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/strip_heredoc.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/strip_heredoc.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/table_name_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/table_name_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/table_name_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/table_name_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/three_state_boolean_column.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/three_state_boolean_column.rb index e7e3ebf4a9..fd27e4d9d3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/three_state_boolean_column.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/three_state_boolean_column.rb @@ -46,7 +46,9 @@ module RuboCop def_node = node.each_ancestor(:def, :defs).first table_node = table_node(node) - return if def_node && change_column_null?(def_node, table_node.value, column_node.value) + if def_node && (table_node.nil? || change_column_null?(def_node, table_node.value, column_node.value)) + return + end add_offense(node) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/time_zone.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/time_zone.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone_assignment.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/time_zone_assignment.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/time_zone_assignment.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/time_zone_assignment.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_formatted_s.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/to_formatted_s.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_formatted_s.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/to_formatted_s.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_s_with_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/to_s_with_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/to_s_with_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/to_s_with_argument.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/transaction_exit_statement.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/transaction_exit_statement.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/transaction_exit_statement.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/transaction_exit_statement.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/uniq_before_pluck.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/uniq_before_pluck.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/uniq_before_pluck.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/uniq_before_pluck.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unique_validation_without_index.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/unique_validation_without_index.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unique_validation_without_index.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/unique_validation_without_index.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unknown_env.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/unknown_env.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unknown_env.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/unknown_env.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unused_ignored_columns.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/unused_ignored_columns.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/unused_ignored_columns.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/unused_ignored_columns.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/validation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/validation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/validation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/validation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_equals.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_equals.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_equals.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_equals.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_exists.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_exists.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_exists.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_exists.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_missing.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_missing.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_missing.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_missing.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails_cops.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/cop/rails_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/cop/rails_cops.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/schema_loader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/schema_loader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader/schema.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/schema_loader/schema.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/schema_loader/schema.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/schema_loader/schema.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/version.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/version.rb index 887f195c0d..c2ea8c7a71 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.0/lib/rubocop/rails/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.19.1/lib/rubocop/rails/version.rb @@ -4,7 +4,7 @@ module RuboCop module Rails # This module holds the RuboCop Rails version information. module Version - STRING = '2.19.0' + STRING = '2.19.1' def self.document_version STRING.match('\d+\.\d+').to_s diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/config/default.yml similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/config/default.yml index 86f7f49917..942273bc9c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/config/default.yml @@ -144,6 +144,12 @@ RSpec/Be: StyleGuide: https://rspec.rubystyle.guide/#be-matcher Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be +RSpec/BeEmpty: + Description: Prefer using `be_empty` when checking for an empty array. + Enabled: pending + VersionAdded: '2.20' + Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEmpty + RSpec/BeEq: Description: Check for expectations where `be(...)` can replace `eq(...)`. Enabled: pending @@ -202,8 +208,8 @@ RSpec/ClassCheck: Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ClassCheck RSpec/ContainExactly: - Description: Prefer `match_array` when matching array values. - Enabled: true + Description: Checks where `contain_exactly` is used. + Enabled: pending VersionAdded: '2.19' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContainExactly @@ -503,6 +509,13 @@ RSpec/ImplicitSubject: VersionChanged: '2.13' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject +RSpec/IndexedLet: + Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`). + Enabled: pending + VersionAdded: '2.20' + Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet + Max: 1 + RSpec/InstanceSpy: Description: Checks for `instance_double` used with `have_received`. Enabled: true @@ -563,8 +576,8 @@ RSpec/LetSetup: Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup RSpec/MatchArray: - Description: Prefer `contain_exactly` when matching an array literal. - Enabled: true + Description: Checks where `match_array` is used. + Enabled: pending VersionAdded: '2.19' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray @@ -1048,8 +1061,9 @@ RSpec/Rails/HttpStatus: SupportedStyles: - numeric - symbolic + - be_status VersionAdded: '1.23' - VersionChanged: '2.0' + VersionChanged: '2.20' Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus RSpec/Rails/InferredSpecType: diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/config/obsoletion.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/config/obsoletion.yml similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/config/obsoletion.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/config/obsoletion.yml diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop-rspec.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop-rspec.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop-rspec.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop-rspec.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/align_left_let_brace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/align_left_let_brace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/align_left_let_brace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/align_left_let_brace.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/align_right_let_brace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/align_right_let_brace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/align_right_let_brace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/align_right_let_brace.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/any_instance.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/any_instance.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/any_instance.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/any_instance.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/around_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/around_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/around_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/around_block.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/base.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/base.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/base.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/base.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_empty.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_empty.rb new file mode 100644 index 0000000000..68d3cd69d0 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_empty.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Prefer using `be_empty` when checking for an empty array. + # + # @example + # # bad + # expect(array).to contain_exactly + # expect(array).to match_array([]) + # + # # good + # expect(array).to be_empty + # + class BeEmpty < Base + extend AutoCorrector + + MSG = 'Use `be_empty` matchers for checking an empty array.' + RESTRICT_ON_SEND = %i[contain_exactly match_array].freeze + + # @!method expect_array_matcher?(node) + def_node_matcher :expect_array_matcher?, <<~PATTERN + (send + (send nil? :expect _) + #Runners.all + ${ + (send nil? :match_array (array)) + (send nil? :contain_exactly) + } + ) + PATTERN + + def on_send(node) + expect_array_matcher?(node.parent) do |expect| + add_offense(expect) do |corrector| + corrector.replace(expect, 'be_empty') + end + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_eq.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_eq.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_eq.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_eq.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_eql.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_eql.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_eql.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_eql.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_nil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_nil.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_nil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_nil.rb index 729b182ffd..12208feea7 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/be_nil.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/be_nil.rb @@ -57,7 +57,7 @@ module RuboCop return unless be_nil_matcher?(node) add_offense(node, message: BE_MSG) do |corrector| - corrector.replace(node.source_range, 'be(nil)') + corrector.replace(node, 'be(nil)') end end @@ -65,7 +65,7 @@ module RuboCop return unless nil_value_expectation?(node) add_offense(node, message: BE_NIL_MSG) do |corrector| - corrector.replace(node.source_range, 'be_nil') + corrector.replace(node, 'be_nil') end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/before_after_all.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/before_after_all.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/before_after_all.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/before_after_all.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/match_style.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/match_style.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/match_style.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/match_style.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/negation_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/negation_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/negation_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/negation_matcher.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/specific_actions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/specific_actions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/specific_actions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/specific_actions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/specific_finders.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/specific_finders.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/specific_finders.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/specific_finders.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/specific_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/specific_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/specific_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/specific_matcher.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/change_by_zero.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/change_by_zero.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/change_by_zero.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/change_by_zero.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/class_check.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/class_check.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/class_check.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/class_check.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/contain_exactly.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/contain_exactly.rb similarity index 64% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/contain_exactly.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/contain_exactly.rb index 0833320feb..65eb8742f9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/contain_exactly.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/contain_exactly.rb @@ -3,7 +3,11 @@ module RuboCop module Cop module RSpec - # Prefer `match_array` when matching array values. + # Checks where `contain_exactly` is used. + # + # This cop checks for the following: + # - Prefer `match_array` when matching array values. + # - Prefer `be_empty` when using `contain_exactly` with no arguments. # # @example # # bad @@ -14,6 +18,7 @@ module RuboCop # # # good # it { is_expected.to contain_exactly(content, *array) } + # class ContainExactly < Base extend AutoCorrector @@ -21,21 +26,27 @@ module RuboCop RESTRICT_ON_SEND = %i[contain_exactly].freeze def on_send(node) - return unless node.each_child_node.all?(&:splat_type?) + return if node.arguments.empty? - add_offense(node) do |corrector| - autocorrect(node, corrector) - end + check_populated_collection(node) end private - def autocorrect(node, corrector) + def check_populated_collection(node) + return unless node.each_child_node.all?(&:splat_type?) + + add_offense(node) do |corrector| + autocorrect_for_populated_array(node, corrector) + end + end + + def autocorrect_for_populated_array(node, corrector) arrays = node.arguments.map do |splat_node| splat_node.children.first end corrector.replace( - node.source_range, + node, "match_array(#{arrays.map(&:source).join(' + ')})" ) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/context_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/context_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/context_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/context_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/context_wording.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/context_wording.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/context_wording.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/context_wording.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/describe_class.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/describe_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/describe_class.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/describe_class.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/describe_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/describe_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/describe_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/describe_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/describe_symbol.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/describe_symbol.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/describe_symbol.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/describe_symbol.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/described_class.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/described_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/described_class.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/described_class.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/described_class_module_wrapping.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/described_class_module_wrapping.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/described_class_module_wrapping.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/described_class_module_wrapping.rb index f35a484daa..263bec6731 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/described_class_module_wrapping.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/described_class_module_wrapping.rb @@ -22,15 +22,15 @@ module RuboCop class DescribedClassModuleWrapping < Base MSG = 'Avoid opening modules and defining specs within them.' - # @!method find_rspec_blocks(node) - def_node_search :find_rspec_blocks, <<~PATTERN - (block (send #explicit_rspec? #ExampleGroups.all ...) ...) + # @!method include_rspec_blocks?(node) + def_node_search :include_rspec_blocks?, <<~PATTERN + ({block numblock} (send #explicit_rspec? #ExampleGroups.all ...) ...) PATTERN def on_module(node) - find_rspec_blocks(node) do - add_offense(node) - end + return unless include_rspec_blocks?(node) + + add_offense(node) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/dialect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/dialect.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/dialect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/dialect.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/duplicated_metadata.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/duplicated_metadata.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/duplicated_metadata.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/duplicated_metadata.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_example_group.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_hook.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_example.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb index d43573d478..d7dadc35a9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb @@ -30,7 +30,7 @@ module RuboCop MSG = 'Add an empty line after `%s`.' def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler - return unless example_group?(node) + return unless spec_group?(node) missing_separating_line_offense(node) do |method| format(MSG, example_group: method) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/example_length.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/example_length.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/example_length.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/example_length.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/example_without_description.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/example_without_description.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/example_without_description.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/example_without_description.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/example_wording.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/example_wording.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/example_wording.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/example_wording.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_actual.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_actual.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_actual.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_actual.rb index dcf6d54496..dd368d3be1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_actual.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_actual.rb @@ -93,8 +93,8 @@ module RuboCop end def swap(corrector, actual, expected) - corrector.replace(actual.source_range, expected.source) - corrector.replace(expected.source_range, actual.source) + corrector.replace(actual, expected.source) + corrector.replace(expected, actual.source) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_change.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_change.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_change.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_change.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_in_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_in_hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_in_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_in_hook.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/expect_output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/expect_output.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb index 0b33ceb4ac..e015a9973e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb @@ -100,10 +100,10 @@ module RuboCop end end + AMBIGUOUS_TYPES = %i[send pair array and or if].freeze + def ambiguous_without_parentheses?(node) - node.parent&.send_type? || - node.parent&.pair_type? || - node.parent&.array_type? + node.parent && AMBIGUOUS_TYPES.include?(node.parent.type) end def remove_parentheses(corrector, node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/file_path.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/file_path.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/file_path.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/file_path.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/focus.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/focus.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/focus.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/focus.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/hook_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/hook_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/hook_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/hook_argument.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/hooks_before_examples.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/hooks_before_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/hooks_before_examples.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/hooks_before_examples.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/identical_equality_assertion.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/identical_equality_assertion.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/identical_equality_assertion.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/identical_equality_assertion.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/implicit_block_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/implicit_block_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/implicit_block_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/implicit_block_expectation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/implicit_expect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/implicit_expect.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/implicit_expect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/implicit_expect.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/implicit_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/implicit_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/implicit_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/implicit_subject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/indexed_let.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/indexed_let.rb new file mode 100644 index 0000000000..91e8c2647f --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/indexed_let.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module RSpec + # Do not set up test data using indexes (e.g., `item_1`, `item_2`). + # + # It makes reading the test harder because it's not clear what exactly + # is tested by this particular example. + # + # @example `Max: 1 (default)` + # # bad + # let(:item_1) { create(:item) } + # let(:item_2) { create(:item) } + # + # let(:item1) { create(:item) } + # let(:item2) { create(:item) } + # + # # good + # + # let(:visible_item) { create(:item, visible: true) } + # let(:invisible_item) { create(:item, visible: false) } + # + # @example `Max: 2` + # # bad + # let(:item_1) { create(:item) } + # let(:item_2) { create(:item) } + # let(:item_3) { create(:item) } + # + # # good + # let(:item_1) { create(:item) } + # let(:item_2) { create(:item) } + # + class IndexedLet < Base + MSG = 'This `let` statement uses index in its name. Please give it ' \ + 'a meaningful name.' + + # @!method let_name(node) + def_node_matcher :let_name, <<~PATTERN + { + (block (send nil? #Helpers.all ({str sym} $_) ...) ...) + (send nil? #Helpers.all ({str sym} $_) block_pass) + } + PATTERN + + def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler + return unless spec_group?(node) + + children = node.body&.child_nodes + return unless children + + filter_indexed_lets(children).each do |let_node| + add_offense(let_node) + end + end + + private + + INDEX_REGEX = /_?\d+/.freeze + + def filter_indexed_lets(candidates) + candidates + .filter { |node| indexed_let?(node) } + .group_by { |node| let_name(node).to_s.gsub(INDEX_REGEX, '') } + .values + .filter { |lets| lets.length > cop_config['Max'] } + .flatten + end + + def indexed_let?(node) + let?(node) && INDEX_REGEX.match?(let_name(node)) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/instance_spy.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/instance_spy.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/instance_spy.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/instance_spy.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/instance_variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/instance_variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/instance_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/instance_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/it_behaves_like.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/it_behaves_like.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/it_behaves_like.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/it_behaves_like.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/iterated_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/iterated_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/iterated_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/iterated_expectation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/leading_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/leading_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/leading_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/leading_subject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/leaky_constant_declaration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/leaky_constant_declaration.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/leaky_constant_declaration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/leaky_constant_declaration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/let_before_examples.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/let_before_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/let_before_examples.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/let_before_examples.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/let_setup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/let_setup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/let_setup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/let_setup.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/match_array.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/match_array.rb similarity index 63% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/match_array.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/match_array.rb index e7ef84f316..058c69f5b2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/match_array.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/match_array.rb @@ -3,7 +3,11 @@ module RuboCop module Cop module RSpec - # Prefer `contain_exactly` when matching an array literal. + # Checks where `match_array` is used. + # + # This cop checks for the following: + # - Prefer `contain_exactly` when matching an array with values. + # - Prefer `eq` when using `match_array` with an empty array literal. # # @example # # bad @@ -17,20 +21,34 @@ module RuboCop # # # good # it { is_expected.to match_array(%w(tremble in fear foolish mortals)) } + # class MatchArray < Base extend AutoCorrector MSG = 'Prefer `contain_exactly` when matching an array literal.' RESTRICT_ON_SEND = %i[match_array].freeze + # @!method match_array_with_empty_array?(node) + def_node_matcher :match_array_with_empty_array?, <<~PATTERN + (send nil? :match_array (array)) + PATTERN + def on_send(node) return unless node.first_argument.array_type? + return if match_array_with_empty_array?(node) + + check_populated_array(node) + end + + private + + def check_populated_array(node) return if node.first_argument.percent_literal? add_offense(node) do |corrector| array_contents = node.arguments.flat_map(&:to_a) corrector.replace( - node.source_range, + node, "contain_exactly(#{array_contents.map(&:source).join(', ')})" ) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/message_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/message_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/message_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/message_chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/message_expectation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/message_expectation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/message_expectation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/message_expectation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/message_spies.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/message_spies.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/message_spies.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/message_spies.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/comments_help.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/comments_help.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/comments_help.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/comments_help.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/final_end_location.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/final_end_location.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/final_end_location.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/final_end_location.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/inside_example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/inside_example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/inside_example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/inside_example_group.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/location_help.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/location_help.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/location_help.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/location_help.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/metadata.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/metadata.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/metadata.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/metadata.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/namespace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/namespace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/namespace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/namespace.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/skip_or_pending.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/top_level_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/top_level_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/top_level_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/top_level_group.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/variable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/mixin/variable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/mixin/variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_describes.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_describes.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_describes.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_describes.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_expectations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_expectations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_expectations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_expectations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_subjects.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_subjects.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/multiple_subjects.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/multiple_subjects.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/named_subject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/named_subject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/named_subject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/named_subject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/nested_groups.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/nested_groups.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/nested_groups.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/nested_groups.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/no_expectation_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/no_expectation_example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/no_expectation_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/no_expectation_example.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/not_to_not.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/not_to_not.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/not_to_not.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/not_to_not.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/overwriting_setup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/overwriting_setup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/overwriting_setup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/overwriting_setup.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/pending.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/pending.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/pending.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/pending.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/pending_without_reason.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/pending_without_reason.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/pending_without_reason.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/pending_without_reason.rb index 15554ed2b9..bf57636a95 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/pending_without_reason.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/pending_without_reason.rb @@ -70,7 +70,12 @@ module RuboCop # @!method skipped_by_example_method?(node) def_node_matcher :skipped_by_example_method?, <<~PATTERN - (send nil? ${#Examples.skipped #Examples.pending} ...) + (send nil? ${#Examples.skipped #Examples.pending}) + PATTERN + + # @!method skipped_by_example_method_with_block?(node) + def_node_matcher :skipped_by_example_method_with_block?, <<~PATTERN + ({block numblock} (send nil? ${#Examples.skipped #Examples.pending} ...) ...) PATTERN # @!method metadata_without_reason?(node) @@ -102,7 +107,7 @@ module RuboCop on_skipped_by_example_method(node) on_skipped_by_example_group_method(node) elsif example?(parent) - on_skipped_by_in_example_method(node, parent) + on_skipped_by_in_example_method(node) end end @@ -121,7 +126,7 @@ module RuboCop explicit_rspec?(node.receiver) end - def on_skipped_by_in_example_method(node, _direct_parent) + def on_skipped_by_in_example_method(node) skipped_in_example?(node) do |pending| add_offense(node, message: "Give the reason for #{pending}.") end @@ -137,6 +142,10 @@ module RuboCop skipped_by_example_method?(node) do |pending| add_offense(node, message: "Give the reason for #{pending}.") end + + skipped_by_example_method_with_block?(node.parent) do |pending| + add_offense(node, message: "Give the reason for #{pending}.") + end end def on_skipped_by_example_group_method(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/predicate_matcher.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/predicate_matcher.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/predicate_matcher.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/predicate_matcher.rb index b006f00ab6..6b576e8882 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/predicate_matcher.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/predicate_matcher.rb @@ -99,7 +99,7 @@ module RuboCop block = block_loc ? block_loc.source : '' corrector.replace( - matcher.source_range, + matcher, to_predicate_matcher(predicate.method_name) + args + block ) end @@ -214,7 +214,7 @@ module RuboCop def corrector_explicit(corrector, to_node, actual, matcher, block_child) replacement_matcher = replacement_matcher(to_node) - corrector.replace(matcher.source_range, replacement_matcher) + corrector.replace(matcher, replacement_matcher) move_predicate(corrector, actual, matcher, block_child) corrector.replace(to_node.loc.selector, 'to') end @@ -226,8 +226,7 @@ module RuboCop block = block_loc ? block_loc.source : '' corrector.remove(block_loc) if block_loc - corrector.insert_after(actual.source_range, - ".#{predicate}" + args + block) + corrector.insert_after(actual, ".#{predicate}" + args + block) end # rubocop:disable Metrics/MethodLength diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/have_http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/have_http_status.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/have_http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/have_http_status.rb index e466ff010c..78e9ed8990 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/have_http_status.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/have_http_status.rb @@ -9,6 +9,7 @@ module RuboCop # @example # # bad # expect(response.status).to be(200) + # expect(response.code).to eq("200") # # # good # expect(response).to have_http_status(200) @@ -18,7 +19,7 @@ module RuboCop MSG = 'Prefer `expect(response).%s have_http_status(%i)` ' \ - 'over `expect(response.status).%s %s`.' + 'over `%s`.' RUNNERS = %i[to to_not not_to].to_set RESTRICT_ON_SEND = RUNNERS @@ -27,19 +28,21 @@ module RuboCop def_node_matcher :match_status, <<-PATTERN (send (send nil? :expect - $(send (send nil? :response) :status) + $(send (send nil? :response) {:status :code}) ) $RUNNERS - $(send nil? {:be :eq :eql :equal} (int $_)) + $(send nil? {:be :eq :eql :equal} ({int str} $_)) ) PATTERN def on_send(node) match_status(node) do |response_status, to, match, status| - message = format(MSG, to: to, match: match.source, status: status) + message = format(MSG, to: to, status: status, + bad_code: node.source) add_offense(node, message: message) do |corrector| - corrector.replace(response_status.source_range, 'response') + corrector.replace(response_status, 'response') corrector.replace(match.loc.selector, 'have_http_status') + corrector.replace(match.first_argument, status.to_i.to_s) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/http_status.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/http_status.rb similarity index 57% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/http_status.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/http_status.rb index e9ea41f33c..7b7a4a1dbb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/http_status.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/http_status.rb @@ -8,6 +8,11 @@ module RuboCop module Rails # Enforces use of symbolic or numeric value to describe HTTP status. # + # This cop inspects only `have_http_status` calls. + # So, this cop does not check if a method starting with `be_*` is used + # when setting for `EnforcedStyle: symbolic` or + # `EnforcedStyle: numeric`. + # # @example `EnforcedStyle: symbolic` (default) # # bad # it { is_expected.to have_http_status 200 } @@ -30,6 +35,19 @@ module RuboCop # it { is_expected.to have_http_status :success } # it { is_expected.to have_http_status :error } # + # @example `EnforcedStyle: be_status` + # # bad + # it { is_expected.to have_http_status :ok } + # it { is_expected.to have_http_status :not_found } + # it { is_expected.to have_http_status 200 } + # it { is_expected.to have_http_status 404 } + # + # # good + # it { is_expected.to be_ok } + # it { is_expected.to be_not_found } + # it { is_expected.to have_http_status :success } + # it { is_expected.to have_http_status :error } + # class HttpStatus < Base extend AutoCorrector include ConfigurableEnforcedStyle @@ -41,12 +59,13 @@ module RuboCop PATTERN def on_send(node) - http_status(node) do |ast_node| - checker = checker_class.new(ast_node) + http_status(node) do |arg| + checker = checker_class.new(arg) return unless checker.offensive? - add_offense(checker.node, message: checker.message) do |corrector| - corrector.replace(checker.node, checker.preferred_style) + add_offense(checker.offense_range, + message: checker.message) do |corrector| + corrector.replace(checker.offense_range, checker.prefer) end end end @@ -59,13 +78,16 @@ module RuboCop SymbolicStyleChecker when :numeric NumericStyleChecker + when :be_status + BeStatusStyleChecker end end # :nodoc: - class SymbolicStyleChecker + class StyleCheckerBase MSG = 'Prefer `%s` over `%s` ' \ 'to describe HTTP status code.' + ALLOWED_STATUSES = %i[error success missing redirect].freeze attr_reader :node @@ -73,16 +95,36 @@ module RuboCop @node = node end + def message + format(MSG, prefer: prefer, current: current) + end + + def offense_range + node + end + + def allowed_symbol? + node.sym_type? && ALLOWED_STATUSES.include?(node.value) + end + + def custom_http_status_code? + node.int_type? && + !::Rack::Utils::SYMBOL_TO_STATUS_CODE.value?(node.source.to_i) + end + end + + # :nodoc: + class SymbolicStyleChecker < StyleCheckerBase def offensive? !node.sym_type? && !custom_http_status_code? end - def message - format(MSG, prefer: preferred_style, current: number.to_s) + def prefer + symbol.inspect end - def preferred_style - symbol.inspect + def current + number.inspect end private @@ -94,50 +136,64 @@ module RuboCop def number node.source.to_i end - - def custom_http_status_code? - node.int_type? && - !::Rack::Utils::SYMBOL_TO_STATUS_CODE.value?(node.source.to_i) - end end # :nodoc: - class NumericStyleChecker - MSG = 'Prefer `%s` over `%s` ' \ - 'to describe HTTP status code.' - - ALLOWED_STATUSES = %i[error success missing redirect].freeze - - attr_reader :node - - def initialize(node) - @node = node - end - + class NumericStyleChecker < StyleCheckerBase def offensive? !node.int_type? && !allowed_symbol? end - def message - format(MSG, prefer: preferred_style, current: symbol.inspect) - end - - def preferred_style + def prefer number.to_s end - private - - def number - ::Rack::Utils::SYMBOL_TO_STATUS_CODE[symbol] + def current + symbol.inspect end + private + def symbol node.value end - def allowed_symbol? - node.sym_type? && ALLOWED_STATUSES.include?(node.value) + def number + ::Rack::Utils::SYMBOL_TO_STATUS_CODE[symbol] + end + end + + # :nodoc: + class BeStatusStyleChecker < StyleCheckerBase + def offensive? + (!node.sym_type? && !custom_http_status_code?) || + (!node.int_type? && !allowed_symbol?) + end + + def offense_range + node.parent + end + + def prefer + if node.sym_type? + "be_#{node.value}" + else + "be_#{symbol}" + end + end + + def current + offense_range.source + end + + private + + def symbol + ::Rack::Utils::SYMBOL_TO_STATUS_CODE.key(number) + end + + def number + node.source.to_i end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/inferred_spec_type.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/minitest_assertions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/minitest_assertions.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/minitest_assertions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/minitest_assertions.rb index 36bfc8ac4e..1a5ac941ab 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/minitest_assertions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/minitest_assertions.rb @@ -13,9 +13,9 @@ module RuboCop # refute_equal(a, b) # # # good - # expect(a).to eq(b) - # expect(a).to(eq(b), "must be equal") - # expect(a).not_to eq(b) + # expect(b).to eq(a) + # expect(b).to(eq(a), "must be equal") + # expect(b).not_to eq(a) # class MinitestAssertions < Base extend AutoCorrector @@ -43,9 +43,9 @@ module RuboCop def replacement(node, expected, actual, failure_message) runner = node.method?(:assert_equal) ? 'to' : 'not_to' if failure_message.nil? - "expect(#{expected.source}).#{runner} eq(#{actual.source})" + "expect(#{actual.source}).#{runner} eq(#{expected.source})" else - "expect(#{expected.source}).#{runner}(eq(#{actual.source}), " \ + "expect(#{actual.source}).#{runner}(eq(#{expected.source}), " \ "#{failure_message.source})" end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/travel_around.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/travel_around.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/rails/travel_around.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/rails/travel_around.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/receive_counts.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/receive_counts.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/receive_counts.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/receive_counts.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/receive_never.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/receive_never.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/receive_never.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/receive_never.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/redundant_around.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/redundant_around.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/redundant_around.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/redundant_around.rb index 3429fafcb0..f943d2b66d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/redundant_around.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/redundant_around.rb @@ -41,11 +41,7 @@ module RuboCop # @!method match_redundant_around_hook_block?(node) def_node_matcher :match_redundant_around_hook_block?, <<~PATTERN - (block - (send _ :around ...) - (args _?) - (send _ :run) - ) + ({block numblock} (send _ :around ...) ... (send _ :run)) PATTERN # @!method match_redundant_around_hook_send?(node) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_description.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_description.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_description.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_description.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_example.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_example_group_body.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_example_group_body.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_example_group_body.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_example_group_body.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_example_group_description.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_example_group_description.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_example_group_description.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_example_group_description.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_include_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_include_example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/repeated_include_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/repeated_include_example.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/return_from_stub.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/return_from_stub.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/return_from_stub.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/return_from_stub.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/scattered_let.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/scattered_let.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/scattered_let.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/scattered_let.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/scattered_setup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/scattered_setup.rb similarity index 60% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/scattered_setup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/scattered_setup.rb index 71ebd6abe3..ef7f0a1835 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/scattered_setup.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/scattered_setup.rb @@ -23,6 +23,9 @@ module RuboCop # end # class ScatteredSetup < Base + include RangeHelp + extend AutoCorrector + MSG = 'Do not define multiple `%s` hooks in the same ' \ 'example group (also defined on %s).' @@ -30,13 +33,11 @@ module RuboCop return unless example_group?(node) repeated_hooks(node).each do |occurrences| - lines = occurrences.map(&:first_line) - occurrences.each do |occurrence| - lines_except_current = lines - [occurrence.first_line] - message = format(MSG, hook_name: occurrences.first.method_name, - lines: lines_msg(lines_except_current)) - add_offense(occurrence, message: message) + message = message(occurrences, occurrence) + add_offense(occurrence, message: message) do |corrector| + autocorrect(corrector, occurrences.first, occurrence) + end end end end @@ -63,6 +64,22 @@ module RuboCop "lines #{numbers.join(', ')}" end end + + def message(occurrences, occurrence) + lines = occurrences.map(&:first_line) + lines_except_current = lines - [occurrence.first_line] + format(MSG, hook_name: occurrences.first.method_name, + lines: lines_msg(lines_except_current)) + end + + def autocorrect(corrector, first_occurrence, occurrence) + return if first_occurrence == occurrence || !first_occurrence.body + + corrector.insert_after(first_occurrence.body, + "\n#{occurrence.body.source}") + corrector.remove(range_by_whole_lines(occurrence.source_range, + include_final_newline: true)) + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/shared_context.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/shared_context.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/shared_context.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/shared_context.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/shared_examples.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/shared_examples.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/shared_examples.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/shared_examples.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/skip_block_inside_example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/skip_block_inside_example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/skip_block_inside_example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/skip_block_inside_example.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/sort_metadata.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/sort_metadata.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/sort_metadata.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/sort_metadata.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/stubbed_mock.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/stubbed_mock.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/stubbed_mock.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/stubbed_mock.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/subject_declaration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/subject_declaration.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/subject_declaration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/subject_declaration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/subject_stub.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/subject_stub.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/subject_stub.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/subject_stub.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/unspecified_exception.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/unspecified_exception.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/unspecified_exception.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/unspecified_exception.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/variable_definition.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/variable_definition.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/variable_definition.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/variable_definition.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/variable_name.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/variable_name.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/variable_name.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/variable_name.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/verified_double_reference.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/verified_double_reference.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/verified_double_reference.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/verified_double_reference.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/verified_doubles.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/verified_doubles.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/verified_doubles.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/verified_doubles.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/void_expect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/void_expect.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/void_expect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/void_expect.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/yield.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/yield.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec/yield.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec/yield.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec_cops.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec_cops.rb index 64f7a7e7f2..0d96f3d3ea 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/cop/rspec_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/cop/rspec_cops.rb @@ -32,6 +32,7 @@ require_relative 'rspec/align_right_let_brace' require_relative 'rspec/any_instance' require_relative 'rspec/around_block' require_relative 'rspec/be' +require_relative 'rspec/be_empty' require_relative 'rspec/be_eq' require_relative 'rspec/be_eql' require_relative 'rspec/be_nil' @@ -71,6 +72,7 @@ require_relative 'rspec/identical_equality_assertion' require_relative 'rspec/implicit_block_expectation' require_relative 'rspec/implicit_expect' require_relative 'rspec/implicit_subject' +require_relative 'rspec/indexed_let' require_relative 'rspec/instance_spy' require_relative 'rspec/instance_variable' require_relative 'rspec/it_behaves_like' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/align_let_brace.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/align_let_brace.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/align_let_brace.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/align_let_brace.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/concept.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/concept.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/concept.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/concept.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/config_formatter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/config_formatter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/config_formatter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/config_formatter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/corrector/move_node.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/corrector/move_node.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/corrector/move_node.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/corrector/move_node.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/description_extractor.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/description_extractor.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/description_extractor.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/description_extractor.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/example.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/example.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/example.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/example.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/example_group.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/example_group.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/example_group.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/example_group.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/factory_bot.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/factory_bot.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/factory_bot.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/factory_bot.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/factory_bot/language.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/factory_bot/language.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/factory_bot/language.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/factory_bot/language.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/hook.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/hook.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/hook.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/hook.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/language.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/language.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/language.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/language.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/language/node_pattern.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/language/node_pattern.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/language/node_pattern.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/language/node_pattern.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/node.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/node.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/node.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/node.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/shared_contexts/default_rspec_language_config_context.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/version.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/version.rb index 6c2dd20b42..11d40c80bf 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/version.rb @@ -4,7 +4,7 @@ module RuboCop module RSpec # Version information for the RSpec RuboCop plugin. module Version - STRING = '2.19.0' + STRING = '2.20.0' end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/wording.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/wording.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.19.0/lib/rubocop/rspec/wording.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.20.0/lib/rubocop/rspec/wording.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm.rb deleted file mode 100644 index e085a0d26a..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm.rb +++ /dev/null @@ -1,266 +0,0 @@ -# encoding: UTF-8 -# -# = net/ntlm.rb -# -# An NTLM Authentication Library for Ruby -# -# This code is a derivative of "dbf2.rb" written by yrock -# and Minero Aoki. You can find original code here: -# http://jp.rubyist.net/magazine/?0013-CodeReview -# ------------------------------------------------------------- -# Copyright (c) 2005,2006 yrock -# -# -# 2006-02-11 refactored by Minero Aoki -# ------------------------------------------------------------- -# -# All protocol information used to write this code stems from -# "The NTLM Authentication Protocol" by Eric Glass. The author -# would thank to him for this tremendous work and making it -# available on the net. -# http://davenport.sourceforge.net/ntlm.html -# ------------------------------------------------------------- -# Copyright (c) 2003 Eric Glass -# -# ------------------------------------------------------------- -# -# The author also looked Mozilla-Firefox-1.0.7 source code, -# namely, security/manager/ssl/src/nsNTLMAuthModule.cpp and -# Jonathan Bastien-Filiatrault's libntlm-ruby. -# "http://x2a.org/websvn/filedetails.php? -# repname=libntlm-ruby&path=%2Ftrunk%2Fntlm.rb&sc=1" -# The latter has a minor bug in its separate_keys function. -# The third key has to begin from the 14th character of the -# input string instead of 13th:) -#-- -# $Id: ntlm.rb,v 1.1 2006/10/05 01:36:52 koheik Exp $ -#++ - -require 'base64' -require 'openssl' -require 'openssl/digest' -require 'socket' - -# Load Order is important here -require 'net/ntlm/exceptions' -require 'net/ntlm/field' -require 'net/ntlm/int16_le' -require 'net/ntlm/int32_le' -require 'net/ntlm/int64_le' -require 'net/ntlm/string' - -require 'net/ntlm/field_set' -require 'net/ntlm/blob' -require 'net/ntlm/security_buffer' -require 'net/ntlm/message' -require 'net/ntlm/message/type0' -require 'net/ntlm/message/type1' -require 'net/ntlm/message/type2' -require 'net/ntlm/message/type3' - -require 'net/ntlm/encode_util' - -require 'net/ntlm/client' -require 'net/ntlm/channel_binding' -require 'net/ntlm/target_info' - -module Net - module NTLM - - LM_MAGIC = "KGS!@\#$%" - TIME_OFFSET = 11644473600 - MAX64 = 0xffffffffffffffff - - - class << self - - # Valid format for LAN Manager hex digest portion: 32 hexadecimal characters. - LAN_MANAGER_HEX_DIGEST_REGEXP = /[0-9a-f]{32}/i - # Valid format for NT LAN Manager hex digest portion: 32 hexadecimal characters. - NT_LAN_MANAGER_HEX_DIGEST_REGEXP = /[0-9a-f]{32}/i - # Valid format for an NTLM hash composed of `':'`. - DATA_REGEXP = /\A#{LAN_MANAGER_HEX_DIGEST_REGEXP}:#{NT_LAN_MANAGER_HEX_DIGEST_REGEXP}\z/ - - # Takes a string and determines whether it is a valid NTLM Hash - # @param [String] the string to validate - # @return [Boolean] whether or not the string is a valid NTLM hash - def is_ntlm_hash?(data) - decoded_data = data.dup - decoded_data = EncodeUtil.decode_utf16le(decoded_data) - if DATA_REGEXP.match(decoded_data) - true - else - false - end - end - - # Conver the value to a 64-Bit Little Endian Int - # @param [String] val The string to convert - def pack_int64le(val) - [val & 0x00000000ffffffff, val >> 32].pack("V2") - end - - # Builds an array of strings that are 7 characters long - # @param [String] str The string to split - # @api private - def split7(str) - s = str.dup - until s.empty? - (ret ||= []).push s.slice!(0, 7) - end - ret - end - - # Not sure what this is doing - # @param [String] str String to generate keys for - # @api private - def gen_keys(str) - split7(str).map{ |str7| - bits = split7(str7.unpack("B*")[0]).inject('')\ - {|ret, tkn| ret += tkn + (tkn.gsub('1', '').size % 2).to_s } - [bits].pack("B*") - } - end - - def apply_des(plain, keys) - dec = OpenSSL::Cipher.new("des-cbc").encrypt - dec.padding = 0 - keys.map {|k| - dec.key = k - dec.update(plain) + dec.final - } - end - - # Generates a Lan Manager Hash - # @param [String] password The password to base the hash on - def lm_hash(password) - keys = gen_keys password.upcase.ljust(14, "\0") - apply_des(LM_MAGIC, keys).join - end - - # Generate a NTLM Hash - # @param [String] password The password to base the hash on - # @option opt :unicode (false) Unicode encode the password - def ntlm_hash(password, opt = {}) - pwd = password.dup - unless opt[:unicode] - pwd = EncodeUtil.encode_utf16le(pwd) - end - OpenSSL::Digest::MD4.digest pwd - end - - # Generate a NTLMv2 Hash - # @param [String] user The username - # @param [String] password The password - # @param [String] target The domain or workstation to authenticate to - # @option opt :unicode (false) Unicode encode the domain - def ntlmv2_hash(user, password, target, opt={}) - if is_ntlm_hash? password - decoded_password = EncodeUtil.decode_utf16le(password) - ntlmhash = [decoded_password.upcase[33,65]].pack('H32') - else - ntlmhash = ntlm_hash(password, opt) - end - userdomain = user.upcase + target - unless opt[:unicode] - userdomain = EncodeUtil.encode_utf16le(userdomain) - end - OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, ntlmhash, userdomain) - end - - def lm_response(arg) - begin - hash = arg[:lm_hash] - chal = arg[:challenge] - rescue - raise ArgumentError - end - chal = NTLM::pack_int64le(chal) if chal.is_a?(Integer) - keys = gen_keys hash.ljust(21, "\0") - apply_des(chal, keys).join - end - - def ntlm_response(arg) - hash = arg[:ntlm_hash] - chal = arg[:challenge] - chal = NTLM::pack_int64le(chal) if chal.is_a?(Integer) - keys = gen_keys hash.ljust(21, "\0") - apply_des(chal, keys).join - end - - def ntlmv2_response(arg, opt = {}) - begin - key = arg[:ntlmv2_hash] - chal = arg[:challenge] - ti = arg[:target_info] - rescue - raise ArgumentError - end - chal = NTLM::pack_int64le(chal) if chal.is_a?(Integer) - - if opt[:client_challenge] - cc = opt[:client_challenge] - else - cc = rand(MAX64) - end - cc = NTLM::pack_int64le(cc) if cc.is_a?(Integer) - - if opt[:timestamp] - ts = opt[:timestamp] - else - ts = Time.now.to_i - end - # epoch -> milsec from Jan 1, 1601 - ts = 10_000_000 * (ts + TIME_OFFSET) - - blob = Blob.new - blob.timestamp = ts - blob.challenge = cc - blob.target_info = ti - - bb = blob.serialize - - OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, key, chal + bb) + bb - end - - def lmv2_response(arg, opt = {}) - key = arg[:ntlmv2_hash] - chal = arg[:challenge] - - chal = NTLM::pack_int64le(chal) if chal.is_a?(Integer) - - if opt[:client_challenge] - cc = opt[:client_challenge] - else - cc = rand(MAX64) - end - cc = NTLM::pack_int64le(cc) if cc.is_a?(Integer) - - OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, key, chal + cc) + cc - end - - def ntlm2_session(arg, opt = {}) - begin - passwd_hash = arg[:ntlm_hash] - chal = arg[:challenge] - rescue - raise ArgumentError - end - chal = NTLM::pack_int64le(chal) if chal.is_a?(Integer) - - if opt[:client_challenge] - cc = opt[:client_challenge] - else - cc = rand(MAX64) - end - cc = NTLM::pack_int64le(cc) if cc.is_a?(Integer) - - keys = gen_keys(passwd_hash.ljust(21, "\0")) - session_hash = OpenSSL::Digest::MD5.digest(chal + cc).slice(0, 8) - response = apply_des(session_hash, keys).join - [cc.ljust(24, "\0"), response] - end - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/blob.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/blob.rb deleted file mode 100644 index f670eb3d39..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/blob.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Net - module NTLM - - BLOB_SIGN = 0x00000101 - - class Blob < FieldSet - int32LE :blob_signature, {:value => BLOB_SIGN} - int32LE :reserved, {:value => 0} - int64LE :timestamp, {:value => 0} - string :challenge, {:value => "", :size => 8} - int32LE :unknown1, {:value => 0} - string :target_info, {:value => "", :size => 0} - int32LE :unknown2, {:value => 0} - - def parse(str, offset=0) - # 28 is the length of all fields before the variable-length - # target_info field. - if str.size > 28 - enable(:target_info) - # Grab everything except the last 4 bytes (which will be :unknown2) - self[:target_info].value = str[28..-5] - end - super - end - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/channel_binding.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/channel_binding.rb deleted file mode 100644 index fda9c6355b..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/channel_binding.rb +++ /dev/null @@ -1,65 +0,0 @@ -module Net - module NTLM - class ChannelBinding - - # Creates a ChannelBinding used for Extended Protection Authentication - # @see http://blogs.msdn.com/b/openspecification/archive/2013/03/26/ntlm-and-channel-binding-hash-aka-exteneded-protection-for-authentication.aspx - # - # @param outer_channel [OpenSSL::X509::Certificate] Server certificate securing - # the outer TLS channel - # @return [NTLM::ChannelBinding] A ChannelBinding holding a token that can be - # embedded in a {Type3} message - def self.create(outer_channel) - new(outer_channel) - end - - # @param outer_channel [OpenSSL::X509::Certificate] Server certificate securing - # the outer TLS channel - def initialize(outer_channel) - @channel = outer_channel - @unique_prefix = 'tls-server-end-point' - @initiator_addtype = 0 - @initiator_address_length = 0 - @acceptor_addrtype = 0 - @acceptor_address_length = 0 - end - - attr_reader :channel, :unique_prefix, :initiator_addtype - attr_reader :initiator_address_length, :acceptor_addrtype - attr_reader :acceptor_address_length - - # Returns a channel binding hash acceptable for use as a AV_PAIR MsvAvChannelBindings - # field value as specified in the NTLM protocol - # - # @return [String] MD5 hash of gss_channel_bindings_struct - def channel_binding_token - @channel_binding_token ||= OpenSSL::Digest::MD5.new(gss_channel_bindings_struct).digest - end - - def gss_channel_bindings_struct - @gss_channel_bindings_struct ||= begin - token = [initiator_addtype].pack('I') - token << [initiator_address_length].pack('I') - token << [acceptor_addrtype].pack('I') - token << [acceptor_address_length].pack('I') - token << [application_data.length].pack('I') - token << application_data - token - end - end - - def channel_hash - @channel_hash ||= OpenSSL::Digest::SHA256.new(channel.to_der) - end - - def application_data - @application_data ||= begin - data = unique_prefix - data << ':' - data << channel_hash.digest - data - end - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/client.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/client.rb deleted file mode 100644 index 91d0895c68..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/client.rb +++ /dev/null @@ -1,65 +0,0 @@ -module Net - module NTLM - class Client - - DEFAULT_FLAGS = NTLM::FLAGS[:UNICODE] | NTLM::FLAGS[:OEM] | - NTLM::FLAGS[:SIGN] | NTLM::FLAGS[:SEAL] | NTLM::FLAGS[:REQUEST_TARGET] | - NTLM::FLAGS[:NTLM] | NTLM::FLAGS[:ALWAYS_SIGN] | NTLM::FLAGS[:NTLM2_KEY] | - NTLM::FLAGS[:KEY128] | NTLM::FLAGS[:KEY_EXCHANGE] | NTLM::FLAGS[:KEY56] - - attr_reader :username, :password, :domain, :workstation, :flags - - # @note All string parameters should be encoded in UTF-8. The proper - # final encoding for placing in the various {Message messages} will be - # chosen based on negotiation with the server. - # - # @param username [String] - # @param password [String] - # @option opts [String] :domain where we're authenticating to - # @option opts [String] :workstation local workstation name - # @option opts [Fixnum] :flags (DEFAULT_FLAGS) see Net::NTLM::Message::Type1.flag - def initialize(username, password, opts = {}) - @username = username - @password = password - @domain = opts[:domain] || nil - @workstation = opts[:workstation] || nil - @flags = opts[:flags] || DEFAULT_FLAGS - end - - # @return [NTLM::Message] - def init_context(resp = nil, channel_binding = nil) - if resp.nil? - @session = nil - type1_message - else - @session = Client::Session.new(self, Net::NTLM::Message.decode64(resp), channel_binding) - @session.authenticate! - end - end - - # @return [Client::Session] - def session - @session - end - - def session_key - @session.exported_session_key - end - - private - - # @return [Message::Type1] - def type1_message - type1 = Message::Type1.new - type1[:flag].value = flags - type1.domain = domain if domain - type1.workstation = workstation if workstation - - type1 - end - - end - end -end - -require "net/ntlm/client/session" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/client/session.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/client/session.rb deleted file mode 100644 index b1b496a0b7..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/client/session.rb +++ /dev/null @@ -1,237 +0,0 @@ -module Net - module NTLM - class Client::Session - - VERSION_MAGIC = "\x01\x00\x00\x00" - TIME_OFFSET = 11644473600 - MAX64 = 0xffffffffffffffff - CLIENT_TO_SERVER_SIGNING = "session key to client-to-server signing key magic constant\0" - SERVER_TO_CLIENT_SIGNING = "session key to server-to-client signing key magic constant\0" - CLIENT_TO_SERVER_SEALING = "session key to client-to-server sealing key magic constant\0" - SERVER_TO_CLIENT_SEALING = "session key to server-to-client sealing key magic constant\0" - - attr_reader :client, :challenge_message, :channel_binding - - # @param client [Net::NTLM::Client] the client instance - # @param challenge_message [Net::NTLM::Message::Type2] server message - def initialize(client, challenge_message, channel_binding = nil) - @client = client - @challenge_message = challenge_message - @channel_binding = channel_binding - end - - # Generate an NTLMv2 AUTHENTICATE_MESSAGE - # @see http://msdn.microsoft.com/en-us/library/cc236643.aspx - # @return [Net::NTLM::Message::Type3] - def authenticate! - calculate_user_session_key! - type3_opts = { - :lm_response => lmv2_resp, - :ntlm_response => ntlmv2_resp, - :domain => domain, - :user => username, - :workstation => workstation, - :flag => (challenge_message.flag & client.flags) - } - t3 = Message::Type3.create type3_opts - if negotiate_key_exchange? - t3.enable(:session_key) - rc4 = OpenSSL::Cipher.new("rc4") - rc4.encrypt - rc4.key = user_session_key - sk = rc4.update exported_session_key - sk << rc4.final - t3.session_key = sk - end - t3 - end - - def exported_session_key - @exported_session_key ||= - begin - if negotiate_key_exchange? - OpenSSL::Cipher.new("rc4").random_key - else - user_session_key - end - end - end - - def sign_message(message) - seq = sequence - sig = OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, client_sign_key, "#{seq}#{message}")[0..7] - if negotiate_key_exchange? - sig = client_cipher.update sig - sig << client_cipher.final - end - "#{VERSION_MAGIC}#{sig}#{seq}" - end - - def verify_signature(signature, message) - seq = signature[-4..-1] - sig = OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, server_sign_key, "#{seq}#{message}")[0..7] - if negotiate_key_exchange? - sig = server_cipher.update sig - sig << server_cipher.final - end - "#{VERSION_MAGIC}#{sig}#{seq}" == signature - end - - def seal_message(message) - emessage = client_cipher.update(message) - emessage + client_cipher.final - end - - def unseal_message(emessage) - message = server_cipher.update(emessage) - message + server_cipher.final - end - - private - - - def user_session_key - @user_session_key ||= nil - end - - def sequence - [raw_sequence].pack("V*") - end - - def raw_sequence - if defined? @raw_sequence - @raw_sequence += 1 - else - @raw_sequence = 0 - end - end - - def client_sign_key - @client_sign_key ||= OpenSSL::Digest::MD5.digest "#{exported_session_key}#{CLIENT_TO_SERVER_SIGNING}" - end - - def server_sign_key - @server_sign_key ||= OpenSSL::Digest::MD5.digest "#{exported_session_key}#{SERVER_TO_CLIENT_SIGNING}" - end - - def client_seal_key - @client_seal_key ||= OpenSSL::Digest::MD5.digest "#{exported_session_key}#{CLIENT_TO_SERVER_SEALING}" - end - - def server_seal_key - @server_seal_key ||= OpenSSL::Digest::MD5.digest "#{exported_session_key}#{SERVER_TO_CLIENT_SEALING}" - end - - def client_cipher - @client_cipher ||= - begin - rc4 = OpenSSL::Cipher.new("rc4") - rc4.encrypt - rc4.key = client_seal_key - rc4 - end - end - - def server_cipher - @server_cipher ||= - begin - rc4 = OpenSSL::Cipher.new("rc4") - rc4.decrypt - rc4.key = server_seal_key - rc4 - end - end - - def client_challenge - @client_challenge ||= NTLM.pack_int64le(rand(MAX64)) - end - - def server_challenge - @server_challenge ||= challenge_message[:challenge].serialize - end - - # epoch -> milsec from Jan 1, 1601 - # @see http://support.microsoft.com/kb/188768 - def timestamp - @timestamp ||= 10_000_000 * (Time.now.to_i + TIME_OFFSET) - end - - def use_oem_strings? - challenge_message.has_flag? :OEM - end - - def negotiate_key_exchange? - challenge_message.has_flag? :KEY_EXCHANGE - end - - def username - oem_or_unicode_str client.username - end - - def password - oem_or_unicode_str client.password - end - - def workstation - (client.workstation ? oem_or_unicode_str(client.workstation) : "") - end - - def domain - (client.domain ? oem_or_unicode_str(client.domain) : "") - end - - def oem_or_unicode_str(str) - if use_oem_strings? - NTLM::EncodeUtil.decode_utf16le str - else - NTLM::EncodeUtil.encode_utf16le str - end - end - - def ntlmv2_hash - @ntlmv2_hash ||= NTLM.ntlmv2_hash(username, password, domain, {:client_challenge => client_challenge, :unicode => !use_oem_strings?}) - end - - def calculate_user_session_key! - @user_session_key = OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, ntlmv2_hash, nt_proof_str) - end - - def lmv2_resp - OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, ntlmv2_hash, server_challenge + client_challenge) + client_challenge - end - - def ntlmv2_resp - nt_proof_str + blob - end - - def nt_proof_str - @nt_proof_str ||= OpenSSL::HMAC.digest(OpenSSL::Digest::MD5.new, ntlmv2_hash, server_challenge + blob) - end - - def blob - @blob ||= - begin - b = Blob.new - b.timestamp = timestamp - b.challenge = client_challenge - b.target_info = target_info - b.serialize - end - end - - def target_info - @target_info ||= begin - if channel_binding - t = Net::NTLM::TargetInfo.new(challenge_message.target_info) - av_id = Net::NTLM::TargetInfo::MSV_AV_CHANNEL_BINDINGS - t.av_pairs[av_id] = channel_binding.channel_binding_token - t.to_s - else - challenge_message.target_info - end - end - end - - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/encode_util.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/encode_util.rb deleted file mode 100644 index 5a13e7866f..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/encode_util.rb +++ /dev/null @@ -1,48 +0,0 @@ -module Net -module NTLM - - class EncodeUtil - if RUBY_VERSION == "1.8.7" - require "kconv" - - # Decode a UTF16 string to a ASCII string - # @param [String] str The string to convert - def self.decode_utf16le(str) - Kconv.kconv(swap16(str), Kconv::ASCII, Kconv::UTF16) - end - - # Encodes a ASCII string to a UTF16 string - # @param [String] str The string to convert - def self.encode_utf16le(str) - swap16(Kconv.kconv(str, Kconv::UTF16, Kconv::ASCII)) - end - - # Taggle the strings endianness between big/little and little/big - # @param [String] str The string to swap the endianness on - def self.swap16(str) - str.unpack("v*").pack("n*") - end - else # Use native 1.9 string encoding functions - - # Decode a UTF16 string to a ASCII string - # @param [String] str The string to convert - def self.decode_utf16le(str) - str = str.dup.force_encoding(Encoding::UTF_16LE) - str.encode(Encoding::UTF_8, Encoding::UTF_16LE).force_encoding('UTF-8') - end - - # Encodes a ASCII string to a UTF16 string - # @param [String] str The string to convert - # @note This implementation may seem stupid but the problem is that UTF16-LE and UTF-8 are incompatiable - # encodings. This library uses string contatination to build the packet bytes. The end result is that - # you can either marshal the encodings elsewhere of simply know that each time you call encode_utf16le - # the function will convert the string bytes to UTF-16LE and note the encoding as UTF-8 so that byte - # concatination works seamlessly. - def self.encode_utf16le(str) - str.dup.force_encoding('UTF-8').encode(Encoding::UTF_16LE, Encoding::UTF_8).force_encoding('UTF-8') - end - end - end - -end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/exceptions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/exceptions.rb deleted file mode 100644 index 12f52015b2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/exceptions.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Net - module NTLM - class NtlmError < StandardError; end - - class InvalidTargetDataError < NtlmError - attr_reader :data - - def initialize(msg, data) - @data = data - super(msg) - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/field.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/field.rb deleted file mode 100644 index 3109bd7dba..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/field.rb +++ /dev/null @@ -1,35 +0,0 @@ -module Net -module NTLM - - # base classes for primitives - # @private - class Field - attr_accessor :active, :value - - def initialize(opts) - @value = opts[:value] - @active = opts[:active].nil? ? true : opts[:active] - @size = opts[:size].nil? ? 0 : opts[:size] - end - - def size - @active ? @size : 0 - end - - # Serializer function for field data - # Exists in this class to be overridden by child classes - def serialize - raise NotImplementedError - end - - # Parser function for field data - # Exists in this class to be overridden by child classes - def parse(str, offset=0) - raise NotImplementedError - end - - end - - -end -end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/field_set.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/field_set.rb deleted file mode 100644 index e79cc66f12..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/field_set.rb +++ /dev/null @@ -1,129 +0,0 @@ -module Net - module NTLM - - # base class of data structure - class FieldSet - class << FieldSet - - # @macro string_security_buffer - # @method $1 - # @method $1= - # @return [String] - def string(name, opts) - add_field(name, Net::NTLM::String, opts) - end - - # @macro int16le_security_buffer - # @method $1 - # @method $1= - # @return [Int16LE] - def int16LE(name, opts) - add_field(name, Net::NTLM::Int16LE, opts) - end - - # @macro int32le_security_buffer - # @method $1 - # @method $1= - # @return [Int32LE] - def int32LE(name, opts) - add_field(name, Net::NTLM::Int32LE, opts) - end - - # @macro int64le_security_buffer - # @method $1 - # @method $1= - # @return [Int64] - def int64LE(name, opts) - add_field(name, Net::NTLM::Int64LE, opts) - end - - # @macro security_buffer - # @method $1 - # @method $1= - # @return [SecurityBuffer] - def security_buffer(name, opts) - add_field(name, Net::NTLM::SecurityBuffer, opts) - end - - def prototypes - @proto - end - - def names - return [] if @proto.nil? - @proto.map{|n, t, o| n} - end - - def types - return [] if @proto.nil? - @proto.map{|n, t, o| t} - end - - def opts - return [] if @proto.nil? - @proto.map{|n, t, o| o} - end - - private - - def add_field(name, type, opts) - (@proto ||= []).push [name, type, opts] - define_accessor name - end - - def define_accessor(name) - module_eval(<<-End, __FILE__, __LINE__ + 1) - def #{name} - self['#{name}'].value - end - - def #{name}=(val) - self['#{name}'].value = val - end - End - end - end - - def initialize - @alist = self.class.prototypes.map{ |n, t, o| [n, t.new(o)] } - end - - def parse(str, offset=0) - @alist.inject(offset){|cur, a| cur += a[1].parse(str, cur)} - end - - def serialize - @alist.map{|n, f| f.serialize }.join - end - - def size - @alist.inject(0){|sum, a| sum += a[1].size} - end - - def [](name) - a = @alist.assoc(name.to_s.intern) - raise ArgumentError, "no such field: #{name}" unless a - a[1] - end - - def []=(name, val) - a = @alist.assoc(name.to_s.intern) - raise ArgumentError, "no such field: #{name}" unless a - a[1] = val - end - - def enable(name) - self[name].active = true - end - - def disable(name) - self[name].active = false - end - - def has_disabled_fields? - @alist.any? { |name, field| !field.active } - end - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int16_le.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int16_le.rb deleted file mode 100644 index e9fb45bf85..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int16_le.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Net - module NTLM - - class Int16LE < Field - - def initialize(opt) - super(opt) - @size = 2 - end - - def parse(str, offset=0) - if @active and str.size >= offset + @size - @value = str[offset, @size].unpack("v")[0] - @size - else - 0 - end - end - - def serialize - [@value].pack("v") - end - end - - end -end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int32_le.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int32_le.rb deleted file mode 100644 index 789013388b..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int32_le.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Net - module NTLM - - class Int32LE < Field - def initialize(opt) - super(opt) - @size = 4 - end - - def parse(str, offset=0) - if @active and str.size >= offset + @size - @value = str.slice(offset, @size).unpack("V")[0] - @size - else - 0 - end - end - - def serialize - [@value].pack("V") if @active - end - end - - end -end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int64_le.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int64_le.rb deleted file mode 100644 index 37bc75537d..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/int64_le.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Net - module NTLM - - class Int64LE < Field - def initialize(opt) - super(opt) - @size = 8 - end - - def parse(str, offset=0) - if @active and str.size >= offset + @size - d, u = str.slice(offset, @size).unpack("V2") - @value = (u * 0x100000000 + d) - @size - else - 0 - end - end - - def serialize - [@value & 0x00000000ffffffff, @value >> 32].pack("V2") if @active - end - end - - end -end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message.rb deleted file mode 100644 index eba8bc13b3..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message.rb +++ /dev/null @@ -1,129 +0,0 @@ -module Net -module NTLM - - SSP_SIGN = "NTLMSSP\0" - - FLAGS = { - :UNICODE => 0x00000001, - :OEM => 0x00000002, - :REQUEST_TARGET => 0x00000004, - :MBZ9 => 0x00000008, - :SIGN => 0x00000010, - :SEAL => 0x00000020, - :NEG_DATAGRAM => 0x00000040, - :NETWARE => 0x00000100, - :NTLM => 0x00000200, - :NEG_NT_ONLY => 0x00000400, - :MBZ7 => 0x00000800, - :DOMAIN_SUPPLIED => 0x00001000, - :WORKSTATION_SUPPLIED => 0x00002000, - :LOCAL_CALL => 0x00004000, - :ALWAYS_SIGN => 0x00008000, - :TARGET_TYPE_DOMAIN => 0x00010000, - :NTLM2_KEY => 0x00080000, - :TARGET_INFO => 0x00800000, - :KEY128 => 0x20000000, - :KEY_EXCHANGE => 0x40000000, - :KEY56 => 0x80000000 - }.freeze - - FLAG_KEYS = FLAGS.keys.sort{|a, b| FLAGS[a] <=> FLAGS[b] } - - DEFAULT_FLAGS = { - :TYPE1 => FLAGS[:UNICODE] | FLAGS[:OEM] | FLAGS[:REQUEST_TARGET] | FLAGS[:NTLM] | FLAGS[:ALWAYS_SIGN] | FLAGS[:NTLM2_KEY], - :TYPE2 => FLAGS[:UNICODE], - :TYPE3 => FLAGS[:UNICODE] | FLAGS[:REQUEST_TARGET] | FLAGS[:NTLM] | FLAGS[:ALWAYS_SIGN] | FLAGS[:NTLM2_KEY] - } - - - # @private false - class Message < FieldSet - class << Message - def parse(str) - m = Type0.new - m.parse(str) - case m.type - when 1 - t = Type1.new.parse(str) - when 2 - t = Type2.new.parse(str) - when 3 - t = Type3.new.parse(str) - else - raise ArgumentError, "unknown type: #{m.type}" - end - t - end - - def decode64(str) - parse(Base64.decode64(str)) - end - end - - # @return [self] - def parse(str) - super - - while has_disabled_fields? && serialize.size < str.size - # enable the next disabled field - self.class.names.find { |name| !self[name].active && enable(name) } - super - end - - self - end - - def has_flag?(flag) - (self[:flag].value & FLAGS[flag]) == FLAGS[flag] - end - - def set_flag(flag) - self[:flag].value |= FLAGS[flag] - end - - def dump_flags - FLAG_KEYS.each{ |k| print(k, "=", has_flag?(k), "\n") } - end - - def serialize - deflag - super + security_buffers.map{|n, f| f.value}.join - end - - def encode64 - Base64.encode64(serialize).gsub(/\n/, '') - end - - def decode64(str) - parse(Base64.decode64(str)) - end - - alias head_size size - - def data_size - security_buffers.inject(0){|sum, a| sum += a[1].data_size} - end - - def size - head_size + data_size - end - - - def security_buffers - @alist.find_all{|n, f| f.instance_of?(SecurityBuffer)} - end - - def deflag - security_buffers.inject(head_size){|cur, a| - a[1].offset = cur - cur += a[1].data_size - } - end - - def data_edge - security_buffers.map{ |n, f| f.active ? f.offset : size}.min - end - - end -end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type0.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type0.rb deleted file mode 100644 index 02334c0def..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type0.rb +++ /dev/null @@ -1,16 +0,0 @@ -module Net - module NTLM - class Message - - # sub class definitions - class Type0 < Message - string :sign, {:size => 8, :value => SSP_SIGN} - int32LE :type, {:value => 0} - end - - - end - end -end - - diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type1.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type1.rb deleted file mode 100644 index 83a8efd773..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type1.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Net - module NTLM - class Message - - # @private false - class Type1 < Message - - string :sign, {:size => 8, :value => SSP_SIGN} - int32LE :type, {:value => 1} - int32LE :flag, {:value => DEFAULT_FLAGS[:TYPE1] } - security_buffer :domain, {:value => ""} - security_buffer :workstation, {:value => Socket.gethostname } - string :os_version, {:size => 8, :value => "", :active => false } - - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type2.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type2.rb deleted file mode 100644 index 200dd25464..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type2.rb +++ /dev/null @@ -1,102 +0,0 @@ -module Net - module NTLM - class Message - - # @private false - class Type2 < Message - - string :sign, { :size => 8, :value => SSP_SIGN } - int32LE :type, { :value => 2 } - security_buffer :target_name, { :size => 0, :value => "" } - int32LE :flag, { :value => DEFAULT_FLAGS[:TYPE2] } - int64LE :challenge, { :value => 0} - int64LE :context, { :value => 0, :active => false } - security_buffer :target_info, { :value => "", :active => false } - string :os_version, { :size => 8, :value => "", :active => false } - - # Generates a Type 3 response based on the Type 2 Information - # @return [Type3] - # @option arg [String] :username The username to authenticate with - # @option arg [String] :password The user's password - # @option arg [String] :domain ('') The domain to authenticate to - # @option opt [String] :workstation (Socket.gethostname) The name of the calling workstation - # @option opt [Boolean] :use_default_target (false) Use the domain supplied by the server in the Type 2 packet - # @note An empty :domain option authenticates to the local machine. - # @note The :use_default_target has precedence over the :domain option - def response(arg, opt = {}) - usr = arg[:user] - pwd = arg[:password] - domain = arg[:domain] ? arg[:domain].upcase : "" - if usr.nil? or pwd.nil? - raise ArgumentError, "user and password have to be supplied" - end - - if opt[:workstation] - ws = opt[:workstation] - else - ws = Socket.gethostname - end - - if opt[:client_challenge] - cc = opt[:client_challenge] - else - cc = rand(MAX64) - end - cc = NTLM::pack_int64le(cc) if cc.is_a?(Integer) - opt[:client_challenge] = cc - - if has_flag?(:OEM) and opt[:unicode] - usr = NTLM::EncodeUtil.decode_utf16le(usr) - pwd = NTLM::EncodeUtil.decode_utf16le(pwd) - ws = NTLM::EncodeUtil.decode_utf16le(ws) - domain = NTLM::EncodeUtil.decode_utf16le(domain) - opt[:unicode] = false - end - - if has_flag?(:UNICODE) and !opt[:unicode] - usr = NTLM::EncodeUtil.encode_utf16le(usr) - pwd = NTLM::EncodeUtil.encode_utf16le(pwd) - ws = NTLM::EncodeUtil.encode_utf16le(ws) - domain = NTLM::EncodeUtil.encode_utf16le(domain) - opt[:unicode] = true - end - - if opt[:use_default_target] - domain = self.target_name - end - - ti = self.target_info - - chal = self[:challenge].serialize - - if opt[:ntlmv2] - ar = {:ntlmv2_hash => NTLM::ntlmv2_hash(usr, pwd, domain, opt), :challenge => chal, :target_info => ti} - lm_res = NTLM::lmv2_response(ar, opt) - ntlm_res = NTLM::ntlmv2_response(ar, opt) - elsif has_flag?(:NTLM2_KEY) - ar = {:ntlm_hash => NTLM::ntlm_hash(pwd, opt), :challenge => chal} - lm_res, ntlm_res = NTLM::ntlm2_session(ar, opt) - else - ar = {:lm_hash => NTLM::lm_hash(pwd), :challenge => chal} - lm_res = NTLM::lm_response(ar) - ar = {:ntlm_hash => NTLM::ntlm_hash(pwd, opt), :challenge => chal} - ntlm_res = NTLM::ntlm_response(ar) - end - - Type3.create({ - :lm_response => lm_res, - :ntlm_response => ntlm_res, - :domain => domain, - :user => usr, - :workstation => ws, - :flag => self.flag - }) - end - - end - - end - end -end - - diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type3.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type3.rb deleted file mode 100644 index 88a8774f00..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/message/type3.rb +++ /dev/null @@ -1,131 +0,0 @@ -module Net - module NTLM - class Message - - # @private false - class Type3 < Message - - string :sign, {:size => 8, :value => SSP_SIGN} - int32LE :type, {:value => 3} - security_buffer :lm_response, {:value => ""} - security_buffer :ntlm_response, {:value => ""} - security_buffer :domain, {:value => ""} - security_buffer :user, {:value => ""} - security_buffer :workstation, {:value => ""} - security_buffer :session_key, {:value => "", :active => false } - int32LE :flag, {:value => 0, :active => false } - string :os_version, {:size => 8, :active => false } - - class << Type3 - # Builds a Type 3 packet - # @note All options must be properly encoded with either unicode or oem encoding - # @return [Type3] - # @option arg [String] :lm_response The LM hash - # @option arg [String] :ntlm_response The NTLM hash - # @option arg [String] :domain The domain to authenticate to - # @option arg [String] :workstation The name of the calling workstation - # @option arg [String] :session_key The session key - # @option arg [Integer] :flag Flags for the packet - def create(arg, opt ={}) - t = new - t.lm_response = arg[:lm_response] - t.ntlm_response = arg[:ntlm_response] - t.domain = arg[:domain] - t.user = arg[:user] - - if arg[:workstation] - t.workstation = arg[:workstation] - end - - if arg[:session_key] - t.enable(:session_key) - t.session_key = arg[:session_key] - end - - if arg[:flag] - t.enable(:session_key) - t.enable(:flag) - t.flag = arg[:flag] - end - t - end - end - - # @param server_challenge (see #password?) - def blank_password?(server_challenge) - password?('', server_challenge) - end - - # @param password [String] - # @param server_challenge [String] The server's {Type2#challenge challenge} from the - # {Type2} message for which this object is a response. - # @return [true] if +password+ was the password used to generate this - # {Type3} message - # @return [false] otherwise - def password?(password, server_challenge) - case ntlm_version - when :ntlm2_session - ntlm2_session_password?(password, server_challenge) - when :ntlmv2 - ntlmv2_password?(password, server_challenge) - else - raise - end - end - - # @return [Symbol] - def ntlm_version - if ntlm_response.size == 24 && lm_response[0,8] != "\x00"*8 && lm_response[8,16] == "\x00"*16 - :ntlm2_session - elsif ntlm_response.size == 24 - :ntlmv1 - elsif ntlm_response.size > 24 - :ntlmv2 - end - end - - private - - def ntlm2_session_password?(password, server_challenge) - hash = ntlm_response - _lm, empty_hash = NTLM.ntlm2_session( - { - :ntlm_hash => NTLM.ntlm_hash(password), - :challenge => server_challenge, - }, - { - :client_challenge => lm_response[0,8] - } - ) - hash == empty_hash - end - - def ntlmv2_password?(password, server_challenge) - - # The first 16 bytes of the ntlm_response are the HMAC of the blob - # that follows it. - blob = Blob.new - blob.parse(ntlm_response[16..-1]) - - empty_hash = NTLM.ntlmv2_response( - { - # user and domain came from the serialized data here, so - # they're already unicode - :ntlmv2_hash => NTLM.ntlmv2_hash(user, '', domain, :unicode => true), - :challenge => server_challenge, - :target_info => blob.target_info - }, - { - :client_challenge => blob.challenge, - # The blob's timestamp is already in milliseconds since 1601, - # so convert it back to epoch time first - :timestamp => (blob.timestamp / 10_000_000) - NTLM::TIME_OFFSET, - } - ) - - empty_hash == ntlm_response - end - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/security_buffer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/security_buffer.rb deleted file mode 100644 index 92645c8da2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/security_buffer.rb +++ /dev/null @@ -1,48 +0,0 @@ - -module Net - module NTLM - - class SecurityBuffer < FieldSet - - int16LE :length, {:value => 0} - int16LE :allocated, {:value => 0} - int32LE :offset, {:value => 0} - - attr_accessor :active - def initialize(opts={}) - super() - @value = opts[:value] - @active = opts[:active].nil? ? true : opts[:active] - @size = 8 - end - - def parse(str, offset=0) - if @active and str.size >= offset + @size - super(str, offset) - @value = str[self.offset, self.length] - @size - else - 0 - end - end - - def serialize - super if @active - end - - def value - @value - end - - def value=(val) - @value = val - self.length = self.allocated = val.size - end - - def data_size - @active ? @value.size : 0 - end - end - - end -end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/string.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/string.rb deleted file mode 100644 index 28edd9caa2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/string.rb +++ /dev/null @@ -1,35 +0,0 @@ -module Net - module NTLM - - class String < Field - def initialize(opts) - super(opts) - @size = opts[:size] - end - - def parse(str, offset=0) - if @active and str.size >= offset + @size - @value = str[offset, @size] - @size - else - 0 - end - end - - def serialize - if @active - @value.to_s - else - "" - end - end - - def value=(val) - @value = val - @size = @value.nil? ? 0 : @value.size - @active = (@size > 0) - end - end - - end -end \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/target_info.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/target_info.rb deleted file mode 100644 index 7cc50acb10..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/target_info.rb +++ /dev/null @@ -1,89 +0,0 @@ -module Net - module NTLM - - # Represents a list of AV_PAIR structures - # @see https://msdn.microsoft.com/en-us/library/cc236646.aspx - class TargetInfo - - # Allowed AvId values for an AV_PAIR - MSV_AV_EOL = "\x00\x00".freeze - MSV_AV_NB_COMPUTER_NAME = "\x01\x00".freeze - MSV_AV_NB_DOMAIN_NAME = "\x02\x00".freeze - MSV_AV_DNS_COMPUTER_NAME = "\x03\x00".freeze - MSV_AV_DNS_DOMAIN_NAME = "\x04\x00".freeze - MSV_AV_DNS_TREE_NAME = "\x05\x00".freeze - MSV_AV_FLAGS = "\x06\x00".freeze - MSV_AV_TIMESTAMP = "\x07\x00".freeze - MSV_AV_SINGLE_HOST = "\x08\x00".freeze - MSV_AV_TARGET_NAME = "\x09\x00".freeze - MSV_AV_CHANNEL_BINDINGS = "\x0A\x00".freeze - - # @param av_pair_sequence [String] AV_PAIR list from challenge message - def initialize(av_pair_sequence) - @av_pairs = read_pairs(av_pair_sequence) - end - - attr_reader :av_pairs - - def to_s - result = '' - av_pairs.each do |k,v| - result << k - result << [v.length].pack('S') - result << v - end - result << Net::NTLM::TargetInfo::MSV_AV_EOL - result << [0].pack('S') - result.force_encoding(Encoding::ASCII_8BIT) - end - - private - - VALID_PAIR_ID = [ - MSV_AV_EOL, - MSV_AV_NB_COMPUTER_NAME, - MSV_AV_NB_DOMAIN_NAME, - MSV_AV_DNS_COMPUTER_NAME, - MSV_AV_DNS_DOMAIN_NAME, - MSV_AV_DNS_TREE_NAME, - MSV_AV_FLAGS, - MSV_AV_TIMESTAMP, - MSV_AV_SINGLE_HOST, - MSV_AV_TARGET_NAME, - MSV_AV_CHANNEL_BINDINGS - ].freeze - - def read_pairs(av_pair_sequence) - offset = 0 - result = {} - return result if av_pair_sequence.nil? - - until offset >= av_pair_sequence.length - id = av_pair_sequence[offset..offset+1] - - unless VALID_PAIR_ID.include?(id) - raise Net::NTLM::InvalidTargetDataError.new( - "Invalid AvId #{to_hex(id)} in AV_PAIR structure", - av_pair_sequence - ) - end - - length = av_pair_sequence[offset+2..offset+3].unpack('S')[0].to_i - if length > 0 - value = av_pair_sequence[offset+4..offset+4+length-1] - result[id] = value - end - - offset += 4 + length - end - - result - end - - def to_hex(str) - return nil if str.nil? - str.bytes.map {|b| '0x' + b.to_s(16).rjust(2,'0').upcase}.join('-') - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/version.rb deleted file mode 100644 index b6a2dba74f..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/net/ntlm/version.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Net - module NTLM - # @private - module VERSION - MAJOR = 0 - MINOR = 6 - TINY = 3 - STRING = [MAJOR, MINOR, TINY].join('.') - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/rubyntlm.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/rubyntlm.rb deleted file mode 100644 index 969c19c714..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib/rubyntlm.rb +++ /dev/null @@ -1 +0,0 @@ -require 'net/ntlm' \ No newline at end of file diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick.rb deleted file mode 100644 index b854b68db4..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick.rb +++ /dev/null @@ -1,232 +0,0 @@ -# frozen_string_literal: false -## -# = WEB server toolkit. -# -# WEBrick is an HTTP server toolkit that can be configured as an HTTPS server, -# a proxy server, and a virtual-host server. WEBrick features complete -# logging of both server operations and HTTP access. WEBrick supports both -# basic and digest authentication in addition to algorithms not in RFC 2617. -# -# A WEBrick server can be composed of multiple WEBrick servers or servlets to -# provide differing behavior on a per-host or per-path basis. WEBrick -# includes servlets for handling CGI scripts, ERB pages, Ruby blocks and -# directory listings. -# -# WEBrick also includes tools for daemonizing a process and starting a process -# at a higher privilege level and dropping permissions. -# -# == Security -# -# *Warning:* WEBrick is not recommended for production. It only implements -# basic security checks. -# -# == Starting an HTTP server -# -# To create a new WEBrick::HTTPServer that will listen to connections on port -# 8000 and serve documents from the current user's public_html folder: -# -# require 'webrick' -# -# root = File.expand_path '~/public_html' -# server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root -# -# To run the server you will need to provide a suitable shutdown hook as -# starting the server blocks the current thread: -# -# trap 'INT' do server.shutdown end -# -# server.start -# -# == Custom Behavior -# -# The easiest way to have a server perform custom operations is through -# WEBrick::HTTPServer#mount_proc. The block given will be called with a -# WEBrick::HTTPRequest with request info and a WEBrick::HTTPResponse which -# must be filled in appropriately: -# -# server.mount_proc '/' do |req, res| -# res.body = 'Hello, world!' -# end -# -# Remember that +server.mount_proc+ must precede +server.start+. -# -# == Servlets -# -# Advanced custom behavior can be obtained through mounting a subclass of -# WEBrick::HTTPServlet::AbstractServlet. Servlets provide more modularity -# when writing an HTTP server than mount_proc allows. Here is a simple -# servlet: -# -# class Simple < WEBrick::HTTPServlet::AbstractServlet -# def do_GET request, response -# status, content_type, body = do_stuff_with request -# -# response.status = 200 -# response['Content-Type'] = 'text/plain' -# response.body = 'Hello, World!' -# end -# end -# -# To initialize the servlet you mount it on the server: -# -# server.mount '/simple', Simple -# -# See WEBrick::HTTPServlet::AbstractServlet for more details. -# -# == Virtual Hosts -# -# A server can act as a virtual host for multiple host names. After creating -# the listening host, additional hosts that do not listen can be created and -# attached as virtual hosts: -# -# server = WEBrick::HTTPServer.new # ... -# -# vhost = WEBrick::HTTPServer.new :ServerName => 'vhost.example', -# :DoNotListen => true, # ... -# vhost.mount '/', ... -# -# server.virtual_host vhost -# -# If no +:DocumentRoot+ is provided and no servlets or procs are mounted on the -# main server it will return 404 for all URLs. -# -# == HTTPS -# -# To create an HTTPS server you only need to enable SSL and provide an SSL -# certificate name: -# -# require 'webrick' -# require 'webrick/https' -# -# cert_name = [ -# %w[CN localhost], -# ] -# -# server = WEBrick::HTTPServer.new(:Port => 8000, -# :SSLEnable => true, -# :SSLCertName => cert_name) -# -# This will start the server with a self-generated self-signed certificate. -# The certificate will be changed every time the server is restarted. -# -# To create a server with a pre-determined key and certificate you can provide -# them: -# -# require 'webrick' -# require 'webrick/https' -# require 'openssl' -# -# cert = OpenSSL::X509::Certificate.new File.read '/path/to/cert.pem' -# pkey = OpenSSL::PKey::RSA.new File.read '/path/to/pkey.pem' -# -# server = WEBrick::HTTPServer.new(:Port => 8000, -# :SSLEnable => true, -# :SSLCertificate => cert, -# :SSLPrivateKey => pkey) -# -# == Proxy Server -# -# WEBrick can act as a proxy server: -# -# require 'webrick' -# require 'webrick/httpproxy' -# -# proxy = WEBrick::HTTPProxyServer.new :Port => 8000 -# -# trap 'INT' do proxy.shutdown end -# -# See WEBrick::HTTPProxy for further details including modifying proxied -# responses. -# -# == Basic and Digest authentication -# -# WEBrick provides both Basic and Digest authentication for regular and proxy -# servers. See WEBrick::HTTPAuth, WEBrick::HTTPAuth::BasicAuth and -# WEBrick::HTTPAuth::DigestAuth. -# -# == WEBrick as a daemonized Web Server -# -# WEBrick can be run as a daemonized server for small loads. -# -# === Daemonizing -# -# To start a WEBrick server as a daemon simple run WEBrick::Daemon.start -# before starting the server. -# -# === Dropping Permissions -# -# WEBrick can be started as one user to gain permission to bind to port 80 or -# 443 for serving HTTP or HTTPS traffic then can drop these permissions for -# regular operation. To listen on all interfaces for HTTP traffic: -# -# sockets = WEBrick::Utils.create_listeners nil, 80 -# -# Then drop privileges: -# -# WEBrick::Utils.su 'www' -# -# Then create a server that does not listen by default: -# -# server = WEBrick::HTTPServer.new :DoNotListen => true, # ... -# -# Then overwrite the listening sockets with the port 80 sockets: -# -# server.listeners.replace sockets -# -# === Logging -# -# WEBrick can separately log server operations and end-user access. For -# server operations: -# -# log_file = File.open '/var/log/webrick.log', 'a+' -# log = WEBrick::Log.new log_file -# -# For user access logging: -# -# access_log = [ -# [log_file, WEBrick::AccessLog::COMBINED_LOG_FORMAT], -# ] -# -# server = WEBrick::HTTPServer.new :Logger => log, :AccessLog => access_log -# -# See WEBrick::AccessLog for further log formats. -# -# === Log Rotation -# -# To rotate logs in WEBrick on a HUP signal (like syslogd can send), open the -# log file in 'a+' mode (as above) and trap 'HUP' to reopen the log file: -# -# trap 'HUP' do log_file.reopen '/path/to/webrick.log', 'a+' -# -# == Copyright -# -# Author: IPR -- Internet Programming with Ruby -- writers -# -# Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -#-- -# $IPR: webrick.rb,v 1.12 2002/10/01 17:16:31 gotoyuzo Exp $ - -module WEBrick -end - -require 'webrick/compat.rb' - -require 'webrick/version.rb' -require 'webrick/config.rb' -require 'webrick/log.rb' -require 'webrick/server.rb' -require_relative 'webrick/utils.rb' -require 'webrick/accesslog' - -require 'webrick/htmlutils.rb' -require 'webrick/httputils.rb' -require 'webrick/cookie.rb' -require 'webrick/httpversion.rb' -require 'webrick/httpstatus.rb' -require 'webrick/httprequest.rb' -require 'webrick/httpresponse.rb' -require 'webrick/httpserver.rb' -require 'webrick/httpservlet.rb' -require 'webrick/httpauth.rb' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/accesslog.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/accesslog.rb deleted file mode 100644 index fccfd65334..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/accesslog.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true -#-- -# accesslog.rb -- Access log handling utilities -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2002 keita yamaguchi -# Copyright (c) 2002 Internet Programming with Ruby writers -# -# $IPR: accesslog.rb,v 1.1 2002/10/01 17:16:32 gotoyuzo Exp $ - -module WEBrick - - ## - # AccessLog provides logging to various files in various formats. - # - # Multiple logs may be written to at the same time: - # - # access_log = [ - # [$stderr, WEBrick::AccessLog::COMMON_LOG_FORMAT], - # [$stderr, WEBrick::AccessLog::REFERER_LOG_FORMAT], - # ] - # - # server = WEBrick::HTTPServer.new :AccessLog => access_log - # - # Custom log formats may be defined. WEBrick::AccessLog provides a subset - # of the formatting from Apache's mod_log_config - # http://httpd.apache.org/docs/mod/mod_log_config.html#formats. See - # AccessLog::setup_params for a list of supported options - - module AccessLog - - ## - # Raised if a parameter such as %e, %i, %o or %n is used without fetching - # a specific field. - - class AccessLogError < StandardError; end - - ## - # The Common Log Format's time format - - CLF_TIME_FORMAT = "[%d/%b/%Y:%H:%M:%S %Z]" - - ## - # Common Log Format - - COMMON_LOG_FORMAT = "%h %l %u %t \"%r\" %s %b" - - ## - # Short alias for Common Log Format - - CLF = COMMON_LOG_FORMAT - - ## - # Referer Log Format - - REFERER_LOG_FORMAT = "%{Referer}i -> %U" - - ## - # User-Agent Log Format - - AGENT_LOG_FORMAT = "%{User-Agent}i" - - ## - # Combined Log Format - - COMBINED_LOG_FORMAT = "#{CLF} \"%{Referer}i\" \"%{User-agent}i\"" - - module_function - - # This format specification is a subset of mod_log_config of Apache: - # - # %a:: Remote IP address - # %b:: Total response size - # %e{variable}:: Given variable in ENV - # %f:: Response filename - # %h:: Remote host name - # %{header}i:: Given request header - # %l:: Remote logname, always "-" - # %m:: Request method - # %{attr}n:: Given request attribute from req.attributes - # %{header}o:: Given response header - # %p:: Server's request port - # %{format}p:: The canonical port of the server serving the request or the - # actual port or the client's actual port. Valid formats are - # canonical, local or remote. - # %q:: Request query string - # %r:: First line of the request - # %s:: Request status - # %t:: Time the request was received - # %T:: Time taken to process the request - # %u:: Remote user from auth - # %U:: Unparsed URI - # %%:: Literal % - - def setup_params(config, req, res) - params = Hash.new("") - params["a"] = req.peeraddr[3] - params["b"] = res.sent_size - params["e"] = ENV - params["f"] = res.filename || "" - params["h"] = req.peeraddr[2] - params["i"] = req - params["l"] = "-" - params["m"] = req.request_method - params["n"] = req.attributes - params["o"] = res - params["p"] = req.port - params["q"] = req.query_string - params["r"] = req.request_line.sub(/\x0d?\x0a\z/o, '') - params["s"] = res.status # won't support "%>s" - params["t"] = req.request_time - params["T"] = Time.now - req.request_time - params["u"] = req.user || "-" - params["U"] = req.unparsed_uri - params["v"] = config[:ServerName] - params - end - - ## - # Formats +params+ according to +format_string+ which is described in - # setup_params. - - def format(format_string, params) - format_string.gsub(/\%(?:\{(.*?)\})?>?([a-zA-Z%])/){ - param, spec = $1, $2 - case spec[0] - when ?e, ?i, ?n, ?o - raise AccessLogError, - "parameter is required for \"#{spec}\"" unless param - (param = params[spec][param]) ? escape(param) : "-" - when ?t - params[spec].strftime(param || CLF_TIME_FORMAT) - when ?p - case param - when 'remote' - escape(params["i"].peeraddr[1].to_s) - else - escape(params["p"].to_s) - end - when ?% - "%" - else - escape(params[spec].to_s) - end - } - end - - ## - # Escapes control characters in +data+ - - def escape(data) - data = data.gsub(/[[:cntrl:]\\]+/) {$&.dump[1...-1]} - data.untaint if RUBY_VERSION < '2.7' - data - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/cgi.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/cgi.rb deleted file mode 100644 index f22480b86b..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/cgi.rb +++ /dev/null @@ -1,313 +0,0 @@ -# frozen_string_literal: true -# -# cgi.rb -- Yet another CGI library -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $Id$ - -require_relative "httprequest" -require_relative "httpresponse" -require_relative "config" -require "stringio" - -module WEBrick - - # A CGI library using WEBrick requests and responses. - # - # Example: - # - # class MyCGI < WEBrick::CGI - # def do_GET req, res - # res.body = 'it worked!' - # res.status = 200 - # end - # end - # - # MyCGI.new.start - - class CGI - - # The CGI error exception class - - CGIError = Class.new(StandardError) - - ## - # The CGI configuration. This is based on WEBrick::Config::HTTP - - attr_reader :config - - ## - # The CGI logger - - attr_reader :logger - - ## - # Creates a new CGI interface. - # - # The first argument in +args+ is a configuration hash which would update - # WEBrick::Config::HTTP. - # - # Any remaining arguments are stored in the @options instance - # variable for use by a subclass. - - def initialize(*args) - if defined?(MOD_RUBY) - unless ENV.has_key?("GATEWAY_INTERFACE") - Apache.request.setup_cgi_env - end - end - if %r{HTTP/(\d+\.\d+)} =~ ENV["SERVER_PROTOCOL"] - httpv = $1 - end - @config = WEBrick::Config::HTTP.dup.update( - :ServerSoftware => ENV["SERVER_SOFTWARE"] || "null", - :HTTPVersion => HTTPVersion.new(httpv || "1.0"), - :RunOnCGI => true, # to detect if it runs on CGI. - :NPH => false # set true to run as NPH script. - ) - if config = args.shift - @config.update(config) - end - @config[:Logger] ||= WEBrick::BasicLog.new($stderr) - @logger = @config[:Logger] - @options = args - end - - ## - # Reads +key+ from the configuration - - def [](key) - @config[key] - end - - ## - # Starts the CGI process with the given environment +env+ and standard - # input and output +stdin+ and +stdout+. - - def start(env=ENV, stdin=$stdin, stdout=$stdout) - sock = WEBrick::CGI::Socket.new(@config, env, stdin, stdout) - req = HTTPRequest.new(@config) - res = HTTPResponse.new(@config) - unless @config[:NPH] or defined?(MOD_RUBY) - def res.setup_header - unless @header["status"] - phrase = HTTPStatus::reason_phrase(@status) - @header["status"] = "#{@status} #{phrase}" - end - super - end - def res.status_line - "" - end - end - - begin - req.parse(sock) - req.script_name = (env["SCRIPT_NAME"] || File.expand_path($0)).dup - req.path_info = (env["PATH_INFO"] || "").dup - req.query_string = env["QUERY_STRING"] - req.user = env["REMOTE_USER"] - res.request_method = req.request_method - res.request_uri = req.request_uri - res.request_http_version = req.http_version - res.keep_alive = req.keep_alive? - self.service(req, res) - rescue HTTPStatus::Error => ex - res.set_error(ex) - rescue HTTPStatus::Status => ex - res.status = ex.code - rescue Exception => ex - @logger.error(ex) - res.set_error(ex, true) - ensure - req.fixup - if defined?(MOD_RUBY) - res.setup_header - Apache.request.status_line = "#{res.status} #{res.reason_phrase}" - Apache.request.status = res.status - table = Apache.request.headers_out - res.header.each{|key, val| - case key - when /^content-encoding$/i - Apache::request.content_encoding = val - when /^content-type$/i - Apache::request.content_type = val - else - table[key] = val.to_s - end - } - res.cookies.each{|cookie| - table.add("Set-Cookie", cookie.to_s) - } - Apache.request.send_http_header - res.send_body(sock) - else - res.send_response(sock) - end - end - end - - ## - # Services the request +req+ which will fill in the response +res+. See - # WEBrick::HTTPServlet::AbstractServlet#service for details. - - def service(req, res) - method_name = "do_" + req.request_method.gsub(/-/, "_") - if respond_to?(method_name) - __send__(method_name, req, res) - else - raise HTTPStatus::MethodNotAllowed, - "unsupported method `#{req.request_method}'." - end - end - - ## - # Provides HTTP socket emulation from the CGI environment - - class Socket # :nodoc: - include Enumerable - - private - - def initialize(config, env, stdin, stdout) - @config = config - @env = env - @header_part = StringIO.new - @body_part = stdin - @out_port = stdout - @out_port.binmode - - @server_addr = @env["SERVER_ADDR"] || "0.0.0.0" - @server_name = @env["SERVER_NAME"] - @server_port = @env["SERVER_PORT"] - @remote_addr = @env["REMOTE_ADDR"] - @remote_host = @env["REMOTE_HOST"] || @remote_addr - @remote_port = @env["REMOTE_PORT"] || 0 - - begin - @header_part << request_line << CRLF - setup_header - @header_part << CRLF - @header_part.rewind - rescue Exception - raise CGIError, "invalid CGI environment" - end - end - - def request_line - meth = @env["REQUEST_METHOD"] || "GET" - unless url = @env["REQUEST_URI"] - url = (@env["SCRIPT_NAME"] || File.expand_path($0)).dup - url << @env["PATH_INFO"].to_s - url = WEBrick::HTTPUtils.escape_path(url) - if query_string = @env["QUERY_STRING"] - unless query_string.empty? - url << "?" << query_string - end - end - end - # we cannot get real HTTP version of client ;) - httpv = @config[:HTTPVersion] - return "#{meth} #{url} HTTP/#{httpv}" - end - - def setup_header - @env.each{|key, value| - case key - when "CONTENT_TYPE", "CONTENT_LENGTH" - add_header(key.gsub(/_/, "-"), value) - when /^HTTP_(.*)/ - add_header($1.gsub(/_/, "-"), value) - end - } - end - - def add_header(hdrname, value) - unless value.empty? - @header_part << hdrname << ": " << value << CRLF - end - end - - def input - @header_part.eof? ? @body_part : @header_part - end - - public - - def peeraddr - [nil, @remote_port, @remote_host, @remote_addr] - end - - def addr - [nil, @server_port, @server_name, @server_addr] - end - - def gets(eol=LF, size=nil) - input.gets(eol, size) - end - - def read(size=nil) - input.read(size) - end - - def each - input.each{|line| yield(line) } - end - - def eof? - input.eof? - end - - def <<(data) - @out_port << data - end - - def write(data) - @out_port.write(data) - end - - def cert - return nil unless defined?(OpenSSL) - if pem = @env["SSL_SERVER_CERT"] - OpenSSL::X509::Certificate.new(pem) unless pem.empty? - end - end - - def peer_cert - return nil unless defined?(OpenSSL) - if pem = @env["SSL_CLIENT_CERT"] - OpenSSL::X509::Certificate.new(pem) unless pem.empty? - end - end - - def peer_cert_chain - return nil unless defined?(OpenSSL) - if @env["SSL_CLIENT_CERT_CHAIN_0"] - keys = @env.keys - certs = keys.sort.collect{|k| - if /^SSL_CLIENT_CERT_CHAIN_\d+$/ =~ k - if pem = @env[k] - OpenSSL::X509::Certificate.new(pem) unless pem.empty? - end - end - } - certs.compact - end - end - - def cipher - return nil unless defined?(OpenSSL) - if cipher = @env["SSL_CIPHER"] - ret = [ cipher ] - ret << @env["SSL_PROTOCOL"] - ret << @env["SSL_CIPHER_USEKEYSIZE"] - ret << @env["SSL_CIPHER_ALGKEYSIZE"] - ret - end - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/compat.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/compat.rb deleted file mode 100644 index 842da1ebbc..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/compat.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# -# compat.rb -- cross platform compatibility -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2002 GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: compat.rb,v 1.6 2002/10/01 17:16:32 gotoyuzo Exp $ - -## -# System call error module used by webrick for cross platform compatibility. -# -# EPROTO:: protocol error -# ECONNRESET:: remote host reset the connection request -# ECONNABORTED:: Client sent TCP reset (RST) before server has accepted the -# connection requested by client. -# -module Errno - ## - # Protocol error. - - class EPROTO < SystemCallError; end - - ## - # Remote host reset the connection request. - - class ECONNRESET < SystemCallError; end - - ## - # Client sent TCP reset (RST) before server has accepted the connection - # requested by client. - - class ECONNABORTED < SystemCallError; end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/config.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/config.rb deleted file mode 100644 index d67375c816..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/config.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true -# -# config.rb -- Default configurations. -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: config.rb,v 1.52 2003/07/22 19:20:42 gotoyuzo Exp $ - -require_relative 'version' -require_relative 'httpversion' -require_relative 'httputils' -require_relative 'utils' -require_relative 'log' - -module WEBrick - module Config - LIBDIR = File::dirname(__FILE__) # :nodoc: - - # for GenericServer - General = Hash.new { |hash, key| - case key - when :ServerName - hash[key] = Utils.getservername - else - nil - end - }.update( - :BindAddress => nil, # "0.0.0.0" or "::" or nil - :Port => nil, # users MUST specify this!! - :MaxClients => 100, # maximum number of the concurrent connections - :ServerType => nil, # default: WEBrick::SimpleServer - :Logger => nil, # default: WEBrick::Log.new - :ServerSoftware => "WEBrick/#{WEBrick::VERSION} " + - "(Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})", - :TempDir => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp', - :DoNotListen => false, - :StartCallback => nil, - :StopCallback => nil, - :AcceptCallback => nil, - :DoNotReverseLookup => true, - :ShutdownSocketWithoutClose => false, - ) - - # for HTTPServer, HTTPRequest, HTTPResponse ... - HTTP = General.dup.update( - :Port => 80, - :RequestTimeout => 30, - :HTTPVersion => HTTPVersion.new("1.1"), - :AccessLog => nil, - :MimeTypes => HTTPUtils::DefaultMimeTypes, - :DirectoryIndex => ["index.html","index.htm","index.cgi","index.rhtml"], - :DocumentRoot => nil, - :DocumentRootOptions => { :FancyIndexing => true }, - :RequestCallback => nil, - :ServerAlias => nil, - :InputBufferSize => 65536, # input buffer size in reading request body - :OutputBufferSize => 65536, # output buffer size in sending File or IO - - # for HTTPProxyServer - :ProxyAuthProc => nil, - :ProxyContentHandler => nil, - :ProxyVia => true, - :ProxyTimeout => true, - :ProxyURI => nil, - - :CGIInterpreter => nil, - :CGIPathEnv => nil, - - # workaround: if Request-URIs contain 8bit chars, - # they should be escaped before calling of URI::parse(). - :Escape8bitURI => false - ) - - ## - # Default configuration for WEBrick::HTTPServlet::FileHandler - # - # :AcceptableLanguages:: - # Array of languages allowed for accept-language. There is no default - # :DirectoryCallback:: - # Allows preprocessing of directory requests. There is no default - # callback. - # :FancyIndexing:: - # If true, show an index for directories. The default is true. - # :FileCallback:: - # Allows preprocessing of file requests. There is no default callback. - # :HandlerCallback:: - # Allows preprocessing of requests. There is no default callback. - # :HandlerTable:: - # Maps file suffixes to file handlers. DefaultFileHandler is used by - # default but any servlet can be used. - # :NondisclosureName:: - # Do not show files matching this array of globs. .ht* and *~ are - # excluded by default. - # :UserDir:: - # Directory inside ~user to serve content from for /~user requests. - # Only works if mounted on /. Disabled by default. - - FileHandler = { - :NondisclosureName => [".ht*", "*~"], - :FancyIndexing => false, - :HandlerTable => {}, - :HandlerCallback => nil, - :DirectoryCallback => nil, - :FileCallback => nil, - :UserDir => nil, # e.g. "public_html" - :AcceptableLanguages => [] # ["en", "ja", ... ] - } - - ## - # Default configuration for WEBrick::HTTPAuth::BasicAuth - # - # :AutoReloadUserDB:: Reload the user database provided by :UserDB - # automatically? - - BasicAuth = { - :AutoReloadUserDB => true, - } - - ## - # Default configuration for WEBrick::HTTPAuth::DigestAuth. - # - # :Algorithm:: MD5, MD5-sess (default), SHA1, SHA1-sess - # :Domain:: An Array of URIs that define the protected space - # :Qop:: 'auth' for authentication, 'auth-int' for integrity protection or - # both - # :UseOpaque:: Should the server send opaque values to the client? This - # helps prevent replay attacks. - # :CheckNc:: Should the server check the nonce count? This helps the - # server detect replay attacks. - # :UseAuthenticationInfoHeader:: Should the server send an - # AuthenticationInfo header? - # :AutoReloadUserDB:: Reload the user database provided by :UserDB - # automatically? - # :NonceExpirePeriod:: How long should we store used nonces? Default is - # 30 minutes. - # :NonceExpireDelta:: How long is a nonce valid? Default is 1 minute - # :InternetExplorerHack:: Hack which allows Internet Explorer to work. - # :OperaHack:: Hack which allows Opera to work. - - DigestAuth = { - :Algorithm => 'MD5-sess', # or 'MD5' - :Domain => nil, # an array includes domain names. - :Qop => [ 'auth' ], # 'auth' or 'auth-int' or both. - :UseOpaque => true, - :UseNextNonce => false, - :CheckNc => false, - :UseAuthenticationInfoHeader => true, - :AutoReloadUserDB => true, - :NonceExpirePeriod => 30*60, - :NonceExpireDelta => 60, - :InternetExplorerHack => true, - :OperaHack => true, - } - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/cookie.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/cookie.rb deleted file mode 100644 index 7b187822a2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/cookie.rb +++ /dev/null @@ -1,172 +0,0 @@ -# frozen_string_literal: true -# -# cookie.rb -- Cookie class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: cookie.rb,v 1.16 2002/09/21 12:23:35 gotoyuzo Exp $ - -require 'time' -require_relative 'httputils' - -module WEBrick - - ## - # Processes HTTP cookies - - class Cookie - - ## - # The cookie name - - attr_reader :name - - ## - # The cookie value - - attr_accessor :value - - ## - # The cookie version - - attr_accessor :version - - ## - # The cookie domain - attr_accessor :domain - - ## - # The cookie path - - attr_accessor :path - - ## - # Is this a secure cookie? - - attr_accessor :secure - - ## - # The cookie comment - - attr_accessor :comment - - ## - # The maximum age of the cookie - - attr_accessor :max_age - - #attr_accessor :comment_url, :discard, :port - - ## - # Creates a new cookie with the given +name+ and +value+ - - def initialize(name, value) - @name = name - @value = value - @version = 0 # Netscape Cookie - - @domain = @path = @secure = @comment = @max_age = - @expires = @comment_url = @discard = @port = nil - end - - ## - # Sets the cookie expiration to the time +t+. The expiration time may be - # a false value to disable expiration or a Time or HTTP format time string - # to set the expiration date. - - def expires=(t) - @expires = t && (t.is_a?(Time) ? t.httpdate : t.to_s) - end - - ## - # Retrieves the expiration time as a Time - - def expires - @expires && Time.parse(@expires) - end - - ## - # The cookie string suitable for use in an HTTP header - - def to_s - ret = +"" - ret << @name << "=" << @value - ret << "; " << "Version=" << @version.to_s if @version > 0 - ret << "; " << "Domain=" << @domain if @domain - ret << "; " << "Expires=" << @expires if @expires - ret << "; " << "Max-Age=" << @max_age.to_s if @max_age - ret << "; " << "Comment=" << @comment if @comment - ret << "; " << "Path=" << @path if @path - ret << "; " << "Secure" if @secure - ret - end - - ## - # Parses a Cookie field sent from the user-agent. Returns an array of - # cookies. - - def self.parse(str) - if str - ret = [] - cookie = nil - ver = 0 - str.split(/;\s+/).each{|x| - key, val = x.split(/=/,2) - val = val ? HTTPUtils::dequote(val) : "" - case key - when "$Version"; ver = val.to_i - when "$Path"; cookie.path = val - when "$Domain"; cookie.domain = val - when "$Port"; cookie.port = val - else - ret << cookie if cookie - cookie = self.new(key, val) - cookie.version = ver - end - } - ret << cookie if cookie - ret - end - end - - ## - # Parses the cookie in +str+ - - def self.parse_set_cookie(str) - cookie_elem = str.split(/;/) - first_elem = cookie_elem.shift - first_elem.strip! - key, value = first_elem.split(/=/, 2) - cookie = new(key, HTTPUtils.dequote(value)) - cookie_elem.each{|pair| - pair.strip! - key, value = pair.split(/=/, 2) - if value - value = HTTPUtils.dequote(value.strip) - end - case key.downcase - when "domain" then cookie.domain = value - when "path" then cookie.path = value - when "expires" then cookie.expires = value - when "max-age" then cookie.max_age = Integer(value) - when "comment" then cookie.comment = value - when "version" then cookie.version = Integer(value) - when "secure" then cookie.secure = true - end - } - return cookie - end - - ## - # Parses the cookies in +str+ - - def self.parse_set_cookies(str) - return str.split(/,(?=[^;,]*=)|,$/).collect{|c| - parse_set_cookie(c) - } - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/htmlutils.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/htmlutils.rb deleted file mode 100644 index 7ff0bde27f..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/htmlutils.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -#-- -# htmlutils.rb -- HTMLUtils Module -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: htmlutils.rb,v 1.7 2002/09/21 12:23:35 gotoyuzo Exp $ - -module WEBrick - module HTMLUtils - - ## - # Escapes &, ", > and < in +string+ - - def escape(string) - return "" unless string - str = string.b - str.gsub!(/&/n, '&') - str.gsub!(/\"/n, '"') - str.gsub!(/>/n, '>') - str.gsub!(/ 'DigestAuth example realm' } - # - # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file' - # htpasswd.auth_type = WEBrick::HTTPAuth::DigestAuth - # htpasswd.set_passwd config[:Realm], 'username', 'password' - # htpasswd.flush - # - # The +:Realm+ is used to provide different access to different groups - # across several resources on a server. Typically you'll need only one - # realm for a server. - # - # This database can be used to create an authenticator: - # - # config[:UserDB] = htpasswd - # - # digest_auth = WEBrick::HTTPAuth::DigestAuth.new config - # - # To authenticate a request call #authenticate with a request and response - # object in a servlet: - # - # def do_GET req, res - # @authenticator.authenticate req, res - # end - # - # For digest authentication the authenticator must not be created every - # request, it must be passed in as an option via WEBrick::HTTPServer#mount. - - module HTTPAuth - module_function - - def _basic_auth(req, res, realm, req_field, res_field, err_type, - block) # :nodoc: - user = pass = nil - if /^Basic\s+(.*)/o =~ req[req_field] - userpass = $1 - user, pass = userpass.unpack("m*")[0].split(":", 2) - end - if block.call(user, pass) - req.user = user - return - end - res[res_field] = "Basic realm=\"#{realm}\"" - raise err_type - end - - ## - # Simple wrapper for providing basic authentication for a request. When - # called with a request +req+, response +res+, authentication +realm+ and - # +block+ the block will be called with a +username+ and +password+. If - # the block returns true the request is allowed to continue, otherwise an - # HTTPStatus::Unauthorized error is raised. - - def basic_auth(req, res, realm, &block) # :yield: username, password - _basic_auth(req, res, realm, "Authorization", "WWW-Authenticate", - HTTPStatus::Unauthorized, block) - end - - ## - # Simple wrapper for providing basic authentication for a proxied request. - # When called with a request +req+, response +res+, authentication +realm+ - # and +block+ the block will be called with a +username+ and +password+. - # If the block returns true the request is allowed to continue, otherwise - # an HTTPStatus::ProxyAuthenticationRequired error is raised. - - def proxy_basic_auth(req, res, realm, &block) # :yield: username, password - _basic_auth(req, res, realm, "Proxy-Authorization", "Proxy-Authenticate", - HTTPStatus::ProxyAuthenticationRequired, block) - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/authenticator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/authenticator.rb deleted file mode 100644 index a6ee28de1a..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/authenticator.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true -#-- -# httpauth/authenticator.rb -- Authenticator mix-in module. -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: authenticator.rb,v 1.3 2003/02/20 07:15:47 gotoyuzo Exp $ - -module WEBrick - module HTTPAuth - - ## - # Module providing generic support for both Digest and Basic - # authentication schemes. - - module Authenticator - - RequestField = "Authorization" # :nodoc: - ResponseField = "WWW-Authenticate" # :nodoc: - ResponseInfoField = "Authentication-Info" # :nodoc: - AuthException = HTTPStatus::Unauthorized # :nodoc: - - ## - # Method of authentication, must be overridden by the including class - - AuthScheme = nil - - ## - # The realm this authenticator covers - - attr_reader :realm - - ## - # The user database for this authenticator - - attr_reader :userdb - - ## - # The logger for this authenticator - - attr_reader :logger - - private - - # :stopdoc: - - ## - # Initializes the authenticator from +config+ - - def check_init(config) - [:UserDB, :Realm].each{|sym| - unless config[sym] - raise ArgumentError, "Argument #{sym.inspect} missing." - end - } - @realm = config[:Realm] - @userdb = config[:UserDB] - @logger = config[:Logger] || Log::new($stderr) - @reload_db = config[:AutoReloadUserDB] - @request_field = self::class::RequestField - @response_field = self::class::ResponseField - @resp_info_field = self::class::ResponseInfoField - @auth_exception = self::class::AuthException - @auth_scheme = self::class::AuthScheme - end - - ## - # Ensures +req+ has credentials that can be authenticated. - - def check_scheme(req) - unless credentials = req[@request_field] - error("no credentials in the request.") - return nil - end - unless match = /^#{@auth_scheme}\s+/i.match(credentials) - error("invalid scheme in %s.", credentials) - info("%s: %s", @request_field, credentials) if $DEBUG - return nil - end - return match.post_match - end - - def log(meth, fmt, *args) - msg = format("%s %s: ", @auth_scheme, @realm) - msg << fmt % args - @logger.__send__(meth, msg) - end - - def error(fmt, *args) - if @logger.error? - log(:error, fmt, *args) - end - end - - def info(fmt, *args) - if @logger.info? - log(:info, fmt, *args) - end - end - - # :startdoc: - end - - ## - # Module providing generic support for both Digest and Basic - # authentication schemes for proxies. - - module ProxyAuthenticator - RequestField = "Proxy-Authorization" # :nodoc: - ResponseField = "Proxy-Authenticate" # :nodoc: - InfoField = "Proxy-Authentication-Info" # :nodoc: - AuthException = HTTPStatus::ProxyAuthenticationRequired # :nodoc: - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/basicauth.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/basicauth.rb deleted file mode 100644 index cc8137aff7..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/basicauth.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true -# -# httpauth/basicauth.rb -- HTTP basic access authentication -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: basicauth.rb,v 1.5 2003/02/20 07:15:47 gotoyuzo Exp $ - -require_relative '../config' -require_relative '../httpstatus' -require_relative 'authenticator' - -module WEBrick - module HTTPAuth - - ## - # Basic Authentication for WEBrick - # - # Use this class to add basic authentication to a WEBrick servlet. - # - # Here is an example of how to set up a BasicAuth: - # - # config = { :Realm => 'BasicAuth example realm' } - # - # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file', password_hash: :bcrypt - # htpasswd.set_passwd config[:Realm], 'username', 'password' - # htpasswd.flush - # - # config[:UserDB] = htpasswd - # - # basic_auth = WEBrick::HTTPAuth::BasicAuth.new config - - class BasicAuth - include Authenticator - - AuthScheme = "Basic" # :nodoc: - - ## - # Used by UserDB to create a basic password entry - - def self.make_passwd(realm, user, pass) - pass ||= "" - pass.crypt(Utils::random_string(2)) - end - - attr_reader :realm, :userdb, :logger - - ## - # Creates a new BasicAuth instance. - # - # See WEBrick::Config::BasicAuth for default configuration entries - # - # You must supply the following configuration entries: - # - # :Realm:: The name of the realm being protected. - # :UserDB:: A database of usernames and passwords. - # A WEBrick::HTTPAuth::Htpasswd instance should be used. - - def initialize(config, default=Config::BasicAuth) - check_init(config) - @config = default.dup.update(config) - end - - ## - # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if - # the authentication was not correct. - - def authenticate(req, res) - unless basic_credentials = check_scheme(req) - challenge(req, res) - end - userid, password = basic_credentials.unpack("m*")[0].split(":", 2) - password ||= "" - if userid.empty? - error("user id was not given.") - challenge(req, res) - end - unless encpass = @userdb.get_passwd(@realm, userid, @reload_db) - error("%s: the user is not allowed.", userid) - challenge(req, res) - end - - case encpass - when /\A\$2[aby]\$/ - password_matches = BCrypt::Password.new(encpass.sub(/\A\$2[aby]\$/, '$2a$')) == password - else - password_matches = password.crypt(encpass) == encpass - end - - unless password_matches - error("%s: password unmatch.", userid) - challenge(req, res) - end - info("%s: authentication succeeded.", userid) - req.user = userid - end - - ## - # Returns a challenge response which asks for authentication information - - def challenge(req, res) - res[@response_field] = "#{@auth_scheme} realm=\"#{@realm}\"" - raise @auth_exception - end - end - - ## - # Basic authentication for proxy servers. See BasicAuth for details. - - class ProxyBasicAuth < BasicAuth - include ProxyAuthenticator - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/digestauth.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/digestauth.rb deleted file mode 100644 index 25ce8ba080..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/digestauth.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true -# -# httpauth/digestauth.rb -- HTTP digest access authentication -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. -# Copyright (c) 2003 H.M. -# -# The original implementation is provided by H.M. -# URL: http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name= -# %C7%A7%BE%DA%B5%A1%C7%BD%A4%F2%B2%FE%C2%A4%A4%B7%A4%C6%A4%DF%A4%EB -# -# $IPR: digestauth.rb,v 1.5 2003/02/20 07:15:47 gotoyuzo Exp $ - -require_relative '../config' -require_relative '../httpstatus' -require_relative 'authenticator' -require 'digest/md5' -require 'digest/sha1' - -module WEBrick - module HTTPAuth - - ## - # RFC 2617 Digest Access Authentication for WEBrick - # - # Use this class to add digest authentication to a WEBrick servlet. - # - # Here is an example of how to set up DigestAuth: - # - # config = { :Realm => 'DigestAuth example realm' } - # - # htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file' - # htdigest.set_passwd config[:Realm], 'username', 'password' - # htdigest.flush - # - # config[:UserDB] = htdigest - # - # digest_auth = WEBrick::HTTPAuth::DigestAuth.new config - # - # When using this as with a servlet be sure not to create a new DigestAuth - # object in the servlet's #initialize. By default WEBrick creates a new - # servlet instance for every request and the DigestAuth object must be - # used across requests. - - class DigestAuth - include Authenticator - - AuthScheme = "Digest" # :nodoc: - - ## - # Struct containing the opaque portion of the digest authentication - - OpaqueInfo = Struct.new(:time, :nonce, :nc) # :nodoc: - - ## - # Digest authentication algorithm - - attr_reader :algorithm - - ## - # Quality of protection. RFC 2617 defines "auth" and "auth-int" - - attr_reader :qop - - ## - # Used by UserDB to create a digest password entry - - def self.make_passwd(realm, user, pass) - pass ||= "" - Digest::MD5::hexdigest([user, realm, pass].join(":")) - end - - ## - # Creates a new DigestAuth instance. Be sure to use the same DigestAuth - # instance for multiple requests as it saves state between requests in - # order to perform authentication. - # - # See WEBrick::Config::DigestAuth for default configuration entries - # - # You must supply the following configuration entries: - # - # :Realm:: The name of the realm being protected. - # :UserDB:: A database of usernames and passwords. - # A WEBrick::HTTPAuth::Htdigest instance should be used. - - def initialize(config, default=Config::DigestAuth) - check_init(config) - @config = default.dup.update(config) - @algorithm = @config[:Algorithm] - @domain = @config[:Domain] - @qop = @config[:Qop] - @use_opaque = @config[:UseOpaque] - @use_next_nonce = @config[:UseNextNonce] - @check_nc = @config[:CheckNc] - @use_auth_info_header = @config[:UseAuthenticationInfoHeader] - @nonce_expire_period = @config[:NonceExpirePeriod] - @nonce_expire_delta = @config[:NonceExpireDelta] - @internet_explorer_hack = @config[:InternetExplorerHack] - - case @algorithm - when 'MD5','MD5-sess' - @h = Digest::MD5 - when 'SHA1','SHA1-sess' # it is a bonus feature :-) - @h = Digest::SHA1 - else - msg = format('Algorithm "%s" is not supported.', @algorithm) - raise ArgumentError.new(msg) - end - - @instance_key = hexdigest(self.__id__, Time.now.to_i, Process.pid) - @opaques = {} - @last_nonce_expire = Time.now - @mutex = Thread::Mutex.new - end - - ## - # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if - # the authentication was not correct. - - def authenticate(req, res) - unless result = @mutex.synchronize{ _authenticate(req, res) } - challenge(req, res) - end - if result == :nonce_is_stale - challenge(req, res, true) - end - return true - end - - ## - # Returns a challenge response which asks for authentication information - - def challenge(req, res, stale=false) - nonce = generate_next_nonce(req) - if @use_opaque - opaque = generate_opaque(req) - @opaques[opaque].nonce = nonce - end - - param = Hash.new - param["realm"] = HTTPUtils::quote(@realm) - param["domain"] = HTTPUtils::quote(@domain.to_a.join(" ")) if @domain - param["nonce"] = HTTPUtils::quote(nonce) - param["opaque"] = HTTPUtils::quote(opaque) if opaque - param["stale"] = stale.to_s - param["algorithm"] = @algorithm - param["qop"] = HTTPUtils::quote(@qop.to_a.join(",")) if @qop - - res[@response_field] = - "#{@auth_scheme} " + param.map{|k,v| "#{k}=#{v}" }.join(", ") - info("%s: %s", @response_field, res[@response_field]) if $DEBUG - raise @auth_exception - end - - private - - # :stopdoc: - - MustParams = ['username','realm','nonce','uri','response'] - MustParamsAuth = ['cnonce','nc'] - - def _authenticate(req, res) - unless digest_credentials = check_scheme(req) - return false - end - - auth_req = split_param_value(digest_credentials) - if auth_req['qop'] == "auth" || auth_req['qop'] == "auth-int" - req_params = MustParams + MustParamsAuth - else - req_params = MustParams - end - req_params.each{|key| - unless auth_req.has_key?(key) - error('%s: parameter missing. "%s"', auth_req['username'], key) - raise HTTPStatus::BadRequest - end - } - - if !check_uri(req, auth_req) - raise HTTPStatus::BadRequest - end - - if auth_req['realm'] != @realm - error('%s: realm unmatch. "%s" for "%s"', - auth_req['username'], auth_req['realm'], @realm) - return false - end - - auth_req['algorithm'] ||= 'MD5' - if auth_req['algorithm'].upcase != @algorithm.upcase - error('%s: algorithm unmatch. "%s" for "%s"', - auth_req['username'], auth_req['algorithm'], @algorithm) - return false - end - - if (@qop.nil? && auth_req.has_key?('qop')) || - (@qop && (! @qop.member?(auth_req['qop']))) - error('%s: the qop is not allowed. "%s"', - auth_req['username'], auth_req['qop']) - return false - end - - password = @userdb.get_passwd(@realm, auth_req['username'], @reload_db) - unless password - error('%s: the user is not allowed.', auth_req['username']) - return false - end - - nonce_is_invalid = false - if @use_opaque - info("@opaque = %s", @opaque.inspect) if $DEBUG - if !(opaque = auth_req['opaque']) - error('%s: opaque is not given.', auth_req['username']) - nonce_is_invalid = true - elsif !(opaque_struct = @opaques[opaque]) - error('%s: invalid opaque is given.', auth_req['username']) - nonce_is_invalid = true - elsif !check_opaque(opaque_struct, req, auth_req) - @opaques.delete(auth_req['opaque']) - nonce_is_invalid = true - end - elsif !check_nonce(req, auth_req) - nonce_is_invalid = true - end - - if /-sess$/i =~ auth_req['algorithm'] - ha1 = hexdigest(password, auth_req['nonce'], auth_req['cnonce']) - else - ha1 = password - end - - if auth_req['qop'] == "auth" || auth_req['qop'] == nil - ha2 = hexdigest(req.request_method, auth_req['uri']) - ha2_res = hexdigest("", auth_req['uri']) - elsif auth_req['qop'] == "auth-int" - body_digest = @h.new - req.body { |chunk| body_digest.update(chunk) } - body_digest = body_digest.hexdigest - ha2 = hexdigest(req.request_method, auth_req['uri'], body_digest) - ha2_res = hexdigest("", auth_req['uri'], body_digest) - end - - if auth_req['qop'] == "auth" || auth_req['qop'] == "auth-int" - param2 = ['nonce', 'nc', 'cnonce', 'qop'].map{|key| - auth_req[key] - }.join(':') - digest = hexdigest(ha1, param2, ha2) - digest_res = hexdigest(ha1, param2, ha2_res) - else - digest = hexdigest(ha1, auth_req['nonce'], ha2) - digest_res = hexdigest(ha1, auth_req['nonce'], ha2_res) - end - - if digest != auth_req['response'] - error("%s: digest unmatch.", auth_req['username']) - return false - elsif nonce_is_invalid - error('%s: digest is valid, but nonce is not valid.', - auth_req['username']) - return :nonce_is_stale - elsif @use_auth_info_header - auth_info = { - 'nextnonce' => generate_next_nonce(req), - 'rspauth' => digest_res - } - if @use_opaque - opaque_struct.time = req.request_time - opaque_struct.nonce = auth_info['nextnonce'] - opaque_struct.nc = "%08x" % (auth_req['nc'].hex + 1) - end - if auth_req['qop'] == "auth" || auth_req['qop'] == "auth-int" - ['qop','cnonce','nc'].each{|key| - auth_info[key] = auth_req[key] - } - end - res[@resp_info_field] = auth_info.keys.map{|key| - if key == 'nc' - key + '=' + auth_info[key] - else - key + "=" + HTTPUtils::quote(auth_info[key]) - end - }.join(', ') - end - info('%s: authentication succeeded.', auth_req['username']) - req.user = auth_req['username'] - return true - end - - def split_param_value(string) - ret = {} - string.scan(/\G\s*([\w\-.*%!]+)=\s*(?:\"((?>\\.|[^\"])*)\"|([^,\"]*))\s*,?/) do - ret[$1] = $3 || $2.gsub(/\\(.)/, "\\1") - end - ret - end - - def generate_next_nonce(req) - now = "%012d" % req.request_time.to_i - pk = hexdigest(now, @instance_key)[0,32] - nonce = [now + ":" + pk].pack("m0") # it has 60 length of chars. - nonce - end - - def check_nonce(req, auth_req) - username = auth_req['username'] - nonce = auth_req['nonce'] - - pub_time, pk = nonce.unpack("m*")[0].split(":", 2) - if (!pub_time || !pk) - error("%s: empty nonce is given", username) - return false - elsif (hexdigest(pub_time, @instance_key)[0,32] != pk) - error("%s: invalid private-key: %s for %s", - username, hexdigest(pub_time, @instance_key)[0,32], pk) - return false - end - - diff_time = req.request_time.to_i - pub_time.to_i - if (diff_time < 0) - error("%s: difference of time-stamp is negative.", username) - return false - elsif diff_time > @nonce_expire_period - error("%s: nonce is expired.", username) - return false - end - - return true - end - - def generate_opaque(req) - @mutex.synchronize{ - now = req.request_time - if now - @last_nonce_expire > @nonce_expire_delta - @opaques.delete_if{|key,val| - (now - val.time) > @nonce_expire_period - } - @last_nonce_expire = now - end - begin - opaque = Utils::random_string(16) - end while @opaques[opaque] - @opaques[opaque] = OpaqueInfo.new(now, nil, '00000001') - opaque - } - end - - def check_opaque(opaque_struct, req, auth_req) - if (@use_next_nonce && auth_req['nonce'] != opaque_struct.nonce) - error('%s: nonce unmatched. "%s" for "%s"', - auth_req['username'], auth_req['nonce'], opaque_struct.nonce) - return false - elsif !check_nonce(req, auth_req) - return false - end - if (@check_nc && auth_req['nc'] != opaque_struct.nc) - error('%s: nc unmatched."%s" for "%s"', - auth_req['username'], auth_req['nc'], opaque_struct.nc) - return false - end - true - end - - def check_uri(req, auth_req) - uri = auth_req['uri'] - if uri != req.request_uri.to_s && uri != req.unparsed_uri && - (@internet_explorer_hack && uri != req.path) - error('%s: uri unmatch. "%s" for "%s"', auth_req['username'], - auth_req['uri'], req.request_uri.to_s) - return false - end - true - end - - def hexdigest(*args) - @h.hexdigest(args.join(":")) - end - - # :startdoc: - end - - ## - # Digest authentication for proxy servers. See DigestAuth for details. - - class ProxyDigestAuth < DigestAuth - include ProxyAuthenticator - - private - def check_uri(req, auth_req) # :nodoc: - return true - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htdigest.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htdigest.rb deleted file mode 100644 index c7e853b775..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htdigest.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true -# -# httpauth/htdigest.rb -- Apache compatible htdigest file -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: htdigest.rb,v 1.4 2003/07/22 19:20:45 gotoyuzo Exp $ - -require_relative 'userdb' -require_relative 'digestauth' -require 'tempfile' - -module WEBrick - module HTTPAuth - - ## - # Htdigest accesses apache-compatible digest password files. Passwords are - # matched to a realm where they are valid. For security, the path for a - # digest password database should be stored outside of the paths available - # to the HTTP server. - # - # Htdigest is intended for use with WEBrick::HTTPAuth::DigestAuth and - # stores passwords using cryptographic hashes. - # - # htpasswd = WEBrick::HTTPAuth::Htdigest.new 'my_password_file' - # htpasswd.set_passwd 'my realm', 'username', 'password' - # htpasswd.flush - - class Htdigest - include UserDB - - ## - # Open a digest password database at +path+ - - def initialize(path) - @path = path - @mtime = Time.at(0) - @digest = Hash.new - @mutex = Thread::Mutex::new - @auth_type = DigestAuth - File.open(@path,"a").close unless File.exist?(@path) - reload - end - - ## - # Reloads passwords from the database - - def reload - mtime = File::mtime(@path) - if mtime > @mtime - @digest.clear - File.open(@path){|io| - while line = io.gets - line.chomp! - user, realm, pass = line.split(/:/, 3) - unless @digest[realm] - @digest[realm] = Hash.new - end - @digest[realm][user] = pass - end - } - @mtime = mtime - end - end - - ## - # Flush the password database. If +output+ is given the database will - # be written there instead of to the original path. - - def flush(output=nil) - output ||= @path - tmp = Tempfile.create("htpasswd", File::dirname(output)) - renamed = false - begin - each{|item| tmp.puts(item.join(":")) } - tmp.close - File::rename(tmp.path, output) - renamed = true - ensure - tmp.close - File.unlink(tmp.path) if !renamed - end - end - - ## - # Retrieves a password from the database for +user+ in +realm+. If - # +reload_db+ is true the database will be reloaded first. - - def get_passwd(realm, user, reload_db) - reload() if reload_db - if hash = @digest[realm] - hash[user] - end - end - - ## - # Sets a password in the database for +user+ in +realm+ to +pass+. - - def set_passwd(realm, user, pass) - @mutex.synchronize{ - unless @digest[realm] - @digest[realm] = Hash.new - end - @digest[realm][user] = make_passwd(realm, user, pass) - } - end - - ## - # Removes a password from the database for +user+ in +realm+. - - def delete_passwd(realm, user) - if hash = @digest[realm] - hash.delete(user) - end - end - - ## - # Iterate passwords in the database. - - def each # :yields: [user, realm, password_hash] - @digest.keys.sort.each{|realm| - hash = @digest[realm] - hash.keys.sort.each{|user| - yield([user, realm, hash[user]]) - } - } - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htgroup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htgroup.rb deleted file mode 100644 index 108c9d0ba6..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htgroup.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true -# -# httpauth/htgroup.rb -- Apache compatible htgroup file -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: htgroup.rb,v 1.1 2003/02/16 22:22:56 gotoyuzo Exp $ - -require 'tempfile' - -module WEBrick - module HTTPAuth - - ## - # Htgroup accesses apache-compatible group files. Htgroup can be used to - # provide group-based authentication for users. Currently Htgroup is not - # directly integrated with any authenticators in WEBrick. For security, - # the path for a digest password database should be stored outside of the - # paths available to the HTTP server. - # - # Example: - # - # htgroup = WEBrick::HTTPAuth::Htgroup.new 'my_group_file' - # htgroup.add 'superheroes', %w[spiderman batman] - # - # htgroup.members('superheroes').include? 'magneto' # => false - - class Htgroup - - ## - # Open a group database at +path+ - - def initialize(path) - @path = path - @mtime = Time.at(0) - @group = Hash.new - File.open(@path,"a").close unless File.exist?(@path) - reload - end - - ## - # Reload groups from the database - - def reload - if (mtime = File::mtime(@path)) > @mtime - @group.clear - File.open(@path){|io| - while line = io.gets - line.chomp! - group, members = line.split(/:\s*/) - @group[group] = members.split(/\s+/) - end - } - @mtime = mtime - end - end - - ## - # Flush the group database. If +output+ is given the database will be - # written there instead of to the original path. - - def flush(output=nil) - output ||= @path - tmp = Tempfile.create("htgroup", File::dirname(output)) - begin - @group.keys.sort.each{|group| - tmp.puts(format("%s: %s", group, self.members(group).join(" "))) - } - ensure - tmp.close - if $! - File.unlink(tmp.path) - else - return File.rename(tmp.path, output) - end - end - end - - ## - # Retrieve the list of members from +group+ - - def members(group) - reload - @group[group] || [] - end - - ## - # Add an Array of +members+ to +group+ - - def add(group, members) - @group[group] = members(group) | members - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htpasswd.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htpasswd.rb deleted file mode 100644 index 9a48e57d16..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/htpasswd.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true -# -# httpauth/htpasswd -- Apache compatible htpasswd file -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: htpasswd.rb,v 1.4 2003/07/22 19:20:45 gotoyuzo Exp $ - -require_relative 'userdb' -require_relative 'basicauth' -require 'tempfile' - -module WEBrick - module HTTPAuth - - ## - # Htpasswd accesses apache-compatible password files. Passwords are - # matched to a realm where they are valid. For security, the path for a - # password database should be stored outside of the paths available to the - # HTTP server. - # - # Htpasswd is intended for use with WEBrick::HTTPAuth::BasicAuth. - # - # To create an Htpasswd database with a single user: - # - # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file' - # htpasswd.set_passwd 'my realm', 'username', 'password' - # htpasswd.flush - - class Htpasswd - include UserDB - - ## - # Open a password database at +path+ - - def initialize(path, password_hash: nil) - @path = path - @mtime = Time.at(0) - @passwd = Hash.new - @auth_type = BasicAuth - @password_hash = password_hash - - case @password_hash - when nil - # begin - # require "string/crypt" - # rescue LoadError - # warn("Unable to load string/crypt, proceeding with deprecated use of String#crypt, consider using password_hash: :bcrypt") - # end - @password_hash = :crypt - when :crypt - # require "string/crypt" - when :bcrypt - require "bcrypt" - else - raise ArgumentError, "only :crypt and :bcrypt are supported for password_hash keyword argument" - end - - File.open(@path,"a").close unless File.exist?(@path) - reload - end - - ## - # Reload passwords from the database - - def reload - mtime = File::mtime(@path) - if mtime > @mtime - @passwd.clear - File.open(@path){|io| - while line = io.gets - line.chomp! - case line - when %r!\A[^:]+:[a-zA-Z0-9./]{13}\z! - if @password_hash == :bcrypt - raise StandardError, ".htpasswd file contains crypt password, only bcrypt passwords supported" - end - user, pass = line.split(":") - when %r!\A[^:]+:\$2[aby]\$\d{2}\$.{53}\z! - if @password_hash == :crypt - raise StandardError, ".htpasswd file contains bcrypt password, only crypt passwords supported" - end - user, pass = line.split(":") - when /:\$/, /:{SHA}/ - raise NotImplementedError, - 'MD5, SHA1 .htpasswd file not supported' - else - raise StandardError, 'bad .htpasswd file' - end - @passwd[user] = pass - end - } - @mtime = mtime - end - end - - ## - # Flush the password database. If +output+ is given the database will - # be written there instead of to the original path. - - def flush(output=nil) - output ||= @path - tmp = Tempfile.create("htpasswd", File::dirname(output)) - renamed = false - begin - each{|item| tmp.puts(item.join(":")) } - tmp.close - File::rename(tmp.path, output) - renamed = true - ensure - tmp.close - File.unlink(tmp.path) if !renamed - end - end - - ## - # Retrieves a password from the database for +user+ in +realm+. If - # +reload_db+ is true the database will be reloaded first. - - def get_passwd(realm, user, reload_db) - reload() if reload_db - @passwd[user] - end - - ## - # Sets a password in the database for +user+ in +realm+ to +pass+. - - def set_passwd(realm, user, pass) - if @password_hash == :bcrypt - # Cost of 5 to match Apache default, and because the - # bcrypt default of 10 will introduce significant delays - # for every request. - @passwd[user] = BCrypt::Password.create(pass, :cost=>5) - else - @passwd[user] = make_passwd(realm, user, pass) - end - end - - ## - # Removes a password from the database for +user+ in +realm+. - - def delete_passwd(realm, user) - @passwd.delete(user) - end - - ## - # Iterate passwords in the database. - - def each # :yields: [user, password] - @passwd.keys.sort.each{|user| - yield([user, @passwd[user]]) - } - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/userdb.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/userdb.rb deleted file mode 100644 index 0d0f72b1f0..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpauth/userdb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -#-- -# httpauth/userdb.rb -- UserDB mix-in module. -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: userdb.rb,v 1.2 2003/02/20 07:15:48 gotoyuzo Exp $ - -module WEBrick - module HTTPAuth - - ## - # User database mixin for HTTPAuth. This mixin dispatches user record - # access to the underlying auth_type for this database. - - module UserDB - - ## - # The authentication type. - # - # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are - # built-in. - - attr_accessor :auth_type - - ## - # Creates an obscured password in +realm+ with +user+ and +password+ - # using the auth_type of this database. - - def make_passwd(realm, user, pass) - @auth_type::make_passwd(realm, user, pass) - end - - ## - # Sets a password in +realm+ with +user+ and +password+ for the - # auth_type of this database. - - def set_passwd(realm, user, pass) - self[user] = pass - end - - ## - # Retrieves a password in +realm+ for +user+ for the auth_type of this - # database. +reload_db+ is a dummy value. - - def get_passwd(realm, user, reload_db=false) - make_passwd(realm, user, self[user]) - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpproxy.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpproxy.rb deleted file mode 100644 index 196682ec2d..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpproxy.rb +++ /dev/null @@ -1,354 +0,0 @@ -# frozen_string_literal: true -# -# httpproxy.rb -- HTTPProxy Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2002 GOTO Kentaro -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httpproxy.rb,v 1.18 2003/03/08 18:58:10 gotoyuzo Exp $ -# $kNotwork: straw.rb,v 1.3 2002/02/12 15:13:07 gotoken Exp $ - -require_relative "httpserver" -require "net/http" - -module WEBrick - - NullReader = Object.new # :nodoc: - class << NullReader # :nodoc: - def read(*args) - nil - end - alias gets read - end - - FakeProxyURI = Object.new # :nodoc: - class << FakeProxyURI # :nodoc: - def method_missing(meth, *args) - if %w(scheme host port path query userinfo).member?(meth.to_s) - return nil - end - super - end - end - - # :startdoc: - - ## - # An HTTP Proxy server which proxies GET, HEAD and POST requests. - # - # To create a simple proxy server: - # - # require 'webrick' - # require 'webrick/httpproxy' - # - # proxy = WEBrick::HTTPProxyServer.new Port: 8000 - # - # trap 'INT' do proxy.shutdown end - # trap 'TERM' do proxy.shutdown end - # - # proxy.start - # - # See ::new for proxy-specific configuration items. - # - # == Modifying proxied responses - # - # To modify content the proxy server returns use the +:ProxyContentHandler+ - # option: - # - # handler = proc do |req, res| - # if res['content-type'] == 'text/plain' then - # res.body << "\nThis content was proxied!\n" - # end - # end - # - # proxy = - # WEBrick::HTTPProxyServer.new Port: 8000, ProxyContentHandler: handler - - class HTTPProxyServer < HTTPServer - - ## - # Proxy server configurations. The proxy server handles the following - # configuration items in addition to those supported by HTTPServer: - # - # :ProxyAuthProc:: Called with a request and response to authorize a - # request - # :ProxyVia:: Appended to the via header - # :ProxyURI:: The proxy server's URI - # :ProxyContentHandler:: Called with a request and response and allows - # modification of the response - # :ProxyTimeout:: Sets the proxy timeouts to 30 seconds for open and 60 - # seconds for read operations - - def initialize(config={}, default=Config::HTTP) - super(config, default) - c = @config - @via = "#{c[:HTTPVersion]} #{c[:ServerName]}:#{c[:Port]}" - end - - # :stopdoc: - def service(req, res) - if req.request_method == "CONNECT" - do_CONNECT(req, res) - elsif req.unparsed_uri =~ %r!^http://! - proxy_service(req, res) - else - super(req, res) - end - end - - def proxy_auth(req, res) - if proc = @config[:ProxyAuthProc] - proc.call(req, res) - end - req.header.delete("proxy-authorization") - end - - def proxy_uri(req, res) - # should return upstream proxy server's URI - return @config[:ProxyURI] - end - - def proxy_service(req, res) - # Proxy Authentication - proxy_auth(req, res) - - begin - public_send("do_#{req.request_method}", req, res) - rescue NoMethodError - raise HTTPStatus::MethodNotAllowed, - "unsupported method `#{req.request_method}'." - rescue => err - logger.debug("#{err.class}: #{err.message}") - raise HTTPStatus::ServiceUnavailable, err.message - end - - # Process contents - if handler = @config[:ProxyContentHandler] - handler.call(req, res) - end - end - - def do_CONNECT(req, res) - # Proxy Authentication - proxy_auth(req, res) - - ua = Thread.current[:WEBrickSocket] # User-Agent - raise HTTPStatus::InternalServerError, - "[BUG] cannot get socket" unless ua - - host, port = req.unparsed_uri.split(":", 2) - # Proxy authentication for upstream proxy server - if proxy = proxy_uri(req, res) - proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0" - if proxy.userinfo - credentials = "Basic " + [proxy.userinfo].pack("m0") - end - host, port = proxy.host, proxy.port - end - - begin - @logger.debug("CONNECT: upstream proxy is `#{host}:#{port}'.") - os = TCPSocket.new(host, port) # origin server - - if proxy - @logger.debug("CONNECT: sending a Request-Line") - os << proxy_request_line << CRLF - @logger.debug("CONNECT: > #{proxy_request_line}") - if credentials - @logger.debug("CONNECT: sending credentials") - os << "Proxy-Authorization: " << credentials << CRLF - end - os << CRLF - proxy_status_line = os.gets(LF) - @logger.debug("CONNECT: read Status-Line from the upstream server") - @logger.debug("CONNECT: < #{proxy_status_line}") - if %r{^HTTP/\d+\.\d+\s+200\s*} =~ proxy_status_line - while line = os.gets(LF) - break if /\A(#{CRLF}|#{LF})\z/om =~ line - end - else - raise HTTPStatus::BadGateway - end - end - @logger.debug("CONNECT #{host}:#{port}: succeeded") - res.status = HTTPStatus::RC_OK - rescue => ex - @logger.debug("CONNECT #{host}:#{port}: failed `#{ex.message}'") - res.set_error(ex) - raise HTTPStatus::EOFError - ensure - if handler = @config[:ProxyContentHandler] - handler.call(req, res) - end - res.send_response(ua) - access_log(@config, req, res) - - # Should clear request-line not to send the response twice. - # see: HTTPServer#run - req.parse(NullReader) rescue nil - end - - begin - while fds = IO::select([ua, os]) - if fds[0].member?(ua) - buf = ua.readpartial(1024); - @logger.debug("CONNECT: #{buf.bytesize} byte from User-Agent") - os.write(buf) - elsif fds[0].member?(os) - buf = os.readpartial(1024); - @logger.debug("CONNECT: #{buf.bytesize} byte from #{host}:#{port}") - ua.write(buf) - end - end - rescue - os.close - @logger.debug("CONNECT #{host}:#{port}: closed") - end - - raise HTTPStatus::EOFError - end - - def do_GET(req, res) - perform_proxy_request(req, res, Net::HTTP::Get) - end - - def do_HEAD(req, res) - perform_proxy_request(req, res, Net::HTTP::Head) - end - - def do_POST(req, res) - perform_proxy_request(req, res, Net::HTTP::Post, req.body_reader) - end - - def do_OPTIONS(req, res) - res['allow'] = "GET,HEAD,POST,OPTIONS,CONNECT" - end - - private - - # Some header fields should not be transferred. - HopByHop = %w( connection keep-alive proxy-authenticate upgrade - proxy-authorization te trailers transfer-encoding ) - ShouldNotTransfer = %w( set-cookie proxy-connection ) - def split_field(f) f ? f.split(/,\s+/).collect{|i| i.downcase } : [] end - - def choose_header(src, dst) - connections = split_field(src['connection']) - src.each{|key, value| - key = key.downcase - if HopByHop.member?(key) || # RFC2616: 13.5.1 - connections.member?(key) || # RFC2616: 14.10 - ShouldNotTransfer.member?(key) # pragmatics - @logger.debug("choose_header: `#{key}: #{value}'") - next - end - dst[key] = value - } - end - - # Net::HTTP is stupid about the multiple header fields. - # Here is workaround: - def set_cookie(src, dst) - if str = src['set-cookie'] - cookies = [] - str.split(/,\s*/).each{|token| - if /^[^=]+;/o =~ token - cookies[-1] << ", " << token - elsif /=/o =~ token - cookies << token - else - cookies[-1] << ", " << token - end - } - dst.cookies.replace(cookies) - end - end - - def set_via(h) - if @config[:ProxyVia] - if h['via'] - h['via'] << ", " << @via - else - h['via'] = @via - end - end - end - - def setup_proxy_header(req, res) - # Choose header fields to transfer - header = Hash.new - choose_header(req, header) - set_via(header) - return header - end - - def setup_upstream_proxy_authentication(req, res, header) - if upstream = proxy_uri(req, res) - if upstream.userinfo - header['proxy-authorization'] = - "Basic " + [upstream.userinfo].pack("m0") - end - return upstream - end - return FakeProxyURI - end - - def create_net_http(uri, upstream) - Net::HTTP.new(uri.host, uri.port, upstream.host, upstream.port) - end - - def perform_proxy_request(req, res, req_class, body_stream = nil) - uri = req.request_uri - path = uri.path.dup - path << "?" << uri.query if uri.query - header = setup_proxy_header(req, res) - upstream = setup_upstream_proxy_authentication(req, res, header) - - body_tmp = [] - http = create_net_http(uri, upstream) - req_fib = Fiber.new do - http.start do - if @config[:ProxyTimeout] - ################################## these issues are - http.open_timeout = 30 # secs # necessary (maybe because - http.read_timeout = 60 # secs # Ruby's bug, but why?) - ################################## - end - if body_stream && req['transfer-encoding'] =~ /\bchunked\b/i - header['Transfer-Encoding'] = 'chunked' - end - http_req = req_class.new(path, header) - http_req.body_stream = body_stream if body_stream - http.request(http_req) do |response| - # Persistent connection requirements are mysterious for me. - # So I will close the connection in every response. - res['proxy-connection'] = "close" - res['connection'] = "close" - - # stream Net::HTTP::HTTPResponse to WEBrick::HTTPResponse - res.status = response.code.to_i - res.chunked = response.chunked? - choose_header(response, res) - set_cookie(response, res) - set_via(res) - response.read_body do |buf| - body_tmp << buf - Fiber.yield # wait for res.body Proc#call - end - end # http.request - end - end - req_fib.resume # read HTTP response headers and first chunk of the body - res.body = ->(socket) do - while buf = body_tmp.shift - socket.write(buf) - buf.clear - req_fib.resume # continue response.read_body - end - end - end - # :stopdoc: - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httprequest.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httprequest.rb deleted file mode 100644 index 680ac65af2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httprequest.rb +++ /dev/null @@ -1,640 +0,0 @@ -# frozen_string_literal: true -# -# httprequest.rb -- HTTPRequest Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httprequest.rb,v 1.64 2003/07/13 17:18:22 gotoyuzo Exp $ - -require 'fiber' -require 'uri' -require_relative 'httpversion' -require_relative 'httpstatus' -require_relative 'httputils' -require_relative 'cookie' - -module WEBrick - - ## - # An HTTP request. This is consumed by service and do_* methods in - # WEBrick servlets - - class HTTPRequest - - BODY_CONTAINABLE_METHODS = [ "POST", "PUT" ] # :nodoc: - - # :section: Request line - - ## - # The complete request line such as: - # - # GET / HTTP/1.1 - - attr_reader :request_line - - ## - # The request method, GET, POST, PUT, etc. - - attr_reader :request_method - - ## - # The unparsed URI of the request - - attr_reader :unparsed_uri - - ## - # The HTTP version of the request - - attr_reader :http_version - - # :section: Request-URI - - ## - # The parsed URI of the request - - attr_reader :request_uri - - ## - # The request path - - attr_reader :path - - ## - # The script name (CGI variable) - - attr_accessor :script_name - - ## - # The path info (CGI variable) - - attr_accessor :path_info - - ## - # The query from the URI of the request - - attr_accessor :query_string - - # :section: Header and entity body - - ## - # The raw header of the request - - attr_reader :raw_header - - ## - # The parsed header of the request - - attr_reader :header - - ## - # The parsed request cookies - - attr_reader :cookies - - ## - # The Accept header value - - attr_reader :accept - - ## - # The Accept-Charset header value - - attr_reader :accept_charset - - ## - # The Accept-Encoding header value - - attr_reader :accept_encoding - - ## - # The Accept-Language header value - - attr_reader :accept_language - - # :section: - - ## - # The remote user (CGI variable) - - attr_accessor :user - - ## - # The socket address of the server - - attr_reader :addr - - ## - # The socket address of the client - - attr_reader :peeraddr - - ## - # Hash of request attributes - - attr_reader :attributes - - ## - # Is this a keep-alive connection? - - attr_reader :keep_alive - - ## - # The local time this request was received - - attr_reader :request_time - - ## - # Creates a new HTTP request. WEBrick::Config::HTTP is the default - # configuration. - - def initialize(config) - @config = config - @buffer_size = @config[:InputBufferSize] - @logger = config[:Logger] - - @request_line = @request_method = - @unparsed_uri = @http_version = nil - - @request_uri = @host = @port = @path = nil - @script_name = @path_info = nil - @query_string = nil - @query = nil - @form_data = nil - - @raw_header = Array.new - @header = nil - @cookies = [] - @accept = [] - @accept_charset = [] - @accept_encoding = [] - @accept_language = [] - @body = +"" - - @addr = @peeraddr = nil - @attributes = {} - @user = nil - @keep_alive = false - @request_time = nil - - @remaining_size = nil - @socket = nil - - @forwarded_proto = @forwarded_host = @forwarded_port = - @forwarded_server = @forwarded_for = nil - end - - ## - # Parses a request from +socket+. This is called internally by - # WEBrick::HTTPServer. - - def parse(socket=nil) - @socket = socket - begin - @peeraddr = socket.respond_to?(:peeraddr) ? socket.peeraddr : [] - @addr = socket.respond_to?(:addr) ? socket.addr : [] - rescue Errno::ENOTCONN - raise HTTPStatus::EOFError - end - - read_request_line(socket) - if @http_version.major > 0 - read_header(socket) - @header['cookie'].each{|cookie| - @cookies += Cookie::parse(cookie) - } - @accept = HTTPUtils.parse_qvalues(self['accept']) - @accept_charset = HTTPUtils.parse_qvalues(self['accept-charset']) - @accept_encoding = HTTPUtils.parse_qvalues(self['accept-encoding']) - @accept_language = HTTPUtils.parse_qvalues(self['accept-language']) - end - return if @request_method == "CONNECT" - return if @unparsed_uri == "*" - - begin - setup_forwarded_info - @request_uri = parse_uri(@unparsed_uri) - @path = HTTPUtils::unescape(@request_uri.path) - @path = HTTPUtils::normalize_path(@path) - @host = @request_uri.host - @port = @request_uri.port - @query_string = @request_uri.query - @script_name = "" - @path_info = @path.dup - rescue - raise HTTPStatus::BadRequest, "bad URI `#{@unparsed_uri}'." - end - - if /\Aclose\z/io =~ self["connection"] - @keep_alive = false - elsif /\Akeep-alive\z/io =~ self["connection"] - @keep_alive = true - elsif @http_version < "1.1" - @keep_alive = false - else - @keep_alive = true - end - end - - ## - # Generate HTTP/1.1 100 continue response if the client expects it, - # otherwise does nothing. - - def continue # :nodoc: - if self['expect'] == '100-continue' && @config[:HTTPVersion] >= "1.1" - @socket << "HTTP/#{@config[:HTTPVersion]} 100 continue#{CRLF}#{CRLF}" - @header.delete('expect') - end - end - - ## - # Returns the request body. - - def body(&block) # :yields: body_chunk - block ||= Proc.new{|chunk| @body << chunk } - read_body(@socket, block) - @body.empty? ? nil : @body - end - - ## - # Prepares the HTTPRequest object for use as the - # source for IO.copy_stream - - def body_reader - @body_tmp = [] - @body_rd = Fiber.new do - body do |buf| - @body_tmp << buf - Fiber.yield - end - end - @body_rd.resume # grab the first chunk and yield - self - end - - # for IO.copy_stream. - def readpartial(size, buf = ''.b) # :nodoc - res = @body_tmp.shift or raise EOFError, 'end of file reached' - if res.length > size - @body_tmp.unshift(res[size..-1]) - res = res[0..size - 1] - end - buf.replace(res) - res.clear - # get more chunks - check alive? because we can take a partial chunk - @body_rd.resume if @body_rd.alive? - buf - end - - ## - # Request query as a Hash - - def query - unless @query - parse_query() - end - @query - end - - ## - # The content-length header - - def content_length - return Integer(self['content-length']) - end - - ## - # The content-type header - - def content_type - return self['content-type'] - end - - ## - # Retrieves +header_name+ - - def [](header_name) - if @header - value = @header[header_name.downcase] - value.empty? ? nil : value.join(", ") - end - end - - ## - # Iterates over the request headers - - def each - if @header - @header.each{|k, v| - value = @header[k] - yield(k, value.empty? ? nil : value.join(", ")) - } - end - end - - ## - # The host this request is for - - def host - return @forwarded_host || @host - end - - ## - # The port this request is for - - def port - return @forwarded_port || @port - end - - ## - # The server name this request is for - - def server_name - return @forwarded_server || @config[:ServerName] - end - - ## - # The client's IP address - - def remote_ip - return self["client-ip"] || @forwarded_for || @peeraddr[3] - end - - ## - # Is this an SSL request? - - def ssl? - return @request_uri.scheme == "https" - end - - ## - # Should the connection this request was made on be kept alive? - - def keep_alive? - @keep_alive - end - - def to_s # :nodoc: - ret = @request_line.dup - @raw_header.each{|line| ret << line } - ret << CRLF - ret << body if body - ret - end - - ## - # Consumes any remaining body and updates keep-alive status - - def fixup() # :nodoc: - begin - body{|chunk| } # read remaining body - rescue HTTPStatus::Error => ex - @logger.error("HTTPRequest#fixup: #{ex.class} occurred.") - @keep_alive = false - rescue => ex - @logger.error(ex) - @keep_alive = false - end - end - - # This method provides the metavariables defined by the revision 3 - # of "The WWW Common Gateway Interface Version 1.1" - # To browse the current document of CGI Version 1.1, see below: - # http://tools.ietf.org/html/rfc3875 - - def meta_vars - meta = Hash.new - - cl = self["Content-Length"] - ct = self["Content-Type"] - meta["CONTENT_LENGTH"] = cl if cl.to_i > 0 - meta["CONTENT_TYPE"] = ct.dup if ct - meta["GATEWAY_INTERFACE"] = "CGI/1.1" - meta["PATH_INFO"] = @path_info ? @path_info.dup : "" - #meta["PATH_TRANSLATED"] = nil # no plan to be provided - meta["QUERY_STRING"] = @query_string ? @query_string.dup : "" - meta["REMOTE_ADDR"] = @peeraddr[3] - meta["REMOTE_HOST"] = @peeraddr[2] - #meta["REMOTE_IDENT"] = nil # no plan to be provided - meta["REMOTE_USER"] = @user - meta["REQUEST_METHOD"] = @request_method.dup - meta["REQUEST_URI"] = @request_uri.to_s - meta["SCRIPT_NAME"] = @script_name.dup - meta["SERVER_NAME"] = @host - meta["SERVER_PORT"] = @port.to_s - meta["SERVER_PROTOCOL"] = "HTTP/" + @config[:HTTPVersion].to_s - meta["SERVER_SOFTWARE"] = @config[:ServerSoftware].dup - - self.each{|key, val| - next if /^content-type$/i =~ key - next if /^content-length$/i =~ key - name = "HTTP_" + key - name.gsub!(/-/o, "_") - name.upcase! - meta[name] = val - } - - meta - end - - private - - # :stopdoc: - - MAX_URI_LENGTH = 2083 # :nodoc: - - # same as Mongrel, Thin and Puma - MAX_HEADER_LENGTH = (112 * 1024) # :nodoc: - - def read_request_line(socket) - @request_line = read_line(socket, MAX_URI_LENGTH) if socket - raise HTTPStatus::EOFError unless @request_line - - @request_bytes = @request_line.bytesize - if @request_bytes >= MAX_URI_LENGTH and @request_line[-1, 1] != LF - raise HTTPStatus::RequestURITooLarge - end - - @request_time = Time.now - if /^(\S+)\s+(\S++)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line - @request_method = $1 - @unparsed_uri = $2 - @http_version = HTTPVersion.new($3 ? $3 : "0.9") - else - rl = @request_line.sub(/\x0d?\x0a\z/o, '') - raise HTTPStatus::BadRequest, "bad Request-Line `#{rl}'." - end - end - - def read_header(socket) - if socket - while line = read_line(socket) - break if /\A(#{CRLF}|#{LF})\z/om =~ line - if (@request_bytes += line.bytesize) > MAX_HEADER_LENGTH - raise HTTPStatus::RequestEntityTooLarge, 'headers too large' - end - @raw_header << line - end - end - @header = HTTPUtils::parse_header(@raw_header.join) - end - - def parse_uri(str, scheme="http") - if @config[:Escape8bitURI] - str = HTTPUtils::escape8bit(str) - end - str.sub!(%r{\A/+}o, '/') - uri = URI::parse(str) - return uri if uri.absolute? - if @forwarded_host - host, port = @forwarded_host, @forwarded_port - elsif self["host"] - host, port = parse_host_request_line(self["host"]) - elsif @addr.size > 0 - host, port = @addr[2], @addr[1] - else - host, port = @config[:ServerName], @config[:Port] - end - uri.scheme = @forwarded_proto || scheme - uri.host = host - uri.port = port ? port.to_i : nil - return URI::parse(uri.to_s) - end - - def parse_host_request_line(host) - pattern = /\A(#{URI::REGEXP::PATTERN::HOST})(?::(\d+))?\z/no - host.scan(pattern)[0] - end - - def read_body(socket, block) - return unless socket - if tc = self['transfer-encoding'] - case tc - when /\Achunked\z/io then read_chunked(socket, block) - else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}." - end - elsif self['content-length'] || @remaining_size - @remaining_size ||= self['content-length'].to_i - while @remaining_size > 0 - sz = [@buffer_size, @remaining_size].min - break unless buf = read_data(socket, sz) - @remaining_size -= buf.bytesize - block.call(buf) - end - if @remaining_size > 0 && @socket.eof? - raise HTTPStatus::BadRequest, "invalid body size." - end - elsif BODY_CONTAINABLE_METHODS.member?(@request_method) - raise HTTPStatus::LengthRequired - end - return @body - end - - def read_chunk_size(socket) - line = read_line(socket) - if /^([0-9a-fA-F]+)(?:;(\S+))?/ =~ line - chunk_size = $1.hex - chunk_ext = $2 - [ chunk_size, chunk_ext ] - else - raise HTTPStatus::BadRequest, "bad chunk `#{line}'." - end - end - - def read_chunked(socket, block) - chunk_size, = read_chunk_size(socket) - while chunk_size > 0 - begin - sz = [ chunk_size, @buffer_size ].min - data = read_data(socket, sz) # read chunk-data - if data.nil? || data.bytesize != sz - raise HTTPStatus::BadRequest, "bad chunk data size." - end - block.call(data) - end while (chunk_size -= sz) > 0 - - read_line(socket) # skip CRLF - chunk_size, = read_chunk_size(socket) - end - read_header(socket) # trailer + CRLF - @header.delete("transfer-encoding") - @remaining_size = 0 - end - - def _read_data(io, method, *arg) - begin - WEBrick::Utils.timeout(@config[:RequestTimeout]){ - return io.__send__(method, *arg) - } - rescue Errno::ECONNRESET - return nil - rescue Timeout::Error - raise HTTPStatus::RequestTimeout - end - end - - def read_line(io, size=4096) - _read_data(io, :gets, LF, size) - end - - def read_data(io, size) - _read_data(io, :read, size) - end - - def parse_query() - begin - if @request_method == "GET" || @request_method == "HEAD" - @query = HTTPUtils::parse_query(@query_string) - elsif self['content-type'] =~ /^application\/x-www-form-urlencoded/ - @query = HTTPUtils::parse_query(body) - elsif self['content-type'] =~ /^multipart\/form-data; boundary=(.+)/ - boundary = HTTPUtils::dequote($1) - @query = HTTPUtils::parse_form_data(body, boundary) - else - @query = Hash.new - end - rescue => ex - raise HTTPStatus::BadRequest, ex.message - end - end - - PrivateNetworkRegexp = / - ^unknown$| - ^((::ffff:)?127.0.0.1|::1)$| - ^(::ffff:)?(10|172\.(1[6-9]|2[0-9]|3[01])|192\.168)\. - /ixo - - # It's said that all X-Forwarded-* headers will contain more than one - # (comma-separated) value if the original request already contained one of - # these headers. Since we could use these values as Host header, we choose - # the initial(first) value. (apr_table_mergen() adds new value after the - # existing value with ", " prefix) - def setup_forwarded_info - if @forwarded_server = self["x-forwarded-server"] - @forwarded_server = @forwarded_server.split(",", 2).first - end - if @forwarded_proto = self["x-forwarded-proto"] - @forwarded_proto = @forwarded_proto.split(",", 2).first - end - if host_port = self["x-forwarded-host"] - host_port = host_port.split(",", 2).first - if host_port =~ /\A(\[[0-9a-fA-F:]+\])(?::(\d+))?\z/ - @forwarded_host = $1 - tmp = $2 - else - @forwarded_host, tmp = host_port.split(":", 2) - end - @forwarded_port = (tmp || (@forwarded_proto == "https" ? 443 : 80)).to_i - end - if addrs = self["x-forwarded-for"] - addrs = addrs.split(",").collect(&:strip) - addrs.reject!{|ip| PrivateNetworkRegexp =~ ip } - @forwarded_for = addrs.first - end - end - - # :startdoc: - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpresponse.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpresponse.rb deleted file mode 100644 index dde0261da0..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpresponse.rb +++ /dev/null @@ -1,588 +0,0 @@ -# frozen_string_literal: true -# -# httpresponse.rb -- HTTPResponse Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httpresponse.rb,v 1.45 2003/07/11 11:02:25 gotoyuzo Exp $ - -require 'time' -require 'uri' -require_relative 'httpversion' -require_relative 'htmlutils' -require_relative 'httputils' -require_relative 'httpstatus' - -module WEBrick - ## - # An HTTP response. This is filled in by the service or do_* methods of a - # WEBrick HTTP Servlet. - - class HTTPResponse - class InvalidHeader < StandardError - end - - ## - # HTTP Response version - - attr_reader :http_version - - ## - # Response status code (200) - - attr_reader :status - - ## - # Response header - - attr_reader :header - - ## - # Response cookies - - attr_reader :cookies - - ## - # Response reason phrase ("OK") - - attr_accessor :reason_phrase - - ## - # Body may be: - # * a String; - # * an IO-like object that responds to +#read+ and +#readpartial+; - # * a Proc-like object that responds to +#call+. - # - # In the latter case, either #chunked= should be set to +true+, - # or header['content-length'] explicitly provided. - # Example: - # - # server.mount_proc '/' do |req, res| - # res.chunked = true - # # or - # # res.header['content-length'] = 10 - # res.body = proc { |out| out.write(Time.now.to_s) } - # end - - attr_accessor :body - - ## - # Request method for this response - - attr_accessor :request_method - - ## - # Request URI for this response - - attr_accessor :request_uri - - ## - # Request HTTP version for this response - - attr_accessor :request_http_version - - ## - # Filename of the static file in this response. Only used by the - # FileHandler servlet. - - attr_accessor :filename - - ## - # Is this a keep-alive response? - - attr_accessor :keep_alive - - ## - # Configuration for this response - - attr_reader :config - - ## - # Bytes sent in this response - - attr_reader :sent_size - - ## - # Set the response body proc as an streaming/upgrade response. - - attr_accessor :upgrade - - ## - # Creates a new HTTP response object. WEBrick::Config::HTTP is the - # default configuration. - - def initialize(config) - @config = config - @buffer_size = config[:OutputBufferSize] - @logger = config[:Logger] - @header = Hash.new - @status = HTTPStatus::RC_OK - @reason_phrase = nil - @http_version = HTTPVersion::convert(@config[:HTTPVersion]) - @body = +"" - @keep_alive = true - @cookies = [] - @request_method = nil - @request_uri = nil - @request_http_version = @http_version # temporary - @chunked = false - @filename = nil - @sent_size = 0 - @bodytempfile = nil - end - - ## - # The response's HTTP status line - - def status_line - "HTTP/#@http_version #@status #@reason_phrase".rstrip << CRLF - end - - ## - # Sets the response's status to the +status+ code - - def status=(status) - @status = status - @reason_phrase = HTTPStatus::reason_phrase(status) - end - - ## - # Retrieves the response header +field+ - - def [](field) - @header[field.downcase] - end - - ## - # Sets the response header +field+ to +value+ - - def []=(field, value) - @chunked = value.to_s.downcase == 'chunked' if field.downcase == 'transfer-encoding' - @header[field.downcase] = value.to_s - end - - ## - # The content-length header - - def content_length - if len = self['content-length'] - return Integer(len) - end - end - - ## - # Sets the content-length header to +len+ - - def content_length=(len) - self['content-length'] = len.to_s - end - - ## - # The content-type header - - def content_type - self['content-type'] - end - - ## - # Sets the content-type header to +type+ - - def content_type=(type) - self['content-type'] = type - end - - ## - # Iterates over each header in the response - - def each - @header.each{|field, value| yield(field, value) } - end - - ## - # Will this response body be returned using chunked transfer-encoding? - - def chunked? - @chunked - end - - ## - # Enables chunked transfer encoding. - - def chunked=(val) - @chunked = val ? true : false - end - - ## - # Will this response's connection be kept alive? - - def keep_alive? - @keep_alive - end - - ## - # Sets the response to be a streaming/upgrade response. - # This will disable keep-alive and chunked transfer encoding. - - def upgrade!(protocol) - @upgrade = protocol - @keep_alive = false - @chunked = false - end - - ## - # Sends the response on +socket+ - - def send_response(socket) # :nodoc: - begin - setup_header() - send_header(socket) - send_body(socket) - rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ENOTCONN => ex - @logger.debug(ex) - @keep_alive = false - rescue Exception => ex - @logger.error(ex) - @keep_alive = false - end - end - - ## - # Sets up the headers for sending - - def setup_header() # :nodoc: - @reason_phrase ||= HTTPStatus::reason_phrase(@status) - @header['server'] ||= @config[:ServerSoftware] - @header['date'] ||= Time.now.httpdate - - if @upgrade - @header['connection'] = 'upgrade' - @header['upgrade'] = @upgrade - @keep_alive = false - - return - end - - # HTTP/0.9 features - if @request_http_version < "1.0" - @http_version = HTTPVersion.new("0.9") - @keep_alive = false - end - - # HTTP/1.0 features - if @request_http_version < "1.1" - if chunked? - @chunked = false - ver = @request_http_version.to_s - msg = "chunked is set for an HTTP/#{ver} request. (ignored)" - @logger.warn(msg) - end - end - - # Determine the message length (RFC2616 -- 4.4 Message Length) - if @status == 304 || @status == 204 || HTTPStatus::info?(@status) - @header.delete('content-length') - @body = "" - elsif chunked? - @header["transfer-encoding"] = "chunked" - @header.delete('content-length') - elsif %r{^multipart/byteranges} =~ @header['content-type'] - @header.delete('content-length') - elsif @header['content-length'].nil? - if @body.respond_to?(:bytesize) - @header['content-length'] = @body.bytesize.to_s - else - @header['connection'] = 'close' - end - end - - # Keep-Alive connection. - if @header['connection'] == "close" - @keep_alive = false - elsif keep_alive? - if chunked? || @header['content-length'] || @status == 304 || @status == 204 || HTTPStatus.info?(@status) - @header['connection'] = "Keep-Alive" - else - msg = "Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true" - @logger.warn(msg) - @header['connection'] = "close" - @keep_alive = false - end - else - @header['connection'] = "close" - end - - # Location is a single absoluteURI. - if location = @header['location'] - if @request_uri - @header['location'] = @request_uri.merge(location).to_s - end - end - end - - def make_body_tempfile # :nodoc: - return if @bodytempfile - bodytempfile = Tempfile.create("webrick") - if @body.nil? - # nothing - elsif @body.respond_to? :readpartial - IO.copy_stream(@body, bodytempfile) - @body.close - elsif @body.respond_to? :call - @body.call(bodytempfile) - else - bodytempfile.write @body - end - bodytempfile.rewind - @body = @bodytempfile = bodytempfile - @header['content-length'] = bodytempfile.stat.size.to_s - end - - def remove_body_tempfile # :nodoc: - if @bodytempfile - @bodytempfile.close - File.unlink @bodytempfile.path - @bodytempfile = nil - end - end - - - ## - # Sends the headers on +socket+ - - def send_header(socket) # :nodoc: - if @http_version.major > 0 - data = status_line().dup - @header.each{|key, value| - tmp = key.gsub(/\bwww|^te$|\b\w/){ $&.upcase } - data << "#{tmp}: #{check_header(value)}" << CRLF - } - @cookies.each{|cookie| - data << "Set-Cookie: " << check_header(cookie.to_s) << CRLF - } - data << CRLF - socket.write(data) - end - rescue InvalidHeader => e - @header.clear - @cookies.clear - set_error e - retry - end - - ## - # Sends the body on +socket+ - - def send_body(socket) # :nodoc: - if @body.respond_to? :readpartial then - send_body_io(socket) - elsif @body.respond_to?(:call) then - send_body_proc(socket) - else - send_body_string(socket) - end - end - - ## - # Redirects to +url+ with a WEBrick::HTTPStatus::Redirect +status+. - # - # Example: - # - # res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect - - def set_redirect(status, url) - url = URI(url).to_s - @body = "#{url}.\n" - @header['location'] = url - raise status - end - - ## - # Creates an error page for exception +ex+ with an optional +backtrace+ - - def set_error(ex, backtrace=false) - case ex - when HTTPStatus::Status - @keep_alive = false if HTTPStatus::error?(ex.code) - self.status = ex.code - else - @keep_alive = false - self.status = HTTPStatus::RC_INTERNAL_SERVER_ERROR - end - @header['content-type'] = "text/html; charset=ISO-8859-1" - - if respond_to?(:create_error_page) - create_error_page() - return - end - - if @request_uri - host, port = @request_uri.host, @request_uri.port - else - host, port = @config[:ServerName], @config[:Port] - end - - error_body(backtrace, ex, host, port) - end - - private - - def check_header(header_value) - header_value = header_value.to_s - if /[\r\n]/ =~ header_value - raise InvalidHeader - else - header_value - end - end - - # :stopdoc: - - def error_body(backtrace, ex, host, port) - @body = +"" - @body << <<-_end_of_html_ - - - #{HTMLUtils::escape(@reason_phrase)} - -

#{HTMLUtils::escape(@reason_phrase)}

- #{HTMLUtils::escape(ex.message)} -
- _end_of_html_ - - if backtrace && $DEBUG - @body << "backtrace of `#{HTMLUtils::escape(ex.class.to_s)}' " - @body << "#{HTMLUtils::escape(ex.message)}" - @body << "
"
-        ex.backtrace.each{|line| @body << "\t#{line}\n"}
-        @body << "

" - end - - @body << <<-_end_of_html_ -
- #{HTMLUtils::escape(@config[:ServerSoftware])} at - #{host}:#{port} -
- - - _end_of_html_ - end - - def send_body_io(socket) - begin - if @request_method == "HEAD" - # do nothing - elsif chunked? - buf = +'' - begin - @body.readpartial(@buffer_size, buf) - size = buf.bytesize - data = +"#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}" - socket.write(data) - data.clear - @sent_size += size - rescue EOFError - break - end while true - buf.clear - socket.write("0#{CRLF}#{CRLF}") - else - if %r{\Abytes (\d+)-(\d+)/\d+\z} =~ @header['content-range'] - offset = $1.to_i - size = $2.to_i - offset + 1 - else - offset = nil - size = @header['content-length'] - size = size.to_i if size - end - begin - @sent_size = IO.copy_stream(@body, socket, size, offset) - rescue NotImplementedError - @body.seek(offset, IO::SEEK_SET) - @sent_size = IO.copy_stream(@body, socket, size) - end - end - ensure - @body.close - end - remove_body_tempfile - end - - def send_body_string(socket) - if @request_method == "HEAD" - # do nothing - elsif chunked? - body ? @body.bytesize : 0 - while buf = @body[@sent_size, @buffer_size] - break if buf.empty? - size = buf.bytesize - data = "#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}" - buf.clear - socket.write(data) - @sent_size += size - end - socket.write("0#{CRLF}#{CRLF}") - else - if @body && @body.bytesize > 0 - socket.write(@body) - @sent_size = @body.bytesize - end - end - end - - def send_body_proc(socket) - if @request_method == "HEAD" - # do nothing - elsif chunked? - @body.call(ChunkedWrapper.new(socket, self)) - socket.write("0#{CRLF}#{CRLF}") - else - if @bodytempfile - @bodytempfile.rewind - IO.copy_stream(@bodytempfile, socket) - else - @body.call(socket) - end - - if content_length = @header['content-length'] - @sent_size = content_length.to_i - end - end - end - - class ChunkedWrapper - def initialize(socket, resp) - @socket = socket - @resp = resp - end - - def write(buf) - return 0 if buf.empty? - socket = @socket - @resp.instance_eval { - size = buf.bytesize - data = +"#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}" - socket.write(data) - data.clear - @sent_size += size - size - } - end - - def <<(*buf) - write(buf) - self - end - end - - # preserved for compatibility with some 3rd-party handlers - def _write_data(socket, data) - socket << data - end - - # :startdoc: - end - -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/https.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/https.rb deleted file mode 100644 index 7f00b3068d..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/https.rb +++ /dev/null @@ -1,152 +0,0 @@ -# frozen_string_literal: true -# -# https.rb -- SSL/TLS enhancement for HTTPServer -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2001 GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: https.rb,v 1.15 2003/07/22 19:20:42 gotoyuzo Exp $ - -require_relative 'ssl' -require_relative 'httpserver' - -module WEBrick - module Config - HTTP.update(SSL) - end - - ## - #-- - # Adds SSL functionality to WEBrick::HTTPRequest - - class HTTPRequest - - ## - # HTTP request SSL cipher - - attr_reader :cipher - - ## - # HTTP request server certificate - - attr_reader :server_cert - - ## - # HTTP request client certificate - - attr_reader :client_cert - - # :stopdoc: - - alias orig_parse parse - - def parse(socket=nil) - if socket.respond_to?(:cert) - @server_cert = socket.cert || @config[:SSLCertificate] - @client_cert = socket.peer_cert - @client_cert_chain = socket.peer_cert_chain - @cipher = socket.cipher - end - orig_parse(socket) - end - - alias orig_parse_uri parse_uri - - def parse_uri(str, scheme="https") - if server_cert - return orig_parse_uri(str, scheme) - end - return orig_parse_uri(str) - end - private :parse_uri - - alias orig_meta_vars meta_vars - - def meta_vars - meta = orig_meta_vars - if server_cert - meta["HTTPS"] = "on" - meta["SSL_SERVER_CERT"] = @server_cert.to_pem - meta["SSL_CLIENT_CERT"] = @client_cert ? @client_cert.to_pem : "" - if @client_cert_chain - @client_cert_chain.each_with_index{|cert, i| - meta["SSL_CLIENT_CERT_CHAIN_#{i}"] = cert.to_pem - } - end - meta["SSL_CIPHER"] = @cipher[0] - meta["SSL_PROTOCOL"] = @cipher[1] - meta["SSL_CIPHER_USEKEYSIZE"] = @cipher[2].to_s - meta["SSL_CIPHER_ALGKEYSIZE"] = @cipher[3].to_s - end - meta - end - - # :startdoc: - end - - ## - #-- - # Fake WEBrick::HTTPRequest for lookup_server - - class SNIRequest - - ## - # The SNI hostname - - attr_reader :host - - ## - # The socket address of the server - - attr_reader :addr - - ## - # The port this request is for - - attr_reader :port - - ## - # Creates a new SNIRequest. - - def initialize(sslsocket, hostname) - @host = hostname - @addr = sslsocket.addr - @port = @addr[1] - end - end - - - ## - #-- - # Adds SSL functionality to WEBrick::HTTPServer - - class HTTPServer < ::WEBrick::GenericServer - ## - # ServerNameIndication callback - - def ssl_servername_callback(sslsocket, hostname = nil) - req = SNIRequest.new(sslsocket, hostname) - server = lookup_server(req) - server ? server.ssl_context : nil - end - - # :stopdoc: - - ## - # Check whether +server+ is also SSL server. - # Also +server+'s SSL context will be created. - - alias orig_virtual_host virtual_host - - def virtual_host(server) - if @config[:SSLEnable] && !server.ssl_context - raise ArgumentError, "virtual host must set SSLEnable to true" - end - orig_virtual_host(server) - end - - # :startdoc: - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb deleted file mode 100644 index 0d261bf00c..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb +++ /dev/null @@ -1,294 +0,0 @@ -# frozen_string_literal: true -# -# httpserver.rb -- HTTPServer Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httpserver.rb,v 1.63 2002/10/01 17:16:32 gotoyuzo Exp $ - -require 'io/wait' -require_relative 'server' -require_relative 'httputils' -require_relative 'httpstatus' -require_relative 'httprequest' -require_relative 'httpresponse' -require_relative 'httpservlet' -require_relative 'accesslog' - -module WEBrick - class HTTPServerError < ServerError; end - - ## - # An HTTP Server - - class HTTPServer < ::WEBrick::GenericServer - ## - # Creates a new HTTP server according to +config+ - # - # An HTTP server uses the following attributes: - # - # :AccessLog:: An array of access logs. See WEBrick::AccessLog - # :BindAddress:: Local address for the server to bind to - # :DocumentRoot:: Root path to serve files from - # :DocumentRootOptions:: Options for the default HTTPServlet::FileHandler - # :HTTPVersion:: The HTTP version of this server - # :Port:: Port to listen on - # :RequestCallback:: Called with a request and response before each - # request is serviced. - # :RequestTimeout:: Maximum time to wait between requests - # :ServerAlias:: Array of alternate names for this server for virtual - # hosting - # :ServerName:: Name for this server for virtual hosting - - def initialize(config={}, default=Config::HTTP) - super(config, default) - @http_version = HTTPVersion::convert(@config[:HTTPVersion]) - - @mount_tab = MountTable.new - if @config[:DocumentRoot] - mount("/", HTTPServlet::FileHandler, @config[:DocumentRoot], - @config[:DocumentRootOptions]) - end - - unless @config[:AccessLog] - @config[:AccessLog] = [ - [ $stderr, AccessLog::COMMON_LOG_FORMAT ], - [ $stderr, AccessLog::REFERER_LOG_FORMAT ] - ] - end - - @virtual_hosts = Array.new - end - - ## - # Processes requests on +sock+ - - def run(sock) - while true - req = create_request(@config) - res = create_response(@config) - server = self - begin - timeout = @config[:RequestTimeout] - while timeout > 0 - break if sock.to_io.wait_readable(0.5) - break if @status != :Running - timeout -= 0.5 - end - raise HTTPStatus::EOFError if timeout <= 0 || @status != :Running - raise HTTPStatus::EOFError if sock.eof? - req.parse(sock) - res.request_method = req.request_method - res.request_uri = req.request_uri - res.request_http_version = req.http_version - res.keep_alive = req.keep_alive? - server = lookup_server(req) || self - if callback = server[:RequestCallback] - callback.call(req, res) - elsif callback = server[:RequestHandler] - msg = ":RequestHandler is deprecated, please use :RequestCallback" - @logger.warn(msg) - callback.call(req, res) - end - server.service(req, res) - rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex - res.set_error(ex) - rescue HTTPStatus::Error => ex - @logger.error(ex.message) - res.set_error(ex) - rescue HTTPStatus::Status => ex - res.status = ex.code - rescue StandardError => ex - @logger.error(ex) - res.set_error(ex, true) - ensure - if req.request_line - if req.keep_alive? && res.keep_alive? - req.fixup() - end - res.send_response(sock) - server.access_log(@config, req, res) - end - end - break if @http_version < "1.1" - break unless req.keep_alive? - break unless res.keep_alive? - end - end - - ## - # Services +req+ and fills in +res+ - - def service(req, res) - if req.unparsed_uri == "*" - if req.request_method == "OPTIONS" - do_OPTIONS(req, res) - raise HTTPStatus::OK - end - raise HTTPStatus::NotFound, "`#{req.unparsed_uri}' not found." - end - - servlet, options, script_name, path_info = search_servlet(req.path) - raise HTTPStatus::NotFound, "`#{req.path}' not found." unless servlet - req.script_name = script_name - req.path_info = path_info - si = servlet.get_instance(self, *options) - @logger.debug(format("%s is invoked.", si.class.name)) - si.service(req, res) - end - - ## - # The default OPTIONS request handler says GET, HEAD, POST and OPTIONS - # requests are allowed. - - def do_OPTIONS(req, res) - res["allow"] = "GET,HEAD,POST,OPTIONS" - end - - ## - # Mounts +servlet+ on +dir+ passing +options+ to the servlet at creation - # time - - def mount(dir, servlet, *options) - @logger.debug(sprintf("%s is mounted on %s.", servlet.inspect, dir)) - @mount_tab[dir] = [ servlet, options ] - end - - ## - # Mounts +proc+ or +block+ on +dir+ and calls it with a - # WEBrick::HTTPRequest and WEBrick::HTTPResponse - - def mount_proc(dir, proc=nil, &block) - proc ||= block - raise HTTPServerError, "must pass a proc or block" unless proc - mount(dir, HTTPServlet::ProcHandler.new(proc)) - end - - ## - # Unmounts +dir+ - - def unmount(dir) - @logger.debug(sprintf("unmount %s.", dir)) - @mount_tab.delete(dir) - end - alias umount unmount - - ## - # Finds a servlet for +path+ - - def search_servlet(path) - script_name, path_info = @mount_tab.scan(path) - servlet, options = @mount_tab[script_name] - if servlet - [ servlet, options, script_name, path_info ] - end - end - - ## - # Adds +server+ as a virtual host. - - def virtual_host(server) - @virtual_hosts << server - @virtual_hosts = @virtual_hosts.sort_by{|s| - num = 0 - num -= 4 if s[:BindAddress] - num -= 2 if s[:Port] - num -= 1 if s[:ServerName] - num - } - end - - ## - # Finds the appropriate virtual host to handle +req+ - - def lookup_server(req) - @virtual_hosts.find{|s| - (s[:BindAddress].nil? || req.addr[3] == s[:BindAddress]) && - (s[:Port].nil? || req.port == s[:Port]) && - ((s[:ServerName].nil? || req.host == s[:ServerName]) || - (!s[:ServerAlias].nil? && s[:ServerAlias].find{|h| h === req.host})) - } - end - - ## - # Logs +req+ and +res+ in the access logs. +config+ is used for the - # server name. - - def access_log(config, req, res) - param = AccessLog::setup_params(config, req, res) - @config[:AccessLog].each{|logger, fmt| - logger << AccessLog::format(fmt+"\n", param) - } - end - - ## - # Creates the HTTPRequest used when handling the HTTP - # request. Can be overridden by subclasses. - def create_request(with_webrick_config) - HTTPRequest.new(with_webrick_config) - end - - ## - # Creates the HTTPResponse used when handling the HTTP - # request. Can be overridden by subclasses. - def create_response(with_webrick_config) - HTTPResponse.new(with_webrick_config) - end - - ## - # Mount table for the path a servlet is mounted on in the directory space - # of the server. Users of WEBrick can only access this indirectly via - # WEBrick::HTTPServer#mount, WEBrick::HTTPServer#unmount and - # WEBrick::HTTPServer#search_servlet - - class MountTable # :nodoc: - def initialize - @tab = Hash.new - compile - end - - def [](dir) - dir = normalize(dir) - @tab[dir] - end - - def []=(dir, val) - dir = normalize(dir) - @tab[dir] = val - compile - val - end - - def delete(dir) - dir = normalize(dir) - res = @tab.delete(dir) - compile - res - end - - def scan(path) - @scanner =~ path - [ $&, $' ] - end - - private - - def compile - k = @tab.keys - k.sort! - k.reverse! - k.collect!{|path| Regexp.escape(path) } - @scanner = Regexp.new("\\A(" + k.join("|") +")(?=/|\\z)") - end - - def normalize(dir) - ret = dir ? dir.dup : +"" - ret.sub!(%r|/+\z|, "") - ret - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet.rb deleted file mode 100644 index 4cb1822cd3..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# -# httpservlet.rb -- HTTPServlet Utility File -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httpservlet.rb,v 1.21 2003/02/23 12:24:46 gotoyuzo Exp $ - -require_relative 'httpservlet/abstract' -require_relative 'httpservlet/filehandler' -require_relative 'httpservlet/cgihandler' -require_relative 'httpservlet/erbhandler' -require_relative 'httpservlet/prochandler' - -module WEBrick - module HTTPServlet - FileHandler.add_handler("cgi", CGIHandler) - FileHandler.add_handler("rhtml", ERBHandler) - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/abstract.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/abstract.rb deleted file mode 100644 index 6fae4de919..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/abstract.rb +++ /dev/null @@ -1,152 +0,0 @@ -# frozen_string_literal: true -# -# httpservlet.rb -- HTTPServlet Module -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: abstract.rb,v 1.24 2003/07/11 11:16:46 gotoyuzo Exp $ - -require_relative '../htmlutils' -require_relative '../httputils' -require_relative '../httpstatus' - -module WEBrick - module HTTPServlet - class HTTPServletError < StandardError; end - - ## - # AbstractServlet allows HTTP server modules to be reused across multiple - # servers and allows encapsulation of functionality. - # - # By default a servlet will respond to GET, HEAD (through an alias to GET) - # and OPTIONS requests. - # - # By default a new servlet is initialized for every request. A servlet - # instance can be reused by overriding ::get_instance in the - # AbstractServlet subclass. - # - # == A Simple Servlet - # - # class Simple < WEBrick::HTTPServlet::AbstractServlet - # def do_GET request, response - # status, content_type, body = do_stuff_with request - # - # response.status = status - # response['Content-Type'] = content_type - # response.body = body - # end - # - # def do_stuff_with request - # return 200, 'text/plain', 'you got a page' - # end - # end - # - # This servlet can be mounted on a server at a given path: - # - # server.mount '/simple', Simple - # - # == Servlet Configuration - # - # Servlets can be configured via initialize. The first argument is the - # HTTP server the servlet is being initialized for. - # - # class Configurable < Simple - # def initialize server, color, size - # super server - # @color = color - # @size = size - # end - # - # def do_stuff_with request - # content = "

Hello, World!" - # - # return 200, "text/html", content - # end - # end - # - # This servlet must be provided two arguments at mount time: - # - # server.mount '/configurable', Configurable, 'red', '2em' - - class AbstractServlet - - ## - # Factory for servlet instances that will handle a request from +server+ - # using +options+ from the mount point. By default a new servlet - # instance is created for every call. - - def self.get_instance(server, *options) - self.new(server, *options) - end - - ## - # Initializes a new servlet for +server+ using +options+ which are - # stored as-is in +@options+. +@logger+ is also provided. - - def initialize(server, *options) - @server = @config = server - @logger = @server[:Logger] - @options = options - end - - ## - # Dispatches to a +do_+ method based on +req+ if such a method is - # available. (+do_GET+ for a GET request). Raises a MethodNotAllowed - # exception if the method is not implemented. - - def service(req, res) - method_name = "do_" + req.request_method.gsub(/-/, "_") - if respond_to?(method_name) - __send__(method_name, req, res) - else - raise HTTPStatus::MethodNotAllowed, - "unsupported method `#{req.request_method}'." - end - end - - ## - # Raises a NotFound exception - - def do_GET(req, res) - raise HTTPStatus::NotFound, "not found." - end - - ## - # Dispatches to do_GET - - def do_HEAD(req, res) - do_GET(req, res) - end - - ## - # Returns the allowed HTTP request methods - - def do_OPTIONS(req, res) - m = self.methods.grep(/\Ado_([A-Z]+)\z/) {$1} - m.sort! - res["allow"] = m.join(",") - end - - private - - ## - # Redirects to a path ending in / - - def redirect_to_directory_uri(req, res) - if req.path[-1] != ?/ - location = WEBrick::HTTPUtils.escape_path(req.path + "/") - if req.query_string && req.query_string.bytesize > 0 - location << "?" << req.query_string - end - res.set_redirect(HTTPStatus::MovedPermanently, location) - end - end - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb deleted file mode 100644 index b0948ae39b..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgi_runner.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# -# cgi_runner.rb -- CGI launcher. -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: cgi_runner.rb,v 1.9 2002/09/25 11:33:15 gotoyuzo Exp $ - -def sysread(io, size) - buf = +"" - while size > 0 - tmp = io.sysread(size) - buf << tmp - size -= tmp.bytesize - end - return buf -end - -STDIN.binmode - -len = sysread(STDIN, 8).to_i -out = sysread(STDIN, len) -STDOUT.reopen(File.open(out, "w")) - -len = sysread(STDIN, 8).to_i -err = sysread(STDIN, len) -STDERR.reopen(File.open(err, "w")) - -len = sysread(STDIN, 8).to_i -dump = sysread(STDIN, len) -hash = Marshal.restore(dump) -ENV.keys.each{|name| ENV.delete(name) } -hash.each{|k, v| ENV[k] = v if v } - -dir = File::dirname(ENV["SCRIPT_FILENAME"]) -Dir::chdir dir - -if ARGV[0] - argv = ARGV.dup - argv << ENV["SCRIPT_FILENAME"] - exec(*argv) - # NOTREACHED -end -exec ENV["SCRIPT_FILENAME"] diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgihandler.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgihandler.rb deleted file mode 100644 index 450aa3806a..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/cgihandler.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true -# -# cgihandler.rb -- CGIHandler Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: cgihandler.rb,v 1.27 2003/03/21 19:56:01 gotoyuzo Exp $ - -require 'rbconfig' -require 'tempfile' -require_relative '../config' -require_relative 'abstract' - -module WEBrick - module HTTPServlet - - ## - # Servlet for handling CGI scripts - # - # Example: - # - # server.mount('/cgi/my_script', WEBrick::HTTPServlet::CGIHandler, - # '/path/to/my_script') - - class CGIHandler < AbstractServlet - Ruby = RbConfig.ruby # :nodoc: - CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\"" # :nodoc: - CGIRunnerArray = [Ruby, "#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb".freeze].freeze # :nodoc: - - ## - # Creates a new CGI script servlet for the script at +name+ - - def initialize(server, name) - super(server, name) - @script_filename = name - @tempdir = server[:TempDir] - interpreter = server[:CGIInterpreter] - if interpreter.is_a?(Array) - @cgicmd = CGIRunnerArray + interpreter - else - @cgicmd = "#{CGIRunner} #{interpreter}" - end - end - - # :stopdoc: - - def do_GET(req, res) - cgi_in = IO::popen(@cgicmd, "wb") - cgi_out = Tempfile.new("webrick.cgiout.", @tempdir, mode: IO::BINARY) - cgi_out.set_encoding("ASCII-8BIT") - cgi_err = Tempfile.new("webrick.cgierr.", @tempdir, mode: IO::BINARY) - cgi_err.set_encoding("ASCII-8BIT") - begin - cgi_in.sync = true - meta = req.meta_vars - meta["SCRIPT_FILENAME"] = @script_filename - meta["PATH"] = @config[:CGIPathEnv] - meta.delete("HTTP_PROXY") - if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM - meta["SystemRoot"] = ENV["SystemRoot"] - end - dump = Marshal.dump(meta) - - cgi_in.write("%8d" % cgi_out.path.bytesize) - cgi_in.write(cgi_out.path) - cgi_in.write("%8d" % cgi_err.path.bytesize) - cgi_in.write(cgi_err.path) - cgi_in.write("%8d" % dump.bytesize) - cgi_in.write(dump) - - req.body { |chunk| cgi_in.write(chunk) } - ensure - cgi_in.close - status = $?.exitstatus - sleep 0.1 if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM - data = cgi_out.read - cgi_out.close(true) - if errmsg = cgi_err.read - if errmsg.bytesize > 0 - @logger.error("CGIHandler: #{@script_filename}:\n" + errmsg) - end - end - cgi_err.close(true) - end - - if status != 0 - @logger.error("CGIHandler: #{@script_filename} exit with #{status}") - end - - data = "" unless data - raw_header, body = data.split(/^[\xd\xa]+/, 2) - raise HTTPStatus::InternalServerError, - "Premature end of script headers: #{@script_filename}" if body.nil? - - begin - header = HTTPUtils::parse_header(raw_header) - if /^(\d+)/ =~ header['status'][0] - res.status = $1.to_i - header.delete('status') - end - if header.has_key?('location') - # RFC 3875 6.2.3, 6.2.4 - res.status = 302 unless (300...400) === res.status - end - if header.has_key?('set-cookie') - header['set-cookie'].each{|k| - res.cookies << Cookie.parse_set_cookie(k) - } - header.delete('set-cookie') - end - header.each{|key, val| res[key] = val.join(", ") } - rescue => ex - raise HTTPStatus::InternalServerError, ex.message - end - res.body = body - end - alias do_POST do_GET - - # :startdoc: - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/erbhandler.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/erbhandler.rb deleted file mode 100644 index 3b232f7f5b..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/erbhandler.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true -# -# erbhandler.rb -- ERBHandler Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: erbhandler.rb,v 1.25 2003/02/24 19:25:31 gotoyuzo Exp $ - -require_relative 'abstract' - -require 'erb' - -module WEBrick - module HTTPServlet - - ## - # ERBHandler evaluates an ERB file and returns the result. This handler - # is automatically used if there are .rhtml files in a directory served by - # the FileHandler. - # - # ERBHandler supports GET and POST methods. - # - # The ERB file is evaluated with the local variables +servlet_request+ and - # +servlet_response+ which are a WEBrick::HTTPRequest and - # WEBrick::HTTPResponse respectively. - # - # Example .rhtml file: - # - # Request to <%= servlet_request.request_uri %> - # - # Query params <%= servlet_request.query.inspect %> - - class ERBHandler < AbstractServlet - - ## - # Creates a new ERBHandler on +server+ that will evaluate and serve the - # ERB file +name+ - - def initialize(server, name) - super(server, name) - @script_filename = name - end - - ## - # Handles GET requests - - def do_GET(req, res) - unless defined?(ERB) - @logger.warn "#{self.class}: ERB not defined." - raise HTTPStatus::Forbidden, "ERBHandler cannot work." - end - begin - data = File.open(@script_filename, &:read) - res.body = evaluate(ERB.new(data), req, res) - res['content-type'] ||= - HTTPUtils::mime_type(@script_filename, @config[:MimeTypes]) - rescue StandardError - raise - rescue Exception => ex - @logger.error(ex) - raise HTTPStatus::InternalServerError, ex.message - end - end - - ## - # Handles POST requests - - alias do_POST do_GET - - private - - ## - # Evaluates +erb+ providing +servlet_request+ and +servlet_response+ as - # local variables. - - def evaluate(erb, servlet_request, servlet_response) - Module.new.module_eval{ - servlet_request.meta_vars - servlet_request.query - erb.result(binding) - } - end - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/filehandler.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/filehandler.rb deleted file mode 100644 index 7ab88bca13..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/filehandler.rb +++ /dev/null @@ -1,552 +0,0 @@ -# frozen_string_literal: true -# -# filehandler.rb -- FileHandler Module -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: filehandler.rb,v 1.44 2003/06/07 01:34:51 gotoyuzo Exp $ - -require 'time' - -require_relative '../htmlutils' -require_relative '../httputils' -require_relative '../httpstatus' - -module WEBrick - module HTTPServlet - - ## - # Servlet for serving a single file. You probably want to use the - # FileHandler servlet instead as it handles directories and fancy indexes. - # - # Example: - # - # server.mount('/my_page.txt', WEBrick::HTTPServlet::DefaultFileHandler, - # '/path/to/my_page.txt') - # - # This servlet handles If-Modified-Since and Range requests. - - class DefaultFileHandler < AbstractServlet - - ## - # Creates a DefaultFileHandler instance for the file at +local_path+. - - def initialize(server, local_path) - super(server, local_path) - @local_path = local_path - end - - # :stopdoc: - - def do_GET(req, res) - st = File::stat(@local_path) - mtime = st.mtime - res['etag'] = sprintf("%x-%x-%x", st.ino, st.size, st.mtime.to_i) - - if not_modified?(req, res, mtime, res['etag']) - res.body = '' - raise HTTPStatus::NotModified - elsif req['range'] - make_partial_content(req, res, @local_path, st.size) - raise HTTPStatus::PartialContent - else - mtype = HTTPUtils::mime_type(@local_path, @config[:MimeTypes]) - res['content-type'] = mtype - res['content-length'] = st.size.to_s - res['last-modified'] = mtime.httpdate - res.body = File.open(@local_path, "rb") - end - end - - def not_modified?(req, res, mtime, etag) - if ir = req['if-range'] - begin - if Time.httpdate(ir) >= mtime - return true - end - rescue - if HTTPUtils::split_header_value(ir).member?(res['etag']) - return true - end - end - end - - if (ims = req['if-modified-since']) && Time.parse(ims) >= mtime - return true - end - - if (inm = req['if-none-match']) && - HTTPUtils::split_header_value(inm).member?(res['etag']) - return true - end - - return false - end - - # returns a lambda for webrick/httpresponse.rb send_body_proc - def multipart_body(body, parts, boundary, mtype, filesize) - lambda do |socket| - begin - begin - first = parts.shift - last = parts.shift - socket.write( - "--#{boundary}#{CRLF}" \ - "Content-Type: #{mtype}#{CRLF}" \ - "Content-Range: bytes #{first}-#{last}/#{filesize}#{CRLF}" \ - "#{CRLF}" - ) - - begin - IO.copy_stream(body, socket, last - first + 1, first) - rescue NotImplementedError - body.seek(first, IO::SEEK_SET) - IO.copy_stream(body, socket, last - first + 1) - end - socket.write(CRLF) - end while parts[0] - socket.write("--#{boundary}--#{CRLF}") - ensure - body.close - end - end - end - - def make_partial_content(req, res, filename, filesize) - mtype = HTTPUtils::mime_type(filename, @config[:MimeTypes]) - unless ranges = HTTPUtils::parse_range_header(req['range']) - raise HTTPStatus::BadRequest, - "Unrecognized range-spec: \"#{req['range']}\"" - end - File.open(filename, "rb"){|io| - if ranges.size > 1 - time = Time.now - boundary = "#{time.sec}_#{time.usec}_#{Process::pid}" - parts = [] - ranges.each {|range| - prange = prepare_range(range, filesize) - next if prange[0] < 0 - parts.concat(prange) - } - raise HTTPStatus::RequestRangeNotSatisfiable if parts.empty? - res["content-type"] = "multipart/byteranges; boundary=#{boundary}" - if req.http_version < '1.1' - res['connection'] = 'close' - else - res.chunked = true - end - res.body = multipart_body(io.dup, parts, boundary, mtype, filesize) - elsif range = ranges[0] - first, last = prepare_range(range, filesize) - raise HTTPStatus::RequestRangeNotSatisfiable if first < 0 - res['content-type'] = mtype - res['content-range'] = "bytes #{first}-#{last}/#{filesize}" - res['content-length'] = (last - first + 1).to_s - res.body = io.dup - else - raise HTTPStatus::BadRequest - end - } - end - - def prepare_range(range, filesize) - first = range.first < 0 ? filesize + range.first : range.first - return -1, -1 if first < 0 || first >= filesize - last = range.last < 0 ? filesize + range.last : range.last - last = filesize - 1 if last >= filesize - return first, last - end - - # :startdoc: - end - - ## - # Serves a directory including fancy indexing and a variety of other - # options. - # - # Example: - # - # server.mount('/assets', WEBrick::HTTPServlet::FileHandler, - # '/path/to/assets') - - class FileHandler < AbstractServlet - HandlerTable = Hash.new # :nodoc: - - ## - # Allow custom handling of requests for files with +suffix+ by class - # +handler+ - - def self.add_handler(suffix, handler) - HandlerTable[suffix] = handler - end - - ## - # Remove custom handling of requests for files with +suffix+ - - def self.remove_handler(suffix) - HandlerTable.delete(suffix) - end - - ## - # Creates a FileHandler servlet on +server+ that serves files starting - # at directory +root+ - # - # +options+ may be a Hash containing keys from - # WEBrick::Config::FileHandler or +true+ or +false+. - # - # If +options+ is true or false then +:FancyIndexing+ is enabled or - # disabled respectively. - - def initialize(server, root, options={}, default=Config::FileHandler) - @config = server.config - @logger = @config[:Logger] - @root = File.expand_path(root) - if options == true || options == false - options = { :FancyIndexing => options } - end - @options = default.dup.update(options) - end - - # :stopdoc: - - def set_filesystem_encoding(str) - enc = Encoding.find('filesystem') - if enc == Encoding::US_ASCII - str.b - else - str.dup.force_encoding(enc) - end - end - - def service(req, res) - # if this class is mounted on "/" and /~username is requested. - # we're going to override path information before invoking service. - if defined?(Etc) && @options[:UserDir] && req.script_name.empty? - if %r|^(/~([^/]+))| =~ req.path_info - script_name, user = $1, $2 - path_info = $' - begin - passwd = Etc::getpwnam(user) - @root = File::join(passwd.dir, @options[:UserDir]) - req.script_name = script_name - req.path_info = path_info - rescue - @logger.debug "#{self.class}#do_GET: getpwnam(#{user}) failed" - end - end - end - prevent_directory_traversal(req, res) - super(req, res) - end - - def do_GET(req, res) - unless exec_handler(req, res) - set_dir_list(req, res) - end - end - - def do_POST(req, res) - unless exec_handler(req, res) - raise HTTPStatus::NotFound, "`#{req.path}' not found." - end - end - - def do_OPTIONS(req, res) - unless exec_handler(req, res) - super(req, res) - end - end - - # ToDo - # RFC2518: HTTP Extensions for Distributed Authoring -- WEBDAV - # - # PROPFIND PROPPATCH MKCOL DELETE PUT COPY MOVE - # LOCK UNLOCK - - # RFC3253: Versioning Extensions to WebDAV - # (Web Distributed Authoring and Versioning) - # - # VERSION-CONTROL REPORT CHECKOUT CHECK_IN UNCHECKOUT - # MKWORKSPACE UPDATE LABEL MERGE ACTIVITY - - private - - def trailing_pathsep?(path) - # check for trailing path separator: - # File.dirname("/aaaa/bbbb/") #=> "/aaaa") - # File.dirname("/aaaa/bbbb/x") #=> "/aaaa/bbbb") - # File.dirname("/aaaa/bbbb") #=> "/aaaa") - # File.dirname("/aaaa/bbbbx") #=> "/aaaa") - return File.dirname(path) != File.dirname(path+"x") - end - - def prevent_directory_traversal(req, res) - # Preventing directory traversal on Windows platforms; - # Backslashes (0x5c) in path_info are not interpreted as special - # character in URI notation. So the value of path_info should be - # normalize before accessing to the filesystem. - - # dirty hack for filesystem encoding; in nature, File.expand_path - # should not be used for path normalization. [Bug #3345] - path = req.path_info.dup.force_encoding(Encoding.find("filesystem")) - if trailing_pathsep?(req.path_info) - # File.expand_path removes the trailing path separator. - # Adding a character is a workaround to save it. - # File.expand_path("/aaa/") #=> "/aaa" - # File.expand_path("/aaa/" + "x") #=> "/aaa/x" - expanded = File.expand_path(path + "x") - expanded.chop! # remove trailing "x" - else - expanded = File.expand_path(path) - end - expanded.force_encoding(req.path_info.encoding) - req.path_info = expanded - end - - def exec_handler(req, res) - raise HTTPStatus::NotFound, "`#{req.path}' not found." unless @root - if set_filename(req, res) - handler = get_handler(req, res) - call_callback(:HandlerCallback, req, res) - h = handler.get_instance(@config, res.filename) - h.service(req, res) - return true - end - call_callback(:HandlerCallback, req, res) - return false - end - - def get_handler(req, res) - suffix1 = (/\.(\w+)\z/ =~ res.filename) && $1.downcase - if /\.(\w+)\.([\w\-]+)\z/ =~ res.filename - if @options[:AcceptableLanguages].include?($2.downcase) - suffix2 = $1.downcase - end - end - handler_table = @options[:HandlerTable] - return handler_table[suffix1] || handler_table[suffix2] || - HandlerTable[suffix1] || HandlerTable[suffix2] || - DefaultFileHandler - end - - def set_filename(req, res) - res.filename = @root - path_info = req.path_info.scan(%r|/[^/]*|) - - path_info.unshift("") # dummy for checking @root dir - while base = path_info.first - base = set_filesystem_encoding(base) - break if base == "/" - break unless File.directory?(File.expand_path(res.filename + base)) - shift_path_info(req, res, path_info) - call_callback(:DirectoryCallback, req, res) - end - - if base = path_info.first - base = set_filesystem_encoding(base) - if base == "/" - if file = search_index_file(req, res) - shift_path_info(req, res, path_info, file) - call_callback(:FileCallback, req, res) - return true - end - shift_path_info(req, res, path_info) - elsif file = search_file(req, res, base) - shift_path_info(req, res, path_info, file) - call_callback(:FileCallback, req, res) - return true - else - raise HTTPStatus::NotFound, "`#{req.path}' not found." - end - end - - return false - end - - def check_filename(req, res, name) - if nondisclosure_name?(name) || windows_ambiguous_name?(name) - @logger.warn("the request refers nondisclosure name `#{name}'.") - raise HTTPStatus::NotFound, "`#{req.path}' not found." - end - end - - def shift_path_info(req, res, path_info, base=nil) - tmp = path_info.shift - base = base || set_filesystem_encoding(tmp) - req.path_info = path_info.join - req.script_name << base - res.filename = File.expand_path(res.filename + base) - check_filename(req, res, File.basename(res.filename)) - end - - def search_index_file(req, res) - @config[:DirectoryIndex].each{|index| - if file = search_file(req, res, "/"+index) - return file - end - } - return nil - end - - def search_file(req, res, basename) - langs = @options[:AcceptableLanguages] - path = res.filename + basename - if File.file?(path) - return basename - elsif langs.size > 0 - req.accept_language.each{|lang| - path_with_lang = path + ".#{lang}" - if langs.member?(lang) && File.file?(path_with_lang) - return basename + ".#{lang}" - end - } - (langs - req.accept_language).each{|lang| - path_with_lang = path + ".#{lang}" - if File.file?(path_with_lang) - return basename + ".#{lang}" - end - } - end - return nil - end - - def call_callback(callback_name, req, res) - if cb = @options[callback_name] - cb.call(req, res) - end - end - - def windows_ambiguous_name?(name) - return true if /[. ]+\z/ =~ name - return true if /::\$DATA\z/ =~ name - return false - end - - def nondisclosure_name?(name) - @options[:NondisclosureName].each{|pattern| - if File.fnmatch(pattern, name, File::FNM_CASEFOLD) - return true - end - } - return false - end - - def set_dir_list(req, res) - redirect_to_directory_uri(req, res) - unless @options[:FancyIndexing] - raise HTTPStatus::Forbidden, "no access permission to `#{req.path}'" - end - local_path = res.filename - list = Dir::entries(local_path).collect{|name| - next if name == "." || name == ".." - next if nondisclosure_name?(name) - next if windows_ambiguous_name?(name) - st = (File::stat(File.join(local_path, name)) rescue nil) - if st.nil? - [ name, nil, -1 ] - elsif st.directory? - [ name + "/", st.mtime, -1 ] - else - [ name, st.mtime, st.size ] - end - } - list.compact! - - query = req.query - - d0 = nil - idx = nil - %w[N M S].each_with_index do |q, i| - if d = query.delete(q) - idx ||= i - d0 ||= d - end - end - d0 ||= "A" - idx ||= 0 - d1 = (d0 == "A") ? "D" : "A" - - if d0 == "A" - list.sort!{|a,b| a[idx] <=> b[idx] } - else - list.sort!{|a,b| b[idx] <=> a[idx] } - end - - namewidth = query["NameWidth"] - if namewidth == "*" - namewidth = nil - elsif !namewidth or (namewidth = namewidth.to_i) < 2 - namewidth = 25 - end - query = query.inject('') {|s, (k, v)| s << '&' << HTMLUtils::escape("#{k}=#{v}")}.dup - - type = +"text/html" - case enc = Encoding.find('filesystem') - when Encoding::US_ASCII, Encoding::ASCII_8BIT - else - type << "; charset=\"#{enc.name}\"" - end - res['content-type'] = type - - title = "Index of #{HTMLUtils::escape(req.path)}" - res.body = +<<-_end_of_html_ - - - - #{title} - - - -

#{title}

- _end_of_html_ - - res.body << "\n" - res.body << "" - res.body << "" - res.body << "\n" - res.body << "\n" - res.body << "\n" - - query.sub!(/\A&/, '?') - list.unshift [ "..", File::mtime(local_path+"/.."), -1 ] - list.each{ |name, time, size| - if name == ".." - dname = "Parent Directory" - elsif namewidth and name.size > namewidth - dname = name[0...(namewidth - 2)] << '..' - else - dname = name - end - s = +"" - s << "" - s << "\n" - res.body << s - } - res.body << "
NameLast modifiedSize
#{HTMLUtils::escape(dname)}" << (time ? time.strftime("%Y/%m/%d %H:%M") : "") << "" << (size >= 0 ? size.to_s : "-") << "
" - res.body << "
" - - res.body << <<-_end_of_html_ -
- #{HTMLUtils::escape(@config[:ServerSoftware])}
- at #{req.host}:#{req.port} -
- - - _end_of_html_ - end - - # :startdoc: - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/prochandler.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/prochandler.rb deleted file mode 100644 index 92e4f80d06..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpservlet/prochandler.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# -# prochandler.rb -- ProcHandler Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: prochandler.rb,v 1.7 2002/09/21 12:23:42 gotoyuzo Exp $ - -require_relative 'abstract' - -module WEBrick - module HTTPServlet - - ## - # Mounts a proc at a path that accepts a request and response. - # - # Instead of mounting this servlet with WEBrick::HTTPServer#mount use - # WEBrick::HTTPServer#mount_proc: - # - # server.mount_proc '/' do |req, res| - # res.body = 'it worked!' - # res.status = 200 - # end - - class ProcHandler < AbstractServlet - # :stopdoc: - def get_instance(server, *options) - self - end - - def initialize(proc) - @proc = proc - end - - def do_GET(request, response) - @proc.call(request, response) - end - - alias do_POST do_GET - alias do_PUT do_GET - # :startdoc: - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpstatus.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpstatus.rb deleted file mode 100644 index c21c1d4679..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpstatus.rb +++ /dev/null @@ -1,194 +0,0 @@ -# frozen_string_literal: true -#-- -# httpstatus.rb -- HTTPStatus Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httpstatus.rb,v 1.11 2003/03/24 20:18:55 gotoyuzo Exp $ - -require_relative 'accesslog' - -module WEBrick - - ## - # This module is used to manager HTTP status codes. - # - # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more - # information. - module HTTPStatus - - ## - # Root of the HTTP status class hierarchy - class Status < StandardError - class << self - attr_reader :code, :reason_phrase # :nodoc: - end - - # Returns the HTTP status code - def code() self::class::code end - - # Returns the HTTP status description - def reason_phrase() self::class::reason_phrase end - - alias to_i code # :nodoc: - end - - # Root of the HTTP info statuses - class Info < Status; end - # Root of the HTTP success statuses - class Success < Status; end - # Root of the HTTP redirect statuses - class Redirect < Status; end - # Root of the HTTP error statuses - class Error < Status; end - # Root of the HTTP client error statuses - class ClientError < Error; end - # Root of the HTTP server error statuses - class ServerError < Error; end - - class EOFError < StandardError; end - - # HTTP status codes and descriptions - StatusMessage = { # :nodoc: - 100 => 'Continue', - 101 => 'Switching Protocols', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-Status', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 307 => 'Temporary Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', - 415 => 'Unsupported Media Type', - 416 => 'Request Range Not Satisfiable', - 417 => 'Expectation Failed', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported', - 507 => 'Insufficient Storage', - 511 => 'Network Authentication Required', - } - - # Maps a status code to the corresponding Status class - CodeToError = {} # :nodoc: - - # Creates a status or error class for each status code and - # populates the CodeToError map. - StatusMessage.each{|code, message| - message.freeze - var_name = message.gsub(/[ \-]/,'_').upcase - err_name = message.gsub(/[ \-]/,'') - - case code - when 100...200; parent = Info - when 200...300; parent = Success - when 300...400; parent = Redirect - when 400...500; parent = ClientError - when 500...600; parent = ServerError - end - - const_set("RC_#{var_name}", code) - err_class = Class.new(parent) - err_class.instance_variable_set(:@code, code) - err_class.instance_variable_set(:@reason_phrase, message) - const_set(err_name, err_class) - CodeToError[code] = err_class - } - - ## - # Returns the description corresponding to the HTTP status +code+ - # - # WEBrick::HTTPStatus.reason_phrase 404 - # => "Not Found" - def reason_phrase(code) - StatusMessage[code.to_i] - end - - ## - # Is +code+ an informational status? - def info?(code) - code.to_i >= 100 and code.to_i < 200 - end - - ## - # Is +code+ a successful status? - def success?(code) - code.to_i >= 200 and code.to_i < 300 - end - - ## - # Is +code+ a redirection status? - def redirect?(code) - code.to_i >= 300 and code.to_i < 400 - end - - ## - # Is +code+ an error status? - def error?(code) - code.to_i >= 400 and code.to_i < 600 - end - - ## - # Is +code+ a client error status? - def client_error?(code) - code.to_i >= 400 and code.to_i < 500 - end - - ## - # Is +code+ a server error status? - def server_error?(code) - code.to_i >= 500 and code.to_i < 600 - end - - ## - # Returns the status class corresponding to +code+ - # - # WEBrick::HTTPStatus[302] - # => WEBrick::HTTPStatus::NotFound - # - def self.[](code) - CodeToError[code] - end - - module_function :reason_phrase - module_function :info?, :success?, :redirect?, :error? - module_function :client_error?, :server_error? - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httputils.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httputils.rb deleted file mode 100644 index 48aa1371b2..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httputils.rb +++ /dev/null @@ -1,523 +0,0 @@ -# frozen_string_literal: true -# -# httputils.rb -- HTTPUtils Module -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httputils.rb,v 1.34 2003/06/05 21:34:08 gotoyuzo Exp $ - -require 'socket' -require 'tempfile' - -module WEBrick - CR = "\x0d" # :nodoc: - LF = "\x0a" # :nodoc: - CRLF = "\x0d\x0a" # :nodoc: - - ## - # HTTPUtils provides utility methods for working with the HTTP protocol. - # - # This module is generally used internally by WEBrick - - module HTTPUtils - - ## - # Normalizes a request path. Raises an exception if the path cannot be - # normalized. - - def normalize_path(path) - raise "abnormal path `#{path}'" if path[0] != ?/ - ret = path.dup - - ret.gsub!(%r{/+}o, '/') # // => / - while ret.sub!(%r'/\.(?:/|\Z)', '/'); end # /. => / - while ret.sub!(%r'/(?!\.\./)[^/]+/\.\.(?:/|\Z)', '/'); end # /foo/.. => /foo - - raise "abnormal path `#{path}'" if %r{/\.\.(/|\Z)} =~ ret - ret - end - module_function :normalize_path - - ## - # Default mime types - - DefaultMimeTypes = { - "ai" => "application/postscript", - "asc" => "text/plain", - "avi" => "video/x-msvideo", - "avif" => "image/avif", - "bin" => "application/octet-stream", - "bmp" => "image/bmp", - "class" => "application/octet-stream", - "cer" => "application/pkix-cert", - "crl" => "application/pkix-crl", - "crt" => "application/x-x509-ca-cert", - #"crl" => "application/x-pkcs7-crl", - "css" => "text/css", - "dms" => "application/octet-stream", - "doc" => "application/msword", - "dvi" => "application/x-dvi", - "eps" => "application/postscript", - "etx" => "text/x-setext", - "exe" => "application/octet-stream", - "gif" => "image/gif", - "htm" => "text/html", - "html" => "text/html", - "ico" => "image/x-icon", - "jpe" => "image/jpeg", - "jpeg" => "image/jpeg", - "jpg" => "image/jpeg", - "js" => "application/javascript", - "json" => "application/json", - "lha" => "application/octet-stream", - "lzh" => "application/octet-stream", - "mjs" => "application/javascript", - "mov" => "video/quicktime", - "mp4" => "video/mp4", - "mpe" => "video/mpeg", - "mpeg" => "video/mpeg", - "mpg" => "video/mpeg", - "otf" => "font/otf", - "pbm" => "image/x-portable-bitmap", - "pdf" => "application/pdf", - "pgm" => "image/x-portable-graymap", - "png" => "image/png", - "pnm" => "image/x-portable-anymap", - "ppm" => "image/x-portable-pixmap", - "ppt" => "application/vnd.ms-powerpoint", - "ps" => "application/postscript", - "qt" => "video/quicktime", - "ras" => "image/x-cmu-raster", - "rb" => "text/plain", - "rd" => "text/plain", - "rtf" => "application/rtf", - "sgm" => "text/sgml", - "sgml" => "text/sgml", - "svg" => "image/svg+xml", - "tif" => "image/tiff", - "tiff" => "image/tiff", - "ttc" => "font/collection", - "ttf" => "font/ttf", - "txt" => "text/plain", - "wasm" => "application/wasm", - "webm" => "video/webm", - "webmanifest" => "application/manifest+json", - "webp" => "image/webp", - "woff" => "font/woff", - "woff2" => "font/woff2", - "xbm" => "image/x-xbitmap", - "xhtml" => "text/html", - "xls" => "application/vnd.ms-excel", - "xml" => "text/xml", - "xpm" => "image/x-xpixmap", - "xwd" => "image/x-xwindowdump", - "zip" => "application/zip", - } - - ## - # Loads Apache-compatible mime.types in +file+. - - def load_mime_types(file) - # note: +file+ may be a "| command" for now; some people may - # rely on this, but currently we do not use this method by default. - File.open(file){ |io| - hash = Hash.new - io.each{ |line| - next if /^#/ =~ line - line.chomp! - mimetype, ext0 = line.split(/\s+/, 2) - next unless ext0 - next if ext0.empty? - ext0.split(/\s+/).each{ |ext| hash[ext] = mimetype } - } - hash - } - end - module_function :load_mime_types - - ## - # Returns the mime type of +filename+ from the list in +mime_tab+. If no - # mime type was found application/octet-stream is returned. - - def mime_type(filename, mime_tab) - suffix1 = (/\.(\w+)$/ =~ filename && $1.downcase) - suffix2 = (/\.(\w+)\.[\w\-]+$/ =~ filename && $1.downcase) - mime_tab[suffix1] || mime_tab[suffix2] || "application/octet-stream" - end - module_function :mime_type - - ## - # Parses an HTTP header +raw+ into a hash of header fields with an Array - # of values. - - def parse_header(raw) - header = Hash.new([].freeze) - field = nil - raw.each_line{|line| - case line - when /^([A-Za-z0-9!\#$%&'*+\-.^_`|~]+):\s*(.*?)\s*\z/om - field, value = $1, $2 - field.downcase! - header[field] = [] unless header.has_key?(field) - header[field] << value - when /^\s+(.*?)\s*\z/om - value = $1 - unless field - raise HTTPStatus::BadRequest, "bad header '#{line}'." - end - header[field][-1] << " " << value - else - raise HTTPStatus::BadRequest, "bad header '#{line}'." - end - } - header.each{|key, values| - values.each(&:strip!) - } - header - end - module_function :parse_header - - ## - # Splits a header value +str+ according to HTTP specification. - - def split_header_value(str) - str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+) - (?:,\s*|\Z)'xn).flatten - end - module_function :split_header_value - - ## - # Parses a Range header value +ranges_specifier+ - - def parse_range_header(ranges_specifier) - if /^bytes=(.*)/ =~ ranges_specifier - byte_range_set = split_header_value($1) - byte_range_set.collect{|range_spec| - case range_spec - when /^(\d+)-(\d+)/ then $1.to_i .. $2.to_i - when /^(\d+)-/ then $1.to_i .. -1 - when /^-(\d+)/ then -($1.to_i) .. -1 - else return nil - end - } - end - end - module_function :parse_range_header - - ## - # Parses q values in +value+ as used in Accept headers. - - def parse_qvalues(value) - tmp = [] - if value - parts = value.split(/,\s*/) - parts.each {|part| - if m = %r{^([^\s,]+?)(?:;\s*q=(\d+(?:\.\d+)?))?$}.match(part) - val = m[1] - q = (m[2] or 1).to_f - tmp.push([val, q]) - end - } - tmp = tmp.sort_by{|val, q| -q} - tmp.collect!{|val, q| val} - end - return tmp - end - module_function :parse_qvalues - - ## - # Removes quotes and escapes from +str+ - - def dequote(str) - ret = (/\A"(.*)"\Z/ =~ str) ? $1 : str.dup - ret.gsub!(/\\(.)/, "\\1") - ret - end - module_function :dequote - - ## - # Quotes and escapes quotes in +str+ - - def quote(str) - +'"' << str.gsub(/[\\\"]/o, "\\\1") << '"' - end - module_function :quote - - ## - # Stores multipart form data. FormData objects are created when - # WEBrick::HTTPUtils.parse_form_data is called. - - class FormData < String - EmptyRawHeader = [].freeze # :nodoc: - EmptyHeader = {}.freeze # :nodoc: - - ## - # The name of the form data part - - attr_accessor :name - - ## - # The filename of the form data part - - attr_accessor :filename - - attr_accessor :next_data # :nodoc: - protected :next_data - - ## - # Creates a new FormData object. - # - # +args+ is an Array of form data entries. One FormData will be created - # for each entry. - # - # This is called by WEBrick::HTTPUtils.parse_form_data for you - - def initialize(*args) - @name = @filename = @next_data = nil - if args.empty? - @raw_header = [] - @header = nil - super("") - else - @raw_header = EmptyRawHeader - @header = EmptyHeader - super(args.shift) - unless args.empty? - @next_data = self.class.new(*args) - end - end - end - - ## - # Retrieves the header at the first entry in +key+ - - def [](*key) - begin - @header[key[0].downcase].join(", ") - rescue StandardError, NameError - super - end - end - - ## - # Adds +str+ to this FormData which may be the body, a header or a - # header entry. - # - # This is called by WEBrick::HTTPUtils.parse_form_data for you - - def <<(str) - if @header - super - elsif str == CRLF - @header = HTTPUtils::parse_header(@raw_header.join) - if cd = self['content-disposition'] - if /\s+name="(.*?)"/ =~ cd then @name = $1 end - if /\s+filename="(.*?)"/ =~ cd then @filename = $1 end - end - else - @raw_header << str - end - self - end - - ## - # Adds +data+ at the end of the chain of entries - # - # This is called by WEBrick::HTTPUtils.parse_form_data for you. - - def append_data(data) - tmp = self - while tmp - unless tmp.next_data - tmp.next_data = data - break - end - tmp = tmp.next_data - end - self - end - - ## - # Yields each entry in this FormData - - def each_data - tmp = self - while tmp - next_data = tmp.next_data - yield(tmp) - tmp = next_data - end - end - - ## - # Returns all the FormData as an Array - - def list - ret = [] - each_data{|data| - ret << data.to_s - } - ret - end - - ## - # A FormData will behave like an Array - - alias :to_ary :list - - ## - # This FormData's body - - def to_s - String.new(self) - end - end - - ## - # Parses the query component of a URI in +str+ - - def parse_query(str) - query = Hash.new - if str - str.split(/[&;]/).each{|x| - next if x.empty? - key, val = x.split(/=/,2) - key = unescape_form(key) - val = unescape_form(val.to_s) - val = FormData.new(val) - val.name = key - if query.has_key?(key) - query[key].append_data(val) - next - end - query[key] = val - } - end - query - end - module_function :parse_query - - ## - # Parses form data in +io+ with the given +boundary+ - - def parse_form_data(io, boundary) - boundary_regexp = /\A--#{Regexp.quote(boundary)}(--)?#{CRLF}\z/ - form_data = Hash.new - return form_data unless io - data = nil - io.each_line{|line| - if boundary_regexp =~ line - if data - data.chop! - key = data.name - if form_data.has_key?(key) - form_data[key].append_data(data) - else - form_data[key] = data - end - end - data = FormData.new - next - else - if data - data << line - end - end - } - return form_data - end - module_function :parse_form_data - - ##### - - reserved = ';/?:@&=+$,' - num = '0123456789' - lowalpha = 'abcdefghijklmnopqrstuvwxyz' - upalpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - mark = '-_.!~*\'()' - unreserved = num + lowalpha + upalpha + mark - control = (0x0..0x1f).collect{|c| c.chr }.join + "\x7f" - space = " " - delims = '<>#%"' - unwise = '{}|\\^[]`' - nonascii = (0x80..0xff).collect{|c| c.chr }.join - - module_function - - # :stopdoc: - - def _make_regex(str) /([#{Regexp.escape(str)}])/n end - def _make_regex!(str) /([^#{Regexp.escape(str)}])/n end - def _escape(str, regex) - str = str.b - str.gsub!(regex) {"%%%02X" % $1.ord} - # %-escaped string should contain US-ASCII only - str.force_encoding(Encoding::US_ASCII) - end - def _unescape(str, regex) - str = str.b - str.gsub!(regex) {$1.hex.chr} - # encoding of %-unescaped string is unknown - str - end - - UNESCAPED = _make_regex(control+space+delims+unwise+nonascii) - UNESCAPED_FORM = _make_regex(reserved+control+delims+unwise+nonascii) - NONASCII = _make_regex(nonascii) - ESCAPED = /%([0-9a-fA-F]{2})/ - UNESCAPED_PCHAR = _make_regex!(unreserved+":@&=+$,") - - # :startdoc: - - ## - # Escapes HTTP reserved and unwise characters in +str+ - - def escape(str) - _escape(str, UNESCAPED) - end - - ## - # Unescapes HTTP reserved and unwise characters in +str+ - - def unescape(str) - _unescape(str, ESCAPED) - end - - ## - # Escapes form reserved characters in +str+ - - def escape_form(str) - ret = _escape(str, UNESCAPED_FORM) - ret.gsub!(/ /, "+") - ret - end - - ## - # Unescapes form reserved characters in +str+ - - def unescape_form(str) - _unescape(str.gsub(/\+/, " "), ESCAPED) - end - - ## - # Escapes path +str+ - - def escape_path(str) - result = +"" - str.scan(%r{/([^/]*)}).each{|i| - result << "/" << _escape(i[0], UNESCAPED_PCHAR) - } - return result - end - - ## - # Escapes 8 bit characters in +str+ - - def escape8bit(str) - _escape(str, NONASCII) - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpversion.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpversion.rb deleted file mode 100644 index 6349590334..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/httpversion.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true -#-- -# HTTPVersion.rb -- presentation of HTTP version -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: httpversion.rb,v 1.5 2002/09/21 12:23:37 gotoyuzo Exp $ - -module WEBrick - - ## - # Represents an HTTP protocol version - - class HTTPVersion - include Comparable - - ## - # The major protocol version number - - attr_accessor :major - - ## - # The minor protocol version number - - attr_accessor :minor - - ## - # Converts +version+ into an HTTPVersion - - def self.convert(version) - version.is_a?(self) ? version : new(version) - end - - ## - # Creates a new HTTPVersion from +version+. - - def initialize(version) - case version - when HTTPVersion - @major, @minor = version.major, version.minor - when String - if /^(\d+)\.(\d+)$/ =~ version - @major, @minor = $1.to_i, $2.to_i - end - end - if @major.nil? || @minor.nil? - raise ArgumentError, - format("cannot convert %s into %s", version.class, self.class) - end - end - - ## - # Compares this version with +other+ according to the HTTP specification - # rules. - - def <=>(other) - unless other.is_a?(self.class) - other = self.class.new(other) - end - if (ret = @major <=> other.major) == 0 - return @minor <=> other.minor - end - return ret - end - - ## - # The HTTP version as show in the HTTP request and response. For example, - # "1.1" - - def to_s - format("%d.%d", @major, @minor) - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/log.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/log.rb deleted file mode 100644 index 4de4bee1c8..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/log.rb +++ /dev/null @@ -1,156 +0,0 @@ -# frozen_string_literal: true -#-- -# log.rb -- Log Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: log.rb,v 1.26 2002/10/06 17:06:10 gotoyuzo Exp $ - -module WEBrick - - ## - # A generic logging class - - class BasicLog - - # Fatal log level which indicates a server crash - - FATAL = 1 - - # Error log level which indicates a recoverable error - - ERROR = 2 - - # Warning log level which indicates a possible problem - - WARN = 3 - - # Information log level which indicates possibly useful information - - INFO = 4 - - # Debugging error level for messages used in server development or - # debugging - - DEBUG = 5 - - # log-level, messages above this level will be logged - attr_accessor :level - - ## - # Initializes a new logger for +log_file+ that outputs messages at +level+ - # or higher. +log_file+ can be a filename, an IO-like object that - # responds to #<< or nil which outputs to $stderr. - # - # If no level is given INFO is chosen by default - - def initialize(log_file=nil, level=nil) - @level = level || INFO - case log_file - when String - @log = File.open(log_file, "a+") - @log.sync = true - @opened = true - when NilClass - @log = $stderr - else - @log = log_file # requires "<<". (see BasicLog#log) - end - end - - ## - # Closes the logger (also closes the log device associated to the logger) - def close - @log.close if @opened - @log = nil - end - - ## - # Logs +data+ at +level+ if the given level is above the current log - # level. - - def log(level, data) - if @log && level <= @level - data += "\n" if /\n\Z/ !~ data - @log << data - end - end - - ## - # Synonym for log(INFO, obj.to_s) - def <<(obj) - log(INFO, obj.to_s) - end - - # Shortcut for logging a FATAL message - def fatal(msg) log(FATAL, "FATAL " + format(msg)); end - # Shortcut for logging an ERROR message - def error(msg) log(ERROR, "ERROR " + format(msg)); end - # Shortcut for logging a WARN message - def warn(msg) log(WARN, "WARN " + format(msg)); end - # Shortcut for logging an INFO message - def info(msg) log(INFO, "INFO " + format(msg)); end - # Shortcut for logging a DEBUG message - def debug(msg) log(DEBUG, "DEBUG " + format(msg)); end - - # Will the logger output FATAL messages? - def fatal?; @level >= FATAL; end - # Will the logger output ERROR messages? - def error?; @level >= ERROR; end - # Will the logger output WARN messages? - def warn?; @level >= WARN; end - # Will the logger output INFO messages? - def info?; @level >= INFO; end - # Will the logger output DEBUG messages? - def debug?; @level >= DEBUG; end - - private - - ## - # Formats +arg+ for the logger - # - # * If +arg+ is an Exception, it will format the error message and - # the back trace. - # * If +arg+ responds to #to_str, it will return it. - # * Otherwise it will return +arg+.inspect. - def format(arg) - if arg.is_a?(Exception) - +"#{arg.class}: #{AccessLog.escape(arg.message)}\n\t" << - arg.backtrace.join("\n\t") << "\n" - elsif arg.respond_to?(:to_str) - AccessLog.escape(arg.to_str) - else - arg.inspect - end - end - end - - ## - # A logging class that prepends a timestamp to each message. - - class Log < BasicLog - # Format of the timestamp which is applied to each logged line. The - # default is "[%Y-%m-%d %H:%M:%S]" - attr_accessor :time_format - - ## - # Same as BasicLog#initialize - # - # You can set the timestamp format through #time_format - def initialize(log_file=nil, level=nil) - super(log_file, level) - @time_format = "[%Y-%m-%d %H:%M:%S]" - end - - ## - # Same as BasicLog#log - def log(level, data) - tmp = Time.now.strftime(@time_format) - tmp << " " << data - super(level, tmp) - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/server.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/server.rb deleted file mode 100644 index f085d5d2b0..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/server.rb +++ /dev/null @@ -1,381 +0,0 @@ -# frozen_string_literal: true -# -# server.rb -- GenericServer Class -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: server.rb,v 1.62 2003/07/22 19:20:43 gotoyuzo Exp $ - -require 'socket' -require_relative 'config' -require_relative 'log' - -module WEBrick - - ## - # Server error exception - - class ServerError < StandardError; end - - ## - # Base server class - - class SimpleServer - - ## - # A SimpleServer only yields when you start it - - def SimpleServer.start - yield - end - end - - ## - # A generic module for daemonizing a process - - class Daemon - - ## - # Performs the standard operations for daemonizing a process. Runs a - # block, if given. - - def Daemon.start - Process.daemon - File.umask(0) - yield if block_given? - end - end - - ## - # Base TCP server class. You must subclass GenericServer and provide a #run - # method. - - class GenericServer - - ## - # The server status. One of :Stop, :Running or :Shutdown - - attr_reader :status - - ## - # The server configuration - - attr_reader :config - - ## - # The server logger. This is independent from the HTTP access log. - - attr_reader :logger - - ## - # Tokens control the number of outstanding clients. The - # :MaxClients configuration sets this. - - attr_reader :tokens - - ## - # Sockets listening for connections. - - attr_reader :listeners - - ## - # Creates a new generic server from +config+. The default configuration - # comes from +default+. - - def initialize(config={}, default=Config::General) - @config = default.dup.update(config) - @status = :Stop - @config[:Logger] ||= Log::new - @logger = @config[:Logger] - - @tokens = Thread::SizedQueue.new(@config[:MaxClients]) - @config[:MaxClients].times{ @tokens.push(nil) } - - webrickv = WEBrick::VERSION - rubyv = "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]" - @logger.info("WEBrick #{webrickv}") - @logger.info("ruby #{rubyv}") - - @listeners = [] - @shutdown_pipe = nil - unless @config[:DoNotListen] - raise ArgumentError, "Port must be an integer" unless @config[:Port].to_s == @config[:Port].to_i.to_s - - @config[:Port] = @config[:Port].to_i - if @config[:Listen] - warn(":Listen option is deprecated; use GenericServer#listen", uplevel: 1) - end - listen(@config[:BindAddress], @config[:Port]) - if @config[:Port] == 0 - @config[:Port] = @listeners[0].addr[1] - end - end - end - - ## - # Retrieves +key+ from the configuration - - def [](key) - @config[key] - end - - ## - # Adds listeners from +address+ and +port+ to the server. See - # WEBrick::Utils::create_listeners for details. - - def listen(address, port) - @listeners += Utils::create_listeners(address, port) - end - - ## - # Starts the server and runs the +block+ for each connection. This method - # does not return until the server is stopped from a signal handler or - # another thread using #stop or #shutdown. - # - # If the block raises a subclass of StandardError the exception is logged - # and ignored. If an IOError or Errno::EBADF exception is raised the - # exception is ignored. If an Exception subclass is raised the exception - # is logged and re-raised which stops the server. - # - # To completely shut down a server call #shutdown from ensure: - # - # server = WEBrick::GenericServer.new - # # or WEBrick::HTTPServer.new - # - # begin - # server.start - # ensure - # server.shutdown - # end - - def start(&block) - raise ServerError, "already started." if @status != :Stop - server_type = @config[:ServerType] || SimpleServer - - setup_shutdown_pipe - - server_type.start{ - @logger.info \ - "#{self.class}#start: pid=#{$$} port=#{@config[:Port]}" - @status = :Running - call_callback(:StartCallback) - - shutdown_pipe = @shutdown_pipe - - thgroup = ThreadGroup.new - begin - while @status == :Running - begin - sp = shutdown_pipe[0] - if svrs = IO.select([sp, *@listeners]) - if svrs[0].include? sp - # swallow shutdown pipe - buf = String.new - nil while String === - sp.read_nonblock([sp.nread, 8].max, buf, exception: false) - break - end - svrs[0].each{|svr| - @tokens.pop # blocks while no token is there. - if sock = accept_client(svr) - unless config[:DoNotReverseLookup].nil? - sock.do_not_reverse_lookup = !!config[:DoNotReverseLookup] - end - th = start_thread(sock, &block) - th[:WEBrickThread] = true - thgroup.add(th) - else - @tokens.push(nil) - end - } - end - rescue Errno::EBADF, Errno::ENOTSOCK, IOError => ex - # if the listening socket was closed in GenericServer#shutdown, - # IO::select raise it. - rescue StandardError => ex - msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}" - @logger.error msg - rescue Exception => ex - @logger.fatal ex - raise - end - end - ensure - cleanup_shutdown_pipe(shutdown_pipe) - cleanup_listener - @status = :Shutdown - @logger.info "going to shutdown ..." - thgroup.list.each{|th| th.join if th[:WEBrickThread] } - call_callback(:StopCallback) - @logger.info "#{self.class}#start done." - @status = :Stop - end - } - end - - ## - # Stops the server from accepting new connections. - - def stop - if @status == :Running - @status = :Shutdown - end - - alarm_shutdown_pipe {|f| f.write_nonblock("\0")} - end - - ## - # Shuts down the server and all listening sockets. New listeners must be - # provided to restart the server. - - def shutdown - stop - - alarm_shutdown_pipe(&:close) - end - - ## - # You must subclass GenericServer and implement \#run which accepts a TCP - # client socket - - def run(sock) - @logger.fatal "run() must be provided by user." - end - - private - - # :stopdoc: - - ## - # Accepts a TCP client socket from the TCP server socket +svr+ and returns - # the client socket. - - def accept_client(svr) - case sock = svr.to_io.accept_nonblock(exception: false) - when :wait_readable - nil - else - if svr.respond_to?(:start_immediately) - sock = OpenSSL::SSL::SSLSocket.new(sock, ssl_context) - sock.sync_close = true - # we cannot do OpenSSL::SSL::SSLSocket#accept here because - # a slow client can prevent us from accepting connections - # from other clients - end - sock - end - rescue Errno::ECONNRESET, Errno::ECONNABORTED, - Errno::EPROTO, Errno::EINVAL - nil - rescue StandardError => ex - msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}" - @logger.error msg - nil - end - - ## - # Starts a server thread for the client socket +sock+ that runs the given - # +block+. - # - # Sets the socket to the :WEBrickSocket thread local variable - # in the thread. - # - # If any errors occur in the block they are logged and handled. - - def start_thread(sock, &block) - Thread.start{ - begin - Thread.current[:WEBrickSocket] = sock - begin - addr = sock.peeraddr - @logger.debug "accept: #{addr[3]}:#{addr[1]}" - rescue SocketError - @logger.debug "accept:
" - raise - end - if sock.respond_to?(:sync_close=) && @config[:SSLStartImmediately] - WEBrick::Utils.timeout(@config[:RequestTimeout]) do - begin - sock.accept # OpenSSL::SSL::SSLSocket#accept - rescue Errno::ECONNRESET, Errno::ECONNABORTED, - Errno::EPROTO, Errno::EINVAL - Thread.exit - end - end - end - call_callback(:AcceptCallback, sock) - block ? block.call(sock) : run(sock) - rescue Errno::ENOTCONN - @logger.debug "Errno::ENOTCONN raised" - rescue ServerError => ex - msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}" - @logger.error msg - rescue Exception => ex - @logger.error ex - ensure - @tokens.push(nil) - Thread.current[:WEBrickSocket] = nil - if addr - @logger.debug "close: #{addr[3]}:#{addr[1]}" - else - @logger.debug "close:
" - end - sock.close - end - } - end - - ## - # Calls the callback +callback_name+ from the configuration with +args+ - - def call_callback(callback_name, *args) - @config[callback_name]&.call(*args) - end - - def setup_shutdown_pipe - return @shutdown_pipe ||= IO.pipe - end - - def cleanup_shutdown_pipe(shutdown_pipe) - @shutdown_pipe = nil - shutdown_pipe&.each(&:close) - end - - def alarm_shutdown_pipe - _, pipe = @shutdown_pipe # another thread may modify @shutdown_pipe. - if pipe - if !pipe.closed? - begin - yield pipe - rescue IOError # closed by another thread. - end - end - end - end - - def cleanup_listener - @listeners.each{|s| - if @logger.debug? - addr = s.addr - @logger.debug("close TCPSocket(#{addr[2]}, #{addr[1]})") - end - begin - s.shutdown - rescue Errno::ENOTCONN - # when `Errno::ENOTCONN: Socket is not connected' on some platforms, - # call #close instead of #shutdown. - # (ignore @config[:ShutdownSocketWithoutClose]) - s.close - else - unless @config[:ShutdownSocketWithoutClose] - s.close - end - end - } - @listeners.clear - end - end # end of GenericServer -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/ssl.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/ssl.rb deleted file mode 100644 index 6937f93bf0..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/ssl.rb +++ /dev/null @@ -1,219 +0,0 @@ -# frozen_string_literal: true -# -# ssl.rb -- SSL/TLS enhancement for GenericServer -# -# Copyright (c) 2003 GOTOU Yuuzou All rights reserved. -# -# $Id$ - -require 'webrick' -require 'openssl' - -module WEBrick - module Config - svrsoft = General[:ServerSoftware] - osslv = ::OpenSSL::OPENSSL_VERSION.split[1] - - ## - # Default SSL server configuration. - # - # WEBrick can automatically create a self-signed certificate if - # :SSLCertName is set. For more information on the various - # SSL options see OpenSSL::SSL::SSLContext. - # - # :ServerSoftware :: - # The server software name used in the Server: header. - # :SSLEnable :: false, - # Enable SSL for this server. Defaults to false. - # :SSLCertificate :: - # The SSL certificate for the server. - # :SSLPrivateKey :: - # The SSL private key for the server certificate. - # :SSLClientCA :: nil, - # Array of certificates that will be sent to the client. - # :SSLExtraChainCert :: nil, - # Array of certificates that will be added to the certificate chain - # :SSLCACertificateFile :: nil, - # Path to a CA certificate file - # :SSLCACertificatePath :: nil, - # Path to a directory containing CA certificates - # :SSLCertificateStore :: nil, - # OpenSSL::X509::Store used for certificate validation of the client - # :SSLTmpDhCallback :: nil, - # Callback invoked when DH parameters are required. - # :SSLVerifyClient :: - # Sets whether the client is verified. This defaults to VERIFY_NONE - # which is typical for an HTTPS server. - # :SSLVerifyDepth :: - # Number of CA certificates to walk when verifying a certificate chain - # :SSLVerifyCallback :: - # Custom certificate verification callback - # :SSLServerNameCallback:: - # Custom servername indication callback - # :SSLTimeout :: - # Maximum session lifetime - # :SSLOptions :: - # Various SSL options - # :SSLCiphers :: - # Ciphers to be used - # :SSLStartImmediately :: - # Immediately start SSL upon connection? Defaults to true - # :SSLCertName :: - # SSL certificate name. Must be set to enable automatic certificate - # creation. - # :SSLCertComment :: - # Comment used during automatic certificate creation. - - SSL = { - :ServerSoftware => "#{svrsoft} OpenSSL/#{osslv}", - :SSLEnable => false, - :SSLCertificate => nil, - :SSLPrivateKey => nil, - :SSLClientCA => nil, - :SSLExtraChainCert => nil, - :SSLCACertificateFile => nil, - :SSLCACertificatePath => nil, - :SSLCertificateStore => nil, - :SSLTmpDhCallback => nil, - :SSLVerifyClient => ::OpenSSL::SSL::VERIFY_NONE, - :SSLVerifyDepth => nil, - :SSLVerifyCallback => nil, # custom verification - :SSLTimeout => nil, - :SSLOptions => nil, - :SSLCiphers => nil, - :SSLStartImmediately => true, - # Must specify if you use auto generated certificate. - :SSLCertName => nil, - :SSLCertComment => "Generated by Ruby/OpenSSL" - } - General.update(SSL) - end - - module Utils - ## - # Creates a self-signed certificate with the given number of +bits+, - # the issuer +cn+ and a +comment+ to be stored in the certificate. - - def create_self_signed_cert(bits, cn, comment) - rsa = if $VERBOSE - OpenSSL::PKey::RSA.new(bits){|p, n| - case p - when 0; $stderr.putc "." # BN_generate_prime - when 1; $stderr.putc "+" # BN_generate_prime - when 2; $stderr.putc "*" # searching good prime, - # n = #of try, - # but also data from BN_generate_prime - when 3; $stderr.putc "\n" # found good prime, n==0 - p, n==1 - q, - # but also data from BN_generate_prime - else; $stderr.putc "*" # BN_generate_prime - end - } - else - OpenSSL::PKey::RSA.new(bits) - end - cert = OpenSSL::X509::Certificate.new - cert.version = 2 - cert.serial = 1 - name = (cn.kind_of? String) ? OpenSSL::X509::Name.parse(cn) - : OpenSSL::X509::Name.new(cn) - cert.subject = name - cert.issuer = name - cert.not_before = Time.now - cert.not_after = Time.now + (365*24*60*60) - cert.public_key = rsa.public_key - - ef = OpenSSL::X509::ExtensionFactory.new(nil,cert) - ef.issuer_certificate = cert - cert.extensions = [ - ef.create_extension("basicConstraints","CA:FALSE"), - ef.create_extension("keyUsage", "keyEncipherment, digitalSignature, keyAgreement, dataEncipherment"), - ef.create_extension("subjectKeyIdentifier", "hash"), - ef.create_extension("extendedKeyUsage", "serverAuth"), - ef.create_extension("nsComment", comment), - ] - aki = ef.create_extension("authorityKeyIdentifier", - "keyid:always,issuer:always") - cert.add_extension(aki) - cert.sign(rsa, "SHA256") - - return [ cert, rsa ] - end - module_function :create_self_signed_cert - end - - ## - #-- - # Updates WEBrick::GenericServer with SSL functionality - - class GenericServer - - ## - # SSL context for the server when run in SSL mode - - def ssl_context # :nodoc: - @ssl_context ||= begin - if @config[:SSLEnable] - ssl_context = setup_ssl_context(@config) - @logger.info("\n" + @config[:SSLCertificate].to_text) - ssl_context - end - end - end - - undef listen - - ## - # Updates +listen+ to enable SSL when the SSL configuration is active. - - def listen(address, port) # :nodoc: - listeners = Utils::create_listeners(address, port) - if @config[:SSLEnable] - listeners.collect!{|svr| - ssvr = ::OpenSSL::SSL::SSLServer.new(svr, ssl_context) - ssvr.start_immediately = @config[:SSLStartImmediately] - ssvr - } - end - @listeners += listeners - setup_shutdown_pipe - end - - ## - # Sets up an SSL context for +config+ - - def setup_ssl_context(config) # :nodoc: - unless config[:SSLCertificate] - cn = config[:SSLCertName] - comment = config[:SSLCertComment] - cert, key = Utils::create_self_signed_cert(2048, cn, comment) - config[:SSLCertificate] = cert - config[:SSLPrivateKey] = key - end - ctx = OpenSSL::SSL::SSLContext.new - ctx.key = config[:SSLPrivateKey] - ctx.cert = config[:SSLCertificate] - ctx.client_ca = config[:SSLClientCA] - ctx.extra_chain_cert = config[:SSLExtraChainCert] - ctx.ca_file = config[:SSLCACertificateFile] - ctx.ca_path = config[:SSLCACertificatePath] - ctx.cert_store = config[:SSLCertificateStore] - ctx.tmp_dh_callback = config[:SSLTmpDhCallback] - ctx.verify_mode = config[:SSLVerifyClient] - ctx.verify_depth = config[:SSLVerifyDepth] - ctx.verify_callback = config[:SSLVerifyCallback] - ctx.servername_cb = config[:SSLServerNameCallback] || proc { |args| ssl_servername_callback(*args) } - ctx.timeout = config[:SSLTimeout] - ctx.options = config[:SSLOptions] - ctx.ciphers = config[:SSLCiphers] - ctx - end - - ## - # ServerNameIndication callback - - def ssl_servername_callback(sslsocket, hostname = nil) - # default - end - - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/utils.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/utils.rb deleted file mode 100644 index e4902d0bd9..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/utils.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true -# -# utils.rb -- Miscellaneous utilities -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou -# Copyright (c) 2002 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: utils.rb,v 1.10 2003/02/16 22:22:54 gotoyuzo Exp $ - -require 'socket' -require 'io/nonblock' -require 'etc' - -module WEBrick - module Utils - ## - # Sets IO operations on +io+ to be non-blocking - def set_non_blocking(io) - io.nonblock = true if io.respond_to?(:nonblock=) - end - module_function :set_non_blocking - - ## - # Sets the close on exec flag for +io+ - def set_close_on_exec(io) - io.close_on_exec = true if io.respond_to?(:close_on_exec=) - end - module_function :set_close_on_exec - - ## - # Changes the process's uid and gid to the ones of +user+ - def su(user) - if pw = Etc.getpwnam(user) - Process::initgroups(user, pw.gid) - Process::Sys::setgid(pw.gid) - Process::Sys::setuid(pw.uid) - else - warn("WEBrick::Utils::su doesn't work on this platform", uplevel: 1) - end - end - module_function :su - - ## - # The server hostname - def getservername - Socket::gethostname - end - module_function :getservername - - ## - # Creates TCP server sockets bound to +address+:+port+ and returns them. - # - # It will create IPV4 and IPV6 sockets on all interfaces. - def create_listeners(address, port) - unless port - raise ArgumentError, "must specify port" - end - sockets = Socket.tcp_server_sockets(address, port) - sockets = sockets.map {|s| - s.autoclose = false - ts = TCPServer.for_fd(s.fileno) - s.close - ts - } - return sockets - end - module_function :create_listeners - - ## - # Characters used to generate random strings - RAND_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + - "0123456789" + - "abcdefghijklmnopqrstuvwxyz" - - ## - # Generates a random string of length +len+ - def random_string(len) - rand_max = RAND_CHARS.bytesize - ret = +"" - len.times{ ret << RAND_CHARS[rand(rand_max)] } - ret - end - module_function :random_string - - ########### - - require "timeout" - require "singleton" - - ## - # Class used to manage timeout handlers across multiple threads. - # - # Timeout handlers should be managed by using the class methods which are - # synchronized. - # - # id = TimeoutHandler.register(10, Timeout::Error) - # begin - # sleep 20 - # puts 'foo' - # ensure - # TimeoutHandler.cancel(id) - # end - # - # will raise Timeout::Error - # - # id = TimeoutHandler.register(10, Timeout::Error) - # begin - # sleep 5 - # puts 'foo' - # ensure - # TimeoutHandler.cancel(id) - # end - # - # will print 'foo' - # - class TimeoutHandler - include Singleton - - ## - # Mutex used to synchronize access across threads - TimeoutMutex = Thread::Mutex.new # :nodoc: - - ## - # Registers a new timeout handler - # - # +time+:: Timeout in seconds - # +exception+:: Exception to raise when timeout elapsed - def TimeoutHandler.register(seconds, exception) - at = Process.clock_gettime(Process::CLOCK_MONOTONIC) + seconds - instance.register(Thread.current, at, exception) - end - - ## - # Cancels the timeout handler +id+ - def TimeoutHandler.cancel(id) - instance.cancel(Thread.current, id) - end - - def self.terminate - instance.terminate - end - - ## - # Creates a new TimeoutHandler. You should use ::register and ::cancel - # instead of creating the timeout handler directly. - def initialize - TimeoutMutex.synchronize{ - @timeout_info = Hash.new - } - @queue = Thread::Queue.new - @watcher = nil - end - - # :nodoc: - private \ - def watch - to_interrupt = [] - while true - now = Process.clock_gettime(Process::CLOCK_MONOTONIC) - wakeup = nil - to_interrupt.clear - TimeoutMutex.synchronize{ - @timeout_info.each {|thread, ary| - next unless ary - ary.each{|info| - time, exception = *info - if time < now - to_interrupt.push [thread, info.object_id, exception] - elsif !wakeup || time < wakeup - wakeup = time - end - } - } - } - to_interrupt.each {|arg| interrupt(*arg)} - if !wakeup - @queue.pop - elsif (wakeup -= now) > 0 - begin - (th = Thread.start {@queue.pop}).join(wakeup) - ensure - th&.kill&.join - end - end - @queue.clear - end - end - - # :nodoc: - private \ - def watcher - (w = @watcher)&.alive? and return w # usual case - TimeoutMutex.synchronize{ - (w = @watcher)&.alive? and next w # pathological check - @watcher = Thread.start(&method(:watch)) - } - end - - ## - # Interrupts the timeout handler +id+ and raises +exception+ - def interrupt(thread, id, exception) - if cancel(thread, id) && thread.alive? - thread.raise(exception, "execution timeout") - end - end - - ## - # Registers a new timeout handler - # - # +time+:: Timeout in seconds - # +exception+:: Exception to raise when timeout elapsed - def register(thread, time, exception) - info = nil - TimeoutMutex.synchronize{ - (@timeout_info[thread] ||= []) << (info = [time, exception]) - } - @queue.push nil - watcher - return info.object_id - end - - ## - # Cancels the timeout handler +id+ - def cancel(thread, id) - TimeoutMutex.synchronize{ - if ary = @timeout_info[thread] - ary.delete_if{|info| info.object_id == id } - if ary.empty? - @timeout_info.delete(thread) - end - return true - end - return false - } - end - - ## - def terminate - TimeoutMutex.synchronize{ - @timeout_info.clear - @watcher&.kill&.join - } - end - end - - ## - # Executes the passed block and raises +exception+ if execution takes more - # than +seconds+. - # - # If +seconds+ is zero or nil, simply executes the block - def timeout(seconds, exception=Timeout::Error) - return yield if seconds.nil? or seconds.zero? - # raise ThreadError, "timeout within critical session" if Thread.critical - id = TimeoutHandler.register(seconds, exception) - begin - yield(seconds) - ensure - TimeoutHandler.cancel(id) - end - end - module_function :timeout - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/version.rb deleted file mode 100644 index ceeefc33f9..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib/webrick/version.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true -#-- -# version.rb -- version and release date -# -# Author: IPR -- Internet Programming with Ruby -- writers -# Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU -# Copyright (c) 2003 Internet Programming with Ruby writers. All rights -# reserved. -# -# $IPR: version.rb,v 1.74 2003/07/22 19:20:43 gotoyuzo Exp $ - -module WEBrick - - ## - # The WEBrick version - - VERSION = "1.8.1" -end diff --git a/Library/Homebrew/vendor/gems/mechanize b/Library/Homebrew/vendor/gems/mechanize new file mode 120000 index 0000000000..5bcf45c9e8 --- /dev/null +++ b/Library/Homebrew/vendor/gems/mechanize @@ -0,0 +1 @@ +mechanize-2.9.1/ \ No newline at end of file diff --git a/Library/Homebrew/vendor/gems/mechanize-2.9.1/LICENSE.txt b/Library/Homebrew/vendor/gems/mechanize-2.9.1/LICENSE.txt new file mode 100644 index 0000000000..3a5074024a --- /dev/null +++ b/Library/Homebrew/vendor/gems/mechanize-2.9.1/LICENSE.txt @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2005 by Michael Neumann (mneumann@ntecs.de) + +Copyright (c) 2006-2021 by Eric Hodel, Akinori MUSHA, Aaron Patterson, Lee Jarvis, Mike Dalessio + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mechanize-2.9.0/lib/mechanize/http/content_disposition_parser.rb b/Library/Homebrew/vendor/gems/mechanize-2.9.1/lib/mechanize/http/content_disposition_parser.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mechanize-2.9.0/lib/mechanize/http/content_disposition_parser.rb rename to Library/Homebrew/vendor/gems/mechanize-2.9.1/lib/mechanize/http/content_disposition_parser.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mechanize-2.9.0/lib/mechanize/version.rb b/Library/Homebrew/vendor/gems/mechanize-2.9.1/lib/mechanize/version.rb similarity index 71% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mechanize-2.9.0/lib/mechanize/version.rb rename to Library/Homebrew/vendor/gems/mechanize-2.9.1/lib/mechanize/version.rb index 1fa6c7890d..db25d2abcb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mechanize-2.9.0/lib/mechanize/version.rb +++ b/Library/Homebrew/vendor/gems/mechanize-2.9.1/lib/mechanize/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true class Mechanize - VERSION = "2.9.0" + VERSION = "2.9.1" end diff --git a/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1 b/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1 new file mode 120000 index 0000000000..5bcf45c9e8 --- /dev/null +++ b/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1 @@ -0,0 +1 @@ +mechanize-2.9.1/ \ No newline at end of file diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 7b76ed791f..af12755d83 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -10,8 +10,6 @@ require "version/parser" # # @api private class Version - extend T::Sig - include Comparable sig { params(name: T.any(String, Symbol), full: T::Boolean).returns(Regexp) } @@ -21,7 +19,6 @@ class Version # A part of a {Version}. class Token - extend T::Sig extend T::Helpers abstract! @@ -105,8 +102,6 @@ class Version # A pseudo-token representing the absence of a token. class NullToken < Token - extend T::Sig - sig { override.returns(NilClass) } attr_reader :value @@ -174,7 +169,6 @@ class Version # A token consisting of only numbers. class NumericToken < Token PATTERN = /[0-9]+/i.freeze - extend T::Sig sig { override.returns(Integer) } attr_reader :value diff --git a/Library/Homebrew/version/head.rb b/Library/Homebrew/version/head.rb index 2607c91517..0edeb47470 100644 --- a/Library/Homebrew/version/head.rb +++ b/Library/Homebrew/version/head.rb @@ -7,8 +7,6 @@ class Version # # @api private class HeadVersion < Version - extend T::Sig - sig { returns(T.nilable(String)) } attr_reader :commit diff --git a/Library/Homebrew/version/null.rb b/Library/Homebrew/version/null.rb index b27e0074df..80fa6f686c 100644 --- a/Library/Homebrew/version/null.rb +++ b/Library/Homebrew/version/null.rb @@ -8,8 +8,6 @@ class Version # # @api private class NullVersion < Version - extend T::Sig - include Comparable include Singleton diff --git a/Library/Homebrew/version/parser.rb b/Library/Homebrew/version/parser.rb index c5127dd99e..d8cf50d9b8 100644 --- a/Library/Homebrew/version/parser.rb +++ b/Library/Homebrew/version/parser.rb @@ -4,7 +4,6 @@ class Version # @api private class Parser - extend T::Sig extend T::Helpers abstract! @@ -14,7 +13,6 @@ class Version # @api private class RegexParser < Parser - extend T::Sig extend T::Helpers abstract! @@ -43,8 +41,6 @@ class Version # @api private class UrlParser < RegexParser - extend T::Sig - sig { override.params(spec: Pathname).returns(String) } def self.process_spec(spec) spec.to_s @@ -53,8 +49,6 @@ class Version # @api private class StemParser < RegexParser - extend T::Sig - SOURCEFORGE_DOWNLOAD_REGEX = %r{(?:sourceforge\.net|sf\.net)/.*/download$}.freeze NO_FILE_EXTENSION_REGEX = /\.[^a-zA-Z]+$/.freeze diff --git a/Library/Homebrew/warnings.rb b/Library/Homebrew/warnings.rb index f0a3ed116f..28387659a8 100644 --- a/Library/Homebrew/warnings.rb +++ b/Library/Homebrew/warnings.rb @@ -7,8 +7,6 @@ require "warning" # # @api private module Warnings - module_function - COMMON_WARNINGS = { parser_syntax: [ %r{warning: parser/current is loading parser/ruby\d+, which recognizes}, @@ -17,7 +15,7 @@ module Warnings ], }.freeze - def ignore(*warnings) + def self.ignore(*warnings) warnings.map! do |warning| next warning if !warning.is_a?(Symbol) || !COMMON_WARNINGS.key?(warning) diff --git a/Library/Homebrew/warnings.rbi b/Library/Homebrew/warnings.rbi deleted file mode 100644 index 5d83b4cc35..0000000000 --- a/Library/Homebrew/warnings.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module Warnings - include Kernel -end diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 22f10bacd3..1388c64ac6 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -117,11 +117,11 @@ function __fish_brew_suggest_casks_all -d "Lists locally available casks" end function __fish_brew_suggest_casks_installed -d "Lists installed casks" - command ls -1 (brew --caskroom) + command ls -1 (brew --caskroom) 2>/dev/null end function __fish_brew_suggest_casks_outdated -d "Lists outdated casks with the information about potential upgrade" - brew outdated --cask --verbose \ + brew outdated --cask --verbose 2>/dev/null \ # replace first space with tab to make the following a description in the completions list: | string replace -r '\s' '\t' end @@ -1147,7 +1147,7 @@ __fish_brew_complete_arg 'pr-automerge' -l tap -d 'Target tap repository (defaul __fish_brew_complete_arg 'pr-automerge' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'pr-automerge' -l with-label -d 'Pull requests must have this label' __fish_brew_complete_arg 'pr-automerge' -l without-approval -d 'Pull requests do not require approval to be merged' -__fish_brew_complete_arg 'pr-automerge' -l without-labels -d 'Pull requests must not have these labels (default: `do not merge`, `new formula`, `automerge-skip`, `CI-published-bottle-commits`)' +__fish_brew_complete_arg 'pr-automerge' -l without-labels -d 'Pull requests must not have these labels (default: `do not merge`, `new formula`, `automerge-skip`, `pre-release`, `CI-published-bottle-commits`)' __fish_brew_complete_arg 'pr-automerge' -l workflow -d 'Workflow file to use with `brew pr-publish`' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index c4a5657009..0839997dab 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -1422,7 +1422,7 @@ _brew_pr_automerge() { '--verbose[Make some output more verbose]' \ '--with-label[Pull requests must have this label]' \ '--without-approval[Pull requests do not require approval to be merged]' \ - '--without-labels[Pull requests must not have these labels (default: `do not merge`, `new formula`, `automerge-skip`, `CI-published-bottle-commits`)]' \ + '--without-labels[Pull requests must not have these labels (default: `do not merge`, `new formula`, `automerge-skip`, `pre-release`, `CI-published-bottle-commits`)]' \ '--workflow[Workflow file to use with `brew pr-publish`]' } diff --git a/docs/Cask-Cookbook.md b/docs/Cask-Cookbook.md index ffc1fdacf8..51ea27192d 100644 --- a/docs/Cask-Cookbook.md +++ b/docs/Cask-Cookbook.md @@ -118,7 +118,6 @@ Having a common order for stanzas makes casks easier to update and parse. Below language url - appcast name desc homepage @@ -219,11 +218,10 @@ Each cask must declare one or more *artifacts* (i.e. something to install). | ------------------------------------------ | :---------------------------: | ----- | | [`uninstall`](#stanza-uninstall) | yes | Procedures to uninstall a cask. Optional unless the `pkg` stanza is used. | [`zap`](#stanza-zap) | yes | Additional procedures for a more complete uninstall, including user files and shared resources. -| [`appcast`](#stanza-appcast) | no | URL providing an appcast feed to find updates for this cask. | [`depends_on`](#stanza-depends_on) | yes | List of dependencies and requirements for this cask. | [`conflicts_with`](#stanza-conflicts_with) | yes | List of conflicts with this cask (*not yet functional*). | [`caveats`](#stanza-caveats) | yes | String or Ruby block providing the user with cask-specific information at install time. -| [`livecheck`](#stanza-livecheck) | no | Ruby block describing how to find updates for this cask. +| [`livecheck`](#stanza-livecheck) | no | Ruby block describing how to find updates for this cask. Supersedes `appcast`. | `preflight` | yes | Ruby block containing preflight install operations (needed only in very rare cases). | [`postflight`](#stanza-flight) | yes | Ruby block containing postflight install operations. | `uninstall_preflight` | yes | Ruby block containing preflight uninstall operations (needed only in very rare cases). @@ -273,42 +271,6 @@ The `target:` key works similarly for most cask artifacts, such as `app`, `binar Don’t use `target:` for aesthetic reasons, like removing version numbers (`app "Slack #{version}.app", target: "Slack.app"`). Use it when it makes sense functionally and document your reason clearly in the cask, using one of the templates: [for clarity](https://github.com/Homebrew/homebrew-cask/blob/0661430a4b0143671459260e5c8affc2f8e50413/Casks/imagemin.rb#L10); [for consistency](https://github.com/Homebrew/homebrew-cask/blob/8be96e3658ff7ab66ca40723c3018fc5e35e3735/Casks/x-moto.rb#L16); [to prevent conflicts](https://github.com/Homebrew/homebrew-cask/blob/f34503e7b5f5d018a65f4c726e1c57e15b8111ae/Casks/telegram-desktop.rb#L20); [due to developer suggestion](https://github.com/Homebrew/homebrew-cask/blob/ff3e9c4a6623af44b8a071027e8dcf3f4edfc6d9/Casks/kivy.rb#L12). -### Stanza: `appcast` - -The value of the `appcast` stanza is a string, holding the URL for an appcast which provides information on future updates. - -**Note:** The [`livecheck` stanza](#stanza-livecheck) is usually preferred, as it allows casks to be updated automatically. - -The main [homebrew/cask](https://github.com/Homebrew/homebrew-cask) repository only accepts submissions for stable versions of software (and [documented exceptions](https://docs.brew.sh/Acceptable-Casks#but-there-is-no-stable-version)), but it still gets pull requests for unstable versions. By checking the submitted `version` against the contents of an appcast, we can better detect these invalid cases. - -There are a few different ways the `appcast` can be determined: - -* If the app is distributed via GitHub releases, the `appcast` will be of the form `https://github.com///releases.atom`. Example: [electron.rb](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/electron.rb#L7) - -* If the app is distributed via GitLab releases, the `appcast` will be of the form `https://gitlab.com///-/tags?format=atom`. Example: [grafx.rb](https://github.com/Homebrew/homebrew-cask/blob/b22381902f9da870bb07d21b496558f283dad612/Casks/grafx.rb#L6) - -* The popular update framework [Sparkle](https://sparkle-project.org/) generally uses the `SUFeedURL` property in `Contents/Info.plist` inside `.app` bundles. Example: [fstream.rb](https://github.com/Homebrew/homebrew-cask/blob/519999d874792f3ad7cc0fffd0520a8fdf468880/Casks/fstream.rb#L6) - -* SourceForge projects follow the form `https://sourceforge.net/projects//rss`. A more specific page can be used as needed, pointing to a specific directory structure: `https://sourceforge.net/projects//rss?path=/path/here`. Example: [displaycal.rb](https://github.com/Homebrew/homebrew-cask/blob/347dc92405889488ea72c47f7d50b1afaf348909/Casks/displaycal.rb#L7) - -* An appcast can be any URL hosted by the app’s developer that changes every time a new release is out or that contains the version number of the current release (e.g. a download HTML page). Webpages that only change on new version releases are preferred, as are sites that do not contain previous version strings (i.e. avoid changelog pages if the download page contains the current version number but not older ones). Example: [securityspy.rb](https://github.com/Homebrew/homebrew-cask/blob/e3495e32b7fb3ed1929b6082a4e3eb6a94d9494f/Casks/securityspy.rb#L6) - -The [`find-appcast`](https://github.com/Homebrew/homebrew-cask/blob/HEAD/developer/bin/find-appcast) script is able to identify some of these, as well as `electron-builder` appcasts which are trickier to find by hand. Run it with: - -```bash -"$(brew --repository homebrew/cask)/developer/bin/find-appcast" '/path/to/application.app' -``` - -#### `appcast` Parameters - -| key | value | -| --------------- | ----------- | -| `must_contain:` | Custom string for `brew audit --appcast ` to check against. (Example: [icollections.rb](https://github.com/Homebrew/homebrew-cask/blob/705ed8ddc23a0e7719348dfb278046f031495938/Casks/icollections.rb#L6-L7)) - -Sometimes a `version` doesn’t match a string on the webpage, in which case we tweak what to search for. For example, if `version` is `6.26.1440` and the appcast’s contents only show `6.24`, the check for “is `version` in the appcast feed” will fail. With `must_contain`, the check is told to “look for this string instead of `version`”. In the example, `must_contain: version.major_minor` is saying “look for `6.24`”, making the check succeed. - -If no `must_contain` is given, the check considers from the beginning of the `version` string until the first character that isn’t alphanumeric or a period. For example, if `version` is `6.26b-14,40`, the check will look for `6.26b`. This is so it covers most cases by default, while still allowing complex `version`s suitable for interpolation in the rest of the cask. - ### Stanza: `binary` In the simple case of a string argument to `binary`, the source file is linked into the `$(brew --prefix)/bin` directory on installation. For example (from [operadriver.rb](https://github.com/Homebrew/homebrew-cask/blob/8145c76101534aabcfc419488578455e636d6330/Casks/operadriver.rb#L15)): @@ -701,7 +663,7 @@ brew install firefox --language=it ### Stanza: `livecheck` -The `livecheck` stanza is used to automatically fetch the latest version of a cask from changelogs, release notes, appcasts, etc. See also: [`brew livecheck` reference](Brew-Livecheck.md) +The `livecheck` stanza is used to automatically fetch the latest version of a cask from changelogs, release notes, appcasts, etc. Since the main [homebrew/cask](https://github.com/Homebrew/homebrew-cask) repository only accepts submissions for stable versions of software (and [documented exceptions](https://docs.brew.sh/Acceptable-Casks#but-there-is-no-stable-version)), this allows for verifying that the submitted version is the latest, and alerting when a newer version is available using [`brew livecheck`](Brew-Livecheck.md). Every `livecheck` block must contain a `url`, which can be either a string or a symbol pointing to other URLs in the cask (`:url` or `:homepage`). @@ -734,7 +696,7 @@ livecheck do end ``` -The `header_match` strategy will try to parse a version from the filename (in the `Content-Disposition` header) and the final URL (in the `Location` header). If that doesn't work, a `regex` can be specified, e.g.: +The `:header_match` strategy will try to parse a version from the filename (in the `Content-Disposition` header) and the final URL (in the `Location` header). If that doesn't work, a `regex` can be specified, e.g.: ```ruby strategy :header_match @@ -764,6 +726,21 @@ strategy :page_match do |page| end ``` +The `:sparkle` strategy takes a URL for an XML feed providing release information to an app that self-updates using the Sparkle framework. This URL can be found within the app bundle as the `SUFeedURL` property in `Contents/Info.plist` or by using the [`find-appcast`](https://github.com/Homebrew/homebrew-cask/blob/HEAD/developer/bin/find-appcast) script. Run it with: + +```bash +"$(brew --repository homebrew/cask)/developer/bin/find-appcast" '/path/to/application.app' +``` + +Both the `sparkle:version` and `sparkle:shortVersionString` attributes are checked by default; if only one is needed, specify `&:version` or `&:short_version`: + +```ruby +url "https://manytricks.com/butler/appcast/" +strategy :sparkle, &:short_version +``` + +If no means are available online for checking which version is current, as a last resort the `:extract_plist` strategy will have `brew livecheck` download the artifact and retrieve its version string from `Contents/Info.plist`. + ### Stanza: `name` `name` accepts a UTF-8 string defining the name of the software, including capitalization and punctuation. It is used to help with searchability and disambiguation. @@ -1118,7 +1095,7 @@ When the domains of `url` and `homepage` differ, the discrepancy should be docum This must be added so a user auditing the cask knows the URL was verified by the Homebrew Cask team as the one provided by the vendor, even though it may look unofficial. It is our responsibility as Homebrew Cask maintainers to verify both the `url` and `homepage` information when first added (or subsequently modified, apart from versioning). -The parameter doesn’t mean you should trust the source blindly, but we only approve casks in which users can easily verify its authenticity with basic means, such as checking the official homepage or public repository. Occasionally, slightly more elaborate techniques may be used, such as inspecting an [`appcast`](#stanza-appcast) we established as official. Cases where such quick verifications aren’t possible (e.g. when the download URL is behind a registration wall) are [treated in a stricter manner](https://docs.brew.sh/Acceptable-Casks#unofficial-vendorless-and-walled-builds). +The parameter doesn’t mean you should trust the source blindly, but we only approve casks in which users can easily verify its authenticity with basic means, such as checking the official homepage or public repository. Occasionally, slightly more elaborate techniques may be used, such as inspecting a [`livecheck`](#stanza-livecheck) URL we established as official. Cases where such quick verifications aren’t possible (e.g. when the download URL is behind a registration wall) are [treated in a stricter manner](https://docs.brew.sh/Acceptable-Casks#unofficial-vendorless-and-walled-builds). #### Difficulty Finding a URL diff --git a/docs/Manpage.md b/docs/Manpage.md index 0a6d77456b..380b157e96 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1323,7 +1323,7 @@ Find pull requests that can be automatically merged using `brew pr-publish`. * `--with-label`: Pull requests must have this label. * `--without-labels`: - Pull requests must not have these labels (default: `do not merge`, `new formula`, `automerge-skip`, `CI-published-bottle-commits`). + Pull requests must not have these labels (default: `do not merge`, `new formula`, `automerge-skip`, `pre-release`, `CI-published-bottle-commits`). * `--without-approval`: Pull requests do not require approval to be merged. * `--publish`: diff --git a/docs/Typechecking.md b/docs/Typechecking.md index e2f0a408a8..f11dce7ef5 100644 --- a/docs/Typechecking.md +++ b/docs/Typechecking.md @@ -8,7 +8,7 @@ The [Sorbet Documentation] is a good place to get started if you want to dive de ### Inline Type Annotations -To add type annotations to a class or module, we extend it with the `T::Sig` module (read this as `Type::Signature`). This adds the `sig` method which is used to annotate method signatures. Here's a simple example: +The `sig` method is used to annotate method signatures. Here's a simple example: ```ruby class MyClass diff --git a/manpages/brew.1 b/manpages/brew.1 index a884e3db51..084df9013a 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1886,7 +1886,7 @@ Pull requests must have this label\. . .TP \fB\-\-without\-labels\fR -Pull requests must not have these labels (default: \fBdo not merge\fR, \fBnew formula\fR, \fBautomerge\-skip\fR, \fBCI\-published\-bottle\-commits\fR)\. +Pull requests must not have these labels (default: \fBdo not merge\fR, \fBnew formula\fR, \fBautomerge\-skip\fR, \fBpre\-release\fR, \fBCI\-published\-bottle\-commits\fR)\. . .TP \fB\-\-without\-approval\fR