diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..03929c08f5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +Library/Homebrew/vendor/portable-ruby +Library/Taps diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..c804e66553 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,56 @@ +name: Docker +on: + pull_request: + paths: + - .github/workflows/docker.yml + - Dockerfile + release: + types: + - published +jobs: + ubuntu: + runs-on: ubuntu-latest + strategy: + matrix: + version: ["16.04", "18.04", "20.04"] + steps: + - name: Checkout + uses: actions/checkout@master + with: + fetch-depth: 0 + persist-credentials: false + - name: Fetch origin/master from Git + run: git fetch origin master + - name: Build Docker image + run: docker build -t brew --build-arg=version=${{matrix.version}} . + - name: Run brew test-bot + run: docker run --rm brew brew test-bot + - name: Deploy the tagged Docker image to GitHub + if: startsWith(github.ref, 'refs/tags/') + run: | + brew_version=${GITHUB_REF:10} + echo "::set-env name=brew_version::$brew_version" + docker login docker.pkg.github.com -u BrewTestBot -p ${{secrets.GITHUB_TOKEN}} + docker tag brew "docker.pkg.github.com/homebrew/brew/ubuntu${{matrix.version}}:$brew_version" + docker push "docker.pkg.github.com/homebrew/brew/ubuntu${{matrix.version}}:$brew_version" + docker tag brew "docker.pkg.github.com/homebrew/brew/ubuntu${{matrix.version}}:latest" + docker push "docker.pkg.github.com/homebrew/brew/ubuntu${{matrix.version}}:latest" + - name: Deploy the tagged Docker image to Docker Hub + if: startsWith(github.ref, 'refs/tags/') + run: | + docker login -u brewtestbot -p ${{secrets.DOCKER_TOKEN}} + docker tag brew "homebrew/ubuntu${{matrix.version}}:$brew_version" + docker push "homebrew/ubuntu${{matrix.version}}:$brew_version" + docker tag brew "homebrew/ubuntu${{matrix.version}}:latest" + docker push "homebrew/ubuntu${{matrix.version}}:latest" + - name: Deploy the homebrew/brew Docker image to GitHub and Docker Hub + if: startsWith(github.ref, 'refs/tags/') && matrix.version == '20.04' + run: | + docker tag brew "docker.pkg.github.com/homebrew/brew/brew:$brew_version" + docker push "docker.pkg.github.com/homebrew/brew/brew:$brew_version" + docker tag brew "docker.pkg.github.com/homebrew/brew/brew:latest" + docker push "docker.pkg.github.com/homebrew/brew/brew:latest" + docker tag brew "homebrew/brew:$brew_version" + docker push "homebrew/brew:$brew_version" + docker tag brew "homebrew/brew:latest" + docker push "homebrew/brew:latest" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d145771145..8b273bede7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,9 +3,9 @@ on: push: branches: master pull_request: [] - release: - types: - - published +env: + HOMEBREW_GITHUB_ACTIONS: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 jobs: tests: if: github.repository == 'Homebrew/brew' @@ -18,7 +18,8 @@ jobs: id: set-up-homebrew run: | if which brew &>/dev/null; then - HOMEBREW_REPOSITORY="$(brew --repo)" + HOMEBREW_PREFIX="$(brew --prefix)" + HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew" else HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew" @@ -30,11 +31,11 @@ jobs: sudo mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar sudo ln -sf ../Homebrew/bin/brew "$HOMEBREW_PREFIX/bin/" cd - - - export PATH="$HOMEBREW_PREFIX/bin:$PATH" - echo "::add-path::$HOMEBREW_PREFIX/bin" fi + export PATH="$HOMEBREW_PREFIX/bin:$PATH" + echo "::add-path::$HOMEBREW_PREFIX/bin" + cd "$HOMEBREW_REPOSITORY" rm -rf "$GITHUB_WORKSPACE" ln -s "$HOMEBREW_REPOSITORY" "$GITHUB_WORKSPACE" @@ -65,11 +66,11 @@ jobs: # Cleanup some Linux `brew doctor` failures sudo rm -rf /usr/local/include/node/ else - # Allow Xcode to be outdated - export HOMEBREW_GITHUB_ACTIONS=1 - # Link old gettext (otherwise `brew doctor` is sad) brew link gettext + + # remove deleted formula + brew uninstall --force python@2 fi brew doctor @@ -92,7 +93,6 @@ jobs: - name: Install taps run: | # Install taps needed for 'brew tests' and 'brew man' - export HOMEBREW_NO_AUTO_UPDATE=1 cd "$(brew --repo)" brew tap homebrew/bundle brew update-reset Library/Taps/homebrew/homebrew-bundle @@ -136,7 +136,6 @@ jobs: HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} # set variables for coverage reporting - HOMEBREW_GITHUB_ACTIONS: 1 HOMEBREW_CI_NAME: github-actions HOMEBREW_COVERALLS_REPO_TOKEN: 3F6U6ZqctoNJwKyREremsqMgpU3qYgxFk @@ -174,30 +173,22 @@ jobs: - name: Build Docker image if: matrix.os == 'ubuntu-latest' - run: | - docker pull homebrew/brew - docker-compose -f Dockerfile.yml build sut + run: docker build -t brew --build-arg=version=16.04 . - name: Run brew test-bot run: | if [ "$RUNNER_OS" = "Linux" ]; then - docker-compose -f Dockerfile.yml run --rm -v $GITHUB_WORKSPACE:/tmp/test-bot sut - docker tag homebrew_sut brew + docker run --rm brew brew test-bot else brew test-bot fi - - name: Deploy the latest Docker image + - name: Deploy the Docker image to GitHub and Docker Hub if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/master' run: | docker login docker.pkg.github.com -u BrewTestBot -p ${{secrets.GITHUB_TOKEN}} - docker tag brew docker.pkg.github.com/homebrew/brew/brew - docker push docker.pkg.github.com/homebrew/brew/brew - - - name: Deploy the tagged Docker image - if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') - run: | - docker login docker.pkg.github.com -u BrewTestBot -p ${{secrets.GITHUB_TOKEN}} - v=${GITHUB_REF:10} - docker tag brew "docker.pkg.github.com/homebrew/brew/brew:$v" - docker push "docker.pkg.github.com/homebrew/brew/brew:$v" + docker tag brew "docker.pkg.github.com/homebrew/brew/ubuntu16.04:master" + docker push "docker.pkg.github.com/homebrew/brew/ubuntu16.04:master" + docker login -u brewtestbot -p ${{secrets.DOCKER_TOKEN}} + docker tag brew "homebrew/ubuntu16.04:master" + docker push "homebrew/ubuntu16.04:master" diff --git a/.gitignore b/.gitignore index 94bfb9b2c9..51706fa962 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ /Library/Homebrew/vendor/portable-ruby /Library/Taps /Library/PinnedTaps +/Library/Homebrew/.byebug_history # Ignore Bundler files **/.bundle/bin @@ -119,6 +120,7 @@ **/vendor/bundle/ruby/*/gems/rspec-support-*/ **/vendor/bundle/ruby/*/gems/rspec-wait-*/ **/vendor/bundle/ruby/*/gems/rubocop-0*/ +**/vendor/bundle/ruby/*/gems/rubocop-ast-*/ **/vendor/bundle/ruby/*/gems/ruby-prof-*/ **/vendor/bundle/ruby/*/gems/ruby-progressbar-*/ **/vendor/bundle/ruby/*/gems/simplecov-*/ @@ -131,6 +133,7 @@ **/vendor/bundle/ruby/*/gems/unf-*/ **/vendor/bundle/ruby/*/gems/unicode-display_width-*/ **/vendor/bundle/ruby/*/gems/webrobots-*/ +**/vendor/bundle/ruby/*/gems/byebug-*/ # Ignore `bin` contents (again). /bin @@ -151,6 +154,7 @@ /docs/vendor # Unignore our root-level metadata files. +!/.dockerignore !/.editorconfig !/.gitignore !/.yardopts diff --git a/Dockerfile b/Dockerfile index 5fdf78e43c..3027de1af0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -FROM ubuntu:xenial -LABEL maintainer="Shaun Jackman " +ARG version=20.04 +FROM ubuntu:$version +ARG DEBIAN_FRONTEND=noninteractive # hadolint ignore=DL3008 RUN apt-get update \ @@ -14,6 +15,7 @@ RUN apt-get update \ fonts-dejavu-core \ g++ \ git \ + less \ libz-dev \ locales \ make \ @@ -23,29 +25,23 @@ RUN apt-get update \ sudo \ uuid-runtime \ tzdata \ - && rm -rf /var/lib/apt/lists/* - -RUN localedef -i en_US -f UTF-8 en_US.UTF-8 \ + && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -f UTF-8 en_US.UTF-8 \ && useradd -m -s /bin/bash linuxbrew \ && echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers + COPY . /home/linuxbrew/.linuxbrew/Homebrew -ARG FORCE_REBUILD +ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH +WORKDIR /home/linuxbrew # hadolint ignore=DL3003 RUN cd /home/linuxbrew/.linuxbrew \ && mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar \ && ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/ \ - && cd /home/linuxbrew/.linuxbrew/Homebrew \ - && git remote set-url origin https://github.com/Homebrew/brew - -WORKDIR /home/linuxbrew -ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH \ - SHELL=/bin/bash - -# Install portable-ruby, tap homebrew/core, install audit gems, and cleanup -RUN HOMEBREW_NO_ANALYTICS=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/core \ - && chown -R linuxbrew: /home/linuxbrew/.linuxbrew \ - && chmod -R g+w,o-w /home/linuxbrew/.linuxbrew \ - && rm -rf ~/.cache \ + && git -C /home/linuxbrew/.linuxbrew/Homebrew remote set-url origin https://github.com/Homebrew/brew \ + && HOMEBREW_NO_ANALYTICS=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/core \ && brew install-bundler-gems \ - && brew cleanup + && brew cleanup \ + && rm -rf ~/.cache \ + && chown -R linuxbrew: /home/linuxbrew/.linuxbrew \ + && chmod -R g+w,o-w /home/linuxbrew/.linuxbrew diff --git a/Dockerfile.yml b/Dockerfile.yml deleted file mode 100644 index ac02ce9147..0000000000 --- a/Dockerfile.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3.7' - -services: - sut: - build: - context: . - cache_from: - - homebrew/brew - args: - - FORCE_REBUILD=1 - command: - - sh - - -xc - - | - /home/linuxbrew/.linuxbrew/bin/brew test-bot - status=$$? - exit $$status diff --git a/Library/.rubocop_rspec.yml b/Library/.rubocop_rspec.yml index e855cce1cc..cb607442c2 100644 --- a/Library/.rubocop_rspec.yml +++ b/Library/.rubocop_rspec.yml @@ -15,12 +15,14 @@ Style/DisableCopsWithinSourceCodeDirective: # Intentionally disabled as it doesn't fit with our code style. RSpec/AnyInstance: Enabled: false +RSpec/FilePath: + Enabled: false RSpec/ImplicitBlockExpectation: Enabled: false RSpec/SubjectStub: Enabled: false -# TODO: try to enable these (also requires fixing Homebrew/bundle) +# TODO: try to enable these RSpec/ContextWording: Enabled: false RSpec/DescribeClass: @@ -34,7 +36,7 @@ RSpec/RepeatedDescription: RSpec/RepeatedExampleGroupDescription: Enabled: false -# TODO: try to reduce these (also requires fixing Homebrew/bundle) +# TODO: try to reduce these RSpec/ExampleLength: Max: 75 RSpec/MultipleExpectations: diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index 223f857a05..bdb40a9b91 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -46,6 +46,8 @@ Metrics/AbcSize: Metrics/BlockLength: Enabled: true Max: 1100 + Exclude: + - 'test/formula_spec.rb' Metrics/BlockNesting: Enabled: true Max: 5 diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index 065dd6c83e..2c28f3de29 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -3,6 +3,7 @@ source "https://rubygems.org" # installed gems +gem "byebug" gem "coveralls", "~> 0.8", require: false gem "parallel_tests" gem "ronn", require: false diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index af02152058..d8f56dddaf 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -1,13 +1,14 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.2.2) + activesupport (6.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.2) + zeitwerk (~> 2.2, >= 2.2.2) ast (2.4.0) + byebug (11.1.3) concurrent-ruby (1.1.6) connection_pool (2.2.2) coveralls (0.8.23) @@ -25,7 +26,6 @@ GEM domain_name (~> 0.5) i18n (1.8.2) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.4) json (2.3.0) mechanize (2.7.6) domain_name (~> 0.5, >= 0.5.1) @@ -38,9 +38,9 @@ GEM webrobots (>= 0.0.9, < 0.2) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.0425) + mime-types-data (3.2020.0512) mini_portile2 (2.4.0) - minitest (5.14.0) + minitest (5.14.1) mustache (1.1.1) net-http-digest_auth (1.4.1) net-http-persistent (4.0.0) @@ -65,9 +65,9 @@ GEM rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.1) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-its (1.3.0) @@ -78,18 +78,20 @@ GEM rspec-support (~> 3.9.0) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.2) + rspec-support (3.9.3) rspec-wait (0.0.9) rspec (>= 3, < 4) - rubocop (0.82.0) - jaro_winkler (~> 1.5.1) + rubocop (0.84.0) parallel (~> 1.10) parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) rexml + rubocop-ast (>= 0.0.3) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-performance (1.5.2) + rubocop-ast (0.0.3) + parser (>= 2.7.0.1) + rubocop-performance (1.6.0) rubocop (>= 0.71.0) rubocop-rspec (1.39.0) rubocop (>= 0.68.1) @@ -105,7 +107,7 @@ GEM tins (~> 1.0) thor (1.0.1) thread_safe (0.3.6) - tins (1.24.1) + tins (1.25.0) sync tzinfo (1.2.7) thread_safe (~> 0.1) @@ -121,6 +123,7 @@ PLATFORMS DEPENDENCIES activesupport + byebug concurrent-ruby coveralls (~> 0.8) mechanize diff --git a/Library/Homebrew/bintray.rb b/Library/Homebrew/bintray.rb index 68c7e2d1cd..8d4a0ea154 100644 --- a/Library/Homebrew/bintray.rb +++ b/Library/Homebrew/bintray.rb @@ -106,12 +106,12 @@ class Bintray formula_packaged = {} bottles_hash.each do |formula_name, bottle_hash| - version = bottle_hash["formula"]["pkg_version"] + version = ERB::Util.url_encode(bottle_hash["formula"]["pkg_version"]) bintray_package = bottle_hash["bintray"]["package"] bintray_repo = bottle_hash["bintray"]["repository"] bottle_hash["bottle"]["tags"].each do |_tag, tag_hash| - filename = tag_hash["filename"] + filename = tag_hash["filename"] # URL encoded in Bottle::Filename#bintray sha256 = tag_hash["sha256"] odebug "Checking remote file #{@bintray_org}/#{bintray_repo}/#{filename}" @@ -132,7 +132,7 @@ class Bintray formula_packaged[formula_name] = true end - odebug "Uploading #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}/#{tag_hash["local_filename"]}" + odebug "Uploading #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}" upload(tag_hash["local_filename"], repo: bintray_repo, package: bintray_package, diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 3a43c7a1b4..092b68a802 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -93,6 +93,30 @@ case "$HOMEBREW_SYSTEM" in Linux) HOMEBREW_LINUX="1" ;; esac +if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" && + -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] && + "$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null +then + HOMEBREW_CURL="$HOMEBREW_PREFIX/opt/curl/bin/curl" +elif [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_CURL_PATH" ]] +then + HOMEBREW_CURL="$HOMEBREW_CURL_PATH" +else + HOMEBREW_CURL="curl" +fi + +if [[ -n "$HOMEBREW_FORCE_BREWED_GIT" && + -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]] && + "$HOMEBREW_PREFIX/opt/git/bin/git" --version >/dev/null +then + HOMEBREW_GIT="$HOMEBREW_PREFIX/opt/git/bin/git" +elif [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_GIT_PATH" ]] +then + HOMEBREW_GIT="$HOMEBREW_GIT_PATH" +else + HOMEBREW_GIT="git" +fi + if [[ -n "$HOMEBREW_MACOS" ]] then HOMEBREW_PROCESSOR="$(uname -p)" @@ -159,24 +183,44 @@ else # Ensure the system Curl is a version that supports modern HTTPS certificates. HOMEBREW_MINIMUM_CURL_VERSION="7.41.0" - system_curl_version_output="$($(command -v curl) --version 2>/dev/null)" - system_curl_name_and_version="${system_curl_version_output%% (*}" - if [[ $(numeric "${system_curl_name_and_version##* }") -lt $(numeric "$HOMEBREW_MINIMUM_CURL_VERSION") ]] + curl_version_output="$($HOMEBREW_CURL --version 2>/dev/null)" + curl_name_and_version="${curl_version_output%% (*}" + if [[ $(numeric "${curl_name_and_version##* }") -lt $(numeric "$HOMEBREW_MINIMUM_CURL_VERSION") ]] then - HOMEBREW_SYSTEM_CURL_TOO_OLD="1" - HOMEBREW_FORCE_BREWED_CURL="1" + if [[ -z $HOMEBREW_CURL_PATH ]]; then + HOMEBREW_SYSTEM_CURL_TOO_OLD=1 + HOMEBREW_FORCE_BREWED_CURL=1 + else + odie </dev/null -then - HOMEBREW_CURL="$HOMEBREW_PREFIX/opt/curl/bin/curl" -elif [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_CURL_PATH" ]] -then - HOMEBREW_CURL="$HOMEBREW_CURL_PATH" -else - HOMEBREW_CURL="curl" -fi - -if [[ -n "$HOMEBREW_FORCE_BREWED_GIT" && - -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]] && - "$HOMEBREW_PREFIX/opt/git/bin/git" --version >/dev/null -then - HOMEBREW_GIT="$HOMEBREW_PREFIX/opt/git/bin/git" -elif [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_GIT_PATH" ]] -then - HOMEBREW_GIT="$HOMEBREW_GIT_PATH" -else - HOMEBREW_GIT="git" -fi - HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)" curl_version_output="$("$HOMEBREW_CURL" --version 2>/dev/null)" curl_name_and_version="${curl_version_output%% (*}" diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 98ad387ce2..f9fd51a250 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -52,6 +52,8 @@ class Build Requirement.prune elsif req.prune_if_build_and_not_dependent?(dependent, formula) Requirement.prune + elsif req.test? + Requirement.prune end end end @@ -65,6 +67,8 @@ class Build Dependency.prune elsif dep.build? Dependency.keep_but_prune_recursive_deps + elsif dep.test? + Dependency.prune end end end @@ -114,7 +118,9 @@ class Build with_env(new_env) do formula.extend(Debrew::Formula) if ARGV.debug? - formula.brew do |_formula, staging| + formula.update_head_version + + formula.brew(fetch: false) do |_formula, staging| # For head builds, HOMEBREW_FORMULA_PREFIX should include the commit, # which is not known until after the formula has been staged. ENV["HOMEBREW_FORMULA_PREFIX"] = formula.prefix diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 32d958f069..e3f99669ca 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -89,7 +89,7 @@ module Cask args: ["list", service], sudo: with_sudo, print_stderr: false ).stdout - if plist_status.match?(/^\{/) + if plist_status.start_with?("{") command.run!("/bin/launchctl", args: ["remove", service], sudo: with_sudo) sleep 1 end diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index f81026ffa9..8e93128b32 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -145,7 +145,7 @@ module Cask command, args = detect_internal_command(*args) || detect_external_command(*args) || [NullCommand.new, args] if help? - puts command.help + Help.new(command.command_name).run else command.run(*args) end @@ -228,7 +228,7 @@ module Cask end def run(*) - exec @path, *ARGV[1..-1] + exec @path, *ARGV[1..] end end @@ -243,6 +243,10 @@ module Cask $stderr.puts $stderr.puts Help.usage end + + def help + run + end end end end diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index c6b988eb4d..1646ddb943 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -37,6 +37,7 @@ module Cask end attr_accessor :args + private :args= def initialize(*args) diff --git a/Library/Homebrew/cask/cmd/help.rb b/Library/Homebrew/cask/cmd/help.rb index 51b6ce7876..28db5331b7 100644 --- a/Library/Homebrew/cask/cmd/help.rb +++ b/Library/Homebrew/cask/cmd/help.rb @@ -3,17 +3,26 @@ module Cask class Cmd class Help < AbstractCommand - def initialize(*) - super - return if args.empty? - - raise ArgumentError, "#{self.class.command_name} does not take arguments." - end - def run - puts self.class.purpose - puts - puts self.class.usage + if args.empty? + puts self.class.purpose + puts + puts self.class.usage + elsif args.count == 1 + command_name = args.first + + unless command = self.class.commands[command_name] + raise "No help information found for command '#{command_name}'." + end + + if command.respond_to?(:usage) + puts command.usage + else + puts command.help + end + else + raise ArgumentError, "#{self.class.command_name} only takes up to one argument." + end end def self.purpose @@ -23,6 +32,10 @@ module Cask EOS end + def self.commands + Cmd.command_classes.select(&:visible?).map { |klass| [klass.command_name, klass] }.to_h + end + def self.usage max_command_len = Cmd.commands.map(&:length).max diff --git a/Library/Homebrew/cask/cmd/info.rb b/Library/Homebrew/cask/cmd/info.rb index a09291bce0..e4acbbe56d 100644 --- a/Library/Homebrew/cask/cmd/info.rb +++ b/Library/Homebrew/cask/cmd/info.rb @@ -46,6 +46,7 @@ module Cask def self.info(cask) puts get_info(cask) + ::Utils::Analytics.cask_output(cask) end def self.title_info(cask) diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index 578e5f06f4..20235e13af 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -33,9 +33,11 @@ module Cask option "--inspect", :inspect, false attr_accessor :format + private :format, :format= attr_accessor :stanza + private :stanza, :stanza= def initialize(*) diff --git a/Library/Homebrew/cask/cmd/list.rb b/Library/Homebrew/cask/cmd/list.rb index 83a17eed74..563f2a59d9 100644 --- a/Library/Homebrew/cask/cmd/list.rb +++ b/Library/Homebrew/cask/cmd/list.rb @@ -7,11 +7,6 @@ module Cask option "--versions", :versions, false option "--full-name", :full_name, false - option "-l", (lambda do |*| - one = true # rubocop:disable Lint/UselessAssignment - opoo "Option -l is obsolete! Implying option -1." - end) - def run args.any? ? list : list_installed end diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 212e40720a..503962e308 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -368,6 +368,7 @@ module Cask fi.installed_on_request = false fi.show_header = true fi.verbose = verbose? + fi.fetch fi.prelude fi.install fi.finish diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index cc12be3886..480a9c9ca1 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -142,14 +142,18 @@ module Homebrew cleanup = Cleanup.new if cleanup.periodic_clean_due? cleanup.periodic_clean! - elsif f.installed? + elsif f.latest_version_installed? cleanup.cleanup_formula(f) end end def periodic_clean_due? return false if Homebrew::EnvConfig.no_install_cleanup? - return true unless PERIODIC_CLEAN_FILE.exist? + + unless PERIODIC_CLEAN_FILE.exist? + FileUtils.touch PERIODIC_CLEAN_FILE + return false + end PERIODIC_CLEAN_FILE.mtime < CLEANUP_DEFAULT_DAYS.days.ago end diff --git a/Library/Homebrew/cli/args.rb b/Library/Homebrew/cli/args.rb index a60d6b23e7..b4dfc2b9cb 100644 --- a/Library/Homebrew/cli/args.rb +++ b/Library/Homebrew/cli/args.rb @@ -5,56 +5,54 @@ require "ostruct" module Homebrew module CLI class Args < OpenStruct - attr_reader :processed_options, :args_parsed + attr_reader :options_only, :flags_only + # undefine tap to allow --tap argument undef tap - def initialize - super + def initialize(argv = ARGV.dup.freeze, set_default_args: false) + super() - self[:remaining] = [] - self[:cmdline_args] = ARGV.dup.freeze - - @args_parsed = false @processed_options = [] + @options_only = args_options_only(argv) + @flags_only = args_flags_only(argv) + + # Can set these because they will be overwritten by freeze_named_args! + # (whereas other values below will only be overwritten if passed). + self[:named_args] = argv.reject { |arg| arg.start_with?("-") } + + # Set values needed before Parser#parse has been run. + return unless set_default_args + + self[:build_from_source?] = argv.include?("--build-from-source") || argv.include?("-s") + self[:build_bottle?] = argv.include?("--build-bottle") + self[:force_bottle?] = argv.include?("--force-bottle") + self[:HEAD?] = argv.include?("--HEAD") + self[:devel?] = argv.include?("--devel") + self[:universal?] = argv.include?("--universal") + end + + def freeze_named_args!(named_args) + # Reset cache values reliant on named_args + @formulae = nil + @resolved_formulae = nil + @formulae_paths = nil + @casks = nil + @kegs = nil + + self[:named_args] = named_args + self[:named_args].freeze end def freeze_processed_options!(processed_options) + # Reset cache values reliant on processed_options + @cli_args = nil + @processed_options += processed_options @processed_options.freeze - @args_parsed = true - end - def option_to_name(option) - option.sub(/\A--?/, "") - .tr("-", "_") - end - - def cli_args - return @cli_args if @cli_args - - @cli_args = [] - processed_options.each do |short, long| - option = long || short - switch = "#{option_to_name(option)}?".to_sym - flag = option_to_name(option).to_sym - if @table[switch] == true || @table[flag] == true - @cli_args << option - elsif @table[flag].instance_of? String - @cli_args << option + "=" + @table[flag] - elsif @table[flag].instance_of? Array - @cli_args << option + "=" + @table[flag].join(",") - end - end - @cli_args - end - - def options_only - @options_only ||= cli_args.select { |arg| arg.start_with?("-") } - end - - def flags_only - @flags_only ||= cli_args.select { |arg| arg.start_with?("--") } + @options_only = args_options_only(cli_args) + @flags_only = args_flags_only(cli_args) end def passthrough @@ -62,7 +60,7 @@ module Homebrew end def named - remaining + named_args || [] end def no_named? @@ -74,46 +72,50 @@ module Homebrew def collect_build_args build_flags = [] - build_flags << "--HEAD" if head - build_flags << "--universal" if build_universal - build_flags << "--build-bottle" if build_bottle - build_flags << "--build-from-source" if build_from_source + build_flags << "--HEAD" if HEAD? + build_flags << "--universal" if build_universal? + build_flags << "--build-bottle" if build_bottle? + build_flags << "--build-from-source" if build_from_source? build_flags end def formulae require "formula" + @formulae ||= (downcased_unique_named - casks).map do |name| if name.include?("/") || File.exist?(name) Formulary.factory(name, spec) else Formulary.find_with_priority(name, spec) end - end.uniq(&:name) + end.uniq(&:name).freeze end def resolved_formulae require "formula" + @resolved_formulae ||= (downcased_unique_named - casks).map do |name| Formulary.resolve(name, spec: spec(nil)) - end.uniq(&:name) + end.uniq(&:name).freeze end def formulae_paths @formulae_paths ||= (downcased_unique_named - casks).map do |name| Formulary.path(name) - end.uniq + end.uniq.freeze end def casks - @casks ||= downcased_unique_named.grep HOMEBREW_CASK_TAP_CASK_REGEX + @casks ||= downcased_unique_named.grep(HOMEBREW_CASK_TAP_CASK_REGEX) + .freeze end def kegs require "keg" require "formula" require "missing_formula" + @kegs ||= downcased_unique_named.map do |name| raise UsageError if name.empty? @@ -158,7 +160,7 @@ module Homebrew Please delete (with rm -rf!) all but one and then try again. EOS end - end + end.freeze end def build_stable? @@ -168,39 +170,56 @@ module Homebrew # Whether a given formula should be built from source during the current # installation run. def build_formula_from_source?(f) - return false if !build_from_source && !build_bottle + return false if !build_from_source? && !build_bottle? formulae.any? { |args_f| args_f.full_name == f.full_name } end - def build_from_source - return true if args_parsed && (build_from_source? || s?) + def include_formula_test_deps?(f) + return false unless include_test? - cmdline_args.include?("--build-from-source") || cmdline_args.include?("-s") - end - - def build_bottle - return true if args_parsed && build_bottle? - - cmdline_args.include?("--build-bottle") - end - - def force_bottle - return true if args_parsed && force_bottle? - - cmdline_args.include?("--force-bottle") + formulae.any? { |args_f| args_f.full_name == f.full_name } end private + def option_to_name(option) + option.sub(/\A--?/, "") + .tr("-", "_") + end + + def cli_args + return @cli_args if @cli_args + + @cli_args = [] + @processed_options.each do |short, long| + option = long || short + switch = "#{option_to_name(option)}?".to_sym + flag = option_to_name(option).to_sym + if @table[switch] == true || @table[flag] == true + @cli_args << option + elsif @table[flag].instance_of? String + @cli_args << option + "=" + @table[flag] + elsif @table[flag].instance_of? Array + @cli_args << option + "=" + @table[flag].join(",") + end + end + @cli_args.freeze + end + + def args_options_only(args) + args.select { |arg| arg.start_with?("-") } + .freeze + end + + def args_flags_only(args) + args.select { |arg| arg.start_with?("--") } + .freeze + end + def downcased_unique_named # Only lowercase names, not paths, bottle filenames or URLs - arguments = if args_parsed - named - else - cmdline_args.reject { |arg| arg.start_with?("-") } - end - arguments.map do |arg| + named.map do |arg| if arg.include?("/") || arg.end_with?(".tar.gz") || File.exist?(arg) arg else @@ -209,28 +228,10 @@ module Homebrew end.uniq end - def head - return true if args_parsed && HEAD? - - cmdline_args.include?("--HEAD") - end - - def devel - return true if args_parsed && devel? - - cmdline_args.include?("--devel") - end - - def build_universal - return true if args_parsed && universal? - - cmdline_args.include?("--universal") - end - def spec(default = :stable) - if head + if HEAD? :head - elsif devel + elsif devel? :devel else default diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index b5d6941d30..53efc00584 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -3,6 +3,7 @@ require "cli/args" require "optparse" require "set" +require "formula" COMMAND_DESC_WIDTH = 80 OPTION_DESC_WIDTH = 43 @@ -12,8 +13,8 @@ module Homebrew class Parser attr_reader :processed_options, :hide_from_man_page - def self.parse(args = ARGV, allow_no_named_args: false, &block) - new(args, &block).parse(args, allow_no_named_args: allow_no_named_args) + def self.parse(argv = ARGV.dup.freeze, allow_no_named_args: false, &block) + new(argv, &block).parse(allow_no_named_args: allow_no_named_args) end def self.from_cmd_path(cmd_path) @@ -37,9 +38,10 @@ module Homebrew } end - def initialize(&block) + def initialize(argv = ARGV.dup.freeze, &block) @parser = OptionParser.new - @args = Homebrew::CLI::Args.new + @argv = argv + @args = Homebrew::CLI::Args.new(@argv) @constraints = [] @conflicts = [] @@ -152,21 +154,22 @@ module Homebrew @parser.to_s end - def parse(cmdline_args = ARGV, allow_no_named_args: false) + def parse(argv = @argv, allow_no_named_args: false) raise "Arguments were already parsed!" if @args_parsed begin - named_args = @parser.parse(cmdline_args) + named_args = @parser.parse(argv) rescue OptionParser::InvalidOption => e $stderr.puts generate_help_text raise e end + check_constraint_violations check_named_args(named_args, allow_no_named_args: allow_no_named_args) - @args[:remaining] = named_args + @args.freeze_named_args!(named_args) @args.freeze_processed_options!(@processed_options) Homebrew.args = @args - cmdline_args.freeze + @args_parsed = true @parser end @@ -186,7 +189,7 @@ module Homebrew end def formula_options - @args.formulae.each do |f| + formulae.each do |f| next if f.options.empty? f.options.each do |o| @@ -341,6 +344,28 @@ module Homebrew option, = @parser.make_switch(args) @processed_options << [option.short.first, option.long.first, option.arg, option.desc.first] end + + def formulae + named_args = @argv.reject { |arg| arg.start_with?("-") } + spec = if @argv.include?("--HEAD") + :head + elsif @argv.include?("--devel") + :devel + else + :stable + end + + # Only lowercase names, not paths, bottle filenames or URLs + named_args.map do |arg| + next if arg.match?(HOMEBREW_CASK_TAP_CASK_REGEX) + + if arg.include?("/") || arg.end_with?(".tar.gz") || File.exist?(arg) + Formulary.factory(arg, spec) + else + Formulary.find_with_priority(arg.downcase, spec) + end + end.compact.uniq(&:name) + end end class OptionConstraintError < RuntimeError diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 644dd6039e..03f373447d 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -152,7 +152,7 @@ module Homebrew end # --HEAD, fail with no head defined - raise "No head is defined for #{f.full_name}" if args.head? && f.head.nil? + raise "No head is defined for #{f.full_name}" if args.HEAD? && f.head.nil? # --devel, fail with no devel defined raise "No devel block is defined for #{f.full_name}" if args.devel? && f.devel.nil? @@ -325,6 +325,7 @@ module Homebrew fi.build_bottle = args.build_bottle? fi.interactive = args.interactive? fi.git = args.git? + fi.fetch fi.prelude fi.install fi.finish diff --git a/Library/Homebrew/cmd/shellenv.sh b/Library/Homebrew/cmd/shellenv.sh index b478b6fcf4..193924f27c 100644 --- a/Library/Homebrew/cmd/shellenv.sh +++ b/Library/Homebrew/cmd/shellenv.sh @@ -3,7 +3,7 @@ #: Print export statements. When run in a shell, this installation of Homebrew will be added to your `PATH`, `MANPATH`, and `INFOPATH`. #: #: The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. -#: Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile` or `~/.zprofile`) with: `eval $(brew shellenv)` +#: Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) with: `eval $(brew shellenv)` homebrew-shellenv() { case "$SHELL" in diff --git a/Library/Homebrew/cmd/tap-pin.rb b/Library/Homebrew/cmd/tap-pin.rb index 97397a7ef5..b8e7a87365 100644 --- a/Library/Homebrew/cmd/tap-pin.rb +++ b/Library/Homebrew/cmd/tap-pin.rb @@ -12,7 +12,7 @@ module Homebrew end def tap_pin - odisabled "brew tap-pin user/tap", - "fully-scoped user/tap/formula naming" + odisabled "the brew tap-pin command", + "fully-scoped user/tap/formula naming when installing and in dependency references" end end diff --git a/Library/Homebrew/cmd/tap-unpin.rb b/Library/Homebrew/cmd/tap-unpin.rb index 07132ec629..2ec6e681a9 100644 --- a/Library/Homebrew/cmd/tap-unpin.rb +++ b/Library/Homebrew/cmd/tap-unpin.rb @@ -12,7 +12,7 @@ module Homebrew end def tap_unpin - odisabled "brew tap-pin user/tap", - "fully-scoped user/tap/formula naming" + odisabled "the brew tap-unpin command", + "fully-scoped user/tap/formula naming when installing and in dependency references" end end diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb index 9d4e77a699..af66c9ac1e 100644 --- a/Library/Homebrew/cmd/uninstall.rb +++ b/Library/Homebrew/cmd/uninstall.rb @@ -80,6 +80,30 @@ module Homebrew puts "#{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed." puts "Run `brew uninstall --force #{keg.name}` to remove all versions." end + + next unless f + + paths = f.pkgetc.find.map(&:to_s) if f.pkgetc.exist? + if paths.present? + puts + opoo <<~EOS + The following #{f.name} configuration files have not been removed! + If desired, remove them manually with `rm -rf`: + #{paths.sort.uniq.join("\n ")} + EOS + end + + unversioned_name = f.name.gsub(/@.+$/, "") + maybe_paths = Dir.glob("#{f.etc}/*#{unversioned_name}*") + maybe_paths -= paths if paths.present? + if maybe_paths.present? + puts + opoo <<~EOS + The following may be #{f.name} configuration files and have not been removed! + If desired, remove them manually with `rm -rf`: + #{maybe_paths.sort.uniq.join("\n ")} + EOS + end end end end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 80841542a2..df2481fb10 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -183,7 +183,6 @@ module Homebrew fi.installed_as_dependency = tab.installed_as_dependency fi.installed_on_request ||= tab.installed_on_request end - fi.prelude upgrade_version = if f.optlinked? "#{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}" @@ -192,6 +191,9 @@ module Homebrew end oh1 "Upgrading #{Formatter.identifier(f.full_specified_name)} #{upgrade_version} #{fi.options.to_a.join(" ")}" + fi.fetch + fi.prelude + # first we unlink the currently active keg for this formula otherwise it is # possible for the existing build to interfere with the build we are about to # do! Seriously, it happens! diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb index 9a2cf29459..a73aa184ef 100644 --- a/Library/Homebrew/compat.rb +++ b/Library/Homebrew/compat.rb @@ -4,3 +4,4 @@ require "compat/cask/dsl/version" require "compat/language/python" require "compat/requirements/macos_requirement" require "compat/formula" +require "compat/os/mac" if OS.mac? diff --git a/Library/Homebrew/compat/language/haskell.rb b/Library/Homebrew/compat/language/haskell.rb new file mode 100644 index 0000000000..0f961b1c34 --- /dev/null +++ b/Library/Homebrew/compat/language/haskell.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +module Language + module Haskell + module Cabal + module Compat + def cabal_sandbox(options = {}) + # odeprecated "Language::Haskell::Cabal.cabal_sandbox" + + pwd = Pathname.pwd + home = options[:home] || pwd + + # pretend HOME is elsewhere, so that ~/.cabal is kept as untouched + # as possible (except for ~/.cabal/setup-exe-cache) + # https://github.com/haskell/cabal/issues/1234 + saved_home = ENV["HOME"] + ENV["HOME"] = home + + system "cabal", "v1-sandbox", "init" + cabal_sandbox_bin = pwd/".cabal-sandbox/bin" + mkdir_p cabal_sandbox_bin + + # make available any tools that will be installed in the sandbox + saved_path = ENV["PATH"] + ENV.prepend_path "PATH", cabal_sandbox_bin + + # avoid updating the cabal package database more than once + system "cabal", "v1-update" unless (home/".cabal/packages").exist? + + yield + + # remove the sandbox and all build products + rm_rf [".cabal-sandbox", "cabal.sandbox.config", "dist"] + + # avoid installing any Haskell libraries, as a matter of policy + rm_rf lib unless options[:keep_lib] + + # restore the environment + ENV["HOME"] = saved_home + ENV["PATH"] = saved_path + end + + def cabal_sandbox_add_source(*args) + # odeprecated "Language::Haskell::Cabal.cabal_sandbox_add_source" + + system "cabal", "v1-sandbox", "add-source", *args + end + + def cabal_install(*args) + # odeprecated "Language::Haskell::Cabal.cabal_install", + # "cabal v2-install directly with std_cabal_v2_args" + + # cabal hardcodes 64 as the maximum number of parallel jobs + # https://github.com/Homebrew/legacy-homebrew/issues/49509 + make_jobs = (ENV.make_jobs > 64) ? 64 : ENV.make_jobs + + # cabal-install's dependency-resolution backtracking strategy can easily + # need more than the default 2,000 maximum number of "backjumps," since + # Hackage is a fast-moving, rolling-release target. The highest known + # needed value by a formula at this time (February 2016) was 43,478 for + # git-annex, so 100,000 should be enough to avoid most gratuitous + # backjumps build failures. + system "cabal", "v1-install", "--jobs=#{make_jobs}", "--max-backjumps=100000", *args + end + + def cabal_configure(flags) + # odeprecated "Language::Haskell::Cabal.cabal_configure" + + system "cabal", "v1-configure", flags + end + + def cabal_install_tools(*tools) + # odeprecated "Language::Haskell::Cabal.cabal_install_tools" + + # install tools sequentially, as some tools can depend on other tools + tools.each { |tool| cabal_install tool } + + # unregister packages installed as dependencies for the tools, so + # that they can't cause dependency conflicts for the main package + rm_rf Dir[".cabal-sandbox/*packages.conf.d/"] + end + + def install_cabal_package(*args, **options) + # odeprecated "Language::Haskell::Cabal.install_cabal_package", + # "cabal v2-update directly followed by v2-install with std_cabal_v2_args" + + cabal_sandbox do + cabal_install_tools(*options[:using]) if options[:using] + + # if we have build flags, we have to pass them to cabal install to resolve the necessary + # dependencies, and call cabal configure afterwards to set the flags again for compile + flags = "--flags=#{options[:flags].join(" ")}" if options[:flags] + + args_and_flags = args + args_and_flags << flags unless flags.nil? + + # install dependencies in the sandbox + cabal_install "--only-dependencies", *args_and_flags + + # call configure if build flags are set + cabal_configure flags unless flags.nil? + + # install the main package in the destination dir + cabal_install "--prefix=#{prefix}", *args + + yield if block_given? + end + end + end + + prepend Compat + end + end +end diff --git a/Library/Homebrew/compat/os/mac.rb b/Library/Homebrew/compat/os/mac.rb new file mode 100644 index 0000000000..af3863c86a --- /dev/null +++ b/Library/Homebrew/compat/os/mac.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module OS + module Mac + class << self + module Compat + def preferred_arch + # odeprecated "MacOS.preferred_arch", "Hardware::CPU.arch (or ideally let the compiler handle it)" + if Hardware::CPU.is_64_bit? + Hardware::CPU.arch_64_bit + else + Hardware::CPU.arch_32_bit + end + end + + def tcc_db + # odeprecated "MacOS.tcc_db" + @tcc_db ||= Pathname.new("/Library/Application Support/com.apple.TCC/TCC.db") + end + + def pre_mavericks_accessibility_dotfile + # odeprecated "MacOS.pre_mavericks_accessibility_dotfile" + @pre_mavericks_accessibility_dotfile ||= Pathname.new("/private/var/db/.AccessibilityAPIEnabled") + end + end + + prepend Compat + end + end +end diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 7f95f25b83..25a9a42147 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -106,7 +106,7 @@ class CompilerSelector def gnu_gcc_versions # prioritize gcc version provided by gcc formula. - v = Formulary.factory("gcc").version.to_s.slice(/\d/) + v = Formulary.factory("gcc").version.to_s.slice(/\d+/) GNU_GCC_VERSIONS - [v] + [v] # move the version to the end of the list rescue FormulaUnavailableError GNU_GCC_VERSIONS diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 1431ec2507..512a06a09b 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -81,7 +81,7 @@ module Homebrew ignores << "optional?" end - ignores << "recommended?" if ARGV.include? "--skip-recommended" + ignores << "recommended?" if Homebrew.args.skip_recommended? [includes, ignores] end @@ -100,16 +100,11 @@ module Homebrew klass.prune if ignores.include?("recommended?") || dependent.build.without?(dep) elsif dep.optional? klass.prune if !includes.include?("optional?") && !dependent.build.with?(dep) - elsif dep.test? - if includes.include?("test?") - Dependency.keep_but_prune_recursive_deps if type == :dependencies - elsif dep.build? - klass.prune unless includes.include?("build?") - else - klass.prune - end - elsif dep.build? - klass.prune unless includes.include?("build?") + elsif dep.build? || dep.test? + keep = false + keep ||= dep.test? && includes.include?("test?") && dependent == formula + keep ||= dep.build? && includes.include?("build?") + klass.prune unless keep end # If a tap isn't installed, we can't find the dependencies of one of diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index 21b8c778e7..d97a5a22a1 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -89,9 +89,6 @@ class Dependency deps.each do |dep| next if dependent.name == dep.name - # we only care about one level of test dependencies. - next if dep.test? && @expand_stack.length > 1 - case action(dependent, dep, &block) when :prune next diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 08cb33977a..82431558e7 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -435,40 +435,6 @@ module Homebrew end end - def audit_keg_only - return unless formula.keg_only? - - whitelist = %w[ - Apple - macOS - OS - Homebrew - Xcode - GPG - GNOME - BSD - Firefox - ].freeze - - reason = formula.keg_only_reason.to_s - # Formulae names can legitimately be uppercase/lowercase/both. - name = Regexp.new(formula.name, Regexp::IGNORECASE) - reason.sub!(name, "") - first_word = reason.split.first - - if reason =~ /\A[A-Z]/ && !reason.start_with?(*whitelist) - # TODO: check could be in RuboCop - problem <<~EOS - '#{first_word}' from the keg_only reason should be '#{first_word.downcase}'. - EOS - end - - return unless reason.end_with?(".") - - # TODO: check could be in RuboCop - problem "keg_only reason should not end with a period." - end - def audit_postgresql return unless formula.name == "postgresql" return unless @core_tap @@ -1018,7 +984,7 @@ module Homebrew except_audits = @except methods.map(&:to_s).grep(/^audit_/).each do |audit_method_name| - name = audit_method_name.gsub(/^audit_/, "") + name = audit_method_name.delete_prefix("audit_") if only_audits next unless only_audits.include?(name) elsif except_audits @@ -1076,9 +1042,6 @@ module Homebrew def audit_version if version.nil? problem "missing version" - elsif version.blank? - # TODO: check could be in RuboCop - problem "version is set to an empty string" elsif !version.detected_from_url? version_text = version version_url = Version.detect(url, specs) @@ -1086,26 +1049,12 @@ module Homebrew problem "version #{version_text} is redundant with version scanned from URL" end end - - # TODO: check could be in RuboCop - problem "version #{version} should not have a leading 'v'" if version.to_s.start_with?("v") - - return unless version.to_s.match?(/_\d+$/) - - # TODO: check could be in RuboCop - problem "version #{version} should not end with an underline and a number" end def audit_download_strategy - if url =~ %r{^(cvs|bzr|hg|fossil)://} || url =~ %r{^(svn)\+http://} - # TODO: check could be in RuboCop - problem "Use of the #{$&} scheme is deprecated, pass `:using => :#{Regexp.last_match(1)}` instead" - end - url_strategy = DownloadStrategyDetector.detect(url) if using == :git || url_strategy == GitDownloadStrategy - # TODO: check could be in RuboCop problem "Git should specify :revision when a :tag is specified." if specs[:tag] && !specs[:revision] end diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index c08997c8aa..77b64f8832 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -118,12 +118,6 @@ module Homebrew formula = args.formulae.first - if formula - tap_full_name, origin_branch, previous_branch = use_correct_linux_tap(formula) - check_for_duplicate_pull_requests(formula, tap_full_name) - checked_for_duplicates = true - end - new_url = args.url if new_url && !formula # Split the new URL on / and find any formulae that have the same URL @@ -152,7 +146,8 @@ module Homebrew end raise FormulaUnspecifiedError unless formula - check_for_duplicate_pull_requests(formula, tap_full_name) unless checked_for_duplicates + tap_full_name, origin_branch, previous_branch = use_correct_linux_tap(formula) + check_for_duplicate_pull_requests(formula, tap_full_name) requested_spec, formula_spec = if args.devel? devel_message = " (devel)" diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index de6f6d6376..e319acd972 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -18,7 +18,8 @@ module Homebrew module_function def irb_args - Homebrew::CLI::Parser.new do + # work around IRB modifying ARGV. + Homebrew::CLI::Parser.new(ARGV.dup) do usage_banner <<~EOS `irb` [] @@ -33,8 +34,7 @@ module Homebrew end def irb - # work around IRB modifying ARGV. - irb_args.parse(ARGV.dup) + irb_args.parse if args.examples? puts "'v8'.f # => instance of the v8 formula" diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb index 9637a5a45d..9abb83302b 100644 --- a/Library/Homebrew/dev-cmd/mirror.rb +++ b/Library/Homebrew/dev-cmd/mirror.rb @@ -41,20 +41,21 @@ module Homebrew downloader.fetch - filename = downloader.basename + filename = ERB::Util.url_encode(downloader.basename) destination_url = "https://dl.bintray.com/#{bintray_org}/#{bintray_repo}/#{filename}" ohai "Uploading to #{destination_url}" + version = ERB::Util.url_encode(f.pkg_version) bintray.upload( downloader.cached_location, repo: bintray_repo, package: bintray_package, - version: f.pkg_version, + version: version, sha256: f.stable.checksum, remote_file: filename, ) - bintray.publish(repo: bintray_repo, package: bintray_package, version: f.pkg_version) + bintray.publish(repo: bintray_repo, package: bintray_package, version: version) ohai "Mirrored #{filename}!" end end diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index 471cfc2c7e..c7aadd8ea1 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -16,9 +16,11 @@ module Homebrew flag "--tap=", description: "Target tap repository (default: `homebrew/core`)." flag "--with-label=", - description: "Pull requests must have this label (default: `ready to merge`)." + 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`)." + switch "--without-approval", + description: "Pull requests do not require approval to be merged." switch "--publish", description: "Run `brew pr-publish` on matching pull requests." switch "--ignore-failures", @@ -33,12 +35,13 @@ module Homebrew pr_automerge_args.parse ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" unless OS.mac? - with_label = Homebrew.args.with_label || "ready to merge" without_labels = Homebrew.args.without_labels || ["do not merge", "new formula"] tap = Tap.fetch(Homebrew.args.tap || CoreTap.instance.name) - query = "is:pr is:open repo:#{tap.full_name} label:\"#{with_label}\"" - query += args.ignore_failures? ? " -status:pending" : " status:success" + query = "is:pr is:open repo:#{tap.full_name}" + query += Homebrew.args.ignore_failures? ? " -status:pending" : " status:success" + query += " review:approved" unless Homebrew.args.without_approval? + query += " label:\"#{with_label}\"" if Homebrew.args.with_label without_labels&.each { |label| query += " -label:\"#{label}\"" } odebug "Searching: #{query}" diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 18bff0c88b..e2facbfa5b 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -22,6 +22,8 @@ module Homebrew switch "--online", description: "Include tests that use the GitHub API and tests that use any of the taps for "\ "official external commands." + switch "--byebug", + description: "Enable debugging using byebug." flag "--only=", description: "Run only `_spec.rb`. Appending `:` will start at a "\ "specific line." @@ -39,6 +41,8 @@ module Homebrew Homebrew.install_bundler_gems! gem_user_dir = Gem.user_dir + require "byebug" if args.byebug? + HOMEBREW_LIBRARY_PATH.cd do ENV.delete("HOMEBREW_COLOR") ENV.delete("HOMEBREW_NO_COLOR") diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 456a156871..bec90038b1 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -78,7 +78,7 @@ class DevelopmentTools path = HOMEBREW_PREFIX/"opt/gcc/bin"/cc path = locate(cc) unless path.exist? version = if path && - build_version = `#{path} --version`[/gcc(?:(?:-\d(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1] + build_version = `#{path} --version`[/gcc(?:(?:-\d+(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1] Version.new build_version else Version::NULL diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index cdf37ee2fe..ae7bb34fa9 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -3,6 +3,7 @@ require "keg" require "language/python" require "formula" +require "formulary" require "version" require "development_tools" require "utils/shell" @@ -832,6 +833,23 @@ module Homebrew EOS end + def check_deleted_formula + kegs = Keg.all + deleted_formulae = [] + kegs.each do |keg| + keg_name = keg.name + deleted_formulae << keg_name if Formulary.tap_paths(keg_name).blank? + end + return if deleted_formulae.blank? + + message = <<~EOS + Some installed formulae were deleted! + You should find replacements for the following formulae: + #{deleted_formulae.join("\n ")} + EOS + message + end + def all methods.map(&:to_s).grep(/^check_/) end diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index ed3c11c4bb..3d8ca97571 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -23,6 +23,7 @@ class AbstractDownloadStrategy attr_reader :cache, :cached_location, :url attr_reader :meta, :name, :version, :shutup + private :meta, :name, :version, :shutup def initialize(url, name, version, **meta) diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 784f714d0b..ab87a048bc 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -11,11 +11,6 @@ module HomebrewArgvExtension flag?("--debug") || !ENV["HOMEBREW_DEBUG"].nil? end - def bottle_arch - arch = value "bottle-arch" - arch&.to_sym - end - def env value "env" end diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index cef4c07f63..6c995e8f16 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -235,20 +235,6 @@ module SharedEnvExtension ohai "Building with an alternative Fortran compiler" puts "This is unsupported." self["F77"] ||= fc - - if ARGV.include? "--default-fortran-flags" - flags = FC_FLAG_VARS.reject { |key| self[key] } - elsif values_at(*FC_FLAG_VARS).compact.empty? - opoo <<~EOS - No Fortran optimization information was provided. You may want to consider - setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to - `brew install` if your compiler is compatible with GCC. - - If you like the default optimization level of your compiler, ignore this - warning. - EOS - end - else if (gfortran = which("gfortran", (HOMEBREW_PREFIX/"bin").to_s)) ohai "Using Homebrew-provided Fortran compiler." @@ -268,8 +254,8 @@ module SharedEnvExtension # @private def effective_arch - if Homebrew.args.build_bottle && ARGV.bottle_arch - ARGV.bottle_arch + if Homebrew.args.build_bottle? && Homebrew.args.bottle_arch + Homebrew.args.bottle_arch.to_sym else Hardware.oldest_cpu end diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb index cd48e4f366..a7eb3b9671 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb @@ -3,8 +3,10 @@ module SharedEnvExtension # @private def effective_arch - if Homebrew.args.build_bottle? - ARGV.bottle_arch || Hardware.oldest_cpu + if Homebrew.args.build_bottle? && Homebrew.args.bottle_arch + Homebrew.args.bottle_arch.to_sym + elsif Homebrew.args.build_bottle? + Hardware.oldest_cpu else :native end diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index 67dd402a1c..4f37ac614b 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -80,7 +80,7 @@ module Hardware # Compatibility with Mac method, which returns lowercase symbols # instead of strings def features - @features ||= flags[1..-1].map(&:intern) + @features ||= flags[1..].map(&:intern) end %w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag| diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index e6ebdeceed..fe0bf0d5be 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -345,6 +345,18 @@ module Homebrew directory on the same volume as your Cellar. EOS end + + def check_deprecated_caskroom_taps + tapped_caskroom_taps = Tap.select { |t| t.user == "caskroom" || t.name == "phinze/cask" } + .map(&:name) + return if tapped_caskroom_taps.empty? + + <<~EOS + You have the following deprecated, cask taps tapped: + #{tapped_caskroom_taps.join("\n ")} + Untap them with `brew untap`. + EOS + end end end end diff --git a/Library/Homebrew/extend/os/mac/software_spec.rb b/Library/Homebrew/extend/os/mac/software_spec.rb index d4f98d208e..e3c1de519f 100644 --- a/Library/Homebrew/extend/os/mac/software_spec.rb +++ b/Library/Homebrew/extend/os/mac/software_spec.rb @@ -11,7 +11,7 @@ class SoftwareSpec deps = Hash[*bounds.shift] end - bounds.transform_values! { |v| MacOS::Version.from_symbol(v) } + bounds = bounds.transform_values { |v| MacOS::Version.from_symbol(v) } if MacOS.version >= bounds[:since] @uses_from_macos_elements << deps else diff --git a/Library/Homebrew/fetch.rb b/Library/Homebrew/fetch.rb index b2e04554b0..6564aaf955 100644 --- a/Library/Homebrew/fetch.rb +++ b/Library/Homebrew/fetch.rb @@ -5,7 +5,7 @@ module Homebrew module_function def fetch_bottle?(f) - return true if Homebrew.args.force_bottle && f.bottle + return true if Homebrew.args.force_bottle? && f.bottle return false unless f.bottle && f.pour_bottle? return false if Homebrew.args.build_formula_from_source?(f) return false unless f.bottle.compatible_cellar? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 4e46d328b3..ab90329020 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -12,6 +12,7 @@ require "build_environment" require "build_options" require "formulary" require "software_spec" +require "livecheck" require "install_renamed" require "pkg_version" require "keg" @@ -125,6 +126,7 @@ class Formula # The currently active {SoftwareSpec}. # @see #determine_active_spec attr_reader :active_spec + protected :active_spec # A symbol to indicate currently active {SoftwareSpec}. @@ -175,6 +177,7 @@ class Formula # Defaults to true. # @return [Boolean] attr_accessor :follow_installed_alias + alias follow_installed_alias? follow_installed_alias # @private @@ -353,6 +356,16 @@ class Formula # @see .homepage= delegate homepage: :"self.class" + # The livecheck specification for the software. + # @method livecheck + # @see .livecheck= + delegate livecheck: :"self.class" + + # Is a livecheck specification defined for the software? + # @method livecheckable? + # @see .livecheckable? + delegate livecheckable?: :"self.class" + # The version for the currently active {SoftwareSpec}. # The version is autodetected from the URL and/or tag so only needs to be # declared if it cannot be autodetected correctly. @@ -790,6 +803,14 @@ class Formula (HOMEBREW_PREFIX/"etc").extend(InstallRenamed) end + # A subdirectory of `etc` with the formula name suffixed. + # e.g. `$HOMEBREW_PREFIX/etc/openssl@1.1` + # Anything using `pkgetc.install` will not overwrite other files on + # e.g. upgrades but will write a new file named `*.default`. + def pkgetc + (HOMEBREW_PREFIX/"etc"/name).extend(InstallRenamed) + end + # The directory where the formula's variable files should be installed. # This directory is not inside the `HOMEBREW_CELLAR` so it persists # across upgrades. @@ -991,11 +1012,11 @@ class Formula self.build = Tab.for_formula(self) new_env = { - "TMPDIR" => HOMEBREW_TEMP, - "TEMP" => HOMEBREW_TEMP, - "TMP" => HOMEBREW_TEMP, - "HOMEBREW_PATH" => nil, - "PATH" => ENV["HOMEBREW_PATH"], + TMPDIR: HOMEBREW_TEMP, + TEMP: HOMEBREW_TEMP, + TMP: HOMEBREW_TEMP, + HOMEBREW_PATH: nil, + PATH: ENV["HOMEBREW_PATH"], } with_env(new_env) do @@ -1080,7 +1101,7 @@ class Formula # keg's formula is deleted. begin keg = Keg.for(path) - rescue NotAKegError, Errno::ENOENT # rubocop:disable Lint/SuppressedException + rescue NotAKegError, Errno::ENOENT # file doesn't belong to any keg. else tab_tap = Tab.for_keg(keg).tap @@ -1089,7 +1110,7 @@ class Formula begin Formulary.factory(keg.name) - rescue FormulaUnavailableError # rubocop:disable Lint/SuppressedException + rescue FormulaUnavailableError # formula for this keg is deleted, so defer to whitelist rescue TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError return false # this keg belongs to another formula @@ -1139,11 +1160,14 @@ class Formula # yields |self,staging| with current working directory set to the uncompressed tarball # where staging is a Mktemp staging context # @private - def brew + def brew(fetch: true) @prefix_returns_versioned_prefix = true + active_spec.fetch if fetch stage do |staging| staging.retain! if Homebrew.args.keep_tmp? + prepare_patches + fetch_patches if fetch begin yield self, staging @@ -1203,7 +1227,7 @@ class Formula next if version.head? tab = Tab.for_keg(keg) - next if version_scheme > tab.version_scheme + next if version_scheme > tab.version_scheme && pkg_version != version next if version_scheme == tab.version_scheme && pkg_version > version # don't consider this keg current if there's a newer formula available @@ -1694,6 +1718,13 @@ class Formula %w[stable devel].each do |spec_sym| next unless spec = send(spec_sym) + + hsh["urls"][spec_sym] = { + "url" => spec.url, + "tag" => spec.specs[:tag], + "revision" => spec.specs[:revision], + } + next unless spec.bottle_defined? bottle_spec = spec.bottle_specification @@ -1713,11 +1744,6 @@ class Formula } end hsh["bottle"][spec_sym] = bottle_info - hsh["urls"][spec_sym] = { - "url" => spec.url, - "tag" => spec.specs[:tag], - "revision" => spec.specs[:revision], - } end hsh["options"] = options.map do |opt| @@ -2057,8 +2083,17 @@ class Formula ENV.update(removed) end + def fetch_patches + patchlist.select(&:external?).each(&:fetch) + end + private + def prepare_patches + active_spec.add_legacy_patches(patches) if respond_to?(:patches) + patchlist.grep(DATAPatch) { |p| p.path = path } + end + # Returns the prefix for a given formula version number. # @private def versioned_prefix(v) @@ -2126,13 +2161,6 @@ class Formula end end - def prepare_patches - active_spec.add_legacy_patches(patches) if respond_to?(:patches) - - patchlist.grep(DATAPatch) { |p| p.path = path } - patchlist.select(&:external?).each(&:fetch) - end - # The methods below define the formula DSL. class << self include BuildEnvironment::DSL @@ -2178,6 +2206,13 @@ class Formula #
homepage "https://www.example.com"
attr_rw :homepage + # Whether a livecheck specification is defined or not. + # It returns true when a livecheck block is present in the {Formula} and + # false otherwise, and is used by livecheck. + def livecheckable? + @livecheckable == true + end + # The `:startup` attribute set by {.plist_options}. # @private attr_reader :plist_startup @@ -2620,6 +2655,26 @@ class Formula define_method(:test, &block) end + # @!attribute [w] livecheck + # Livecheck can be used to check for newer versions of the software. + # This method evaluates the DSL specified in the livecheck block of the + # {Formula} (if it exists) and sets the instance variables of a Livecheck + # object accordingly. This is used by brew livecheck to check for newer + # versions of the software. + # + #
livecheck do
+    #   skip "Not maintained"
+    #   url "https://example.com/foo/releases"
+    #   regex /foo-(\d+(?:\.\d+)+)\.tar/
+    # end
+ def livecheck(&block) + @livecheck ||= Livecheck.new + return @livecheck unless block_given? + + @livecheckable = true + @livecheck.instance_eval(&block) + end + # Defines whether the {Formula}'s bottle can be used on the given Homebrew # installation. # diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 1dd08c9cb1..d81f6d70e7 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -224,6 +224,41 @@ module FormulaCellarChecks EOS end + def check_plist(prefix, plist) + return unless prefix.directory? + + plist = begin + Plist.parse_xml(plist) + rescue + nil + end + return if plist.blank? + + program_location = plist["ProgramArguments"]&.first + key = "first ProgramArguments value" + if program_location.blank? + program_location = plist["Program"] + key = "Program" + end + return if program_location.blank? + + Dir.chdir("/") do + unless File.exist?(program_location) + return <<~EOS + The plist #{key} does not exist: + #{program_location} + EOS + end + + return if File.executable?(program_location) + end + + <<~EOS + The plist #{key} is not executable: + #{program_location} + EOS + end + def audit_installed @new_formula ||= false @@ -240,6 +275,7 @@ module FormulaCellarChecks problem_if_output(check_elisp_root(formula.share, formula.name)) problem_if_output(check_python_packages(formula.lib, formula.deps)) problem_if_output(check_shim_references(formula.prefix)) + problem_if_output(check_plist(formula.prefix, formula.plist)) end alias generic_audit_installed audit_installed diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index fb66acdb23..9ee3c45b29 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -25,6 +25,7 @@ class FormulaInstaller def self.mode_attr_accessor(*names) attr_accessor(*names) + private(*names) names.each do |name| predicate = "#{name}?" @@ -38,6 +39,7 @@ class FormulaInstaller attr_reader :formula attr_accessor :options, :build_bottle attr_accessor :installed_as_dependency, :installed_on_request, :link_keg + mode_attr_accessor :show_summary_heading, :show_header mode_attr_accessor :build_from_source, :force_bottle, :include_test mode_attr_accessor :ignore_deps, :only_deps, :interactive, :git @@ -49,10 +51,10 @@ class FormulaInstaller @show_header = false @ignore_deps = false @only_deps = false - @build_from_source = Homebrew.args.build_from_source + @build_from_source = Homebrew.args.build_from_source? @build_bottle = false - @force_bottle = Homebrew.args.force_bottle - @include_test = ARGV.include?("--include-test") + @force_bottle = Homebrew.args.force_bottle? + @include_test = Homebrew.args.include_test? @interactive = false @git = false @verbose = Homebrew.args.verbose? @@ -267,7 +269,7 @@ class FormulaInstaller return if only_deps? - if build_bottle? && (arch = ARGV.bottle_arch) && !Hardware::CPU.optimization_flags.include?(arch) + if build_bottle? && (arch = Homebrew.args.bottle_arch) && !Hardware::CPU.optimization_flags.include?(arch.to_sym) raise "Unrecognized architecture for --bottle-arch: #{arch}" end @@ -277,7 +279,7 @@ class FormulaInstaller opoo "#{formula.full_name}: #{old_flag} was deprecated; using #{new_flag} instead!" end - options = display_options(formula) + options = display_options(formula).join(" ") oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options}".strip if show_header? unless formula.tap&.private? @@ -451,13 +453,16 @@ class FormulaInstaller build = effective_build_options_for(dependent) install_bottle_for_dependent = install_bottle_for?(dependent, build) + keep_build_test = false + keep_build_test ||= runtime_requirements.include?(req) + keep_build_test ||= req.test? && include_test? && dependent == f + keep_build_test ||= req.build? && !install_bottle_for_dependent && !dependent.latest_version_installed? + if req.prune_from_option?(build) Requirement.prune elsif req.satisfied? Requirement.prune - elsif include_test? && req.test? - next - elsif !runtime_requirements.include?(req) && install_bottle_for_dependent + elsif (req.build? || req.test?) && !keep_build_test Requirement.prune elsif (dep = formula_deps_map[dependent.name]) && dep.build? Requirement.prune @@ -484,13 +489,13 @@ class FormulaInstaller inherited_options.fetch(dependent.name, []), ) + keep_build_test = false + keep_build_test ||= dep.test? && include_test? && Homebrew.args.include_formula_test_deps?(dependent) + keep_build_test ||= dep.build? && !install_bottle_for?(dependent, build) && !dependent.latest_version_installed? + if dep.prune_from_option?(build) Dependency.prune - elsif include_test? && dep.test? && !dep.installed? - Dependency.keep_but_prune_recursive_deps - elsif dep.build? && install_bottle_for?(dependent, build) - Dependency.prune - elsif dep.prune_if_build_and_not_dependent?(dependent) + elsif (dep.build? || dep.test?) && !keep_build_test Dependency.prune elsif dep.satisfied?(inherited_options[dep.name]) Dependency.skip @@ -527,16 +532,15 @@ class FormulaInstaller end def display_options(formula) - options = [] - if formula.head? - options << "--HEAD" + options = if formula.head? + ["--HEAD"] elsif formula.devel? - options << "--devel" + ["--devel"] + else + [] end options += effective_build_options_for(formula).used_options.to_a - return if options.empty? - - options.join(" ") + options end def inherited_options_for(dep) @@ -561,6 +565,23 @@ class FormulaInstaller @show_header = true unless deps.empty? end + def fetch_dependency(dep) + df = dep.to_formula + fi = FormulaInstaller.new(df) + + fi.build_from_source = Homebrew.args.build_formula_from_source?(df) + fi.force_bottle = false + fi.include_test = Homebrew.args.include_formula_test_deps?(df) + fi.verbose = verbose? + fi.quiet = quiet? + fi.debug = debug? + # When fetching we don't need to recurse the dependency tree as it's already + # been done for us in `compute_dependencies` and there's no requirement to + # fetch in a particular order. + fi.ignore_deps = true + fi.fetch + end + def install_dependency(dep, inherited_options) df = dep.to_formula tab = Tab.for_formula(df) @@ -593,6 +614,7 @@ class FormulaInstaller fi.options &= df.options fi.build_from_source = Homebrew.args.build_formula_from_source?(df) fi.force_bottle = false + fi.include_test = Homebrew.args.include_formula_test_deps?(df) fi.verbose = verbose? fi.quiet = quiet? fi.debug = debug? @@ -699,7 +721,7 @@ class FormulaInstaller if build_bottle? args << "--build-bottle" - args << "--bottle-arch=#{ARGV.bottle_arch}" if ARGV.bottle_arch + args << "--bottle-arch=#{Homebrew.args.bottle_arch}" if Homebrew.args.bottle_arch end args << "--git" if git? @@ -707,7 +729,6 @@ class FormulaInstaller args << "--verbose" if verbose? args << "--debug" if debug? args << "--cc=#{Homebrew.args.cc}" if Homebrew.args.cc - args << "--default-fortran-flags" if ARGV.include? "--default-fortran-flags" args << "--keep-tmp" if Homebrew.args.keep_tmp? if ARGV.env @@ -776,7 +797,7 @@ class FormulaInstaller rescue Exception => e # rubocop:disable Lint/RescueException if e.is_a? BuildError e.formula = formula - e.options = options + e.options = display_options(formula) end ignore_interrupts do @@ -947,14 +968,38 @@ class FormulaInstaller @show_summary_heading = true end - def pour - if (bottle_path = formula.local_bottle_path) - downloader = LocalBottleDownloadStrategy.new(bottle_path) - else - downloader = formula.bottle - downloader.fetch + def fetch_dependencies + deps = compute_dependencies + + return if deps.empty? || ignore_deps? + + deps.each { |dep, _options| fetch_dependency(dep) } + end + + def fetch + fetch_dependencies + + return if only_deps? + + unless pour_bottle? + formula.fetch_patches + formula.resources.each(&:fetch) end + downloader.fetch + end + + def downloader + if (bottle_path = formula.local_bottle_path) + LocalBottleDownloadStrategy.new(bottle_path) + elsif pour_bottle? + formula.bottle + else + formula + end + end + + def pour HOMEBREW_CELLAR.cd do downloader.stage end diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 83565d1a49..b01973fab6 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -491,8 +491,8 @@ module Formulary if possible_pinned_tap_formulae.size == 1 selected_formula = factory(possible_pinned_tap_formulae.first, spec) if core_path(ref).file? - odisabled "brew tap-pin user/tap", - "fully-scoped user/tap/formula naming" + odisabled "the brew tap-pin command", + "fully-scoped user/tap/formula naming when installing and in dependency references" end selected_formula else diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 6e9aefb675..b7067e7717 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -85,7 +85,7 @@ module Homebrew end def args - @args ||= CLI::Args.new + @args ||= CLI::Args.new(set_default_args: true) end def messages diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index 7e45247b75..0e41977c72 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -103,7 +103,7 @@ module Homebrew help_lines = command_help_lines(path) return if help_lines.blank? - Formatter.wrap(help_lines.join.gsub(/^ /, ""), COMMAND_DESC_WIDTH) + Formatter.wrap(help_lines.join.delete_prefix(" "), COMMAND_DESC_WIDTH) .sub("@hide_from_man_page ", "") .sub(/^\* /, "#{Tty.bold}Usage: brew#{Tty.reset} ") .gsub(/`(.*?)`/m, "#{Tty.bold}\\1#{Tty.reset}") diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index d40cf4457b..16818f0ce2 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -184,6 +184,7 @@ class Keg end attr_reader :path, :name, :linked_keg_record, :opt_record + protected :path extend Forwardable diff --git a/Library/Homebrew/language/haskell.rb b/Library/Homebrew/language/haskell.rb index e4b11e3071..964fa4f773 100644 --- a/Library/Homebrew/language/haskell.rb +++ b/Library/Homebrew/language/haskell.rb @@ -1,96 +1,3 @@ # frozen_string_literal: true -module Language - module Haskell - module Cabal - def cabal_sandbox(options = {}) - pwd = Pathname.pwd - home = options[:home] || pwd - - # pretend HOME is elsewhere, so that ~/.cabal is kept as untouched - # as possible (except for ~/.cabal/setup-exe-cache) - # https://github.com/haskell/cabal/issues/1234 - saved_home = ENV["HOME"] - ENV["HOME"] = home - - system "cabal", "v1-sandbox", "init" - cabal_sandbox_bin = pwd/".cabal-sandbox/bin" - mkdir_p cabal_sandbox_bin - - # make available any tools that will be installed in the sandbox - saved_path = ENV["PATH"] - ENV.prepend_path "PATH", cabal_sandbox_bin - - # avoid updating the cabal package database more than once - system "cabal", "v1-update" unless (home/".cabal/packages").exist? - - yield - - # remove the sandbox and all build products - rm_rf [".cabal-sandbox", "cabal.sandbox.config", "dist"] - - # avoid installing any Haskell libraries, as a matter of policy - rm_rf lib unless options[:keep_lib] - - # restore the environment - ENV["HOME"] = saved_home - ENV["PATH"] = saved_path - end - - def cabal_sandbox_add_source(*args) - system "cabal", "v1-sandbox", "add-source", *args - end - - def cabal_install(*args) - # cabal hardcodes 64 as the maximum number of parallel jobs - # https://github.com/Homebrew/legacy-homebrew/issues/49509 - make_jobs = (ENV.make_jobs > 64) ? 64 : ENV.make_jobs - - # cabal-install's dependency-resolution backtracking strategy can easily - # need more than the default 2,000 maximum number of "backjumps," since - # Hackage is a fast-moving, rolling-release target. The highest known - # needed value by a formula at this time (February 2016) was 43,478 for - # git-annex, so 100,000 should be enough to avoid most gratuitous - # backjumps build failures. - system "cabal", "v1-install", "--jobs=#{make_jobs}", "--max-backjumps=100000", *args - end - - def cabal_configure(flags) - system "cabal", "v1-configure", flags - end - - def cabal_install_tools(*tools) - # install tools sequentially, as some tools can depend on other tools - tools.each { |tool| cabal_install tool } - - # unregister packages installed as dependencies for the tools, so - # that they can't cause dependency conflicts for the main package - rm_rf Dir[".cabal-sandbox/*packages.conf.d/"] - end - - def install_cabal_package(*args, **options) - cabal_sandbox do - cabal_install_tools(*options[:using]) if options[:using] - - # if we have build flags, we have to pass them to cabal install to resolve the necessary - # dependencies, and call cabal configure afterwards to set the flags again for compile - flags = "--flags=#{options[:flags].join(" ")}" if options[:flags] - - args_and_flags = args - args_and_flags << flags unless flags.nil? - - # install dependencies in the sandbox - cabal_install "--only-dependencies", *args_and_flags - - # call configure if build flags are set - cabal_configure flags unless flags.nil? - - # install the main package in the destination dir - cabal_install "--prefix=#{prefix}", *args - - yield if block_given? - end - end - end - end -end +require "compat/language/haskell" diff --git a/Library/Homebrew/livecheck.rb b/Library/Homebrew/livecheck.rb new file mode 100644 index 0000000000..f2bf621f1e --- /dev/null +++ b/Library/Homebrew/livecheck.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Livecheck can be used to check for newer versions of the software. +# The livecheck DSL specified in the formula is evaluated the methods +# of this class, which set the instance variables accordingly. The +# information is used by brew livecheck when checking for newer versions +# of the software. +class Livecheck + # The reason for skipping livecheck for the formula. + # e.g. `Not maintained` + attr_reader :skip_msg + + def initialize + @regex = nil + @skip = false + @skip_msg = nil + @url = nil + end + + # Sets the regex instance variable to the argument given, returns the + # regex instance variable when no argument is given. + def regex(pattern = nil) + return @regex if pattern.nil? + + @regex = pattern + end + + # Sets the skip instance variable to true, indicating that livecheck + # must be skipped for the formula. If an argument is given and present, + # its value is assigned to the skip_msg instance variable, else nil is + # assigned. + def skip(skip_msg = nil) + @skip = true + @skip_msg = skip_msg.presence + end + + # Should livecheck be skipped for the formula? + def skip? + @skip + end + + # Sets the url instance variable to the argument given, returns the url + # instance variable when no argument is given. + def url(val = nil) + return @url if val.nil? + + @url = val + end + + # Returns a Hash of all instance variable values. + def to_hash + { + "regex" => @regex, + "skip" => @skip, + "skip_msg" => @skip_msg, + "url" => @url, + } + end +end diff --git a/Library/Homebrew/manpages/brew-cask.1.md b/Library/Homebrew/manpages/brew-cask.1.md index cec5db30ad..32da99944a 100644 --- a/Library/Homebrew/manpages/brew-cask.1.md +++ b/Library/Homebrew/manpages/brew-cask.1.md @@ -243,7 +243,8 @@ Environment variables specific to Homebrew Cask: * `HOMEBREW_CASK_OPTS`: This variable may contain any arguments normally used as options on the command-line. This is particularly useful to make options persistent. - For example, you might add to your .bash_profile or .zshenv something like: + For example, you might add to your ~/.profile, ~/.bash_profile, or ~/.zshenv + something like: export HOMEBREW_CASK_OPTS='--appdir=~/Applications --fontdir=/Library/Fonts' diff --git a/Library/Homebrew/os/linux/elf.rb b/Library/Homebrew/os/linux/elf.rb index 244a22e114..11603dee71 100644 --- a/Library/Homebrew/os/linux/elf.rb +++ b/Library/Homebrew/os/linux/elf.rb @@ -132,6 +132,8 @@ module ELFShim elsif DevelopmentTools.locate "patchelf" needed_libraries_using_patchelf path else + return [nil, []] if path.basename.to_s == "patchelf" + raise "patchelf must be installed: brew install patchelf" end end diff --git a/Library/Homebrew/os/linux/glibc.rb b/Library/Homebrew/os/linux/glibc.rb index 8a7fa52506..c7073b39f3 100644 --- a/Library/Homebrew/os/linux/glibc.rb +++ b/Library/Homebrew/os/linux/glibc.rb @@ -15,7 +15,7 @@ module OS end def minimum_version - Version.new "2.12" + Version.new "2.13" end def below_minimum_version? diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 5343d7def4..3118edf50f 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -166,14 +166,6 @@ module OS paths.uniq end - def preferred_arch - if Hardware::CPU.is_64_bit? - Hardware::CPU.arch_64_bit - else - Hardware::CPU.arch_32_bit - end - end - def app_with_bundle_id(*ids) path = mdfind(*ids) .reject { |p| p.include?("/Backups.backupdb/") } @@ -196,13 +188,5 @@ module OS def mdfind_query(*ids) ids.map! { |id| "kMDItemCFBundleIdentifier == #{id}" }.join(" || ") end - - def tcc_db - @tcc_db ||= Pathname.new("/Library/Application Support/com.apple.TCC/TCC.db") - end - - def pre_mavericks_accessibility_dotfile - @pre_mavericks_accessibility_dotfile ||= Pathname.new("/private/var/db/.AccessibilityAPIEnabled") - end end end diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index db49f65e79..1050e5bdf4 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -117,8 +117,8 @@ class ExternalPatch attr_reader :resource, :strip def_delegators :resource, - :url, :fetch, :patch_files, :verify_download_integrity, :cached_download, - :clear_cache + :url, :fetch, :patch_files, :verify_download_integrity, + :cached_download, :downloaded?, :clear_cache def initialize(strip, &block) @strip = strip diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index 4a53a2a757..ff3c5707f2 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -25,7 +25,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = options - fi.build_bottle = Homebrew.args.build_bottle + fi.build_bottle = Homebrew.args.build_bottle? fi.interactive = Homebrew.args.interactive? fi.git = Homebrew.args.git? fi.link_keg ||= keg_was_linked if keg_had_linked_opt @@ -35,6 +35,7 @@ module Homebrew fi.installed_as_dependency = tab.installed_as_dependency fi.installed_on_request = tab.installed_on_request end + fi.fetch fi.prelude oh1 "Reinstalling #{Formatter.identifier(f.full_name)} #{options.to_a.join " "}" diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index ebd2179a24..f593ca5753 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -151,6 +151,7 @@ class Requirement include BuildEnvironment::DSL attr_reader :env_proc, :build + attr_rw :fatal, :cask, :download def satisfy(options = nil, &block) diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 920a787c3f..082dd1a7a8 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -55,6 +55,10 @@ class Resource "#{owner.name}--#{escaped_name}" end + def downloaded? + cached_download.exist? + end + def cached_download downloader.cached_location end @@ -68,16 +72,23 @@ class Resource # directory. Subclasses that override stage should implement the tmp # dir using {Mktemp} so that works with all subtypes. def stage(target = nil, &block) - raise ArgumentError, "target directory or block is required" unless target || block + raise ArgumentError, "target directory or block is required" if target.blank? && block.blank? - fetch prepare_patches + fetch_patches(skip_downloaded: true) + fetch unless downloaded? + unpack(target, &block) end def prepare_patches patches.grep(DATAPatch) { |p| p.path = owner.owner.path } - patches.select(&:external?).each(&:fetch) + end + + def fetch_patches(skip_downloaded: false) + external_patches = patches.select(&:external?) + external_patches.reject!(&:downloaded?) if skip_downloaded + external_patches.each(&:fetch) end def apply_patches @@ -114,6 +125,8 @@ class Resource def fetch(verify_download_integrity: true) HOMEBREW_CACHE.mkpath + fetch_patches + begin downloader.fetch rescue ErrorDuringExecution, CurlDownloadStrategyError => e diff --git a/Library/Homebrew/rubocops.rb b/Library/Homebrew/rubocops.rb index 6252f64b58..7a0f2c70e8 100644 --- a/Library/Homebrew/rubocops.rb +++ b/Library/Homebrew/rubocops.rb @@ -20,5 +20,7 @@ require "rubocops/lines" require "rubocops/class" require "rubocops/uses_from_macos" require "rubocops/files" +require "rubocops/keg_only" +require "rubocops/version" require "rubocops/rubocop-cask" diff --git a/Library/Homebrew/rubocops/cask/homepage_matches_url.rb b/Library/Homebrew/rubocops/cask/homepage_matches_url.rb index 34c5261698..b260d5c730 100644 --- a/Library/Homebrew/rubocops/cask/homepage_matches_url.rb +++ b/Library/Homebrew/rubocops/cask/homepage_matches_url.rb @@ -40,6 +40,7 @@ module RuboCop private attr_reader :cask_block + def_delegators :cask_block, :cask_node, :toplevel_stanzas, :sorted_toplevel_stanzas @@ -141,10 +142,10 @@ module RuboCop end home = homepage.downcase if (split_host = host.split(".")).length >= 3 - host = split_host[-2..-1].join(".") + host = split_host[-2..].join(".") end if (split_home = homepage.split(".")).length >= 3 - home = split_home[-2..-1].join(".") + home = split_home[-2..].join(".") end host == home end diff --git a/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb b/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb index 24d65737c3..f76d258faa 100644 --- a/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb +++ b/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb @@ -19,6 +19,7 @@ module RuboCop private attr_reader :cask_block + def_delegators :cask_block, :toplevel_stanzas end diff --git a/Library/Homebrew/rubocops/cask/stanza_grouping.rb b/Library/Homebrew/rubocops/cask/stanza_grouping.rb index 631d2c7e2a..aec43875c7 100644 --- a/Library/Homebrew/rubocops/cask/stanza_grouping.rb +++ b/Library/Homebrew/rubocops/cask/stanza_grouping.rb @@ -39,6 +39,7 @@ module RuboCop private attr_reader :cask_block, :line_ops + def_delegators :cask_block, :cask_node, :toplevel_stanzas def add_offenses diff --git a/Library/Homebrew/rubocops/cask/stanza_order.rb b/Library/Homebrew/rubocops/cask/stanza_order.rb index bb8c153ba7..2a81bdb113 100644 --- a/Library/Homebrew/rubocops/cask/stanza_order.rb +++ b/Library/Homebrew/rubocops/cask/stanza_order.rb @@ -31,6 +31,7 @@ module RuboCop private attr_reader :cask_block + def_delegators :cask_block, :cask_node, :toplevel_stanzas, :sorted_toplevel_stanzas diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index a9d4d577b8..5049598b4b 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -12,24 +12,25 @@ module RuboCop class ComponentsOrder < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) component_precedence_list = [ - [{ name: :include, type: :method_call }], - [{ name: :desc, type: :method_call }], - [{ name: :homepage, type: :method_call }], - [{ name: :url, type: :method_call }], - [{ name: :mirror, type: :method_call }], - [{ name: :version, type: :method_call }], - [{ name: :sha256, type: :method_call }], - [{ name: :revision, type: :method_call }], + [{ name: :include, type: :method_call }], + [{ name: :desc, type: :method_call }], + [{ name: :homepage, type: :method_call }], + [{ name: :url, type: :method_call }], + [{ name: :mirror, type: :method_call }], + [{ name: :version, type: :method_call }], + [{ name: :sha256, type: :method_call }], + [{ name: :revision, type: :method_call }], [{ name: :version_scheme, type: :method_call }], - [{ name: :head, type: :method_call }], - [{ name: :stable, type: :block_call }], - [{ name: :bottle, type: :block_call }], + [{ name: :head, type: :method_call }], + [{ name: :stable, type: :block_call }], + [{ name: :livecheck, type: :block_call }], + [{ name: :bottle, type: :block_call }], [{ name: :pour_bottle?, type: :block_call }], - [{ name: :devel, type: :block_call }], - [{ name: :head, type: :block_call }], - [{ name: :bottle, type: :method_call }], - [{ name: :keg_only, type: :method_call }], - [{ name: :option, type: :method_call }], + [{ name: :devel, type: :block_call }], + [{ name: :head, type: :block_call }], + [{ name: :bottle, type: :method_call }], + [{ name: :keg_only, type: :method_call }], + [{ name: :option, type: :method_call }], [{ name: :deprecated_option, type: :method_call }], [{ name: :depends_on, type: :method_call }], [{ name: :uses_from_macos, type: :method_call }], diff --git a/Library/Homebrew/rubocops/extend/formula.rb b/Library/Homebrew/rubocops/extend/formula.rb index 74eef626ee..81281cd63a 100644 --- a/Library/Homebrew/rubocops/extend/formula.rb +++ b/Library/Homebrew/rubocops/extend/formula.rb @@ -17,6 +17,7 @@ module RuboCop include RangeHelp attr_accessor :file_path + @registry = Cop.registry # This method is called by RuboCop and is the main entry point diff --git a/Library/Homebrew/rubocops/keg_only.rb b/Library/Homebrew/rubocops/keg_only.rb new file mode 100644 index 0000000000..e2969f2df1 --- /dev/null +++ b/Library/Homebrew/rubocops/keg_only.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require "rubocops/extend/formula" + +module RuboCop + module Cop + module FormulaAudit + class KegOnly < FormulaCop + def audit_formula(_node, _class_node, _parent_class_node, body_node) + keg_only_node = find_node_method_by_name(body_node, :keg_only) + return unless keg_only_node + + whitelist = %w[ + Apple + macOS + OS + Homebrew + Xcode + GPG + GNOME + BSD + Firefox + ].freeze + + reason = string_content(parameters(keg_only_node).first) + name = Regexp.new(@formula_name, Regexp::IGNORECASE) + reason = reason.sub(name, "") + first_word = reason.split.first + + if reason =~ /\A[A-Z]/ && !reason.start_with?(*whitelist) + problem "'#{first_word}' from the keg_only reason should be '#{first_word.downcase}'." + end + + return unless reason.end_with?(".") + + problem "keg_only reason should not end with a period." + end + end + end + end +end diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 33d471a33a..33c1ded388 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -66,6 +66,16 @@ module RuboCop problem "#{url} should be `https://www.apache.org/dyn/closer.lua?path=#{match[1]}`" end + version_control_pattern = %r{^(cvs|bzr|hg|fossil)://} + audit_urls(urls, version_control_pattern) do |match, _| + problem "Use of the #{match[1]}:// scheme is deprecated, pass `:using => :#{match[1]}` instead" + end + + svn_pattern = %r{^svn\+http://} + audit_urls(urls, svn_pattern) do |_, _| + problem "Use of the svn+http:// scheme is deprecated, pass `:using => :svn` instead" + end + audit_urls(mirrors, /.*/) do |_, mirror| urls.each do |url| url_string = string_content(parameters(url).first) @@ -220,7 +230,7 @@ module RuboCop # Use new-style archive downloads archive_gh_pattern = %r{https://.*github.*/(?:tar|zip)ball/} audit_urls(urls, archive_gh_pattern) do |_, url| - next if url.match?(/\.git$/) + next if url.end_with?(".git") problem "Use /archive/ URLs for GitHub tarballs (url is #{url})." end diff --git a/Library/Homebrew/rubocops/version.rb b/Library/Homebrew/rubocops/version.rb new file mode 100644 index 0000000000..f4ed91c18d --- /dev/null +++ b/Library/Homebrew/rubocops/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require "rubocops/extend/formula" + +module RuboCop + module Cop + module FormulaAudit + class Version < FormulaCop + def audit_formula(_node, _class_node, _parent_class_node, body_node) + version_node = find_node_method_by_name(body_node, :version) + return unless version_node + + version = string_content(parameters(version_node).first) + + problem "version is set to an empty string" if version.empty? + + problem "version #{version} should not have a leading 'v'" if version.start_with?("v") + + return unless version.match?(/_\d+$/) + + problem "version #{version} should not end with an underline and a number" + end + end + end + end +end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index d3e6410cba..0e31f23b9f 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -11,7 +11,6 @@ require "patch" require "compilers" require "global" require "os/mac/version" -require "cli/parser" class SoftwareSpec extend Forwardable @@ -96,7 +95,7 @@ class SoftwareSpec def bottled? bottle_specification.tag?(Utils::Bottles.tag) && \ - (bottle_specification.compatible_cellar? || Homebrew.args.force_bottle) + (bottle_specification.compatible_cellar? || Homebrew.args.force_bottle?) end def bottle(disable_type = nil, disable_reason = nil, &block) @@ -275,7 +274,7 @@ class Bottle end def bintray - "#{name}-#{version}#{extname}" + ERB::Util.url_encode("#{name}-#{version}#{extname}") end def extname diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 7285de1926..4c2c57d0ec 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -78,7 +78,7 @@ module Homebrew case output_type when :print args << "--debug" if ARGV.debug? - args << "--display-cop-names" if ARGV.include? "--display-cop-names" + args << "--display-cop-names" if Homebrew.args.display_cop_names? args << "--format" << "simple" if files system(cache_env, "rubocop", *args) rubocop_success = $CHILD_STATUS.success? diff --git a/Library/Homebrew/test/.rubocop_todo.yml b/Library/Homebrew/test/.rubocop_todo.yml index e3fca6d865..18986235db 100644 --- a/Library/Homebrew/test/.rubocop_todo.yml +++ b/Library/Homebrew/test/.rubocop_todo.yml @@ -12,53 +12,6 @@ RSpec/ExampleLength: Exclude: - 'rubocops/patches_spec.rb' -# Offense count: 41 -# Configuration parameters: CustomTransform, IgnoreMethods. -RSpec/FilePath: - Exclude: - - 'ARGV_spec.rb' - - 'PATH_spec.rb' - - 'bottle_filename_spec.rb' - - 'cache_store_spec.rb' - - 'cask/artifact/alt_target_spec.rb' - - 'cask/artifact/generic_artifact_spec.rb' - - 'cask/artifact/two_apps_correct_spec.rb' - - 'cask/artifact/uninstall_no_zap_spec.rb' - - 'cask/cask_loader/from__path_loader_spec.rb' - - 'cask/macos_spec.rb' - - 'cli/parser_spec.rb' - - 'checksum_verification_spec.rb' - - 'cxxstdlib_spec.rb' - - 'diagnostic_checks_spec.rb' - - 'env_config_spec.rb' - - 'missing_formula_spec.rb' - - 'os/linux/diagnostic_spec.rb' - - 'os/mac/diagnostic_spec.rb' - - 'requirements/macos_requirement_spec.rb' - - 'rubocops/cask/homepage_matches_url_spec.rb' - - 'rubocops/cask/homepage_url_trailing_slash_spec.rb' - - 'rubocops/cask/no_dsl_version_spec.rb' - - 'rubocops/cask/stanza_grouping_spec.rb' - - 'rubocops/cask/stanza_order_spec.rb' - - 'rubocops/caveats_spec.rb' - - 'rubocops/components_order_spec.rb' - - 'rubocops/components_redundancy_spec.rb' - - 'rubocops/conflicts_spec.rb' - - 'rubocops/dependency_order_spec.rb' - - 'rubocops/files_spec.rb' - - 'rubocops/homepage_spec.rb' - - 'rubocops/options_spec.rb' - - 'rubocops/patches_spec.rb' - - 'rubocops/text_spec.rb' - - 'rubocops/uses_from_macos_spec.rb' - - 'rubocops/formula_desc_spec.rb' - - 'search_spec.rb' - - 'string_spec.rb' - - 'style_spec.rb' - - 'system_command_result_spec.rb' - - 'unpack_strategy/p7zip_spec.rb' - - 'utils/github_spec.rb' - # Offense count: 6 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: @@ -83,6 +36,7 @@ RSpec/MultipleDescribes: - 'cmd/cleanup_spec.rb' - 'cmd/commands_spec.rb' - 'cmd/config_spec.rb' + - 'cmd/deps_spec.rb' - 'cmd/desc_spec.rb' - 'cmd/doctor_spec.rb' - 'cmd/fetch_spec.rb' diff --git a/Library/Homebrew/test/cask/cmd/info_spec.rb b/Library/Homebrew/test/cask/cmd/info_spec.rb index 01fd90d27a..7d529f7112 100644 --- a/Library/Homebrew/test/cask/cmd/info_spec.rb +++ b/Library/Homebrew/test/cask/cmd/info_spec.rb @@ -2,6 +2,7 @@ require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" +require "utils" describe Cask::Cmd::Info, :cask do it_behaves_like "a command that requires a Cask token" @@ -139,7 +140,16 @@ describe Cask::Cmd::Info, :cask do EOS end - it "can run be run with a url twice", :needs_network do + it "can run be run with a url twice and returns analytics", :needs_network do + analytics = { + "analytics" => { + "install" => { + "30d" => { "docker" => 1000 }, "90d" => { "docker" => 2000 }, "365d" => { "docker" => 3000 } + }, + }, + } + expect(Utils::Analytics).to receive(:formulae_brew_sh_json).twice.with("cask/docker.json") + .and_return(analytics) expect { described_class.run("https://raw.githubusercontent.com/Homebrew/homebrew-cask" \ "/d0b2c58652ae5eff20a7a4ac93292a08b250912b/Casks/docker.rb") @@ -155,6 +165,8 @@ describe Cask::Cmd::Info, :cask do Docker CE ==> Artifacts Docker.app (App) + ==> Analytics + install: 1,000 (30 days), 2,000 (90 days), 3,000 (365 days) ==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/d0b2c58652ae5eff20a7a4ac93292a08b250912b/Casks/docker.rb. docker: 2.0.0.2-ce-mac81,30215 (auto_updates) https://www.docker.com/community-edition @@ -164,6 +176,8 @@ describe Cask::Cmd::Info, :cask do Docker CE ==> Artifacts Docker.app (App) + ==> Analytics + install: 1,000 (30 days), 2,000 (90 days), 3,000 (365 days) EOS end end diff --git a/Library/Homebrew/test/cmd/deps_spec.rb b/Library/Homebrew/test/cmd/deps_spec.rb index 8ec40bffbd..f63454712a 100644 --- a/Library/Homebrew/test/cmd/deps_spec.rb +++ b/Library/Homebrew/test/cmd/deps_spec.rb @@ -1,5 +1,11 @@ # frozen_string_literal: true +require "cmd/shared_examples/args_parse" + +describe "Homebrew.deps_args" do + it_behaves_like "parseable arguments" +end + describe "brew deps", :integration_test do it "outputs all of a Formula's dependencies and their dependencies on separate lines" do setup_test_formula "foo" diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index 0bc91c86c5..b0623567a3 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -14,6 +14,17 @@ describe "brew install", :integration_test do .to output(%r{#{HOMEBREW_CELLAR}/testball1/0\.1}).to_stdout .and not_to_output.to_stderr .and be_a_success + expect(HOMEBREW_CELLAR/"testball1/0.1/foo/test").not_to be_a_file + end + + it "installs formulae with options" do + setup_test_formula "testball1" + + expect { brew "install", "testball1", "--with-foo" } + .to output(%r{#{HOMEBREW_CELLAR}/testball1/0\.1}).to_stdout + .and not_to_output.to_stderr + .and be_a_success + expect(HOMEBREW_CELLAR/"testball1/0.1/foo/test").to be_a_file end it "can install keg-only Formulae" do @@ -27,6 +38,7 @@ describe "brew install", :integration_test do .to output(%r{#{HOMEBREW_CELLAR}/testball1/1\.0}).to_stdout .and not_to_output.to_stderr .and be_a_success + expect(HOMEBREW_CELLAR/"testball1/1.0/foo/test").not_to be_a_file end it "can install HEAD Formulae" do @@ -59,5 +71,6 @@ describe "brew install", :integration_test do .to output(%r{#{HOMEBREW_CELLAR}/testball1/HEAD\-d5eb689}).to_stdout .and output(/Cloning into/).to_stderr .and be_a_success + expect(HOMEBREW_CELLAR/"testball1/HEAD-d5eb689/foo/test").not_to be_a_file end end diff --git a/Library/Homebrew/test/cmd/shared_examples/args_parse.rb b/Library/Homebrew/test/cmd/shared_examples/args_parse.rb index 9cc16d455a..c9e8cc1d80 100644 --- a/Library/Homebrew/test/cmd/shared_examples/args_parse.rb +++ b/Library/Homebrew/test/cmd/shared_examples/args_parse.rb @@ -3,11 +3,12 @@ shared_examples "parseable arguments" do subject(:method_name) do |example| example.metadata[:example_group][:parent_example_group][:description] - .gsub(/^Homebrew\./, "") + .delete_prefix("Homebrew.") end let(:command_name) do - method_name.gsub(/_args$/, "").tr("_", "-") + method_name.delete_suffix("_args") + .tr("_", "-") end it "can parse arguments" do diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 895d339aef..132d70bf40 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -300,69 +300,6 @@ module Homebrew end end - describe "#audit_keg_only" do - specify "keg_only_needs_downcasing" do - fa = formula_auditor "foo", <<~RUBY, strict: true - class Foo < Formula - url "https://brew.sh/foo-1.0.tgz" - - keg_only "Because why not" - end - RUBY - - fa.audit_keg_only - expect(fa.problems) - .to eq(["'Because' from the keg_only reason should be 'because'.\n"]) - end - - specify "keg_only_redundant_period" do - fa = formula_auditor "foo", <<~RUBY, strict: true - class Foo < Formula - url "https://brew.sh/foo-1.0.tgz" - - keg_only "because this line ends in a period." - end - RUBY - - fa.audit_keg_only - expect(fa.problems) - .to eq(["keg_only reason should not end with a period."]) - end - - specify "keg_only_handles_block_correctly" do - fa = formula_auditor "foo", <<~RUBY, strict: true - class Foo < Formula - url "https://brew.sh/foo-1.0.tgz" - - keg_only <<~EOF - this line starts with a lowercase word. - - This line does not but that shouldn't be a - problem - EOF - end - RUBY - - fa.audit_keg_only - expect(fa.problems) - .to eq([]) - end - - specify "keg_only_handles_whitelist_correctly" do - fa = formula_auditor "foo", <<~RUBY, strict: true - class Foo < Formula - url "https://brew.sh/foo-1.0.tgz" - - keg_only "Apple ships foo in the CLT package" - end - RUBY - - fa.audit_keg_only - expect(fa.problems) - .to eq([]) - end - end - describe "#audit_revision_and_version_scheme" do subject { fa = described_class.new(Formulary.factory(formula_path)) diff --git a/Library/Homebrew/test/formula_installer_bottle_spec.rb b/Library/Homebrew/test/formula_installer_bottle_spec.rb index bf2d6576b4..87842ff27b 100644 --- a/Library/Homebrew/test/formula_installer_bottle_spec.rb +++ b/Library/Homebrew/test/formula_installer_bottle_spec.rb @@ -24,7 +24,10 @@ describe FormulaInstaller do stub_formula_loader formula("gcc") { url "gcc-1.0" } stub_formula_loader formula("patchelf") { url "patchelf-1.0" } allow(Formula["patchelf"]).to receive(:latest_version_installed?).and_return(true) - described_class.new(formula).install + + fi = FormulaInstaller.new(formula) + fi.fetch + fi.install keg = Keg.new(formula.prefix) diff --git a/Library/Homebrew/test/formula_installer_spec.rb b/Library/Homebrew/test/formula_installer_spec.rb index 6ddef8faad..53fd117e03 100644 --- a/Library/Homebrew/test/formula_installer_spec.rb +++ b/Library/Homebrew/test/formula_installer_spec.rb @@ -22,6 +22,7 @@ describe FormulaInstaller do installer = described_class.new(formula) + installer.fetch installer.install keg = Keg.new(formula.prefix) @@ -156,6 +157,7 @@ describe FormulaInstaller do it "shows audit problems if HOMEBREW_DEVELOPER is set" do ENV["HOMEBREW_DEVELOPER"] = "1" + formula_installer.fetch formula_installer.install expect(formula_installer).to receive(:audit_installed).and_call_original formula_installer.caveats diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 43b0c4b2e5..6daf45f1ab 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -698,6 +698,43 @@ describe Formula do expect(f1.test_fixtures("foo")).to eq(Pathname.new("#{HOMEBREW_LIBRARY_PATH}/test/support/fixtures/foo")) end + specify "#livecheck" do + f = formula do + url "https://brew.sh/test-1.0.tbz" + livecheck do + skip "foo" + url "https://brew.sh/test/releases" + regex(/test-(\d+(?:\.\d+)+)\.tbz/) + end + end + + expect(f.livecheck.skip?).to be true + expect(f.livecheck.skip_msg).to eq("foo") + expect(f.livecheck.url).to eq("https://brew.sh/test/releases") + expect(f.livecheck.regex).to eq(/test-(\d+(?:\.\d+)+)\.tbz/) + end + + describe "#livecheckable?" do + specify "no livecheck block defined" do + f = formula do + url "https://brew.sh/test-1.0.tbz" + end + + expect(f.livecheckable?).to be false + end + + specify "livecheck block defined" do + f = formula do + url "https://brew.sh/test-1.0.tbz" + livecheck do + regex(/test-(\d+(?:.\d+)+).tbz/) + end + end + + expect(f.livecheckable?).to be true + end + end + specify "dependencies" do f1 = formula "f1" do url "f1-1.0" diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 3170b71cb2..157b608050 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -149,6 +149,7 @@ describe Formulary do let(:installer) { FormulaInstaller.new(installed_formula) } it "returns a Formula when given a rack" do + installer.fetch installer.install f = described_class.from_rack(installed_formula.rack) @@ -156,6 +157,7 @@ describe Formulary do end it "returns a Formula when given a Keg" do + installer.fetch installer.install keg = Keg.new(installed_formula.prefix) diff --git a/Library/Homebrew/test/livecheck_spec.rb b/Library/Homebrew/test/livecheck_spec.rb new file mode 100644 index 0000000000..f975548cda --- /dev/null +++ b/Library/Homebrew/test/livecheck_spec.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require "livecheck" + +describe Livecheck do + subject(:livecheckable) { described_class.new } + + describe "#regex" do + it "returns nil if unset" do + expect(livecheckable.regex).to be nil + end + + it "returns the Regex if set" do + livecheckable.regex(/foo/) + expect(livecheckable.regex).to eq(/foo/) + end + end + + describe "#skip" do + it "sets the instance variable skip to true and skip_msg to nil when the argument is not present" do + livecheckable.skip + expect(livecheckable.instance_variable_get(:@skip)).to be true + expect(livecheckable.instance_variable_get(:@skip_msg)).to be nil + end + + it "sets the instance variable skip to true and skip_msg to the argument when present" do + livecheckable.skip("foo") + expect(livecheckable.instance_variable_get(:@skip)).to be true + expect(livecheckable.instance_variable_get(:@skip_msg)).to eq("foo") + end + end + + describe "#skip?" do + it "returns the value of the instance variable skip" do + expect(livecheckable.skip?).to be false + livecheckable.skip + expect(livecheckable.skip?).to be true + end + end + + describe "#url" do + it "returns nil if unset" do + expect(livecheckable.url).to be nil + end + + it "returns the URL if set" do + livecheckable.url("foo") + expect(livecheckable.url).to eq("foo") + end + end + + describe "#to_hash" do + it "returns a Hash of all instance variables" do + expect(livecheckable.to_hash).to eq({ "regex"=>nil, "skip"=>false, "skip_msg"=>nil, "url"=>nil }) + end + end +end diff --git a/Library/Homebrew/test/messages_spec.rb b/Library/Homebrew/test/messages_spec.rb index c34dfbe141..9bf48c58aa 100644 --- a/Library/Homebrew/test/messages_spec.rb +++ b/Library/Homebrew/test/messages_spec.rb @@ -76,8 +76,8 @@ describe Messages do # rubocop:disable RSpec/VerifiedDoubles context "when the --display-times argument is present" do before do - allow(Homebrew).to receive(:args) - .and_return(double(display_times?: true, flags_only: ["--display-times"])) + allow(Homebrew).to receive(:args).and_return \ + double(display_times?: true, flags_only: ["--display-times"]) end context "when install_times is empty" do diff --git a/Library/Homebrew/test/os/mac/formula_spec.rb b/Library/Homebrew/test/os/mac/formula_spec.rb index 289703cfdd..c966aef3d0 100644 --- a/Library/Homebrew/test/os/mac/formula_spec.rb +++ b/Library/Homebrew/test/os/mac/formula_spec.rb @@ -3,6 +3,43 @@ require "formula" describe Formula do + describe "#uses_from_macos" do + before do + allow(OS).to receive(:mac?).and_return(true) + allow(OS::Mac).to receive(:version).and_return(OS::Mac::Version.from_symbol(:sierra)) + end + + it "adds a macOS dependency to all specs if the OS version meets requirements" do + f = formula "foo" do + url "foo-1.0" + + uses_from_macos("foo", since: :el_capitan) + end + + expect(f.class.stable.deps).to be_empty + expect(f.class.devel.deps).to be_empty + expect(f.class.head.deps).to be_empty + expect(f.class.stable.uses_from_macos_elements.first).to eq("foo") + expect(f.class.devel.uses_from_macos_elements.first).to eq("foo") + expect(f.class.head.uses_from_macos_elements.first).to eq("foo") + end + + it "doesn't add a macOS dependency to any spec if the OS version doesn't meet requirements" do + f = formula "foo" do + url "foo-1.0" + + uses_from_macos("foo", since: :high_sierra) + end + + expect(f.class.stable.deps.first.name).to eq("foo") + expect(f.class.devel.deps.first.name).to eq("foo") + expect(f.class.head.deps.first.name).to eq("foo") + expect(f.class.stable.uses_from_macos_elements).to be_empty + expect(f.class.devel.uses_from_macos_elements).to be_empty + expect(f.class.head.uses_from_macos_elements).to be_empty + end + end + describe "#on_macos" do it "defines an url on macos only" do f = formula do diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index 1edc7fd499..821cbd64a1 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -19,6 +19,23 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do RUBY end + it "When `bottle` precedes `livecheck`" do + expect_offense(<<~RUBY) + class Foo < Formula + homepage "https://brew.sh" + url "https://brew.sh/foo-1.0.tgz" + + bottle :unneeded + + livecheck do + ^^^^^^^^^^^^ `livecheck` (line 7) should be put before `bottle` (line 5) + url "https://brew.sh/foo/versions/" + regex(/href=.+?foo-(\d+(?:\.\d+)+)\.t/) + end + end + RUBY + end + it "When url precedes homepage" do expect_offense(<<~RUBY) class Foo < Formula diff --git a/Library/Homebrew/test/rubocops/keg_only_spec.rb b/Library/Homebrew/test/rubocops/keg_only_spec.rb new file mode 100644 index 0000000000..81112da206 --- /dev/null +++ b/Library/Homebrew/test/rubocops/keg_only_spec.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require "rubocops/keg_only" + +describe RuboCop::Cop::FormulaAudit::KegOnly do + subject(:cop) { described_class.new } + + specify "keg_only_needs_downcasing" do + expect_offense(<<~RUBY) + class Foo < Formula + + url "https://brew.sh/foo-1.0.tgz" + homepage "https://brew.sh" + + keg_only "Because why not" + ^^^^^^^^^^^^^^^^^^^^^^^^^^ 'Because' from the keg_only reason should be 'because'. + end + RUBY + end + + specify "keg_only_redundant_period" do + expect_offense(<<~RUBY) + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + homepage "https://brew.sh" + + keg_only "ending with a period." + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ keg_only reason should not end with a period. + end + RUBY + end + + specify "keg_only_handles_block_correctly" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + homepage "https://brew.sh" + + keg_only <<~EOF + this line starts with a lowercase word. + + This line does not but that shouldn't be a + problem + EOF + end + RUBY + end + + specify "keg_only_handles_whitelist_correctly" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + homepage "https://brew.sh" + + keg_only "Apple ships foo in the CLT package" + end + RUBY + end + + specify "keg_only does not need downcasing of formula name in reason" do + filename = Formulary.core_path("foo") + File.open(filename, "w") do |file| + FileUtils.chmod "-rwx", filename + + expect_no_offenses(<<~RUBY, file) + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + + keg_only "Foo is the formula name hence downcasing is not required" + end + RUBY + end + end +end diff --git a/Library/Homebrew/test/rubocops/patches_spec.rb b/Library/Homebrew/test/rubocops/patches_spec.rb index d2ed6ce03a..f2a0fc25a7 100644 --- a/Library/Homebrew/test/rubocops/patches_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_spec.rb @@ -68,7 +68,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do line: 5, column: 33, source: source }] - elsif patch_url.match?(%r{^http://trac\.macports\.org}) + elsif patch_url.start_with?("http://trac.macports.org") [{ message: <<~EOS.chomp, Patches from MacPorts Trac should be https://, not http: @@ -78,7 +78,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do line: 5, column: 5, source: source }] - elsif patch_url.match?(%r{^http://bugs\.debian\.org}) + elsif patch_url.start_with?("http://bugs.debian.org") [{ message: <<~EOS.chomp, Patches from Debian should be https://, not http: @@ -205,7 +205,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do line: 5, column: 37, source: source }] - elsif patch_url.match?(%r{^http://trac\.macports\.org}) + elsif patch_url.start_with?("http://trac.macports.org") [{ message: <<~EOS.chomp, Patches from MacPorts Trac should be https://, not http: @@ -215,7 +215,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do line: 5, column: 9, source: source }] - elsif patch_url.match?(%r{^http://bugs\.debian\.org}) + elsif patch_url.start_with?("http://bugs.debian.org") [{ message: <<~EOS.chomp, Patches from Debian should be https://, not http: diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index c3a547f435..24c33cf60a 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -159,6 +159,26 @@ describe RuboCop::Cop::FormulaAudit::Urls do "not a source archive; homebrew/core is source-only.", "col" => 2, "formula_tap" => "homebrew-core", + }, { + "url" => "cvs://brew.sh/foo/bar", + "msg" => "Use of the cvs:// scheme is deprecated, pass `:using => :cvs` instead", + "col" => 2, + }, { + "url" => "bzr://brew.sh/foo/bar", + "msg" => "Use of the bzr:// scheme is deprecated, pass `:using => :bzr` instead", + "col" => 2, + }, { + "url" => "hg://brew.sh/foo/bar", + "msg" => "Use of the hg:// scheme is deprecated, pass `:using => :hg` instead", + "col" => 2, + }, { + "url" => "fossil://brew.sh/foo/bar", + "msg" => "Use of the fossil:// scheme is deprecated, pass `:using => :fossil` instead", + "col" => 2, + }, { + "url" => "svn+http://brew.sh/foo/bar", + "msg" => "Use of the svn+http:// scheme is deprecated, pass `:using => :svn` instead", + "col" => 2, }] } diff --git a/Library/Homebrew/test/rubocops/version_spec.rb b/Library/Homebrew/test/rubocops/version_spec.rb new file mode 100644 index 0000000000..45ac7ecf1e --- /dev/null +++ b/Library/Homebrew/test/rubocops/version_spec.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require "rubocops/version" + +describe RuboCop::Cop::FormulaAudit::Version do + subject(:cop) { described_class.new } + + context "When auditing version" do + it "version should not be an empty string" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + version "" + ^^^^^^^^^^ version is set to an empty string + end + RUBY + end + + it "version should not have a leading 'v'" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + version "v1.0" + ^^^^^^^^^^^^^^ version v1.0 should not have a leading 'v' + end + RUBY + end + + it "version should not end with underline and number" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + version "1_0" + ^^^^^^^^^^^^^ version 1_0 should not end with an underline and a number + end + RUBY + end + end +end diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 65490fddfa..f40e98cb25 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -39,6 +39,7 @@ require "rspec/retry" require "rubocop" require "rubocop/rspec/support" require "find" +require "byebug" $LOAD_PATH.push(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/test/support/lib")) @@ -177,7 +178,7 @@ RSpec.configure do |config| @__stdout = $stdout.clone @__stderr = $stderr.clone - unless example.metadata.key?(:focus) || ENV.key?("VERBOSE_TESTS") + if (example.metadata.keys & [:focus, :byebug]).empty? && !ENV.key?("VERBOSE_TESTS") $stdout.reopen(File::NULL) $stderr.reopen(File::NULL) end 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 0a28b8b558..3f4468a3a7 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 @@ -176,6 +176,7 @@ RSpec.shared_context "integration test" do setup_test_formula(name, content) fi = FormulaInstaller.new(Formula[name]) fi.build_bottle = build_bottle + fi.fetch fi.prelude fi.install fi.finish diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index c0d4e33e6f..d4844080bd 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -4,19 +4,19 @@ require "utils/shell" describe Utils::Shell do describe "::profile" do - it "returns ~/.bash_profile by default" do + it "returns ~/.profile by default" do ENV["SHELL"] = "/bin/another_shell" - expect(subject.profile).to eq("~/.bash_profile") + expect(subject.profile).to eq("~/.profile") end - it "returns ~/.bash_profile for sh" do + it "returns ~/.profile for sh" do ENV["SHELL"] = "/bin/sh" - expect(subject.profile).to eq("~/.bash_profile") + expect(subject.profile).to eq("~/.profile") end - it "returns ~/.bash_profile for Bash" do + it "returns ~/.profile for Bash" do ENV["SHELL"] = "/bin/bash" - expect(subject.profile).to eq("~/.bash_profile") + expect(subject.profile).to eq("~/.profile") end it "returns /tmp/.zshrc for Zsh if ZDOTDIR is /tmp" do diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index d4e8fa2536..b440a9553f 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -437,13 +437,13 @@ module Kernel n_back_bytes = max_bytes_in - n_front_bytes if n_front_bytes.zero? front = bytes[1..0] - back = bytes[-max_bytes_in..-1] + back = bytes[-max_bytes_in..] elsif n_back_bytes.zero? front = bytes[0..(max_bytes_in - 1)] back = bytes[1..0] else front = bytes[0..(n_front_bytes - 1)] - back = bytes[-n_back_bytes..-1] + back = bytes[-n_back_bytes..] end out = front + glue_bytes + back out.force_encoding("UTF-8") diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index eea5d8fe18..3c27ae4e9d 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -67,7 +67,7 @@ module Utils return if exception.formula.tap.private? action = exception.formula.full_name - if (options = exception.options&.to_a&.join(" ")) + if (options = exception.options.to_a.map(&:to_s).join(" ").presence) action = "#{action} #{options}".strip end report_event("BuildError", action) @@ -119,7 +119,7 @@ module Utils def output(filter: nil) days = Homebrew.args.days || "30" category = Homebrew.args.category || "install" - json = formulae_api_json("analytics/#{category}/#{days}d.json") + json = formulae_brew_sh_json("analytics/#{category}/#{days}d.json") return if json.blank? || json["items"].blank? os_version = category == "os-version" @@ -147,10 +147,7 @@ module Utils table_output(category, days, results, os_version: os_version, cask_install: cask_install) end - def formula_output(f) - json = formulae_api_json("#{formula_path}/#{f}.json") - return if json.blank? || json["analytics"].blank? - + def get_analytics(json) full_analytics = Homebrew.args.analytics? || Homebrew.args.verbose? ohai "Analytics" @@ -179,6 +176,20 @@ module Utils end end + def formula_output(f) + json = formulae_brew_sh_json("#{formula_path}/#{f}.json") + return if json.blank? || json["analytics"].blank? + + get_analytics(json) + end + + def cask_output(cask) + json = formulae_brew_sh_json("#{cask_path}/#{cask}.json") + return if json.blank? || json["analytics"].blank? + + get_analytics(json) + end + def custom_prefix_label "custom-prefix" end @@ -307,7 +318,7 @@ module Utils end end - def formulae_api_json(endpoint) + def formulae_brew_sh_json(endpoint) return if Homebrew::EnvConfig.no_analytics? || Homebrew::EnvConfig.no_github_api? output, = curl_output("--max-time", "5", @@ -336,6 +347,10 @@ module Utils "analytics" end alias generic_analytics_path analytics_path + + def cask_path + "cask" + end end end end diff --git a/Library/Homebrew/utils/fork.rb b/Library/Homebrew/utils/fork.rb index bd8066b3fc..6427193ce8 100644 --- a/Library/Homebrew/utils/fork.rb +++ b/Library/Homebrew/utils/fork.rb @@ -5,11 +5,13 @@ require "socket" module Utils def self.rewrite_child_error(child_error) - error = if child_error.inner_class == ErrorDuringExecution + error = if child_error.inner["cmd"] && + child_error.inner_class == ErrorDuringExecution ErrorDuringExecution.new(child_error.inner["cmd"], status: child_error.inner["status"], output: child_error.inner["output"]) - elsif child_error.inner_class == BuildError + elsif child_error.inner["cmd"] && + child_error.inner_class == BuildError # We fill `BuildError#formula` and `BuildError#options` in later, # when we rescue this in `FormulaInstaller#build`. BuildError.new(nil, child_error.inner["cmd"], diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index a6f233a259..32f187afca 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -39,9 +39,15 @@ module Utils # return the shell profile file based on user's preferred shell def profile - return "#{ENV["ZDOTDIR"]}/.zshrc" if preferred == :zsh && ENV["ZDOTDIR"].present? + case preferred + when :bash + bash_profile = "#{ENV["HOME"]}/.bash_profile" + return bash_profile if File.exist? bash_profile + when :zsh + return "#{ENV["ZDOTDIR"]}/.zshrc" if ENV["ZDOTDIR"].present? + end - SHELL_PROFILE_MAP.fetch(preferred, "~/.bash_profile") + SHELL_PROFILE_MAP.fetch(preferred, "~/.profile") end def set_variable_in_profile(variable, value) @@ -67,12 +73,12 @@ module Utils end SHELL_PROFILE_MAP = { - bash: "~/.bash_profile", + bash: "~/.profile", csh: "~/.cshrc", fish: "~/.config/fish/config.fish", ksh: "~/.kshrc", mksh: "~/.kshrc", - sh: "~/.bash_profile", + sh: "~/.profile", tcsh: "~/.tcshrc", zsh: "~/.zshrc", }.freeze diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index bb5b6581f2..4dd5a37499 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -5,40 +5,40 @@ ruby_version = RbConfig::CONFIG["ruby_version"] path = File.expand_path('..', __FILE__) $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.8.2/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.14.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.14.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thread_safe-0.3.6/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-1.2.7/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.3.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-6.0.2.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-6.0.3.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ast-2.4.0/lib" $:.unshift "#{path}/" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/byebug-11.1.3" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/byebug-11.1.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/connection_pool-2.2.2/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/json-2.3.0" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/json-2.3.0" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/json-2.3.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/docile-1.3.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.10.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-0.16.1/lib" -$:.unshift "#{path}/../../portable-ruby/2.6.3/lib/ruby/gems/2.6.0/gems/sync-0.5.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tins-1.24.1/lib" +$:.unshift "#{path}/../../../../../../../../Library/Ruby/Gems/2.6.0/gems/sync-0.5.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tins-1.25.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/term-ansicolor-1.7.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thor-1.0.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/coveralls-0.8.23/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/diff-lcs-1.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/unf_ext-0.0.7.7" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/unf_ext-0.0.7.7" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unf_ext-0.0.7.7/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unf-0.1.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/domain_name-0.5.20190701/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/hpricot-0.8.6" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/hpricot-0.8.6" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/hpricot-0.8.6/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/http-cookie-1.0.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/jaro_winkler-1.5.4" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/jaro_winkler-1.5.4/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-data-3.2020.0425/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-data-3.2020.0512/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-3.3.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-digest_auth-1.4.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-persistent-4.0.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mini_portile2-2.4.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/nokogiri-1.10.9" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.9" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/nokogiri-1.10.9/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ntlm-http-0.1.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/webrobots-0.1.2/lib" @@ -49,21 +49,22 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel_tests-2.32.0 $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parser-2.7.1.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.5.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rainbow-3.0.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-13/2.6.0-static/rdiscount-2.2.0.1" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/rdiscount-2.2.0.1" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rdiscount-2.2.0.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rexml-3.2.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ronn-0.7.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-support-3.9.2/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-core-3.9.1/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-expectations-3.9.1/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-support-3.9.3/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-core-3.9.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-expectations-3.9.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-mocks-3.9.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-3.9.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-its-1.3.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-retry-0.6.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-0.0.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.7.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.82.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.5.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.84.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.6.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.39.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/option_merger.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/option_merger.rb deleted file mode 100644 index ab9ca727f6..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/option_merger.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require "active_support/core_ext/hash/deep_merge" - -module ActiveSupport - class OptionMerger #:nodoc: - instance_methods.each do |method| - undef_method(method) if method !~ /^(__|instance_eval|class|object_id)/ - end - - def initialize(context, options) - @context, @options = context, options - end - - private - def method_missing(method, *arguments, &block) - if arguments.first.is_a?(Proc) - proc = arguments.pop - arguments << lambda { |*args| @options.deep_merge(proc.call(*args)) } - else - arguments << (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup) - end - - @context.__send__(method, *arguments, &block) - end - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/actionable_error.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/actionable_error.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/actionable_error.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/actionable_error.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/array_inquirer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/array_inquirer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/array_inquirer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/array_inquirer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/backtrace_cleaner.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/backtrace_cleaner.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/backtrace_cleaner.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/backtrace_cleaner.rb index 02cbfbaee6..f55e821e10 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/backtrace_cleaner.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/backtrace_cleaner.rb @@ -85,7 +85,6 @@ module ActiveSupport end private - FORMATTED_GEMS_PATTERN = /\A[^\/]+ \([\w.]+\) / def add_gem_filter diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/benchmarkable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/benchmarkable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/benchmarkable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/benchmarkable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/builder.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/builder.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/builder.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/builder.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb index d0644a0f7e..11746e0537 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/callbacks.rb @@ -142,7 +142,6 @@ module ActiveSupport end private - # A hook invoked every time a before callback is halted. # This can be overridden in ActiveSupport::Callbacks implementors in order # to provide better debugging/logging. @@ -582,7 +581,6 @@ module ActiveSupport attr_reader :chain private - def append_one(callback) @callbacks = nil remove_duplicates(callback) @@ -843,7 +841,6 @@ module ActiveSupport end protected - def get_callbacks(name) # :nodoc: __callbacks[name.to_sym] end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/concern.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concern.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/concern.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concern.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/configurable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/configurable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/configurable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/configurable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/conversions.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/conversions.rb index ea688ed2ea..0780c4ed8a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/conversions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/conversions.rb @@ -74,13 +74,13 @@ class Array case length when 0 - "" + +"" when 1 - "#{self[0]}" + +"#{self[0]}" when 2 - "#{self[0]}#{options[:two_words_connector]}#{self[1]}" + +"#{self[0]}#{options[:two_words_connector]}#{self[1]}" else - "#{self[0...-1].join(options[:words_connector])}#{options[:last_word_connector]}#{self[-1]}" + +"#{self[0...-1].join(options[:words_connector])}#{options[:last_word_connector]}#{self[-1]}" end end @@ -181,7 +181,7 @@ class Array # # def to_xml(options = {}) - require "active_support/builder" unless defined?(Builder) + require "active_support/builder" unless defined?(Builder::XmlMarkup) options = options.dup options[:indent] ||= 2 diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/extract.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/extract.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/extract.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/extract.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/extract_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/extract_options.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/extract_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/extract_options.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/grouping.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/grouping.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/grouping.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/grouping.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/prepend_and_append.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/prepend_and_append.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/prepend_and_append.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/prepend_and_append.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/wrap.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/wrap.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/wrap.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/array/wrap.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/benchmark.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/benchmark.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/benchmark.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/benchmark.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/big_decimal.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/big_decimal.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/big_decimal.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/big_decimal.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/big_decimal/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/big_decimal/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/big_decimal/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/big_decimal/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/attribute.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class/attribute.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/attribute.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class/attribute.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/attribute_accessors.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class/attribute_accessors.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/attribute_accessors.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class/attribute_accessors.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/subclasses.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class/subclasses.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/subclasses.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/class/subclasses.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/acts_like.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/acts_like.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/acts_like.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/acts_like.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/calculations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/calculations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/calculations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/calculations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/zones.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/zones.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date/zones.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date/zones.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/calculations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/calculations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/calculations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/calculations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/compatibility.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/compatibility.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/compatibility.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/compatibility.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/zones.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/zones.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/zones.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/zones.rb index 894fd9b76d..fb6a27cb27 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_and_time/zones.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_and_time/zones.rb @@ -29,7 +29,6 @@ module DateAndTime end private - def time_with_zone(time, zone) if time ActiveSupport::TimeWithZone.new(time.utc? ? time : time.getutc, zone) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/acts_like.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/acts_like.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/acts_like.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/acts_like.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/calculations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/calculations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/calculations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/calculations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/compatibility.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/compatibility.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/compatibility.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/compatibility.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/conversions.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/conversions.rb index 29725c89f7..231bf870a2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/date_time/conversions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/date_time/conversions.rb @@ -96,7 +96,6 @@ class DateTime end private - def offset_in_seconds (offset * 86400).to_i end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/digest.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/digest.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/digest.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/digest.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/digest/uuid.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/digest/uuid.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/digest/uuid.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/digest/uuid.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/enumerable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/enumerable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/enumerable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/enumerable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/file.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/file.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/file.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/file.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/file/atomic.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/file/atomic.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/file/atomic.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/file/atomic.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/compact.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/compact.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/compact.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/compact.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/conversions.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/conversions.rb index 5b48254646..61cbcaff27 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/conversions.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/conversions.rb @@ -73,7 +73,7 @@ class Hash # configure your own builder with the :builder option. The method also accepts # options like :dasherize and friends, they are forwarded to the builder. def to_xml(options = {}) - require "active_support/builder" unless defined?(Builder) + require "active_support/builder" unless defined?(Builder::XmlMarkup) options = options.dup options[:indent] ||= 2 diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/deep_merge.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/deep_merge.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/deep_merge.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/deep_merge.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/deep_transform_values.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/deep_transform_values.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/deep_transform_values.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/deep_transform_values.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/except.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/except.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/except.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/except.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/indifferent_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/indifferent_access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/indifferent_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/indifferent_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/keys.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/keys.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/keys.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/keys.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/reverse_merge.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/reverse_merge.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/reverse_merge.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/reverse_merge.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/slice.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/slice.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/slice.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/slice.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/transform_values.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/transform_values.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/hash/transform_values.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/hash/transform_values.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer/inflections.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer/inflections.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer/inflections.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer/inflections.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer/multiple.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer/multiple.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer/multiple.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer/multiple.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer/time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer/time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/integer/time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/integer/time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel/concern.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel/concern.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel/concern.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel/concern.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel/reporting.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel/reporting.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel/reporting.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel/reporting.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel/singleton_class.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel/singleton_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/kernel/singleton_class.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/kernel/singleton_class.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/load_error.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/load_error.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/load_error.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/load_error.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/marshal.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/marshal.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/marshal.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/marshal.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/aliasing.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/aliasing.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/aliasing.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/aliasing.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/anonymous.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/anonymous.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/anonymous.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/anonymous.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/attr_internal.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/attr_internal.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/attr_internal.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/attr_internal.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/attribute_accessors.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/attribute_accessors.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/attribute_accessors.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/attribute_accessors.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/concerning.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/concerning.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/concerning.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/concerning.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/delegation.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/delegation.rb index ccdb6f0a7f..893e3aff54 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/delegation.rb @@ -193,7 +193,13 @@ class Module method_names = methods.map do |method| # Attribute writer methods only accept one argument. Makes sure []= # methods still accept two arguments. - definition = /[^\]]=$/.match?(method) ? "arg" : "*args, &block" + definition = if /[^\]]=$/.match?(method) + "arg" + elsif RUBY_VERSION >= "2.7" + "..." + else + "*args, &block" + end # The following generated method calls the target exactly once, storing # the returned value in a dummy variable. @@ -308,6 +314,7 @@ class Module end end end + ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true) RUBY end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/deprecation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/deprecation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/deprecation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/deprecation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/introspection.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/introspection.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/introspection.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/introspection.rb index 9b6df40596..aff8c2f3ce 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/introspection.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/introspection.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "active_support/core_ext/string/filters" require "active_support/inflector" class Module diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/reachable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/reachable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/reachable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/reachable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/redefine_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/redefine_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/redefine_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/redefine_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/remove_method.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/remove_method.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/remove_method.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/module/remove_method.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/name_error.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/name_error.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/name_error.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/name_error.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/bytes.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/bytes.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/bytes.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/bytes.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/numeric/time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/numeric/time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/acts_like.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/acts_like.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/acts_like.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/acts_like.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/blank.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/blank.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/blank.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/blank.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/deep_dup.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/deep_dup.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/deep_dup.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/deep_dup.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/duplicable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/duplicable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/duplicable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/duplicable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/inclusion.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/inclusion.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/inclusion.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/inclusion.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/instance_variables.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/instance_variables.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/instance_variables.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/instance_variables.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/json.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/json.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/to_param.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/to_param.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/to_param.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/to_param.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/to_query.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/to_query.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/to_query.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/to_query.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/try.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/try.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/try.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/try.rb index ef8a1f476d..d4b13fa413 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/try.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/try.rb @@ -15,6 +15,7 @@ module ActiveSupport public_send(method_name, *args, &b) end end + ruby2_keywords(:try) if respond_to?(:ruby2_keywords, true) def try!(method_name = nil, *args, &b) if method_name.nil? && block_given? @@ -27,6 +28,7 @@ module ActiveSupport public_send(method_name, *args, &b) end end + ruby2_keywords(:try!) if respond_to?(:ruby2_keywords, true) end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/with_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/with_options.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/with_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/object/with_options.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/compare_range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/compare_range.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/compare_range.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/compare_range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/each.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/each.rb index 2f22cd0e92..2d86997edf 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/each.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/each.rb @@ -15,7 +15,6 @@ module ActiveSupport end private - def ensure_iteration_allowed raise TypeError, "can't iterate from #{first.class}" if first.is_a?(TimeWithZone) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/include_range.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/include_range.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/include_range.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/include_range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/include_time_with_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/include_time_with_zone.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/include_time_with_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/include_time_with_zone.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/overlaps.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/overlaps.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/range/overlaps.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/range/overlaps.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/regexp.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/regexp.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/regexp.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/regexp.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/securerandom.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/securerandom.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/securerandom.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/securerandom.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/behavior.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/behavior.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/behavior.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/behavior.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/exclude.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/exclude.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/exclude.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/exclude.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/filters.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/filters.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/filters.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/filters.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/indent.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/indent.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/indent.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/indent.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/inflections.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/inflections.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/inflections.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/inflections.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/inquiry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/inquiry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/inquiry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/inquiry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/multibyte.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/multibyte.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/multibyte.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/multibyte.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/output_safety.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/output_safety.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/output_safety.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/output_safety.rb index 62c628e23f..e226779422 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/output_safety.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/output_safety.rb @@ -291,7 +291,6 @@ module ActiveSupport #:nodoc: end private - def html_escape_interpolated_argument(arg) (!html_safe? || arg.html_safe?) ? arg : CGI.escapeHTML(arg.to_s) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/starts_ends_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/starts_ends_with.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/starts_ends_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/starts_ends_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/strip.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/strip.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/strip.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/strip.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/zones.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/zones.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/string/zones.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/string/zones.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/acts_like.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/acts_like.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/acts_like.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/acts_like.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/calculations.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/calculations.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/calculations.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/calculations.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/compatibility.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/compatibility.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/compatibility.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/compatibility.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/conversions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/conversions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/conversions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/conversions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/zones.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/zones.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/zones.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/time/zones.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/uri.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/uri.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/uri.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/core_ext/uri.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/current_attributes.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/current_attributes.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/current_attributes.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/current_attributes.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/behaviors.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/behaviors.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/behaviors.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/behaviors.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/constant_accessor.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/constant_accessor.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/constant_accessor.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/constant_accessor.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/instance_delegator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/instance_delegator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/instance_delegator.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/instance_delegator.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/method_wrappers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/method_wrappers.rb similarity index 80% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/method_wrappers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/method_wrappers.rb index 7c0a54a1d0..bc202ff2e4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/method_wrappers.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/method_wrappers.rb @@ -58,15 +58,21 @@ module ActiveSupport method_names.each do |method_name| if target_module.method_defined?(method_name) || target_module.private_method_defined?(method_name) method = target_module.instance_method(method_name) - target_module.redefine_method(method_name) do |*args, &block| - deprecator.deprecation_warning(method_name, options[method_name]) - method.bind(self).call(*args, &block) + target_module.module_eval do + redefine_method(method_name) do |*args, &block| + deprecator.deprecation_warning(method_name, options[method_name]) + method.bind(self).call(*args, &block) + end + ruby2_keywords(method_name) if respond_to?(:ruby2_keywords, true) end else mod ||= Module.new - mod.define_method(method_name) do |*args, &block| - deprecator.deprecation_warning(method_name, options[method_name]) - super(*args, &block) + mod.module_eval do + define_method(method_name) do |*args, &block| + deprecator.deprecation_warning(method_name, options[method_name]) + super(*args, &block) + end + ruby2_keywords(method_name) if respond_to?(:ruby2_keywords, true) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/proxy_wrappers.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/proxy_wrappers.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/proxy_wrappers.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/proxy_wrappers.rb index 24c75b5661..b6b32e2025 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/proxy_wrappers.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/proxy_wrappers.rb @@ -121,7 +121,7 @@ module ActiveSupport # (Backtrace information…) # ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] class DeprecatedConstantProxy < Module - def self.new(*args, &block) + def self.new(*args, **kwargs, &block) object = args.first return object unless object @@ -145,6 +145,10 @@ module ActiveSupport target.inspect end + # Don't give a deprecation warning on methods that IRB may invoke + # during tab-completion. + delegate :hash, :instance_methods, :name, to: :target + # Returns the class of the new constant. # # PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/reporting.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/reporting.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/deprecation/reporting.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/deprecation/reporting.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/descendants_tracker.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/descendants_tracker.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/descendants_tracker.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/descendants_tracker.rb index 21565138a7..1dad4f923e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/descendants_tracker.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/descendants_tracker.rb @@ -41,7 +41,6 @@ module ActiveSupport end private - def accumulate_descendants(klass, acc) if direct_descendants = @@direct_descendants[klass] direct_descendants.each do |direct_descendant| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/digest.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/digest.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/digest.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/digest.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/duration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/duration.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/duration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/duration.rb index 4ab7b827bb..f1f5253115 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/duration.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/duration.rb @@ -182,15 +182,15 @@ module ActiveSupport # def build(value) parts = {} - remainder = value.to_f + remainder = value.round(9) PARTS.each do |part| unless part == :seconds part_in_seconds = PARTS_IN_SECONDS[part] parts[part] = remainder.div(part_in_seconds) - remainder = (remainder % part_in_seconds).round(9) + remainder %= part_in_seconds end - end + end unless value == 0 parts[:seconds] = remainder @@ -198,7 +198,6 @@ module ActiveSupport end private - def calculate_total_seconds(parts) parts.inject(0) do |total, (part, value)| total + value * PARTS_IN_SECONDS[part] @@ -209,7 +208,7 @@ module ActiveSupport def initialize(value, parts) #:nodoc: @value, @parts = value, parts.to_h @parts.default = 0 - @parts.reject! { |k, v| v.zero? } + @parts.reject! { |k, v| v.zero? } unless value == 0 end def coerce(other) #:nodoc: @@ -372,7 +371,7 @@ module ActiveSupport alias :before :ago def inspect #:nodoc: - return "0 seconds" if parts.empty? + return "#{value} seconds" if parts.empty? parts. sort_by { |unit, _ | PARTS.index(unit) }. @@ -399,10 +398,15 @@ module ActiveSupport end private - def sum(sign, time = ::Time.current) - parts.inject(time) do |t, (type, number)| - if t.acts_like?(:time) || t.acts_like?(:date) + unless time.acts_like?(:time) || time.acts_like?(:date) + raise ::ArgumentError, "expected a time or date, got #{time.inspect}" + end + + if parts.empty? + time.since(sign * value) + else + parts.inject(time) do |t, (type, number)| if type == :seconds t.since(sign * number) elsif type == :minutes @@ -412,8 +416,6 @@ module ActiveSupport else t.advance(type => sign * number) end - else - raise ::ArgumentError, "expected a time or date, got #{time.inspect}" end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/encrypted_configuration.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/encrypted_configuration.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/encrypted_file.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/encrypted_file.rb index 2b7db568a5..544dacb7e5 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/encrypted_file.rb @@ -94,7 +94,7 @@ module ActiveSupport end def handle_missing_key - raise MissingKeyError, key_path: key_path, env_key: env_key if raise_if_missing_key + raise MissingKeyError.new(key_path: key_path, env_key: env_key) if raise_if_missing_key end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/evented_file_update_checker.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/evented_file_update_checker.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/evented_file_update_checker.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/evented_file_update_checker.rb index 98f9508071..9cbe1ed973 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/evented_file_update_checker.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/evented_file_update_checker.rb @@ -224,7 +224,6 @@ module ActiveSupport end private - def ascendant_of?(base, other) base != other && other.ascend do |ascendant| break true if base == ascendant diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/execution_wrapper.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/execution_wrapper.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/execution_wrapper.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/execution_wrapper.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/executor.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/executor.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/executor.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/executor.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/file_update_checker.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/file_update_checker.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/file_update_checker.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/file_update_checker.rb index 1a0bb10815..9b665e7f19 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/file_update_checker.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/file_update_checker.rb @@ -98,7 +98,6 @@ module ActiveSupport end private - def watched @watched || begin all = @files.select { |f| File.exist?(f) } diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/gem_version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/gem_version.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/gem_version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/gem_version.rb index e75f204995..50375f27af 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/gem_version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/gem_version.rb @@ -9,8 +9,8 @@ module ActiveSupport module VERSION MAJOR = 6 MINOR = 0 - TINY = 2 - PRE = "2" + TINY = 3 + PRE = "1" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/gzip.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/gzip.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/gzip.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/gzip.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/hash_with_indifferent_access.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/hash_with_indifferent_access.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/hash_with_indifferent_access.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/hash_with_indifferent_access.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/i18n.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/i18n.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/i18n.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/i18n.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/i18n_railtie.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/i18n_railtie.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/i18n_railtie.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/i18n_railtie.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflections.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflections.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflections.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflections.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/inflections.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/inflections.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/inflections.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/inflections.rb index 88cdd99dbd..5b29a13894 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/inflections.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/inflections.rb @@ -230,7 +230,6 @@ module ActiveSupport end private - def define_acronym_regex_patterns @acronym_regex = @acronyms.empty? ? /(?=a)b/ : /#{@acronyms.values.join("|")}/ @acronyms_camelize_regex = /^(?:#{@acronym_regex}(?=\b|[A-Z_])|\w)/ diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/methods.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/methods.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/methods.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/methods.rb index ee193add6f..cb8ac62682 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/methods.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/methods.rb @@ -196,7 +196,7 @@ module ActiveSupport # # Singular names are not handled correctly: # - # classify('calculus') # => "Calculus" + # classify('calculus') # => "Calculu" def classify(table_name) # strip out any leading schema name camelize(singularize(table_name.to_s.sub(/.*\./, ""))) @@ -359,7 +359,6 @@ module ActiveSupport end private - # Mounts a regular expression, returned as a string to ease interpolation, # that will match part by part the given constant. # diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/transliterate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/transliterate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/inflector/transliterate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/inflector/transliterate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/key_generator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/key_generator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/key_generator.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/key_generator.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/lazy_load_hooks.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/lazy_load_hooks.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb index a6b096a973..c6f7ccf0a2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/lazy_load_hooks.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/lazy_load_hooks.rb @@ -54,7 +54,6 @@ module ActiveSupport end private - def with_execution_control(name, block, once) unless @run_once[name].include?(block) @run_once[name] << block if once diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/locale/en.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/locale/en.rb similarity index 78% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/locale/en.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/locale/en.rb index a2a7ea7ae1..29eb9dec0c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/locale/en.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/locale/en.rb @@ -4,7 +4,8 @@ en: { number: { nth: { - ordinals: lambda do |_key, number:, **_options| + ordinals: lambda do |_key, options| + number = options[:number] case number when 1; "st" when 2; "nd" @@ -22,7 +23,8 @@ end end, - ordinalized: lambda do |_key, number:, **_options| + ordinalized: lambda do |_key, options| + number = options[:number] "#{number}#{ActiveSupport::Inflector.ordinal(number)}" end } diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/locale/en.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/locale/en.yml similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/locale/en.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/locale/en.yml diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger.rb index b8555c887b..d8f537c64d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger.rb @@ -77,7 +77,7 @@ module ActiveSupport end end - def initialize(*args) + def initialize(*args, **kwargs) super @formatter = SimpleFormatter.new end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger_silence.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger_silence.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger_silence.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger_silence.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger_thread_safe_level.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger_thread_safe_level.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/logger_thread_safe_level.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/logger_thread_safe_level.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/message_encryptor.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/message_encryptor.rb index 7d6f8937f0..00548cb381 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/message_encryptor.rb @@ -172,7 +172,7 @@ module ActiveSupport iv = cipher.random_iv cipher.auth_data = "" if aead_mode? - encrypted_data = cipher.update(Messages::Metadata.wrap(@serializer.dump(value), metadata_options)) + encrypted_data = cipher.update(Messages::Metadata.wrap(@serializer.dump(value), **metadata_options)) encrypted_data << cipher.final blob = "#{::Base64.strict_encode64 encrypted_data}--#{::Base64.strict_encode64 iv}" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/message_verifier.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/message_verifier.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/message_verifier.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/message_verifier.rb index c4a4afe95f..82865c779b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/message_verifier.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/message_verifier.rb @@ -172,8 +172,8 @@ module ActiveSupport # # other_verifier = ActiveSupport::MessageVerifier.new 'd1ff3r3nt-s3Krit' # other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature - def verify(*args) - verified(*args) || raise(InvalidSignature) + def verify(*args, **options) + verified(*args, **options) || raise(InvalidSignature) end # Generates a signed message for the provided value. diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/multibyte.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/multibyte.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/multibyte.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/multibyte.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications/fanout.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/fanout.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications/fanout.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/fanout.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications/instrumenter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/instrumenter.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications/instrumenter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/instrumenter.rb index cd3845dd60..927c382e5d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/notifications/instrumenter.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/instrumenter.rb @@ -46,7 +46,6 @@ module ActiveSupport end private - def unique_id SecureRandom.hex(10) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/option_merger.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/option_merger.rb new file mode 100644 index 0000000000..a4f40b02a4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/option_merger.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require "active_support/core_ext/hash/deep_merge" + +module ActiveSupport + class OptionMerger #:nodoc: + instance_methods.each do |method| + undef_method(method) if !/^(__|instance_eval|class|object_id)/.match?(method) + end + + def initialize(context, options) + @context, @options = context, options + end + + private + def method_missing(method, *arguments, &block) + options = nil + if arguments.first.is_a?(Proc) + proc = arguments.pop + arguments << lambda { |*args| @options.deep_merge(proc.call(*args)) } + elsif arguments.last.respond_to?(:to_hash) + options = @options.deep_merge(arguments.pop) + else + options = @options + end + + invoke_method(method, arguments, options, &block) + end + + if RUBY_VERSION >= "2.7" + def invoke_method(method, arguments, options, &block) + if options + @context.__send__(method, *arguments, **options, &block) + else + @context.__send__(method, *arguments, &block) + end + end + else + def invoke_method(method, arguments, options, &block) + arguments << options if options + @context.__send__(method, *arguments, &block) + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/ordered_hash.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/ordered_hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/ordered_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/ordered_hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/ordered_options.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/ordered_options.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/ordered_options.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/ordered_options.rb index ea822706e8..55c850dbce 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/ordered_options.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/ordered_options.rb @@ -56,6 +56,10 @@ module ActiveSupport def respond_to_missing?(name, include_private) true end + + def extractable_options? + true + end end # +InheritableOptions+ provides a constructor to build an +OrderedOptions+ diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/parameter_filter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/parameter_filter.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/parameter_filter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/parameter_filter.rb index 7114cc8efb..f700dbbea5 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/parameter_filter.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/parameter_filter.rb @@ -51,7 +51,6 @@ module ActiveSupport end private - def compiled_filter @compiled_filter ||= CompiledFilter.compile(@filters, mask: @mask) end @@ -103,7 +102,7 @@ module ActiveSupport def value_for_key(key, value, parents = [], original_params = nil) parents.push(key) if deep_regexps - if regexps.any? { |r| r.match?(key) } + if regexps.any? { |r| r.match?(key.to_s) } value = @mask elsif deep_regexps && (joined = parents.join(".")) && deep_regexps.any? { |r| r.match?(joined) } value = @mask diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/per_thread_registry.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/per_thread_registry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/per_thread_registry.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/per_thread_registry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/proxy_object.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/proxy_object.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/proxy_object.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/proxy_object.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/rails.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/rails.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/rails.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/rails.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/railtie.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/railtie.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/railtie.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/railtie.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/reloader.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/reloader.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/reloader.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/reloader.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/rescuable.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/rescuable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/rescuable.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/rescuable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/security_utils.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/security_utils.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/security_utils.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/security_utils.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/string_inquirer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/string_inquirer.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/string_inquirer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/string_inquirer.rb index a3af36720e..e5091e127a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/string_inquirer.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/string_inquirer.rb @@ -18,7 +18,6 @@ module ActiveSupport # vehicle.bike? # => false class StringInquirer < String private - def respond_to_missing?(method_name, include_private = false) (method_name[-1] == "?") || super end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/subscriber.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/subscriber.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/subscriber.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/subscriber.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/tagged_logging.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/tagged_logging.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/test_case.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/test_case.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/test_case.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/test_case.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/time_with_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/time_with_zone.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/time_with_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/time_with_zone.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/values/time_zone.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/values/time_zone.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/values/time_zone.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/values/time_zone.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/version.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/version.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini.rb index 075cd4ed8b..f6ae08bb5d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini.rb @@ -155,7 +155,6 @@ module ActiveSupport end private - def _dasherize(key) # $2 must be a non-greedy regex for this to work left, middle, right = /\A(_*)(.*?)(_*)\Z/.match(key.strip)[1, 3] diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/jdom.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/jdom.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/jdom.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/jdom.rb index 32fe6ade28..12ca19a76f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/jdom.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/jdom.rb @@ -53,7 +53,6 @@ module ActiveSupport end private - # Convert an XML element and merge into the hash # # hash:: diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/libxml.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/libxml.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/libxml.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/libxml.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/libxmlsax.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/libxmlsax.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/libxmlsax.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/libxmlsax.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/nokogiri.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/nokogiri.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/nokogiri.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/nokogiri.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/nokogirisax.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/nokogirisax.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/nokogirisax.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/nokogirisax.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/rexml.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/rexml.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/xml_mini/rexml.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/xml_mini/rexml.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/config/default.yml similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/config/default.yml index 13740d9418..e6b3c65f69 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/config/default.yml @@ -1,5 +1,10 @@ # This is the default configuration file. +Performance/BindCall: + Description: 'Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`.' + Enabled: true + VersionAdded: '1.6' + Performance/Caller: Description: >- Use `caller(n..n)` instead of `caller`. @@ -21,6 +26,7 @@ Performance/Casecmp: Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`.. Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code' Enabled: true + Safe: false VersionAdded: '0.36' Performance/ChainArrayAllocation: @@ -49,6 +55,16 @@ Performance/Count: VersionAdded: '0.31' VersionChanged: '1.5' +Performance/DeletePrefix: + Description: 'Use `delete_prefix` instead of `gsub`.' + Enabled: true + VersionAdded: '1.6' + +Performance/DeleteSuffix: + Description: 'Use `delete_suffix` instead of `gsub`.' + Enabled: true + VersionAdded: '1.6' + Performance/Detect: Description: >- Use `detect` instead of `select.first`, `find_all.first`, @@ -87,7 +103,7 @@ Performance/EndWith: VersionChanged: '0.44' Performance/FixedSize: - Description: 'Do not compute the size of statically sized objects except in constants' + Description: 'Do not compute the size of statically sized objects except in constants.' Enabled: true VersionAdded: '0.35' @@ -95,7 +111,7 @@ Performance/FlatMap: Description: >- Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)` - or `Enumberable#collect..Array#flatten(1)` + or `Enumberable#collect..Array#flatten(1)`. Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code' Enabled: true VersionAdded: '0.30' @@ -106,7 +122,7 @@ Performance/FlatMap: # `flatten` without any parameters can flatten multiple levels. Performance/InefficientHashSearch: - Description: 'Use `key?` or `value?` instead of `keys.include?` or `values.include?`' + Description: 'Use `key?` or `value?` instead of `keys.include?` or `values.include?`.' Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code' Enabled: true VersionAdded: '0.56' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop-performance.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop-performance.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop-performance.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop-performance.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/mixin/regexp_metacharacter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/mixin/regexp_metacharacter.rb new file mode 100644 index 0000000000..68c7c49840 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/mixin/regexp_metacharacter.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + # Common functionality for handling regexp metacharacters. + module RegexpMetacharacter + def literal_at_start?(regex_str) + # is this regexp 'literal' in the sense of only matching literal + # chars, rather than using metachars like `.` and `*` and so on? + # also, is it anchored at the start of the string? + # (tricky: \s, \d, and so on are metacharacters, but other characters + # escaped with a slash are just literals. LITERAL_REGEX takes all + # that into account.) + regex_str =~ /\A(\\A|\^)(?:#{Util::LITERAL_REGEX})+\z/ + end + + def literal_at_end?(regex_str) + # is this regexp 'literal' in the sense of only matching literal + # chars, rather than using metachars like . and * and so on? + # also, is it anchored at the end of the string? + regex_str =~ /\A(?:#{Util::LITERAL_REGEX})+(\\z|\$)\z/ + end + + def drop_start_metacharacter(regexp_string) + if regexp_string.start_with?('\\A') + regexp_string[2..-1] # drop `\A` anchor + else + regexp_string[1..-1] # drop `^` anchor + end + end + + def drop_end_metacharacter(regexp_string) + if regexp_string.end_with?('\\z') + regexp_string.chomp('\z') # drop `\z` anchor + else + regexp_string.chop # drop `$` anchor + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/bind_call.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/bind_call.rb new file mode 100644 index 0000000000..cf671fde25 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/bind_call.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Performance + # In Ruby 2.7, `UnboundMethod#bind_call` has been added. + # + # This cop identifies places where `bind(obj).call(args, ...)` + # can be replaced by `bind_call(obj, args, ...)`. + # + # The `bind_call(obj, args, ...)` method is faster than + # `bind(obj).call(args, ...)`. + # + # @example + # # bad + # umethod.bind(obj).call(foo, bar) + # umethod.bind(obj).(foo, bar) + # + # # good + # umethod.bind_call(obj, foo, bar) + # + class BindCall < Cop + include RangeHelp + extend TargetRubyVersion + + minimum_target_ruby_version 2.7 + + MSG = 'Use `bind_call(%s%s%s)` ' \ + 'instead of `bind(%s).call(%s)`.' + + def_node_matcher :bind_with_call_method?, <<~PATTERN + (send + $(send + (send nil? _) :bind + $(...)) :call + $...) + PATTERN + + def on_send(node) + bind_with_call_method?(node) do |receiver, bind_arg, call_args_node| + range = correction_range(receiver, node) + + call_args = build_call_args(call_args_node) + + message = message(bind_arg.source, call_args) + + add_offense(node, location: range, message: message) + end + end + + def autocorrect(node) + receiver, bind_arg, call_args_node = bind_with_call_method?(node) + + range = correction_range(receiver, node) + + call_args = build_call_args(call_args_node) + call_args = ", #{call_args}" unless call_args.empty? + + replacement_method = "bind_call(#{bind_arg.source}#{call_args})" + + lambda do |corrector| + corrector.replace(range, replacement_method) + end + end + + private + + def message(bind_arg, call_args) + comma = call_args.empty? ? '' : ', ' + + format(MSG, bind_arg: bind_arg, comma: comma, call_args: call_args) + end + + def correction_range(receiver, node) + location_of_bind = receiver.loc.selector.begin_pos + location_of_call = node.loc.end.end_pos + + range_between(location_of_bind, location_of_call) + end + + def build_call_args(call_args_node) + call_args_node.map(&:source).join(', ') + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/caller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/caller.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/caller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/caller.rb index 9cc82243d4..7f9d22887f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/caller.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/caller.rb @@ -24,14 +24,14 @@ module RuboCop MSG_FIRST = 'Use `%s(%d..%d).first`' \ ' instead of `%s.first`.' - def_node_matcher :slow_caller?, <<-PATTERN + def_node_matcher :slow_caller?, <<~PATTERN { (send nil? {:caller :caller_locations}) (send nil? {:caller :caller_locations} int) } PATTERN - def_node_matcher :caller_with_scope_method?, <<-PATTERN + def_node_matcher :caller_with_scope_method?, <<~PATTERN { (send #slow_caller? :first) (send #slow_caller? :[] int) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/case_when_splat.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/case_when_splat.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/case_when_splat.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/case_when_splat.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/casecmp.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/casecmp.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/casecmp.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/casecmp.rb index c411eca255..cfb0c709cb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/casecmp.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/casecmp.rb @@ -5,6 +5,8 @@ module RuboCop module Performance # This cop identifies places where a case-insensitive string comparison # can better be implemented using `casecmp`. + # This cop is unsafe because `String#casecmp` and `String#casecmp?` behave + # differently when using Non-ASCII characters. # # @example # # bad @@ -21,21 +23,21 @@ module RuboCop MSG = 'Use `%s` instead of `%s`.' CASE_METHODS = %i[downcase upcase].freeze - def_node_matcher :downcase_eq, <<-PATTERN + def_node_matcher :downcase_eq, <<~PATTERN (send $(send _ ${:downcase :upcase}) ${:== :eql? :!=} ${str (send _ {:downcase :upcase} ...) (begin str)}) PATTERN - def_node_matcher :eq_downcase, <<-PATTERN + def_node_matcher :eq_downcase, <<~PATTERN (send {str (send _ {:downcase :upcase} ...) (begin str)} ${:== :eql? :!=} $(send _ ${:downcase :upcase})) PATTERN - def_node_matcher :downcase_downcase, <<-PATTERN + def_node_matcher :downcase_downcase, <<~PATTERN (send $(send _ ${:downcase :upcase}) ${:== :eql? :!=} diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/chain_array_allocation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/chain_array_allocation.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/chain_array_allocation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/chain_array_allocation.rb index 49620cea8e..140dfa48ed 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/chain_array_allocation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/chain_array_allocation.rb @@ -51,7 +51,7 @@ module RuboCop '(followed by `return array` if required) instead of chaining '\ '`%s...%s`.' - def_node_matcher :flat_map_candidate?, <<-PATTERN + def_node_matcher :flat_map_candidate?, <<~PATTERN { (send (send _ ${#{RETURN_NEW_ARRAY_WHEN_ARGS}} {int lvar ivar cvar gvar}) ${#{HAS_MUTATION_ALTERNATIVE}} $...) (send (block (send _ ${#{ALWAYS_RETURNS_NEW_ARRAY} }) ...) ${#{HAS_MUTATION_ALTERNATIVE}} $...) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/compare_with_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/compare_with_block.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/compare_with_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/compare_with_block.rb index 040e6e47b2..01c1393a5d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/compare_with_block.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/compare_with_block.rb @@ -30,14 +30,14 @@ module RuboCop '`%s { |%s, %s| %s ' \ '<=> %s }`.' - def_node_matcher :compare?, <<-PATTERN + def_node_matcher :compare?, <<~PATTERN (block $(send _ {:sort :min :max}) (args (arg $_a) (arg $_b)) $send) PATTERN - def_node_matcher :replaceable_body?, <<-PATTERN + def_node_matcher :replaceable_body?, <<~PATTERN (send (send (lvar %1) $_method $...) :<=> diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/count.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/count.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/count.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/count.rb index 80a6e42627..4a2eb1df83 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/count.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/count.rb @@ -42,7 +42,7 @@ module RuboCop MSG = 'Use `count` instead of `%s...%s`.' - def_node_matcher :count_candidate?, <<-PATTERN + def_node_matcher :count_candidate?, <<~PATTERN { (send (block $(send _ ${:select :reject}) ...) ${:count :length :size}) (send $(send _ ${:select :reject} (:block_pass _)) ${:count :length :size}) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/delete_prefix.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/delete_prefix.rb new file mode 100644 index 0000000000..f2867720dc --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/delete_prefix.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Performance + # In Ruby 2.5, `String#delete_prefix` has been added. + # + # This cop identifies places where `gsub(/\Aprefix/, '')` + # can be replaced by `delete_prefix('prefix')`. + # + # The `delete_prefix('prefix')` method is faster than + # `gsub(/\Aprefix/, '')`. + # + # @example + # + # # bad + # str.gsub(/\Aprefix/, '') + # str.gsub!(/\Aprefix/, '') + # str.gsub(/^prefix/, '') + # str.gsub!(/^prefix/, '') + # + # # good + # str.delete_prefix('prefix') + # str.delete_prefix!('prefix') + # + class DeletePrefix < Cop + extend TargetRubyVersion + include RegexpMetacharacter + + minimum_target_ruby_version 2.5 + + MSG = 'Use `%s` instead of `%s`.' + + PREFERRED_METHODS = { + gsub: :delete_prefix, + gsub!: :delete_prefix! + }.freeze + + def_node_matcher :gsub_method?, <<~PATTERN + (send $!nil? ${:gsub :gsub!} (regexp (str $#literal_at_start?) (regopt)) (str $_)) + PATTERN + + def on_send(node) + gsub_method?(node) do |_, bad_method, _, replace_string| + return unless replace_string.blank? + + good_method = PREFERRED_METHODS[bad_method] + + message = format(MSG, current: bad_method, prefer: good_method) + + add_offense(node, location: :selector, message: message) + end + end + + def autocorrect(node) + gsub_method?(node) do |receiver, bad_method, regexp_str, _| + lambda do |corrector| + good_method = PREFERRED_METHODS[bad_method] + regexp_str = drop_start_metacharacter(regexp_str) + regexp_str = interpret_string_escapes(regexp_str) + string_literal = to_string_literal(regexp_str) + + new_code = "#{receiver.source}.#{good_method}(#{string_literal})" + + corrector.replace(node, new_code) + end + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/delete_suffix.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/delete_suffix.rb new file mode 100644 index 0000000000..8d727dd57f --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/delete_suffix.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Performance + # In Ruby 2.5, `String#delete_suffix` has been added. + # + # This cop identifies places where `gsub(/suffix\z/, '')` + # can be replaced by `delete_suffix('suffix')`. + # + # The `delete_suffix('suffix')` method is faster than + # `gsub(/suffix\z/, '')`. + # + # @example + # + # # bad + # str.gsub(/suffix\z/, '') + # str.gsub!(/suffix\z/, '') + # str.gsub(/suffix$/, '') + # str.gsub!(/suffix$/, '') + # + # # good + # str.delete_suffix('suffix') + # str.delete_suffix!('suffix') + # + class DeleteSuffix < Cop + extend TargetRubyVersion + include RegexpMetacharacter + + minimum_target_ruby_version 2.5 + + MSG = 'Use `%s` instead of `%s`.' + + PREFERRED_METHODS = { + gsub: :delete_suffix, + gsub!: :delete_suffix! + }.freeze + + def_node_matcher :gsub_method?, <<~PATTERN + (send $!nil? ${:gsub :gsub!} (regexp (str $#literal_at_end?) (regopt)) (str $_)) + PATTERN + + def on_send(node) + gsub_method?(node) do |_, bad_method, _, replace_string| + return unless replace_string.blank? + + good_method = PREFERRED_METHODS[bad_method] + + message = format(MSG, current: bad_method, prefer: good_method) + + add_offense(node, location: :selector, message: message) + end + end + + def autocorrect(node) + gsub_method?(node) do |receiver, bad_method, regexp_str, _| + lambda do |corrector| + good_method = PREFERRED_METHODS[bad_method] + regexp_str = drop_end_metacharacter(regexp_str) + regexp_str = interpret_string_escapes(regexp_str) + string_literal = to_string_literal(regexp_str) + + new_code = "#{receiver.source}.#{good_method}(#{string_literal})" + + corrector.replace(node, new_code) + end + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/detect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/detect.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/detect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/detect.rb index f1aa75be8d..958b4e8444 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/detect.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/detect.rb @@ -28,7 +28,7 @@ module RuboCop REVERSE_MSG = 'Use `reverse.%s` instead of ' \ '`%s.%s`.' - def_node_matcher :detect_candidate?, <<-PATTERN + def_node_matcher :detect_candidate?, <<~PATTERN { (send $(block (send _ {:select :find_all}) ...) ${:first :last} $...) (send $(send _ {:select :find_all} ...) ${:first :last} $...) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/double_start_end_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/double_start_end_with.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/double_start_end_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/double_start_end_with.rb index 530c41d424..92e7e385be 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/double_start_end_with.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/double_start_end_with.rb @@ -75,13 +75,13 @@ module RuboCop cop_config['IncludeActiveSupportAliases'] end - def_node_matcher :two_start_end_with_calls, <<-PATTERN + def_node_matcher :two_start_end_with_calls, <<~PATTERN (or (send $_recv [{:start_with? :end_with?} $_method] $...) (send _recv _method $...)) PATTERN - def_node_matcher :check_with_active_support_aliases, <<-PATTERN + def_node_matcher :check_with_active_support_aliases, <<~PATTERN (or (send $_recv [{:start_with? :starts_with? :end_with? :ends_with?} $_method] diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/end_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/end_with.rb similarity index 77% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/end_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/end_with.rb index 66f43a6ce6..584d2eb6f1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/end_with.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/end_with.rb @@ -15,26 +15,27 @@ module RuboCop # 'abc'.match(/bc\Z/) # /bc\Z/.match('abc') # + # 'abc'.match?(/bc$/) + # /bc$/.match?('abc') + # 'abc' =~ /bc$/ + # /bc$/ =~ 'abc' + # 'abc'.match(/bc$/) + # /bc$/.match('abc') + # # # good # 'abc'.end_with?('bc') class EndWith < Cop + include RegexpMetacharacter + MSG = 'Use `String#end_with?` instead of a regex match anchored to ' \ 'the end of the string.' - SINGLE_QUOTE = "'" - def_node_matcher :redundant_regex?, <<-PATTERN + def_node_matcher :redundant_regex?, <<~PATTERN {(send $!nil? {:match :=~ :match?} (regexp (str $#literal_at_end?) (regopt))) (send (regexp (str $#literal_at_end?) (regopt)) {:match :match?} $_) (match-with-lvasgn (regexp (str $#literal_at_end?) (regopt)) $_)} PATTERN - def literal_at_end?(regex_str) - # is this regexp 'literal' in the sense of only matching literal - # chars, rather than using metachars like . and * and so on? - # also, is it anchored at the end of the string? - regex_str =~ /\A(?:#{LITERAL_REGEX})+\\z\z/ - end - def on_send(node) return unless redundant_regex?(node) @@ -45,7 +46,7 @@ module RuboCop def autocorrect(node) redundant_regex?(node) do |receiver, regex_str| receiver, regex_str = regex_str, receiver if receiver.is_a?(String) - regex_str = regex_str[0..-3] # drop \Z anchor + regex_str = drop_end_metacharacter(regex_str) regex_str = interpret_string_escapes(regex_str) lambda do |corrector| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/fixed_size.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/fixed_size.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/fixed_size.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/fixed_size.rb index c3a0beb481..76be44259c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/fixed_size.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/fixed_size.rb @@ -48,7 +48,7 @@ module RuboCop class FixedSize < Cop MSG = 'Do not compute the size of statically sized objects.' - def_node_matcher :counter, <<-MATCHER + def_node_matcher :counter, <<~MATCHER (send ${array hash str sym} {:count :length :size} $...) MATCHER diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/flat_map.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/flat_map.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/flat_map.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/flat_map.rb index b5b91876a7..de4677a444 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/flat_map.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/flat_map.rb @@ -22,7 +22,7 @@ module RuboCop 'and `flatten` can be used to flatten ' \ 'multiple levels.' - def_node_matcher :flat_map_candidate?, <<-PATTERN + def_node_matcher :flat_map_candidate?, <<~PATTERN (send { (block $(send _ ${:collect :map}) ...) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/inefficient_hash_search.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/inefficient_hash_search.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/inefficient_hash_search.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/inefficient_hash_search.rb index 0a4a1cc0b2..b72063faef 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/inefficient_hash_search.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/inefficient_hash_search.rb @@ -37,7 +37,7 @@ module RuboCop # h = { a: 1, b: 2 }; h.value?(nil) # class InefficientHashSearch < Cop - def_node_matcher :inefficient_include?, <<-PATTERN + def_node_matcher :inefficient_include?, <<~PATTERN (send (send $_ {:keys :values}) :include? _) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/open_struct.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/open_struct.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/open_struct.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/open_struct.rb index d3d3e212aa..192bc81239 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/open_struct.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/open_struct.rb @@ -31,7 +31,7 @@ module RuboCop MSG = 'Consider using `Struct` over `OpenStruct` ' \ 'to optimize the performance.' - def_node_matcher :open_struct, <<-PATTERN + def_node_matcher :open_struct, <<~PATTERN (send (const {nil? cbase} :OpenStruct) :new ...) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/range_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/range_include.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/range_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/range_include.rb index 77eebc8bbc..0e49753c54 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/range_include.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/range_include.rb @@ -31,7 +31,7 @@ module RuboCop # Right now, we only detect direct calls on a Range literal # (We don't even catch it if the Range is in double parens) - def_node_matcher :range_include, <<-PATTERN + def_node_matcher :range_include, <<~PATTERN (send {irange erange (begin {irange erange})} :include? ...) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_block_call.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_block_call.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_block_call.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_block_call.rb index 315deac115..1301ae821e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_block_call.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_block_call.rb @@ -29,16 +29,16 @@ module RuboCop CLOSE_PAREN = ')' SPACE = ' ' - def_node_matcher :blockarg_def, <<-PATTERN + def_node_matcher :blockarg_def, <<~PATTERN {(def _ (args ... (blockarg $_)) $_) (defs _ _ (args ... (blockarg $_)) $_)} PATTERN - def_node_search :blockarg_calls, <<-PATTERN + def_node_search :blockarg_calls, <<~PATTERN (send (lvar %1) :call ...) PATTERN - def_node_search :blockarg_assigned?, <<-PATTERN + def_node_search :blockarg_assigned?, <<~PATTERN (lvasgn %1 ...) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_match.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_match.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_match.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_match.rb index b1eabc8ae4..f0bfecde0a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_match.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_match.rb @@ -23,12 +23,12 @@ module RuboCop # 'match' is a fairly generic name, so we don't flag it unless we see # a string or regexp literal on one side or the other - def_node_matcher :match_call?, <<-PATTERN + def_node_matcher :match_call?, <<~PATTERN {(send {str regexp} :match _) (send !nil? :match {str regexp})} PATTERN - def_node_matcher :only_truthiness_matters?, <<-PATTERN + def_node_matcher :only_truthiness_matters?, <<~PATTERN ^({if while until case while_post until_post} equal?(%0) ...) PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_merge.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_merge.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_merge.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_merge.rb index d93ca155d9..bfb7347aec 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/redundant_merge.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/redundant_merge.rb @@ -5,11 +5,25 @@ module RuboCop module Performance # This cop identifies places where `Hash#merge!` can be replaced by # `Hash#[]=`. + # You can set the maximum number of key-value pairs to consider + # an offense with `MaxKeyValuePairs`. # # @example + # # bad # hash.merge!(a: 1) # hash.merge!({'key' => 'value'}) + # + # # good + # hash[:a] = 1 + # hash['key'] = 'value' + # + # @example MaxKeyValuePairs: 2 (default) + # # bad # hash.merge!(a: 1, b: 2) + # + # # good + # hash[:a] = 1 + # hash[:b] = 2 class RedundantMerge < Cop AREF_ASGN = '%s[%s] = %s' MSG = 'Use `%s` instead of `%s`.' @@ -20,11 +34,11 @@ module RuboCop %send RUBY - def_node_matcher :redundant_merge_candidate, <<-PATTERN + def_node_matcher :redundant_merge_candidate, <<~PATTERN (send $!nil? :merge! [(hash $...) !kwsplat_type?]) PATTERN - def_node_matcher :modifier_flow_control?, <<-PATTERN + def_node_matcher :modifier_flow_control?, <<~PATTERN [{if while until} modifier_form?] PATTERN @@ -168,13 +182,11 @@ module RuboCop end def unwind(receiver) - while receiver.respond_to?(:send_type?) && receiver.send_type? - receiver, = *receiver - end + receiver, = *receiver while receiver.respond_to?(:send_type?) && receiver.send_type? receiver end - def_node_matcher :each_with_object_node, <<-PATTERN + def_node_matcher :each_with_object_node, <<~PATTERN (block (send _ :each_with_object _) (args _ $_) ...) PATTERN end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/regexp_match.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/regexp_match.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/regexp_match.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/regexp_match.rb index e59ea7f63d..bc5579ec05 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/regexp_match.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/regexp_match.rb @@ -73,32 +73,28 @@ module RuboCop # end # end class RegexpMatch < Cop - extend TargetRubyVersion - - minimum_target_ruby_version 2.4 - # Constants are included in this list because it is unlikely that # someone will store `nil` as a constant and then use it for comparison TYPES_IMPLEMENTING_MATCH = %i[const regexp str sym].freeze MSG = 'Use `match?` instead of `%s` when `MatchData` ' \ 'is not used.' - def_node_matcher :match_method?, <<-PATTERN + def_node_matcher :match_method?, <<~PATTERN { (send _recv :match {regexp str sym}) (send {regexp str sym} :match _) } PATTERN - def_node_matcher :match_with_int_arg_method?, <<-PATTERN + def_node_matcher :match_with_int_arg_method?, <<~PATTERN (send _recv :match _ (int ...)) PATTERN - def_node_matcher :match_operator?, <<-PATTERN + def_node_matcher :match_operator?, <<~PATTERN (send !nil? {:=~ :!~} !nil?) PATTERN - def_node_matcher :match_threequals?, <<-PATTERN + def_node_matcher :match_threequals?, <<~PATTERN (send (regexp (str _) {(regopt) (regopt _)}) :=== !nil?) PATTERN @@ -109,7 +105,7 @@ module RuboCop regexp.to_regexp.named_captures.empty? end - MATCH_NODE_PATTERN = <<-PATTERN + MATCH_NODE_PATTERN = <<~PATTERN { #match_method? #match_with_int_arg_method? @@ -122,7 +118,7 @@ module RuboCop def_node_matcher :match_node?, MATCH_NODE_PATTERN def_node_search :search_match_nodes, MATCH_NODE_PATTERN - def_node_search :last_matches, <<-PATTERN + def_node_search :last_matches, <<~PATTERN { (send (const nil? :Regexp) :last_match) (send (const nil? :Regexp) :last_match _) @@ -256,6 +252,13 @@ module RuboCop def correct_operator(corrector, recv, arg, oper = nil) op_range = correction_range(recv, arg) + replace_with_match_predicate_method(corrector, recv, arg, op_range) + + corrector.insert_after(arg.loc.expression, ')') unless op_range.source.end_with?('(') + corrector.insert_before(recv.loc.expression, '!') if oper == :!~ + end + + def replace_with_match_predicate_method(corrector, recv, arg, op_range) if TYPES_IMPLEMENTING_MATCH.include?(recv.type) corrector.replace(op_range, '.match?(') elsif TYPES_IMPLEMENTING_MATCH.include?(arg.type) @@ -264,9 +267,6 @@ module RuboCop else corrector.replace(op_range, '&.match?(') end - - corrector.insert_after(arg.loc.expression, ')') - corrector.insert_before(recv.loc.expression, '!') if oper == :!~ end def swap_receiver_and_arg(corrector, recv, arg) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/reverse_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/reverse_each.rb similarity index 82% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/reverse_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/reverse_each.rb index 6c6fdfba14..09a8214123 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/reverse_each.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/reverse_each.rb @@ -18,7 +18,7 @@ module RuboCop MSG = 'Use `reverse_each` instead of `reverse.each`.' UNDERSCORE = '_' - def_node_matcher :reverse_each?, <<-MATCHER + def_node_matcher :reverse_each?, <<~MATCHER (send $(send _ :reverse) :each) MATCHER @@ -34,7 +34,8 @@ module RuboCop end def autocorrect(node) - ->(corrector) { corrector.replace(node.loc.dot, UNDERSCORE) } + range = range_between(node.loc.dot.begin_pos, node.loc.selector.begin_pos) + ->(corrector) { corrector.replace(range, UNDERSCORE) } end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/size.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/size.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/size.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/size.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/start_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/start_with.rb similarity index 70% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/start_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/start_with.rb index b4a7cae8a1..18733d4bdf 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/start_with.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/start_with.rb @@ -15,29 +15,27 @@ module RuboCop # 'abc'.match(/\Aab/) # /\Aab/.match('abc') # + # 'abc'.match?(/^ab/) + # /^ab/.match?('abc') + # 'abc' =~ /^ab/ + # /^ab/ =~ 'abc' + # 'abc'.match(/^ab/) + # /^ab/.match('abc') + # # # good # 'abc'.start_with?('ab') class StartWith < Cop + include RegexpMetacharacter + MSG = 'Use `String#start_with?` instead of a regex match anchored to ' \ 'the beginning of the string.' - SINGLE_QUOTE = "'" - def_node_matcher :redundant_regex?, <<-PATTERN + def_node_matcher :redundant_regex?, <<~PATTERN {(send $!nil? {:match :=~ :match?} (regexp (str $#literal_at_start?) (regopt))) (send (regexp (str $#literal_at_start?) (regopt)) {:match :match?} $_) (match-with-lvasgn (regexp (str $#literal_at_start?) (regopt)) $_)} PATTERN - def literal_at_start?(regex_str) - # is this regexp 'literal' in the sense of only matching literal - # chars, rather than using metachars like `.` and `*` and so on? - # also, is it anchored at the start of the string? - # (tricky: \s, \d, and so on are metacharacters, but other characters - # escaped with a slash are just literals. LITERAL_REGEX takes all - # that into account.) - regex_str =~ /\A\\A(?:#{LITERAL_REGEX})+\z/ - end - def on_send(node) return unless redundant_regex?(node) @@ -48,7 +46,7 @@ module RuboCop def autocorrect(node) redundant_regex?(node) do |receiver, regex_str| receiver, regex_str = regex_str, receiver if receiver.is_a?(String) - regex_str = regex_str[2..-1] # drop \A anchor + regex_str = drop_start_metacharacter(regex_str) regex_str = interpret_string_escapes(regex_str) lambda do |corrector| diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/string_replacement.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/string_replacement.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/string_replacement.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/string_replacement.rb index b5b0a4dafd..e6dab7e396 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/string_replacement.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/string_replacement.rb @@ -26,9 +26,8 @@ module RuboCop DELETE = 'delete' TR = 'tr' BANG = '!' - SINGLE_QUOTE = "'" - def_node_matcher :string_replacement?, <<-PATTERN + def_node_matcher :string_replacement?, <<~PATTERN (send _ {:gsub :gsub!} ${regexp str (send (const nil? :Regexp) {:new :compile} _)} $str) @@ -48,9 +47,7 @@ module RuboCop first_source, = first_source(first_param) second_source, = *second_param - unless first_param.str_type? - first_source = interpret_string_escapes(first_source) - end + first_source = interpret_string_escapes(first_source) unless first_param.str_type? replacement_method = replacement_method(node, first_source, second_source) @@ -67,9 +64,7 @@ module RuboCop to_string_literal(first)) end - if second.empty? && first.length == 1 - remove_second_param(corrector, node, first_param) - end + remove_second_param(corrector, node, first_param) if second.empty? && first.length == 1 end end @@ -99,9 +94,7 @@ module RuboCop def offense(node, first_param, second_param) first_source, = first_source(first_param) - unless first_param.str_type? - first_source = interpret_string_escapes(first_source) - end + first_source = interpret_string_escapes(first_source) unless first_param.str_type? second_source, = *second_param message = message(node, first_source, second_source) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/times_map.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/times_map.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/times_map.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/times_map.rb index 1a04732947..cd719da2ce 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/times_map.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/times_map.rb @@ -61,7 +61,7 @@ module RuboCop map_or_collect: map_or_collect.method_name) end - def_node_matcher :times_map_call, <<-PATTERN + def_node_matcher :times_map_call, <<~PATTERN {(block $(send (send $!nil? :times) {:map :collect}) ...) $(send (send $!nil? :times) {:map :collect} (block_pass ...))} PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/unfreeze_string.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/unfreeze_string.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/unfreeze_string.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/unfreeze_string.rb index 408fa959d4..eb52b1fc32 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/unfreeze_string.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/unfreeze_string.rb @@ -24,17 +24,13 @@ module RuboCop # +'something' # +'' class UnfreezeString < Cop - extend TargetRubyVersion - - minimum_target_ruby_version 2.3 - MSG = 'Use unary plus to get an unfrozen string literal.' - def_node_matcher :dup_string?, <<-PATTERN + def_node_matcher :dup_string?, <<~PATTERN (send {str dstr} :dup) PATTERN - def_node_matcher :string_new?, <<-PATTERN + def_node_matcher :string_new?, <<~PATTERN { (send (const nil? :String) :new {str dstr}) (send (const nil? :String) :new) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/uri_default_parser.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/uri_default_parser.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/uri_default_parser.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/uri_default_parser.rb index a8aa3eb128..e0d2ac8f40 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance/uri_default_parser.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance/uri_default_parser.rb @@ -17,7 +17,7 @@ module RuboCop MSG = 'Use `%sURI::DEFAULT_PARSER` instead of ' \ '`%sURI::Parser.new`.' - def_node_matcher :uri_parser_new?, <<-PATTERN + def_node_matcher :uri_parser_new?, <<~PATTERN (send (const (const ${nil? cbase} :URI) :Parser) :new) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance_cops.rb similarity index 86% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance_cops.rb index 0d0a13d621..446357cff3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/cop/performance_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/cop/performance_cops.rb @@ -1,10 +1,15 @@ # frozen_string_literal: true +require_relative 'mixin/regexp_metacharacter' + +require_relative 'performance/bind_call' require_relative 'performance/caller' require_relative 'performance/case_when_splat' require_relative 'performance/casecmp' require_relative 'performance/compare_with_block' require_relative 'performance/count' +require_relative 'performance/delete_prefix' +require_relative 'performance/delete_suffix' require_relative 'performance/detect' require_relative 'performance/double_start_end_with' require_relative 'performance/end_with' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance/inject.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance/inject.rb index f82404dad3..e255a881a4 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance/inject.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance/inject.rb @@ -8,7 +8,7 @@ module RuboCop def self.defaults! path = CONFIG_DEFAULT.to_s hash = ConfigLoader.send(:load_yaml_configuration, path) - config = Config.new(hash, path) + config = Config.new(hash, path).tap(&:make_excludes_absolute) puts "configuration from #{path}" if ConfigLoader.debug? config = ConfigLoader.merge_with_default(config, path) ConfigLoader.instance_variable_set(:@default_configuration, config) diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance/version.rb similarity index 81% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance/version.rb index d07d623aab..a18eaf866b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.5.2/lib/rubocop/performance/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.6.0/lib/rubocop/performance/version.rb @@ -3,7 +3,7 @@ module RuboCop module Performance module Version - STRING = '1.5.2' + STRING = '1.6.0' end end end diff --git a/completions/zsh/_brew b/completions/zsh/_brew index f216255bd3..c4f75cf6a7 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -377,17 +377,19 @@ _brew_edit() { '*:: :__brew_formulae_or_ruby_files' } -# brew fetch [--force] [--retry] [-v] [--devel|--HEAD] [--deps] [--build-from-source|--force-bottle] formulae +# brew fetch [--force] [--retry] [-v] [--devel|--HEAD] [--deps] +# [--build-from-source|--build-bottle|--force-bottle] formulae _brew_fetch() { _arguments \ - '--force[remove previously cached version and re-fetch]' \ + '(--force -f)'{--force,-f}'[remove previously cached version and re-fetch]' \ '--retry[retry if a download fails or re-download if the checksum of a previously cached version no longer matches]' \ - '-v[verbose VCS checkout]' \ + '(--verbose -v)'{--verbose,-v}'[verbose VCS checkout]' \ '(--HEAD)--devel[fetch devel version instead of stable]' \ '(--devel)--HEAD[fetch HEAD version instead of stable]' \ '--deps[also download dependencies for any listed formulae]' \ - '(--force-bottle)--build-from-source[download the source rather than a bottle]' \ - '(--build-from-source)--force-bottle[download a bottle if it exists for the current version of OS X, even if it would not be used during installation]' \ + '(--build-from-source -s --force-bottle --build-bottle)'{--build-from-source,-s}'[download the source rather than a bottle]' \ + '(--build-from-source -s --force-bottle)--build-bottle[download the source (for eventual bottling) rather than a bottle]' \ + '(--build-from-source -s --build-bottle)--force-bottle[download a bottle if it exists for the current version of OS X, even if it would not be used during installation]' \ '*:formula:__brew_formulae' } @@ -431,9 +433,10 @@ _brew_info() { '(--all --installed)*: :__brew_formulae' } -# brew install [--debug] [--env=std|super] [--ignore-dependencies] -# [--only-dependencies] [--cc=compiler] [--build-from-source] -# [--devel|--HEAD] [--keep-tmp] formulae +# brew install [--debug] [--env=std|super] +# [--ignore-dependencies|--only-dependencies] [--include-test] +# [--cc=compiler] [--build-from-source|--build-bottle|--force-fottle] +# [--devel|--HEAD] [--fetch-HEAD] [--bottle-arch=architecture] [--keep-tmp] formulae # brew install --interactive [--git] formula _brew_install() { local state @@ -441,11 +444,16 @@ _brew_install() { - normal-install \ '--debug[if brewing fails, open an interactive debugging session]' \ -'-env=-[use standard or super environment]:environment:(std super)' \ - '--ignore-dependencies[skip installing any dependencies of any kind]' \ - '--only-dependencies[install the dependencies but do not install the specified formula]' \ + '(--only-dependencies)--ignore-dependencies[skip installing any dependencies of any kind]' \ + '(--ignore-dependencies)--only-dependencies[install the dependencies but do not install the specified formula]' \ '--cc=-[attempt to compile using compiler]:compiler: ' \ - '(--build-from-source -s)'{--build-from-source,-s}'[compile the specified formula from source even if a bottle is provided]' \ + '(--build-from-source -s --force-bottle --build-bottle)'{--build-from-source,-s}'[compile the specified formula from source even if a bottle is provided]' \ + '(--build-from-source -s --force-bottle)--build-bottle[prepare the formula for eventual bottling during installation, skipping any post-install steps]' \ + '(--build-from-source -s --build-bottle)--force-bottle[install from a bottle if it exists for the current version of OS X, even if it would not normally be used for installation]' \ + '--include-test[install testing dependencies]' \ '(--devel --HEAD)'{--devel,--HEAD}'[install the development / HEAD version]' \ + '--fetch-HEAD[fetch the upstream repository to detect if the HEAD installation of the formula is outdated]' \ + '--bottle-arch=-[optimise bottles for the specified architecture]:architecture: ' \ '--keep-tmp[don''t delete temporary files created during installation]' \ '--display-times[display installation times at end of run]' \ '*: : __brew_formulae' \ @@ -570,7 +578,7 @@ _brew_pull() { } # brew pr-pull [--no-upload|--no-publish] [--dry-run] [--clean] [--branch-okay] -# [--resolve] [--workflow] [--artifact] [--bintray-org] [--tap] pull_request +# [--resolve] [--workflow] [--artifact] [--bintray-org] [--tap] pull_request _brew_pr_pull() { _arguments \ '(--no-upload)--no-publish[download the bottles, apply the bottle commit, and upload the bottles to Bintray, but don''t publish them]' \ @@ -592,10 +600,19 @@ _brew_readall() { } # brew reinstall formulae: +# mostly copy from brew install _brew_reinstall() { _arguments \ - '--display-times[display installation times at end of run]' \ - '*::formula:__brew_installed_formulae' + - normal-install \ + '--debug[if brewing fails, open an interactive debugging session]' \ + '(--build-from-source -s --force-bottle)'{--build-from-source,-s}'[compile the specified formula from source even if a bottle is provided]' \ + '(--build-from-source -s)--force-bottle[install from a bottle if it exists for the current version of OS X, even if it would not normally be used for installation]' \ + '--keep-tmp[don''t delete temporary files created during installation]' \ + '--display-times[display installation times at end of run]' \ + '*::formula:__brew_installed_formulae' \ + - interactive-install \ + '--interactive[download and patch formula, then open a shell]' \ + '::formula:__brew_installed_formulae' } # brew search, -S: @@ -790,7 +807,8 @@ _brew_upgrade() { '--ignore-dependencies[skip installing any dependencies of any kind]' \ '--only-dependencies[install the dependencies but do not install the specified formula]' \ '--cc=-[attempt to compile using compiler]:compiler: ' \ - '(--build-from-source -s)'{--build-from-source,-s}'[compile the specified formula from source even if a bottle is provided]' \ + '(--build-from-source -s --force-bottle)'{--build-from-source,-s}'[compile the specified formula from source even if a bottle is provided]' \ + '(--build-from-source -s)--force-bottle[install from a bottle if it exists for the current version of OS X, even if it would not normally be used for installation]' \ '(--devel --HEAD)'{--devel,--HEAD}'[install the development / HEAD version]' \ '--keep-tmp[don''t delete temporary files created during installation]' \ '--display-times[display installation times at end of run]' \ diff --git a/completions/zsh/_brew_cask b/completions/zsh/_brew_cask index da49f5c462..c841b006c3 100644 --- a/completions/zsh/_brew_cask +++ b/completions/zsh/_brew_cask @@ -19,7 +19,13 @@ __brew_cask() { __brew_all_casks() { local -a list local expl - list=( $(brew search --casks) ) + local comp_cachename=brew_casks + + if _cache_invalid $comp_cachename || ! _retrieve_cache $comp_cachename; then + list=( $(brew search --casks) ) + _store_cache $comp_cachename list + fi + _wanted list expl 'all casks' compadd -a list } diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index 21784fcf79..67d92ea5cd 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -277,7 +277,22 @@ Some advice for specific cases: * If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples. A good example is [`tinyxml2`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/tinyxml2.rb), which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully. * If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc. -* If the software cannot function without credentials or requires a virtual machine, docker instance, etc. to run, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected. +* If the software cannot function without credentials or requires a virtual machine, docker instance, etc. to run, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected. This is prefered over mocking a dependency. +* Homebrew comes with a number of [standard test fixtures](https://github.com/Homebrew/brew/tree/master/Library/Homebrew/test/support/fixtures), including numerous sample images, sounds, and documents in various formats. You can get the file path to a test fixture with `test_fixtures("test.svg")`. +* If your test requires a test file that isn't a standard test fixture, you can install it from a source repository during the `test` phase with a resource block, like this: + +```ruby +resource("testdata") do + url "https://example.com/input.foo" + sha256 "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" +end + +test do + resource("testdata").stage do + assert_match "OK", shell_output("#{bin}/foo build-foo input.foo") + end +end +``` ### Manuals @@ -396,6 +411,12 @@ system "make", "install" You’ll see stuff like this in some formulae. This moves the file `foo` into the formula’s `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`). +You can also rename the file during the installation process. This can be useful for adding a prefix to binaries that would otherwise cause conflicts with another formula, or for removing a file extension. For example, to install `foo.py` into the formula's `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) as just `foo` instead of `foo.py`: + +```ruby +bin.install "foo.py" => "foo" +``` + ### `inreplace` [`inreplace`](https://rubydoc.brew.sh/Utils/Inreplace) is a convenience function that can edit files in-place. For example: diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index d3d28d8299..e94a45a0b6 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,12 +1,12 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.2.2) + activesupport (6.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.2) + zeitwerk (~> 2.2, >= 2.2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) coffee-script (2.4.1) @@ -210,7 +210,7 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.0) + minitest (5.14.1) multipart-post (2.1.1) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) @@ -244,7 +244,7 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) - typhoeus (1.3.1) + typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (1.2.7) thread_safe (~> 0.1) diff --git a/docs/Gems,-Eggs-and-Perl-Modules.md b/docs/Gems,-Eggs-and-Perl-Modules.md index 1323981730..d7793fb63b 100644 --- a/docs/Gems,-Eggs-and-Perl-Modules.md +++ b/docs/Gems,-Eggs-and-Perl-Modules.md @@ -114,7 +114,7 @@ sudo cpan local::lib Note that this will install some other dependencies like `Module::Install`. Then put the appropriate incantation in your shell’s startup, e.g. for -`.bash_profile` you insert the below, for others see the +`.profile` you insert the below, for others see the [`local::lib`](https://metacpan.org/pod/local::lib) docs. ```sh diff --git a/docs/How-to-Create-and-Maintain-a-Tap.md b/docs/How-to-Create-and-Maintain-a-Tap.md index 29e69abe6b..63a08a87c2 100644 --- a/docs/How-to-Create-and-Maintain-a-Tap.md +++ b/docs/How-to-Create-and-Maintain-a-Tap.md @@ -26,7 +26,7 @@ a tap with a `Formula` subdirectory. ## Naming your formulae to avoid clashes -If your formulae have the same name as Homebrew/homebrew-core formulae they cannot be installed side-by-side. If you wish to create a different version of a formula that's in Homebrew/homebrew-core (e.g. with `option`s) consider giving it a different name e.g. `nginx-full` for more fully-featured `nginx` formula. This will allow both `nginx` and `nginx-full` to be installed at the same time (but not linked if there are conflicts and one of them is not declared to be `keg_only`). +If your formulae have the same name as Homebrew/homebrew-core formulae they cannot be installed side-by-side. If you wish to create a different version of a formula that's in Homebrew/homebrew-core (e.g. with `option`s) consider giving it a different name e.g. `nginx-full` for more fully-featured `nginx` formula. This will allow both `nginx` and `nginx-full` to be installed at the same time (assuming one is `keg_only` or the linked files do not clash). ### Installing @@ -72,7 +72,7 @@ See [homebrew/cask](https://github.com/Homebrew/homebrew-cask) for an example of ### Naming Unlike formulae, casks must have globally unique names to avoid clashes. -This can be achieved by e.g. prepending the cask name with you github username: `username-formula-name`. +This can be achieved by e.g. prepending the cask name with your github username: `username-formula-name`. ## External commands @@ -81,3 +81,11 @@ You can provide your tap users with custom `brew` commands by adding them in a See [homebrew/aliases](https://github.com/Homebrew/homebrew-aliases) for an example of a tap with external commands. + +## Official Vendor Taps + +Some upstream software providers like to package their software in their own Homebrew tap. When their software is [eligible for Homebrew/homebrew-core](Acceptable-Formulae.md) we prefer to maintain software there for ease of updates, improved discoverability and use of tools such as [formulae.brew.sh](https://formulae.brew.sh). + +We are not willing to remove software packaged in Homebrew/homebrew-core in favour of an upstream tap. We are not willing to instruct users in our formulae to use your formulae instead. If upstream projects have issues with how Homebrew packages your software: please file issues (or, ideally, pull requests) to address these problems. + +There’s an increasing desire in commercial open source about “maintaining control” e.g. defining exactly what binaries are shipping to users. Not supporting users (or even software distributions) to build-from-source is antithetical to the values of open source. If you think Homebrew's perspective is annoying on this: try and see how Debian responds to requests to ship your binaries. diff --git a/docs/Manpage.md b/docs/Manpage.md index a6eccb4505..36c45bea58 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -435,7 +435,7 @@ ones). No online search is performed. Print export statements. When run in a shell, this installation of Homebrew will be added to your `PATH`, `MANPATH`, and `INFOPATH`. The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. -Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile` or `~/.zprofile`) with: `eval $(brew shellenv)` +Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) with: `eval $(brew shellenv)` ### `switch` *`formula`* *`version`* @@ -858,9 +858,11 @@ Find pull requests that can be automatically merged using `brew pr-publish`. * `--tap`: Target tap repository (default: `homebrew/core`). * `--with-label`: - Pull requests must have this label (default: `ready to merge`). + Pull requests must have this label. * `--without-labels`: Pull requests must not have these labels (default: `do not merge`, `new formula`). +* `--without-approval`: + Pull requests do not require approval to be merged. * `--publish`: Run `brew pr-publish` on matching pull requests. * `--ignore-failures`: @@ -1013,6 +1015,8 @@ Run Homebrew's unit and integration tests. Do not load the compatibility layer when running tests. * `--online`: Include tests that use the GitHub API and tests that use any of the taps for official external commands. +* `--byebug`: + Enable debugging using byebug. * `--only`: Run only *`test_script`*`_spec.rb`. Appending `:`*`line_number`* will start at a specific line. * `--seed`: diff --git a/docs/New-Maintainer-Checklist.md b/docs/New-Maintainer-Checklist.md index b9961fa05a..7a27dd3ec8 100644 --- a/docs/New-Maintainer-Checklist.md +++ b/docs/New-Maintainer-Checklist.md @@ -66,10 +66,11 @@ If they accept, follow a few steps to get them set up: - Add them to Homebrew/brew's README, run `brew man` and commit the changes. - Start the process to [add them as Homebrew members](#members), for formal voting rights and the ability to hold office for Homebrew. -If they are interested in doing system administration work or Homebrew/brew releases: +If they are interested in doing system administration work: - Invite them to the [`homebrew-ops` private operations mailing list](https://lists.sfconservancy.org/mailman/admin/homebrew-ops/members/add). - Invite them to the [`homebrew` private 1Password](https://homebrew.1password.com/people). +- Optionally: make them [owners on the Homebrew GitHub organisation](https://github.com/orgs/Homebrew/people) if they need to access organisation-wide settings (like GitHub Actions organisation shared runners). If they are elected to the Homebrew's [Project Leadership Committee](https://docs.brew.sh/Homebrew-Governance#4-project-leadership-committee): diff --git a/docs/Shell-Completion.md b/docs/Shell-Completion.md index d56cfd1c93..34a4c64f59 100644 --- a/docs/Shell-Completion.md +++ b/docs/Shell-Completion.md @@ -8,7 +8,7 @@ You must configure your shell to enable its completion support. This is because ## Configuring Completions in `bash` -To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` file: +To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.profile` file: ```sh if type brew &>/dev/null; then diff --git a/manpages/brew-cask.1 b/manpages/brew-cask.1 index f9487b6347..6dcccee77b 100644 --- a/manpages/brew-cask.1 +++ b/manpages/brew-cask.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW\-CASK" "1" "April 2020" "Homebrew" "brew-cask" +.TH "BREW\-CASK" "1" "May 2020" "Homebrew" "brew-cask" . .SH "NAME" \fBbrew\-cask\fR \- a friendly binary installer for macOS @@ -274,7 +274,7 @@ Environment variables specific to Homebrew Cask: . .TP \fBHOMEBREW_CASK_OPTS\fR -This variable may contain any arguments normally used as options on the command\-line\. This is particularly useful to make options persistent\. For example, you might add to your \.bash_profile or \.zshenv something like: +This variable may contain any arguments normally used as options on the command\-line\. This is particularly useful to make options persistent\. For example, you might add to your ~/\.profile, ~/\.bash_profile, or ~/\.zshenv something like: . .IP "" 4 . diff --git a/manpages/brew.1 b/manpages/brew.1 index 39b4c97fdd..d69f8f770a 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "April 2020" "Homebrew" "brew" +.TH "BREW" "1" "May 2020" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The Missing Package Manager for macOS @@ -576,7 +576,7 @@ Search for \fItext\fR in the given package manager\'s list\. Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fBPATH\fR, \fBMANPATH\fR, and \fBINFOPATH\fR\. . .P -The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOSITORY\fR are also exported to avoid querying them multiple times\. Consider adding evaluation of this command\'s output to your dotfiles (e\.g\. \fB~/\.profile\fR or \fB~/\.zprofile\fR) with: \fBeval $(brew shellenv)\fR +The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOSITORY\fR are also exported to avoid querying them multiple times\. Consider adding evaluation of this command\'s output to your dotfiles (e\.g\. \fB~/\.profile\fR, \fB~/\.bash_profile\fR, or \fB~/\.zprofile\fR) with: \fBeval $(brew shellenv)\fR . .SS "\fBswitch\fR \fIformula\fR \fIversion\fR" Symlink all of the specified \fIversion\fR of \fIformula\fR\'s installation into Homebrew\'s prefix\. @@ -1103,13 +1103,17 @@ Target tap repository (default: \fBhomebrew/core\fR)\. . .TP \fB\-\-with\-label\fR -Pull requests must have this label (default: \fBready to merge\fR)\. +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)\. . .TP +\fB\-\-without\-approval\fR +Pull requests do not require approval to be merged\. +. +.TP \fB\-\-publish\fR Run \fBbrew pr\-publish\fR on matching pull requests\. . @@ -1303,6 +1307,10 @@ Do not load the compatibility layer when running tests\. Include tests that use the GitHub API and tests that use any of the taps for official external commands\. . .TP +\fB\-\-byebug\fR +Enable debugging using byebug\. +. +.TP \fB\-\-only\fR Run only \fItest_script\fR\fB_spec\.rb\fR\. Appending \fB:\fR\fIline_number\fR will start at a specific line\. .