diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 48b7093d1..d515d46b3 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -93,8 +93,7 @@ Style/ConditionalAssignment: Style/Documentation: Enabled: false -# we want to add this slowly and manually -# TODO: add to more files +# don't want this for formulae but re-enabled for Library/Homebrew Style/FrozenStringLiteralComment: Enabled: false diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index c91eaa0f2..416a664bb 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -117,6 +117,11 @@ Style/DocumentationMethod: Include: - 'Library/Homebrew/formula.rb' +# don't want this for formulae but re-enabled for Library/Homebrew +Style/FrozenStringLiteralComment: + Enabled: true + EnforcedStyle: always + # so many of these in formulae but none in here Style/GuardClause: Enabled: true diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index 8fc84b9e5..975ad6383 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" # installed gems diff --git a/Library/Homebrew/PATH.rb b/Library/Homebrew/PATH.rb index 263f26484..4f46be178 100644 --- a/Library/Homebrew/PATH.rb +++ b/Library/Homebrew/PATH.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PATH include Enumerable extend Forwardable diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index a84e32626..9c2b77c73 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] std_trap = trap("INT") { exit! 130 } # no backtrace thanks diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 761738c9e..ba6592eba 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -348,9 +348,6 @@ else RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt" fi -# Don't set this for anyone (yet) -unset HOMEBREW_FROZEN_STRING_LITERAL - if [[ -z "$HOMEBREW_RUBY_WARNINGS" ]] then export HOMEBREW_RUBY_WARNINGS="-W0" @@ -502,5 +499,5 @@ else # Unshift command back into argument list (unless argument list was empty). [[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@" - { update-preinstall "$@"; exec "$HOMEBREW_RUBY_PATH" $HOMEBREW_FROZEN_STRING_LITERAL $HOMEBREW_RUBY_WARNINGS "$RUBY_DISABLE_OPTIONS" "$HOMEBREW_LIBRARY/Homebrew/brew.rb" "$@"; } + { update-preinstall "$@"; exec "$HOMEBREW_RUBY_PATH" $HOMEBREW_RUBY_WARNINGS "$RUBY_DISABLE_OPTIONS" "$HOMEBREW_LIBRARY/Homebrew/brew.rb" "$@"; } fi diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index ab99bf46e..7e6285220 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This script is loaded by formula_installer as a separate instance. # Thrown exceptions are propagated back to the parent process over a pipe diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index d8ecdccbd..7a991f2be 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BuildEnvironment def initialize(*settings) @settings = Set.new(*settings) diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index bc7b278a6..fc81bb821 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BuildOptions # @private def initialize(args, options) diff --git a/Library/Homebrew/cache_store.rb b/Library/Homebrew/cache_store.rb index 9aeac80ee..842161ec1 100644 --- a/Library/Homebrew/cache_store.rb +++ b/Library/Homebrew/cache_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "json" # diff --git a/Library/Homebrew/cask/all.rb b/Library/Homebrew/cask/all.rb index 6b8bf5f60..f84520567 100644 --- a/Library/Homebrew/cask/all.rb +++ b/Library/Homebrew/cask/all.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "hardware" require "cask/artifact" diff --git a/Library/Homebrew/cask/artifact.rb b/Library/Homebrew/cask/artifact.rb index 1d89d6e9d..98ccf9d66 100644 --- a/Library/Homebrew/cask/artifact.rb +++ b/Library/Homebrew/cask/artifact.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/app" require "cask/artifact/artifact" # generic 'artifact' stanza require "cask/artifact/binary" diff --git a/Library/Homebrew/cask/artifact/abstract_artifact.rb b/Library/Homebrew/cask/artifact/abstract_artifact.rb index c313fcdb4..d75748d99 100644 --- a/Library/Homebrew/cask/artifact/abstract_artifact.rb +++ b/Library/Homebrew/cask/artifact/abstract_artifact.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask module Artifact class AbstractArtifact diff --git a/Library/Homebrew/cask/artifact/abstract_flight_block.rb b/Library/Homebrew/cask/artifact/abstract_flight_block.rb index dff490b77..3eb47fe82 100644 --- a/Library/Homebrew/cask/artifact/abstract_flight_block.rb +++ b/Library/Homebrew/cask/artifact/abstract_flight_block.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_artifact" module Cask diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 9cca7f11b..82aa4fd46 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "timeout" require "utils/user" @@ -92,10 +94,10 @@ module Cask sleep 1 end paths = [ - "/Library/LaunchAgents/#{service}.plist", - "/Library/LaunchDaemons/#{service}.plist", + +"/Library/LaunchAgents/#{service}.plist", + +"/Library/LaunchDaemons/#{service}.plist", ] - paths.each { |elt| elt.prepend(ENV["HOME"]) } unless with_sudo + paths.each { |elt| elt.prepend(ENV["HOME"]).freeze } unless with_sudo paths = paths.map { |elt| Pathname(elt) }.select(&:exist?) paths.each do |path| command.run!("/bin/rm", args: ["-f", "--", path], sudo: with_sudo) diff --git a/Library/Homebrew/cask/artifact/app.rb b/Library/Homebrew/cask/artifact/app.rb index a1c92120e..99bf5fcbb 100644 --- a/Library/Homebrew/cask/artifact/app.rb +++ b/Library/Homebrew/cask/artifact/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/artifact.rb b/Library/Homebrew/cask/artifact/artifact.rb index 39c751130..1252f40f0 100644 --- a/Library/Homebrew/cask/artifact/artifact.rb +++ b/Library/Homebrew/cask/artifact/artifact.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" require "extend/hash_validator" diff --git a/Library/Homebrew/cask/artifact/audio_unit_plugin.rb b/Library/Homebrew/cask/artifact/audio_unit_plugin.rb index 84c1a694a..b027d294d 100644 --- a/Library/Homebrew/cask/artifact/audio_unit_plugin.rb +++ b/Library/Homebrew/cask/artifact/audio_unit_plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/binary.rb b/Library/Homebrew/cask/artifact/binary.rb index a630e7c6f..39c525762 100644 --- a/Library/Homebrew/cask/artifact/binary.rb +++ b/Library/Homebrew/cask/artifact/binary.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/symlinked" module Cask diff --git a/Library/Homebrew/cask/artifact/colorpicker.rb b/Library/Homebrew/cask/artifact/colorpicker.rb index 28a9b7db0..627260c33 100644 --- a/Library/Homebrew/cask/artifact/colorpicker.rb +++ b/Library/Homebrew/cask/artifact/colorpicker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/dictionary.rb b/Library/Homebrew/cask/artifact/dictionary.rb index 129fab095..fe2c2b65b 100644 --- a/Library/Homebrew/cask/artifact/dictionary.rb +++ b/Library/Homebrew/cask/artifact/dictionary.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/font.rb b/Library/Homebrew/cask/artifact/font.rb index ebf158c22..3f9f38518 100644 --- a/Library/Homebrew/cask/artifact/font.rb +++ b/Library/Homebrew/cask/artifact/font.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/input_method.rb b/Library/Homebrew/cask/artifact/input_method.rb index 3637e3ca2..802495184 100644 --- a/Library/Homebrew/cask/artifact/input_method.rb +++ b/Library/Homebrew/cask/artifact/input_method.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/installer.rb b/Library/Homebrew/cask/artifact/installer.rb index 612b86c5f..e1be5f505 100644 --- a/Library/Homebrew/cask/artifact/installer.rb +++ b/Library/Homebrew/cask/artifact/installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_artifact" require "extend/hash_validator" diff --git a/Library/Homebrew/cask/artifact/internet_plugin.rb b/Library/Homebrew/cask/artifact/internet_plugin.rb index da7404789..21dd0b37f 100644 --- a/Library/Homebrew/cask/artifact/internet_plugin.rb +++ b/Library/Homebrew/cask/artifact/internet_plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/moved.rb b/Library/Homebrew/cask/artifact/moved.rb index 67b0ca2e5..077c957a5 100644 --- a/Library/Homebrew/cask/artifact/moved.rb +++ b/Library/Homebrew/cask/artifact/moved.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/relocated" module Cask diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 505bbbb95..139a83571 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "plist" require "utils/user" diff --git a/Library/Homebrew/cask/artifact/postflight_block.rb b/Library/Homebrew/cask/artifact/postflight_block.rb index 50c1e5d7f..43cb49f5b 100644 --- a/Library/Homebrew/cask/artifact/postflight_block.rb +++ b/Library/Homebrew/cask/artifact/postflight_block.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_flight_block" module Cask diff --git a/Library/Homebrew/cask/artifact/preflight_block.rb b/Library/Homebrew/cask/artifact/preflight_block.rb index 3984eab8a..341cdb1e0 100644 --- a/Library/Homebrew/cask/artifact/preflight_block.rb +++ b/Library/Homebrew/cask/artifact/preflight_block.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_flight_block" module Cask diff --git a/Library/Homebrew/cask/artifact/prefpane.rb b/Library/Homebrew/cask/artifact/prefpane.rb index 7221a1a80..393d6e5c4 100644 --- a/Library/Homebrew/cask/artifact/prefpane.rb +++ b/Library/Homebrew/cask/artifact/prefpane.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/qlplugin.rb b/Library/Homebrew/cask/artifact/qlplugin.rb index 4317b5f3b..b9c5f8f06 100644 --- a/Library/Homebrew/cask/artifact/qlplugin.rb +++ b/Library/Homebrew/cask/artifact/qlplugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 59fa34a0b..55d7efdc8 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_artifact" require "extend/hash_validator" @@ -50,7 +52,7 @@ module Cask private - ALT_NAME_ATTRIBUTE = "com.apple.metadata:kMDItemAlternateNames".freeze + ALT_NAME_ATTRIBUTE = "com.apple.metadata:kMDItemAlternateNames" # Try to make the asset searchable under the target name. Spotlight # respects this attribute for many filetypes, but ignores it for App diff --git a/Library/Homebrew/cask/artifact/screen_saver.rb b/Library/Homebrew/cask/artifact/screen_saver.rb index 2a7746e9b..ba3041625 100644 --- a/Library/Homebrew/cask/artifact/screen_saver.rb +++ b/Library/Homebrew/cask/artifact/screen_saver.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/service.rb b/Library/Homebrew/cask/artifact/service.rb index 87c28928f..b42d22c43 100644 --- a/Library/Homebrew/cask/artifact/service.rb +++ b/Library/Homebrew/cask/artifact/service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/stage_only.rb b/Library/Homebrew/cask/artifact/stage_only.rb index add6ba3da..d0b2295c3 100644 --- a/Library/Homebrew/cask/artifact/stage_only.rb +++ b/Library/Homebrew/cask/artifact/stage_only.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_artifact" module Cask diff --git a/Library/Homebrew/cask/artifact/suite.rb b/Library/Homebrew/cask/artifact/suite.rb index 7a0289826..4d8332f70 100644 --- a/Library/Homebrew/cask/artifact/suite.rb +++ b/Library/Homebrew/cask/artifact/suite.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/symlinked.rb b/Library/Homebrew/cask/artifact/symlinked.rb index dc6d434e2..8043f0a84 100644 --- a/Library/Homebrew/cask/artifact/symlinked.rb +++ b/Library/Homebrew/cask/artifact/symlinked.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/relocated" module Cask diff --git a/Library/Homebrew/cask/artifact/uninstall.rb b/Library/Homebrew/cask/artifact/uninstall.rb index 93b6ada85..cdd2da2b8 100644 --- a/Library/Homebrew/cask/artifact/uninstall.rb +++ b/Library/Homebrew/cask/artifact/uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_uninstall" module Cask diff --git a/Library/Homebrew/cask/artifact/vst3_plugin.rb b/Library/Homebrew/cask/artifact/vst3_plugin.rb index f067c014c..ea5dc05d0 100644 --- a/Library/Homebrew/cask/artifact/vst3_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst3_plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/vst_plugin.rb b/Library/Homebrew/cask/artifact/vst_plugin.rb index 661e16de7..6796e286c 100644 --- a/Library/Homebrew/cask/artifact/vst_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst_plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/moved" module Cask diff --git a/Library/Homebrew/cask/artifact/zap.rb b/Library/Homebrew/cask/artifact/zap.rb index 168797468..cd1ccc736 100644 --- a/Library/Homebrew/cask/artifact/zap.rb +++ b/Library/Homebrew/cask/artifact/zap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/artifact/abstract_uninstall" module Cask diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 6e73ccf16..861a7064c 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/checkable" require "cask/download" require "digest" diff --git a/Library/Homebrew/cask/auditor.rb b/Library/Homebrew/cask/auditor.rb index 8a5485739..c36aa5012 100644 --- a/Library/Homebrew/cask/auditor.rb +++ b/Library/Homebrew/cask/auditor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/download" module Cask diff --git a/Library/Homebrew/cask/cache.rb b/Library/Homebrew/cask/cache.rb index 525d8c2b6..228639862 100644 --- a/Library/Homebrew/cask/cache.rb +++ b/Library/Homebrew/cask/cache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask module Cache module_function diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 46e7542bb..23d20dcc7 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/cask_loader" require "cask/config" require "cask/dsl" diff --git a/Library/Homebrew/cask/cask_dependencies.rb b/Library/Homebrew/cask/cask_dependencies.rb index f40fc4fe9..8ef27001e 100644 --- a/Library/Homebrew/cask/cask_dependencies.rb +++ b/Library/Homebrew/cask/cask_dependencies.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" require "cask/topological_hash" diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index 1416442b8..bd375b0de 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/cask" require "uri" diff --git a/Library/Homebrew/cask/caskroom.rb b/Library/Homebrew/cask/caskroom.rb index 73a1b0ae8..542ea0bca 100644 --- a/Library/Homebrew/cask/caskroom.rb +++ b/Library/Homebrew/cask/caskroom.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/user" module Cask diff --git a/Library/Homebrew/cask/checkable.rb b/Library/Homebrew/cask/checkable.rb index bac03f5fb..1e7a87464 100644 --- a/Library/Homebrew/cask/checkable.rb +++ b/Library/Homebrew/cask/checkable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask module Checkable def errors diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 79b0077e2..eaa73213a 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "optparse" require "shellwords" diff --git a/Library/Homebrew/cask/cmd/abstract_command.rb b/Library/Homebrew/cask/cmd/abstract_command.rb index 9b6510269..b08a3ea89 100644 --- a/Library/Homebrew/cask/cmd/abstract_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "options" require "search" @@ -59,8 +61,7 @@ module Cask if matches.one? "Did you mean “#{matches.first}”?" elsif !matches.empty? - "Did you mean one of these?\n" - .concat(Formatter.columns(matches.take(20))) + "Did you mean one of these?\n#{Formatter.columns(matches.take(20))}" end end end diff --git a/Library/Homebrew/cask/cmd/abstract_internal_command.rb b/Library/Homebrew/cask/cmd/abstract_internal_command.rb index 52c47f5cb..c07fe8b5b 100644 --- a/Library/Homebrew/cask/cmd/abstract_internal_command.rb +++ b/Library/Homebrew/cask/cmd/abstract_internal_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class AbstractInternalCommand < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/audit.rb b/Library/Homebrew/cask/cmd/audit.rb index a127bd4b1..5c9307aed 100644 --- a/Library/Homebrew/cask/cmd/audit.rb +++ b/Library/Homebrew/cask/cmd/audit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Audit < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/cat.rb b/Library/Homebrew/cask/cmd/cat.rb index 558dadc21..627852257 100644 --- a/Library/Homebrew/cask/cmd/cat.rb +++ b/Library/Homebrew/cask/cmd/cat.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Cat < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/create.rb b/Library/Homebrew/cask/cmd/create.rb index 43da21044..68fb976da 100644 --- a/Library/Homebrew/cask/cmd/create.rb +++ b/Library/Homebrew/cask/cmd/create.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Create < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/doctor.rb b/Library/Homebrew/cask/cmd/doctor.rb index e1a0b583e..ddd033a2e 100644 --- a/Library/Homebrew/cask/cmd/doctor.rb +++ b/Library/Homebrew/cask/cmd/doctor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "system_config" require "cask/checkable" diff --git a/Library/Homebrew/cask/cmd/edit.rb b/Library/Homebrew/cask/cmd/edit.rb index 2687ce921..ff5f7569c 100644 --- a/Library/Homebrew/cask/cmd/edit.rb +++ b/Library/Homebrew/cask/cmd/edit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Edit < AbstractCommand @@ -10,9 +12,9 @@ module Cask def run exec_editor cask_path rescue CaskUnavailableError => e - reason = e.reason.empty? ? "" : "#{e.reason} " + reason = e.reason.empty? ? +"" : +"#{e.reason} " reason.concat("Run #{Formatter.identifier("brew cask create #{e.token}")} to create a new Cask.") - raise e.class.new(e.token, reason) + raise e.class.new(e.token, reason.freeze) end def cask_path diff --git a/Library/Homebrew/cask/cmd/fetch.rb b/Library/Homebrew/cask/cmd/fetch.rb index 4b3d6d82c..cebf3d8d8 100644 --- a/Library/Homebrew/cask/cmd/fetch.rb +++ b/Library/Homebrew/cask/cmd/fetch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/download" module Cask diff --git a/Library/Homebrew/cask/cmd/home.rb b/Library/Homebrew/cask/cmd/home.rb index e9258a48a..16adc13a5 100644 --- a/Library/Homebrew/cask/cmd/home.rb +++ b/Library/Homebrew/cask/cmd/home.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Home < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/info.rb b/Library/Homebrew/cask/cmd/info.rb index 9899e6006..445388993 100644 --- a/Library/Homebrew/cask/cmd/info.rb +++ b/Library/Homebrew/cask/cmd/info.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "json" require "cask/installer" @@ -104,14 +106,14 @@ module Cask end def self.artifact_info(cask) - artifact_output = ohai_title("Artifacts") + artifact_output = ohai_title("Artifacts").dup cask.artifacts.each do |artifact| next unless artifact.respond_to?(:install_phase) next unless DSL::ORDINARY_ARTIFACT_CLASSES.include?(artifact.class) artifact_output << "\n" << artifact.to_s end - artifact_output + artifact_output.freeze end end end diff --git a/Library/Homebrew/cask/cmd/install.rb b/Library/Homebrew/cask/cmd/install.rb index fd9eda548..44a02ed00 100644 --- a/Library/Homebrew/cask/cmd/install.rb +++ b/Library/Homebrew/cask/cmd/install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Install < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/internal_help.rb b/Library/Homebrew/cask/cmd/internal_help.rb index 9698a405f..2ddac93db 100644 --- a/Library/Homebrew/cask/cmd/internal_help.rb +++ b/Library/Homebrew/cask/cmd/internal_help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class InternalHelp < AbstractInternalCommand diff --git a/Library/Homebrew/cask/cmd/internal_stanza.rb b/Library/Homebrew/cask/cmd/internal_stanza.rb index be830311a..9095614e1 100644 --- a/Library/Homebrew/cask/cmd/internal_stanza.rb +++ b/Library/Homebrew/cask/cmd/internal_stanza.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class InternalStanza < AbstractInternalCommand diff --git a/Library/Homebrew/cask/cmd/list.rb b/Library/Homebrew/cask/cmd/list.rb index 9d336366d..08e9604e1 100644 --- a/Library/Homebrew/cask/cmd/list.rb +++ b/Library/Homebrew/cask/cmd/list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class List < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/options.rb b/Library/Homebrew/cask/cmd/options.rb index 8de1a2863..9dca4e3d7 100644 --- a/Library/Homebrew/cask/cmd/options.rb +++ b/Library/Homebrew/cask/cmd/options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd module Options diff --git a/Library/Homebrew/cask/cmd/outdated.rb b/Library/Homebrew/cask/cmd/outdated.rb index 519758317..f11bd6dd3 100644 --- a/Library/Homebrew/cask/cmd/outdated.rb +++ b/Library/Homebrew/cask/cmd/outdated.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Outdated < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/reinstall.rb b/Library/Homebrew/cask/cmd/reinstall.rb index 87a964189..a8711bec8 100644 --- a/Library/Homebrew/cask/cmd/reinstall.rb +++ b/Library/Homebrew/cask/cmd/reinstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Reinstall < Install diff --git a/Library/Homebrew/cask/cmd/style.rb b/Library/Homebrew/cask/cmd/style.rb index d2a4138ee..539aee117 100644 --- a/Library/Homebrew/cask/cmd/style.rb +++ b/Library/Homebrew/cask/cmd/style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Style < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/uninstall.rb b/Library/Homebrew/cask/cmd/uninstall.rb index 9b9f13434..dfa8bbfb7 100644 --- a/Library/Homebrew/cask/cmd/uninstall.rb +++ b/Library/Homebrew/cask/cmd/uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Uninstall < AbstractCommand diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 709f64aa3..b248bbe14 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/config" module Cask diff --git a/Library/Homebrew/cask/cmd/zap.rb b/Library/Homebrew/cask/cmd/zap.rb index 8436a1ff7..73a8b6858 100644 --- a/Library/Homebrew/cask/cmd/zap.rb +++ b/Library/Homebrew/cask/cmd/zap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Cmd class Zap < AbstractCommand diff --git a/Library/Homebrew/cask/config.rb b/Library/Homebrew/cask/config.rb index 404370e68..527e3f072 100644 --- a/Library/Homebrew/cask/config.rb +++ b/Library/Homebrew/cask/config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "json" require "extend/hash_validator" diff --git a/Library/Homebrew/cask/download.rb b/Library/Homebrew/cask/download.rb index 0a5b2c357..eb3a444bc 100644 --- a/Library/Homebrew/cask/download.rb +++ b/Library/Homebrew/cask/download.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fileutils" require "cask/cache" require "cask/quarantine" diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index 7db3d80df..eaceac002 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "locale" require "lazy_object" diff --git a/Library/Homebrew/cask/dsl/appcast.rb b/Library/Homebrew/cask/dsl/appcast.rb index 98a041171..f2296ad94 100644 --- a/Library/Homebrew/cask/dsl/appcast.rb +++ b/Library/Homebrew/cask/dsl/appcast.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class DSL class Appcast diff --git a/Library/Homebrew/cask/dsl/base.rb b/Library/Homebrew/cask/dsl/base.rb index d52675259..2a14a1c8c 100644 --- a/Library/Homebrew/cask/dsl/base.rb +++ b/Library/Homebrew/cask/dsl/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class DSL class Base diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index e2e43349d..2ddd19b05 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Caveats DSL. Each method should handle output, following the # convention of at least one trailing blank line so that the user # can distinguish separate caveats. diff --git a/Library/Homebrew/cask/dsl/conflicts_with.rb b/Library/Homebrew/cask/dsl/conflicts_with.rb index 2505743a6..abd947722 100644 --- a/Library/Homebrew/cask/dsl/conflicts_with.rb +++ b/Library/Homebrew/cask/dsl/conflicts_with.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/hash_validator" using HashValidator diff --git a/Library/Homebrew/cask/dsl/container.rb b/Library/Homebrew/cask/dsl/container.rb index 9c49e2da1..378e94ced 100644 --- a/Library/Homebrew/cask/dsl/container.rb +++ b/Library/Homebrew/cask/dsl/container.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "unpack_strategy" module Cask diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index 13c8381d7..56a410727 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubygems" module Cask diff --git a/Library/Homebrew/cask/dsl/postflight.rb b/Library/Homebrew/cask/dsl/postflight.rb index a2c0db3bc..9e0b1f55b 100644 --- a/Library/Homebrew/cask/dsl/postflight.rb +++ b/Library/Homebrew/cask/dsl/postflight.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/staged" module Cask diff --git a/Library/Homebrew/cask/dsl/preflight.rb b/Library/Homebrew/cask/dsl/preflight.rb index 0eab22179..1cf1e03b5 100644 --- a/Library/Homebrew/cask/dsl/preflight.rb +++ b/Library/Homebrew/cask/dsl/preflight.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class DSL class Preflight < Base diff --git a/Library/Homebrew/cask/dsl/uninstall_postflight.rb b/Library/Homebrew/cask/dsl/uninstall_postflight.rb index 458d96c73..db83749a2 100644 --- a/Library/Homebrew/cask/dsl/uninstall_postflight.rb +++ b/Library/Homebrew/cask/dsl/uninstall_postflight.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class DSL class UninstallPostflight < Base diff --git a/Library/Homebrew/cask/dsl/uninstall_preflight.rb b/Library/Homebrew/cask/dsl/uninstall_preflight.rb index 38376f272..25d8f1d0d 100644 --- a/Library/Homebrew/cask/dsl/uninstall_preflight.rb +++ b/Library/Homebrew/cask/dsl/uninstall_preflight.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/staged" module Cask diff --git a/Library/Homebrew/cask/dsl/version.rb b/Library/Homebrew/cask/dsl/version.rb index e93a886f8..29faf0c8a 100644 --- a/Library/Homebrew/cask/dsl/version.rb +++ b/Library/Homebrew/cask/dsl/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class DSL class Version < ::String diff --git a/Library/Homebrew/cask/exceptions.rb b/Library/Homebrew/cask/exceptions.rb index 8cbf70d10..401203f8a 100644 --- a/Library/Homebrew/cask/exceptions.rb +++ b/Library/Homebrew/cask/exceptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class CaskError < RuntimeError; end diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 98c1fc104..d59d7d3b4 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubygems" require "formula_installer" @@ -136,9 +138,10 @@ module Cask end def summary - s = "" + s = +"" s << "#{Emoji.install_badge} " if Emoji.enabled? s << "#{@cask} was successfully #{upgrade? ? "upgraded" : "installed"}!" + s.freeze end def download diff --git a/Library/Homebrew/cask/macos.rb b/Library/Homebrew/cask/macos.rb index 967b895bc..84a8eb54e 100644 --- a/Library/Homebrew/cask/macos.rb +++ b/Library/Homebrew/cask/macos.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "os/mac/version" module OS diff --git a/Library/Homebrew/cask/metadata.rb b/Library/Homebrew/cask/metadata.rb index 276554b35..9a47567e9 100644 --- a/Library/Homebrew/cask/metadata.rb +++ b/Library/Homebrew/cask/metadata.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + module Cask module Metadata - METADATA_SUBDIR = ".metadata".freeze + METADATA_SUBDIR = ".metadata" def metadata_master_container_path @metadata_master_container_path ||= caskroom_path.join(METADATA_SUBDIR) diff --git a/Library/Homebrew/cask/pkg.rb b/Library/Homebrew/cask/pkg.rb index 070dd197d..42986319d 100644 --- a/Library/Homebrew/cask/pkg.rb +++ b/Library/Homebrew/cask/pkg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask class Pkg def self.all_matching(regexp, command) diff --git a/Library/Homebrew/cask/quarantine.rb b/Library/Homebrew/cask/quarantine.rb index 7cddb7b33..ee3cd70fa 100644 --- a/Library/Homebrew/cask/quarantine.rb +++ b/Library/Homebrew/cask/quarantine.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + require "development_tools" module Cask module Quarantine module_function - QUARANTINE_ATTRIBUTE = "com.apple.quarantine".freeze + QUARANTINE_ATTRIBUTE = "com.apple.quarantine" QUARANTINE_SCRIPT = (HOMEBREW_LIBRARY_PATH/"cask/utils/quarantine.swift").freeze diff --git a/Library/Homebrew/cask/staged.rb b/Library/Homebrew/cask/staged.rb index e2aacc351..b0216fc34 100644 --- a/Library/Homebrew/cask/staged.rb +++ b/Library/Homebrew/cask/staged.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/user" module Cask diff --git a/Library/Homebrew/cask/topological_hash.rb b/Library/Homebrew/cask/topological_hash.rb index 8320bbb89..919dc161f 100644 --- a/Library/Homebrew/cask/topological_hash.rb +++ b/Library/Homebrew/cask/topological_hash.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tsort" # a basic topologically sortable hashmap diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index 678d79569..329a1bfe0 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class URL ATTRIBUTES = [ :using, diff --git a/Library/Homebrew/cask/utils.rb b/Library/Homebrew/cask/utils.rb index d95091a51..69bdd9652 100644 --- a/Library/Homebrew/cask/utils.rb +++ b/Library/Homebrew/cask/utils.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + require "utils/user" require "yaml" require "open3" require "stringio" -BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs".freeze +BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs" module Cask module Utils diff --git a/Library/Homebrew/cask/verify.rb b/Library/Homebrew/cask/verify.rb index 06bc03d8c..ca0c0ddee 100644 --- a/Library/Homebrew/cask/verify.rb +++ b/Library/Homebrew/cask/verify.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask module Verify module_function diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index 6f9fcb9cc..620f40dc7 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/python" class Caveats @@ -40,7 +42,7 @@ class Caveats #{f.name} is keg-only, which means it was not symlinked into #{HOMEBREW_PREFIX}, because #{f.keg_only_reason.to_s.chomp}. EOS - end + end.dup if f.bin.directory? || f.sbin.directory? s << <<~EOS @@ -118,10 +120,10 @@ class Caveats #{root_dir}/share/zsh/site-functions EOS when :fish - fish_caveats = "fish #{installed.join(" and ")} have been installed to:" + fish_caveats = +"fish #{installed.join(" and ")} have been installed to:" fish_caveats << "\n #{root_dir}/share/fish/vendor_completions.d" if completion_installed fish_caveats << "\n #{root_dir}/share/fish/vendor_functions.d" if functions_installed - fish_caveats + fish_caveats.freeze end end diff --git a/Library/Homebrew/checksum.rb b/Library/Homebrew/checksum.rb index c1d0e7055..fe0960df4 100644 --- a/Library/Homebrew/checksum.rb +++ b/Library/Homebrew/checksum.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Checksum extend Forwardable diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb index 416de41fc..3f5e3aa37 100644 --- a/Library/Homebrew/cleaner.rb +++ b/Library/Homebrew/cleaner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Cleans a newly installed keg. # By default: # diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index cfce53568..7b569ca72 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/bottles" require "utils/gems" require "formula" diff --git a/Library/Homebrew/cli/args.rb b/Library/Homebrew/cli/args.rb index 3f2ff6906..bcb3563cd 100644 --- a/Library/Homebrew/cli/args.rb +++ b/Library/Homebrew/cli/args.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "ostruct" module Homebrew diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index bd3473558..8626201c8 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/args" require "optparse" require "set" diff --git a/Library/Homebrew/cmd/--cache.rb b/Library/Homebrew/cmd/--cache.rb index a593af31d..c814e1a53 100644 --- a/Library/Homebrew/cmd/--cache.rb +++ b/Library/Homebrew/cmd/--cache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fetch" require "cli/parser" diff --git a/Library/Homebrew/cmd/--cellar.rb b/Library/Homebrew/cmd/--cellar.rb index a9e7758fb..859d90b6d 100644 --- a/Library/Homebrew/cmd/--cellar.rb +++ b/Library/Homebrew/cmd/--cellar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/--env.rb b/Library/Homebrew/cmd/--env.rb index 7a8c39bef..e696ca665 100644 --- a/Library/Homebrew/cmd/--env.rb +++ b/Library/Homebrew/cmd/--env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV" require "build_environment" require "utils/shell" diff --git a/Library/Homebrew/cmd/--prefix.rb b/Library/Homebrew/cmd/--prefix.rb index 86295cd2f..04135da0a 100644 --- a/Library/Homebrew/cmd/--prefix.rb +++ b/Library/Homebrew/cmd/--prefix.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/--repository.rb b/Library/Homebrew/cmd/--repository.rb index d283fbfed..2d3f6ba36 100644 --- a/Library/Homebrew/cmd/--repository.rb +++ b/Library/Homebrew/cmd/--repository.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/--version.rb b/Library/Homebrew/cmd/--version.rb index b5c4283be..c89ba493d 100644 --- a/Library/Homebrew/cmd/--version.rb +++ b/Library/Homebrew/cmd/--version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/analytics.rb b/Library/Homebrew/cmd/analytics.rb index 0b24527d9..ac49c188d 100644 --- a/Library/Homebrew/cmd/analytics.rb +++ b/Library/Homebrew/cmd/analytics.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/cask.rb b/Library/Homebrew/cmd/cask.rb index 667c25607..82f0ffcd0 100644 --- a/Library/Homebrew/cmd/cask.rb +++ b/Library/Homebrew/cmd/cask.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/all" module Homebrew diff --git a/Library/Homebrew/cmd/cat.rb b/Library/Homebrew/cmd/cat.rb index 3214d3d2f..a8c360dcc 100644 --- a/Library/Homebrew/cmd/cat.rb +++ b/Library/Homebrew/cmd/cat.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index dc714f0b5..e1840843b 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cleanup" require "cli/parser" diff --git a/Library/Homebrew/cmd/command.rb b/Library/Homebrew/cmd/command.rb index 9fad816fd..0968eeda2 100644 --- a/Library/Homebrew/cmd/command.rb +++ b/Library/Homebrew/cmd/command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "commands" require "cli/parser" diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index 8705db094..3bf14e1fc 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb index 7f21c9c34..f1e8e0a36 100644 --- a/Library/Homebrew/cmd/config.rb +++ b/Library/Homebrew/cmd/config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "system_config" require "cli/parser" diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index ed4ed9391..8835c5995 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "ostruct" require "cli/parser" diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 27689bd47..b30a8cb27 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "descriptions" require "search" require "description_cache_store" diff --git a/Library/Homebrew/cmd/diy.rb b/Library/Homebrew/cmd/diy.rb index cda37e600..48bcc9ccc 100644 --- a/Library/Homebrew/cmd/diy.rb +++ b/Library/Homebrew/cmd/diy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 6f0557125..709bbaf38 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "diagnostic" require "cli/parser" diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index f98ad6d8a..66fb5c5eb 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "fetch" require "cli/parser" diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index a6329cc0a..6986f6160 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "install" require "system_config" diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index 84d28ab35..d75c424e1 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "help" module Homebrew diff --git a/Library/Homebrew/cmd/home.rb b/Library/Homebrew/cmd/home.rb index a00176207..eb81019d1 100644 --- a/Library/Homebrew/cmd/home.rb +++ b/Library/Homebrew/cmd/home.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 0007af6fd..7bac8db03 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "missing_formula" require "caveats" require "cli/parser" diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 9200344a5..f64c03ea2 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "missing_formula" require "formula_installer" require "development_tools" diff --git a/Library/Homebrew/cmd/leaves.rb b/Library/Homebrew/cmd/leaves.rb index 4583ec181..f9bbfe214 100644 --- a/Library/Homebrew/cmd/leaves.rb +++ b/Library/Homebrew/cmd/leaves.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "tab" require "cli/parser" diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 2427f798d..fe280a381 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "ostruct" require "caveats" require "cli/parser" diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index cc590b090..3b3b1ef3f 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "metafiles" require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 6506fd929..000543faa 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/migrate.rb b/Library/Homebrew/cmd/migrate.rb index 4c863b203..25a94da2a 100644 --- a/Library/Homebrew/cmd/migrate.rb +++ b/Library/Homebrew/cmd/migrate.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "migrator" require "cli/parser" diff --git a/Library/Homebrew/cmd/missing.rb b/Library/Homebrew/cmd/missing.rb index 56d7a3880..b0d4fb7ac 100644 --- a/Library/Homebrew/cmd/missing.rb +++ b/Library/Homebrew/cmd/missing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "tab" require "diagnostic" diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index 340355cac..e30baddfb 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "options" require "cli/parser" diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index b23361247..6e66764fa 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "keg" require "cli/parser" diff --git a/Library/Homebrew/cmd/pin.rb b/Library/Homebrew/cmd/pin.rb index 148f9f395..33ae70e43 100644 --- a/Library/Homebrew/cmd/pin.rb +++ b/Library/Homebrew/cmd/pin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 8c6207760..4f11e8931 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sandbox" require "formula_installer" require "cli/parser" diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index 3303abe37..24dd837e5 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "readall" require "cli/parser" diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 3cab67073..818597150 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula_installer" require "development_tools" require "messages" diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 4007527f9..3efacc74a 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "missing_formula" require "descriptions" diff --git a/Library/Homebrew/cmd/sh.rb b/Library/Homebrew/cmd/sh.rb index 42137f067..6d3fec814 100644 --- a/Library/Homebrew/cmd/sh.rb +++ b/Library/Homebrew/cmd/sh.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV" require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 881b73bd5..b62ac97c7 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "json" require "open3" require "style" diff --git a/Library/Homebrew/cmd/switch.rb b/Library/Homebrew/cmd/switch.rb index 99484f83e..56e005d1d 100644 --- a/Library/Homebrew/cmd/switch.rb +++ b/Library/Homebrew/cmd/switch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "keg" require "cli/parser" diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index 134b0bf7c..a5f0093b2 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/tap-pin.rb b/Library/Homebrew/cmd/tap-pin.rb index 3f0ddcb9a..114dd9e65 100644 --- a/Library/Homebrew/cmd/tap-pin.rb +++ b/Library/Homebrew/cmd/tap-pin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/tap-unpin.rb b/Library/Homebrew/cmd/tap-unpin.rb index 64a320f22..1cab3cbf6 100644 --- a/Library/Homebrew/cmd/tap-unpin.rb +++ b/Library/Homebrew/cmd/tap-unpin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index d3cce4549..6bb3d164c 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb index aff746b81..e50c8f8ca 100644 --- a/Library/Homebrew/cmd/uninstall.rb +++ b/Library/Homebrew/cmd/uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" require "formula" require "diagnostic" diff --git a/Library/Homebrew/cmd/unlink.rb b/Library/Homebrew/cmd/unlink.rb index b63b060f5..f41e95e8c 100644 --- a/Library/Homebrew/cmd/unlink.rb +++ b/Library/Homebrew/cmd/unlink.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "ostruct" require "cli/parser" diff --git a/Library/Homebrew/cmd/unpack.rb b/Library/Homebrew/cmd/unpack.rb index e12b354c6..f56ae42a6 100644 --- a/Library/Homebrew/cmd/unpack.rb +++ b/Library/Homebrew/cmd/unpack.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "stringio" require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/unpin.rb b/Library/Homebrew/cmd/unpin.rb index 0722418d1..2ffd94989 100644 --- a/Library/Homebrew/cmd/unpin.rb +++ b/Library/Homebrew/cmd/unpin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb index d86c80f37..333399984 100644 --- a/Library/Homebrew/cmd/untap.rb +++ b/Library/Homebrew/cmd/untap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index d8da2b0d4..0f8e8f213 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula_versions" require "migrator" require "formulary" diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index cd71173a8..c968c5b32 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "install" require "reinstall" require "formula_installer" diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index f8fd73b24..d70f877a3 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/commands.rb b/Library/Homebrew/commands.rb index 9f25f2a2e..46db17891 100644 --- a/Library/Homebrew/commands.rb +++ b/Library/Homebrew/commands.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Commands def self.path(cmd) [ diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index a76f2ba1d..e2c608068 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @private module CompilerConstants GNU_GCC_VERSIONS = %w[4.9 5 6 7 8].freeze diff --git a/Library/Homebrew/config.rb b/Library/Homebrew/config.rb index 7dec7452c..30d39094d 100644 --- a/Library/Homebrew/config.rb +++ b/Library/Homebrew/config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] # Path to `bin/brew` main executable in `HOMEBREW_PREFIX` diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index 82f4c7605..1b279c28b 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "compilers" class CxxStdlib diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb index de5c4686a..f3827b964 100644 --- a/Library/Homebrew/debrew.rb +++ b/Library/Homebrew/debrew.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "mutex_m" require "debrew/irb" diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb index eeb3758a9..7087bd859 100644 --- a/Library/Homebrew/debrew/irb.rb +++ b/Library/Homebrew/debrew/irb.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "irb" module IRB diff --git a/Library/Homebrew/dependable.rb b/Library/Homebrew/dependable.rb index ce0f5fd4e..2b97e7db7 100644 --- a/Library/Homebrew/dependable.rb +++ b/Library/Homebrew/dependable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "options" module Dependable diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 386890c80..dff99d540 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" class Dependencies < DelegateClass(Array) diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index b5afba777..ec9acadab 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependable" # A dependency on another Homebrew formula. diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 8ad82f9ce..e7e9e9006 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependency" require "dependencies" require "requirement" diff --git a/Library/Homebrew/description_cache_store.rb b/Library/Homebrew/description_cache_store.rb index 984cefd16..b507aed6b 100644 --- a/Library/Homebrew/description_cache_store.rb +++ b/Library/Homebrew/description_cache_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "set" require "cache_store" require "searchable" diff --git a/Library/Homebrew/descriptions.rb b/Library/Homebrew/descriptions.rb index 137c79bf3..46b7f2ef3 100644 --- a/Library/Homebrew/descriptions.rb +++ b/Library/Homebrew/descriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "formula_versions" require "search" diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index e578558cc..690d04acf 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "formula_versions" require "utils/curl" diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 60d10efa4..7ff09281f 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -1,3 +1,7 @@ +# Uses ERB so can't use Frozen String Literals until >=Ruby 2.4: +# https://bugs.ruby-lang.org/issues/12031 +# frozen_string_literal: false + require "formula" require "utils/bottles" require "tab" @@ -39,7 +43,7 @@ module Homebrew def bottle_args Homebrew::CLI::Parser.new do - usage_banner <<~EOS + usage_banner <<~EOS.freeze `bottle` [] Generate a bottle (binary package) from a formula that was installed with @@ -376,7 +380,7 @@ module Homebrew "#{key}: old: #{old_value}, new: #{value}" end - odie <<~EOS + odie <<~EOS.freeze --keep-old was passed but there are changes in: #{mismatches.join("\n")} EOS @@ -487,7 +491,7 @@ module Homebrew end unless mismatches.empty? - odie <<~EOS + odie <<~EOS.freeze --keep-old was passed but there are changes in: #{mismatches.join("\n")} EOS diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index f81211371..574a0c9a4 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index 308320459..96bdaf524 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "formula_creator" require "missing_formula" diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index 1b1b6f341..b4ace42c5 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index 6b532f882..761d63af6 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" require "utils/git" require "formulary" diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index 673588fa9..7b1ca2307 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index e0fa43c68..819373f5b 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" class Symbol diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 4da94cfdd..d864ec9c3 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cache_store" require "linkage_checker" require "cli/parser" diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb index 2efa0a0e9..5e07666f0 100644 --- a/Library/Homebrew/dev-cmd/man.rb +++ b/Library/Homebrew/dev-cmd/man.rb @@ -1,3 +1,7 @@ +# Uses ERB so can't use Frozen String Literals until >=Ruby 2.4: +# https://bugs.ruby-lang.org/issues/12031 +# frozen_string_literal: false + require "formula" require "erb" require "ostruct" @@ -14,7 +18,7 @@ module Homebrew def man_args Homebrew::CLI::Parser.new do - usage_banner <<~EOS + usage_banner <<~EOS.freeze `man` [] Generate Homebrew's manpages. diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb index 8662756db..298e9e594 100644 --- a/Library/Homebrew/dev-cmd/mirror.rb +++ b/Library/Homebrew/dev-cmd/mirror.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb index be85d0f98..e84cd11ae 100644 --- a/Library/Homebrew/dev-cmd/prof.rb +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 9a2fcd6c8..0fbfffeb1 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "net/http" require "net/https" require "json" diff --git a/Library/Homebrew/dev-cmd/release-notes.rb b/Library/Homebrew/dev-cmd/release-notes.rb index 2b51ee960..fd65abc49 100644 --- a/Library/Homebrew/dev-cmd/release-notes.rb +++ b/Library/Homebrew/dev-cmd/release-notes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb index b7012a7d8..dcc20138e 100644 --- a/Library/Homebrew/dev-cmd/ruby.rb +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 9408a8d0e..db5e742c1 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tap" require "cli/parser" diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb index 5515c57f5..4c10ac558 100644 --- a/Library/Homebrew/dev-cmd/test.rb +++ b/Library/Homebrew/dev-cmd/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV" require "sandbox" require "timeout" diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index fb44ee660..34795359a 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" require "fileutils" diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 84832cd23..25c9e316a 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/parser" module Homebrew diff --git a/Library/Homebrew/dev-cmd/vendor-gems.rb b/Library/Homebrew/dev-cmd/vendor-gems.rb index 0188f9d7b..3c22d1c3a 100644 --- a/Library/Homebrew/dev-cmd/vendor-gems.rb +++ b/Library/Homebrew/dev-cmd/vendor-gems.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cli/parser" diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index b5d938ab5..aed19cc8d 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @private class DevelopmentTools class << self diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 2560cfd7a..c713faf74 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" require "language/python" require "formula" @@ -69,7 +71,8 @@ module Homebrew end def inject_file_list(list, string) - list.reduce(string) { |acc, elem| acc << " #{elem}\n" } + list.reduce(string.dup) { |acc, elem| acc << " #{elem}\n" } + .freeze end ############# END HELPERS diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 544c1e411..f2ef478d7 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "json" require "rexml/document" require "time" diff --git a/Library/Homebrew/emoji.rb b/Library/Homebrew/emoji.rb index 652d5b2eb..68e015630 100644 --- a/Library/Homebrew/emoji.rb +++ b/Library/Homebrew/emoji.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Emoji class << self def install_badge diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 4c4158295..5d6ca67cd 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "shellwords" class UsageError < RuntimeError @@ -529,7 +531,7 @@ class ErrorDuringExecution < RuntimeError status end - s = "Failure while executing; `#{cmd.shelljoin.gsub(/\\=/, "=")}` exited with #{exitstatus}." + s = +"Failure while executing; `#{cmd.shelljoin.gsub(/\\=/, "=")}` exited with #{exitstatus}." unless [*output].empty? format_output_line = lambda do |type_line| @@ -546,7 +548,7 @@ class ErrorDuringExecution < RuntimeError s << "\n" unless s.end_with?("\n") end - super s + super s.freeze end def stderr diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 57127524f..dfea80f2e 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module HomebrewArgvExtension def named # TODO: use @instance variable to ||= cache when moving to CLI::Parser diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index e0eee1b75..4d8bae102 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "hardware" require "extend/ENV/shared" require "extend/ENV/std" diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index 9198c19a6..067deee69 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "compilers" require "development_tools" diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index eb079f19b..06f4e50d3 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "hardware" require "extend/ENV/shared" @@ -6,7 +8,7 @@ module Stdenv include SharedEnvExtension # @private - SAFE_CFLAGS_FLAGS = "-w -pipe".freeze + SAFE_CFLAGS_FLAGS = "-w -pipe" # @private def setup_build_environment(formula = nil) diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 403144a3c..2aa440689 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV/shared" require "development_tools" diff --git a/Library/Homebrew/extend/cachable.rb b/Library/Homebrew/extend/cachable.rb index 69d86ccb7..754509648 100644 --- a/Library/Homebrew/extend/cachable.rb +++ b/Library/Homebrew/extend/cachable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cachable def cache @cache ||= {} diff --git a/Library/Homebrew/extend/git_repository.rb b/Library/Homebrew/extend/git_repository.rb index 8cd389ddf..caf69be7b 100644 --- a/Library/Homebrew/extend/git_repository.rb +++ b/Library/Homebrew/extend/git_repository.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/git" require "utils/popen" diff --git a/Library/Homebrew/extend/hash_validator.rb b/Library/Homebrew/extend/hash_validator.rb index 1a00d3fa1..ff6d7aec5 100644 --- a/Library/Homebrew/extend/hash_validator.rb +++ b/Library/Homebrew/extend/hash_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module HashValidator refine Hash do def assert_valid_keys!(*valid_keys) diff --git a/Library/Homebrew/extend/io.rb b/Library/Homebrew/extend/io.rb index 4ddfecde2..21080e1fe 100644 --- a/Library/Homebrew/extend/io.rb +++ b/Library/Homebrew/extend/io.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IO def readline_nonblock(sep = $INPUT_RECORD_SEPARATOR) line = +"" diff --git a/Library/Homebrew/extend/module.rb b/Library/Homebrew/extend/module.rb index b31454373..5ba8ae7e0 100644 --- a/Library/Homebrew/extend/module.rb +++ b/Library/Homebrew/extend/module.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Module def attr_rw(*attrs) file, line, = caller.first.split(":") diff --git a/Library/Homebrew/extend/optparse.rb b/Library/Homebrew/extend/optparse.rb index 801f7badd..d59dcbeca 100644 --- a/Library/Homebrew/extend/optparse.rb +++ b/Library/Homebrew/extend/optparse.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "optparse" OptionParser.accept Pathname do |path| diff --git a/Library/Homebrew/extend/os/analytics.rb b/Library/Homebrew/extend/os/analytics.rb index 13b981169..749d80c66 100644 --- a/Library/Homebrew/extend/os/analytics.rb +++ b/Library/Homebrew/extend/os/analytics.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/utils/analytics" if OS.mac? diff --git a/Library/Homebrew/extend/os/bottles.rb b/Library/Homebrew/extend/os/bottles.rb index 6ee9a2146..b9426c9d5 100644 --- a/Library/Homebrew/extend/os/bottles.rb +++ b/Library/Homebrew/extend/os/bottles.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/utils/bottles" if OS.mac? diff --git a/Library/Homebrew/extend/os/caveats.rb b/Library/Homebrew/extend/os/caveats.rb index e67138087..6dddc2a8f 100644 --- a/Library/Homebrew/extend/os/caveats.rb +++ b/Library/Homebrew/extend/os/caveats.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/caveats" if OS.mac? diff --git a/Library/Homebrew/extend/os/cleaner.rb b/Library/Homebrew/extend/os/cleaner.rb index 26226b93d..0fc9822e7 100644 --- a/Library/Homebrew/extend/os/cleaner.rb +++ b/Library/Homebrew/extend/os/cleaner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/cleaner" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/dependency_collector.rb b/Library/Homebrew/extend/os/dependency_collector.rb index f3635e3da..b73abbdcf 100644 --- a/Library/Homebrew/extend/os/dependency_collector.rb +++ b/Library/Homebrew/extend/os/dependency_collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/dependency_collector" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/development_tools.rb b/Library/Homebrew/extend/os/development_tools.rb index 3280c85b0..61385fc5c 100644 --- a/Library/Homebrew/extend/os/development_tools.rb +++ b/Library/Homebrew/extend/os/development_tools.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/development_tools" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/diagnostic.rb b/Library/Homebrew/extend/os/diagnostic.rb index 34d09f961..d94fb033b 100644 --- a/Library/Homebrew/extend/os/diagnostic.rb +++ b/Library/Homebrew/extend/os/diagnostic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/diagnostic" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/extend/ENV/shared.rb b/Library/Homebrew/extend/os/extend/ENV/shared.rb index 1a6b2294b..ee2c60f12 100644 --- a/Library/Homebrew/extend/os/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/extend/ENV/shared.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/extend/ENV/shared" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/extend/ENV/std.rb b/Library/Homebrew/extend/os/extend/ENV/std.rb index 7d117c626..4fa49e135 100644 --- a/Library/Homebrew/extend/os/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/extend/ENV/std.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/extend/ENV/std" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/extend/ENV/super.rb b/Library/Homebrew/extend/os/extend/ENV/super.rb index 951f4cac8..e7d197638 100644 --- a/Library/Homebrew/extend/os/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/extend/ENV/super.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/extend/ENV/super" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/formula_cellar_checks.rb b/Library/Homebrew/extend/os/formula_cellar_checks.rb index 30805adfb..85bf7f77b 100644 --- a/Library/Homebrew/extend/os/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/formula_cellar_checks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/formula_cellar_checks" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/formula_support.rb b/Library/Homebrew/extend/os/formula_support.rb index e1708c93d..b092c72bc 100644 --- a/Library/Homebrew/extend/os/formula_support.rb +++ b/Library/Homebrew/extend/os/formula_support.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/formula_support" if OS.mac? diff --git a/Library/Homebrew/extend/os/hardware.rb b/Library/Homebrew/extend/os/hardware.rb index 728775cac..f23d41e4a 100644 --- a/Library/Homebrew/extend/os/hardware.rb +++ b/Library/Homebrew/extend/os/hardware.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/hardware" require "extend/os/mac/hardware/cpu" diff --git a/Library/Homebrew/extend/os/install.rb b/Library/Homebrew/extend/os/install.rb index a98faed82..8e93626db 100644 --- a/Library/Homebrew/extend/os/install.rb +++ b/Library/Homebrew/extend/os/install.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/linux/install" if OS.linux? diff --git a/Library/Homebrew/extend/os/keg.rb b/Library/Homebrew/extend/os/keg.rb index 4164a9626..7b321b1b9 100644 --- a/Library/Homebrew/extend/os/keg.rb +++ b/Library/Homebrew/extend/os/keg.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/keg" if OS.mac? diff --git a/Library/Homebrew/extend/os/keg_relocate.rb b/Library/Homebrew/extend/os/keg_relocate.rb index 6bfe18f28..2107c8388 100644 --- a/Library/Homebrew/extend/os/keg_relocate.rb +++ b/Library/Homebrew/extend/os/keg_relocate.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/keg_relocate" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/language/java.rb b/Library/Homebrew/extend/os/language/java.rb index 0394f4199..03e20040e 100644 --- a/Library/Homebrew/extend/os/language/java.rb +++ b/Library/Homebrew/extend/os/language/java.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/language/java" if OS.mac? diff --git a/Library/Homebrew/extend/os/linkage_checker.rb b/Library/Homebrew/extend/os/linkage_checker.rb index 9ded9646d..4fe4204f6 100644 --- a/Library/Homebrew/extend/os/linkage_checker.rb +++ b/Library/Homebrew/extend/os/linkage_checker.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/linux/linkage_checker" if OS.linux? diff --git a/Library/Homebrew/extend/os/linux/cleaner.rb b/Library/Homebrew/extend/os/linux/cleaner.rb index d82ef1164..21d646c0b 100644 --- a/Library/Homebrew/extend/os/linux/cleaner.rb +++ b/Library/Homebrew/extend/os/linux/cleaner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Cleaner private diff --git a/Library/Homebrew/extend/os/linux/dependency_collector.rb b/Library/Homebrew/extend/os/linux/dependency_collector.rb index 1949002cc..b965138c0 100644 --- a/Library/Homebrew/extend/os/linux/dependency_collector.rb +++ b/Library/Homebrew/extend/os/linux/dependency_collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DependencyCollector def java_dep_if_needed(tags) req = JavaRequirement.new(tags) diff --git a/Library/Homebrew/extend/os/linux/development_tools.rb b/Library/Homebrew/extend/os/linux/development_tools.rb index af0a12383..590c0e0d7 100644 --- a/Library/Homebrew/extend/os/linux/development_tools.rb +++ b/Library/Homebrew/extend/os/linux/development_tools.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DevelopmentTools class << self def locate(tool) diff --git a/Library/Homebrew/extend/os/linux/diagnostic.rb b/Library/Homebrew/extend/os/linux/diagnostic.rb index 7279e59fa..c1698eced 100644 --- a/Library/Homebrew/extend/os/linux/diagnostic.rb +++ b/Library/Homebrew/extend/os/linux/diagnostic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tempfile" require "utils/shell" require "os/linux/diagnostic" diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb index 4d938d08f..4b76a64af 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SharedEnvExtension # @private def effective_arch diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/std.rb b/Library/Homebrew/extend/os/linux/extend/ENV/std.rb index a129530db..af3f462ee 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/std.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Stdenv def setup_build_environment(formula = nil) generic_setup_build_environment(formula) diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index b8e1f1dd9..94eb819d6 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Superenv # @private def self.bin diff --git a/Library/Homebrew/extend/os/linux/extend/pathname.rb b/Library/Homebrew/extend/os/linux/extend/pathname.rb index 604351da7..7b4bd6371 100644 --- a/Library/Homebrew/extend/os/linux/extend/pathname.rb +++ b/Library/Homebrew/extend/os/linux/extend/pathname.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "os/linux/elf" class Pathname diff --git a/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb b/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb index 0665f5678..00a14f98b 100644 --- a/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FormulaCellarChecks def valid_library_extension?(filename) generic_valid_library_extension?(filename) || filename.basename.to_s.include?(".so.") diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index 75d983ff0..4de99e35f 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Hardware class CPU class << self diff --git a/Library/Homebrew/extend/os/linux/install.rb b/Library/Homebrew/extend/os/linux/install.rb index 84b96ac06..7efbff87d 100644 --- a/Library/Homebrew/extend/os/linux/install.rb +++ b/Library/Homebrew/extend/os/linux/install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Install module_function diff --git a/Library/Homebrew/extend/os/linux/keg_relocate.rb b/Library/Homebrew/extend/os/linux/keg_relocate.rb index dd08361de..a3da66d27 100644 --- a/Library/Homebrew/extend/os/linux/keg_relocate.rb +++ b/Library/Homebrew/extend/os/linux/keg_relocate.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Keg def relocate_dynamic_linkage(relocation) # Patching the dynamic linker of glibc breaks it. diff --git a/Library/Homebrew/extend/os/linux/linkage_checker.rb b/Library/Homebrew/extend/os/linux/linkage_checker.rb index a1a6fa7f4..95fd37ac7 100644 --- a/Library/Homebrew/extend/os/linux/linkage_checker.rb +++ b/Library/Homebrew/extend/os/linux/linkage_checker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LinkageChecker # Libraries provided by glibc and gcc. SYSTEM_LIBRARY_WHITELIST = %w[ diff --git a/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb b/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb index 23a68743d..1b1b6347c 100644 --- a/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb +++ b/Library/Homebrew/extend/os/linux/requirements/java_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/java" class JavaRequirement < Requirement diff --git a/Library/Homebrew/extend/os/linux/requirements/osxfuse_requirement.rb b/Library/Homebrew/extend/os/linux/requirements/osxfuse_requirement.rb index b4cb9fc62..2c2d79f45 100644 --- a/Library/Homebrew/extend/os/linux/requirements/osxfuse_requirement.rb +++ b/Library/Homebrew/extend/os/linux/requirements/osxfuse_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class OsxfuseRequirement < Requirement diff --git a/Library/Homebrew/extend/os/linux/software_spec.rb b/Library/Homebrew/extend/os/linux/software_spec.rb index 7e62ef9d8..12ed0de45 100644 --- a/Library/Homebrew/extend/os/linux/software_spec.rb +++ b/Library/Homebrew/extend/os/linux/software_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BottleSpecification def skip_relocation? false diff --git a/Library/Homebrew/extend/os/linux/system_config.rb b/Library/Homebrew/extend/os/linux/system_config.rb index 53c42fcf3..bae9ad3e4 100644 --- a/Library/Homebrew/extend/os/linux/system_config.rb +++ b/Library/Homebrew/extend/os/linux/system_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "os/linux/glibc" diff --git a/Library/Homebrew/extend/os/linux/tap.rb b/Library/Homebrew/extend/os/linux/tap.rb index 4242ef099..854a3d9eb 100644 --- a/Library/Homebrew/extend/os/linux/tap.rb +++ b/Library/Homebrew/extend/os/linux/tap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CoreTap < Tap # @private def initialize diff --git a/Library/Homebrew/extend/os/mac/caveats.rb b/Library/Homebrew/extend/os/mac/caveats.rb index 7ddfb5fb4..05df496cb 100644 --- a/Library/Homebrew/extend/os/mac/caveats.rb +++ b/Library/Homebrew/extend/os/mac/caveats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Caveats undef plist_caveats diff --git a/Library/Homebrew/extend/os/mac/cleaner.rb b/Library/Homebrew/extend/os/mac/cleaner.rb index 69d82814d..35b6e374c 100644 --- a/Library/Homebrew/extend/os/mac/cleaner.rb +++ b/Library/Homebrew/extend/os/mac/cleaner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Cleaner private diff --git a/Library/Homebrew/extend/os/mac/dependency_collector.rb b/Library/Homebrew/extend/os/mac/dependency_collector.rb index 014fecdb5..11c58bbe7 100644 --- a/Library/Homebrew/extend/os/mac/dependency_collector.rb +++ b/Library/Homebrew/extend/os/mac/dependency_collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DependencyCollector undef git_dep_if_needed, subversion_dep_if_needed, cvs_dep_if_needed, xz_dep_if_needed, unzip_dep_if_needed, bzip2_dep_if_needed diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index 0d175c0ec..e1b1d0e87 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "os/mac/xcode" # @private diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 3847d64ad..ae16cf562 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Diagnostic class Checks diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb b/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb index 67a3944c3..476d30f75 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SharedEnvExtension def no_weak_imports_support? return false unless compiler == :clang diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index a44a614a6..049fa6adc 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Stdenv # @private diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index 6cc29ba1e..b5485e33a 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Superenv class << self undef bin diff --git a/Library/Homebrew/extend/os/mac/extend/pathname.rb b/Library/Homebrew/extend/os/mac/extend/pathname.rb index 4ced5a094..9289aa73b 100644 --- a/Library/Homebrew/extend/os/mac/extend/pathname.rb +++ b/Library/Homebrew/extend/os/mac/extend/pathname.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "os/mac/mach" class Pathname diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb index 97b02c91d..9f0805404 100644 --- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cache_store" require "linkage_checker" diff --git a/Library/Homebrew/extend/os/mac/formula_support.rb b/Library/Homebrew/extend/os/mac/formula_support.rb index 39309663d..95f316be8 100644 --- a/Library/Homebrew/extend/os/mac/formula_support.rb +++ b/Library/Homebrew/extend/os/mac/formula_support.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class KegOnlyReason def valid? true diff --git a/Library/Homebrew/extend/os/mac/hardware.rb b/Library/Homebrew/extend/os/mac/hardware.rb index 25e9d0c58..b41439350 100644 --- a/Library/Homebrew/extend/os/mac/hardware.rb +++ b/Library/Homebrew/extend/os/mac/hardware.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Hardware def self.oldest_cpu(version = MacOS.version) if version >= :mojave diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb index c8e3c9f39..75a56877e 100644 --- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Hardware class CPU class << self diff --git a/Library/Homebrew/extend/os/mac/keg.rb b/Library/Homebrew/extend/os/mac/keg.rb index a0dc175ca..c0b1e3fcc 100644 --- a/Library/Homebrew/extend/os/mac/keg.rb +++ b/Library/Homebrew/extend/os/mac/keg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Keg GENERIC_KEG_LINK_DIRECTORIES = (remove_const :KEG_LINK_DIRECTORIES).freeze KEG_LINK_DIRECTORIES = (GENERIC_KEG_LINK_DIRECTORIES + ["Frameworks"]).freeze diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 8fed56b88..170b828a7 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Keg class << self undef file_linked_libraries diff --git a/Library/Homebrew/extend/os/mac/language/java.rb b/Library/Homebrew/extend/os/mac/language/java.rb index ef5615353..d750bf632 100644 --- a/Library/Homebrew/extend/os/mac/language/java.rb +++ b/Library/Homebrew/extend/os/mac/language/java.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Java def self.java_home_cmd(version = nil) diff --git a/Library/Homebrew/extend/os/mac/missing_formula.rb b/Library/Homebrew/extend/os/mac/missing_formula.rb index cf54137ad..5e4879b72 100644 --- a/Library/Homebrew/extend/os/mac/missing_formula.rb +++ b/Library/Homebrew/extend/os/mac/missing_formula.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module MissingFormula class << self diff --git a/Library/Homebrew/extend/os/mac/requirements/java_requirement.rb b/Library/Homebrew/extend/os/mac/requirements/java_requirement.rb index 59b208d78..f8130f758 100644 --- a/Library/Homebrew/extend/os/mac/requirements/java_requirement.rb +++ b/Library/Homebrew/extend/os/mac/requirements/java_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class JavaRequirement < Requirement env do env_java_common diff --git a/Library/Homebrew/extend/os/mac/requirements/osxfuse_requirement.rb b/Library/Homebrew/extend/os/mac/requirements/osxfuse_requirement.rb index f6ca8cfc2..bcdfabdf7 100644 --- a/Library/Homebrew/extend/os/mac/requirements/osxfuse_requirement.rb +++ b/Library/Homebrew/extend/os/mac/requirements/osxfuse_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class OsxfuseRequirement < Requirement diff --git a/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb b/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb index f4a5da695..5c0f5cb9c 100644 --- a/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb +++ b/Library/Homebrew/extend/os/mac/requirements/x11_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class X11Requirement < Requirement diff --git a/Library/Homebrew/extend/os/mac/search.rb b/Library/Homebrew/extend/os/mac/search.rb index d26cf1727..82cf08b5c 100644 --- a/Library/Homebrew/extend/os/mac/search.rb +++ b/Library/Homebrew/extend/os/mac/search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/cask" require "cask/cask_loader" diff --git a/Library/Homebrew/extend/os/mac/system_config.rb b/Library/Homebrew/extend/os/mac/system_config.rb index ec017bdc2..6d92ee2d6 100644 --- a/Library/Homebrew/extend/os/mac/system_config.rb +++ b/Library/Homebrew/extend/os/mac/system_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SystemConfig class << self undef describe_java, describe_homebrew_ruby diff --git a/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb b/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb index 6f0dc90a3..4aaf225f1 100644 --- a/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb +++ b/Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Zip prepend Module.new { diff --git a/Library/Homebrew/extend/os/mac/utils/analytics.rb b/Library/Homebrew/extend/os/mac/utils/analytics.rb index f59ba37fe..3e624df8a 100644 --- a/Library/Homebrew/extend/os/mac/utils/analytics.rb +++ b/Library/Homebrew/extend/os/mac/utils/analytics.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module Utils module Analytics class << self def custom_prefix_label - "non-/usr/local".freeze + "non-/usr/local" end end end diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb index 954ca0b36..09bb7027b 100644 --- a/Library/Homebrew/extend/os/mac/utils/bottles.rb +++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Utils class Bottles class << self diff --git a/Library/Homebrew/extend/os/missing_formula.rb b/Library/Homebrew/extend/os/missing_formula.rb index c58992576..b77e64274 100644 --- a/Library/Homebrew/extend/os/missing_formula.rb +++ b/Library/Homebrew/extend/os/missing_formula.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/missing_formula" if OS.mac? diff --git a/Library/Homebrew/extend/os/pathname.rb b/Library/Homebrew/extend/os/pathname.rb index 5e6edeb30..58e109e3f 100644 --- a/Library/Homebrew/extend/os/pathname.rb +++ b/Library/Homebrew/extend/os/pathname.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/extend/pathname" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/requirements/java_requirement.rb b/Library/Homebrew/extend/os/requirements/java_requirement.rb index 673d53079..85c36f1ae 100644 --- a/Library/Homebrew/extend/os/requirements/java_requirement.rb +++ b/Library/Homebrew/extend/os/requirements/java_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/requirements/java_requirement" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/requirements/osxfuse_requirement.rb b/Library/Homebrew/extend/os/requirements/osxfuse_requirement.rb index ab491aa1e..eab9176f3 100644 --- a/Library/Homebrew/extend/os/requirements/osxfuse_requirement.rb +++ b/Library/Homebrew/extend/os/requirements/osxfuse_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/requirements/osxfuse_requirement" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/requirements/x11_requirement.rb b/Library/Homebrew/extend/os/requirements/x11_requirement.rb index 664b6c7c0..5389f38a1 100644 --- a/Library/Homebrew/extend/os/requirements/x11_requirement.rb +++ b/Library/Homebrew/extend/os/requirements/x11_requirement.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/requirements/x11_requirement" if OS.mac? diff --git a/Library/Homebrew/extend/os/search.rb b/Library/Homebrew/extend/os/search.rb index 69c6b0254..c6909a0fa 100644 --- a/Library/Homebrew/extend/os/search.rb +++ b/Library/Homebrew/extend/os/search.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/search" if OS.mac? diff --git a/Library/Homebrew/extend/os/software_spec.rb b/Library/Homebrew/extend/os/software_spec.rb index a3421738f..aae7c1299 100644 --- a/Library/Homebrew/extend/os/software_spec.rb +++ b/Library/Homebrew/extend/os/software_spec.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/linux/software_spec" if OS.linux? diff --git a/Library/Homebrew/extend/os/system_config.rb b/Library/Homebrew/extend/os/system_config.rb index b80eec5e8..9c06e9a02 100644 --- a/Library/Homebrew/extend/os/system_config.rb +++ b/Library/Homebrew/extend/os/system_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/system_config" elsif OS.linux? diff --git a/Library/Homebrew/extend/os/tap.rb b/Library/Homebrew/extend/os/tap.rb index 93c67d484..82e0a09f6 100644 --- a/Library/Homebrew/extend/os/tap.rb +++ b/Library/Homebrew/extend/os/tap.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/linux/tap" if OS.linux? diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 77c3ce651..1ad0ff96a 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" require "metafiles" diff --git a/Library/Homebrew/extend/predicable.rb b/Library/Homebrew/extend/predicable.rb index d02fbb89b..dba7f17b5 100644 --- a/Library/Homebrew/extend/predicable.rb +++ b/Library/Homebrew/extend/predicable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Predicable def attr_predicate(*attrs) attrs.each do |attr| diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index 71f08c453..1d8619bb9 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Contains backports from newer versions of Ruby require "backports/2.4.0/string/match" require "backports/2.5.0/string/delete_prefix" diff --git a/Library/Homebrew/fetch.rb b/Library/Homebrew/fetch.rb index 32f9e3f7c..4d9a13719 100644 --- a/Library/Homebrew/fetch.rb +++ b/Library/Homebrew/fetch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Fetch module_function diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 5fd2553b5..79aa5f98f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cache_store" require "formula_support" require "lock_file" diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index 2ef69d6d7..b1f9a2aab 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Assertions require "rubygems" diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index c8080ec94..dfd7c3cc9 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/shell" module FormulaCellarChecks diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index c9de19fb1..b7ee699a1 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "digest" require "erb" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index afedd08de..09fd6822b 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cxxstdlib" require "formula" require "keg" @@ -664,7 +666,7 @@ class FormulaInstaller end def summary - s = "" + s = +"" s << "#{Emoji.install_badge} " if Emoji.enabled? s << "#{formula.prefix.resolved_path}: #{formula.prefix.abv}" s << ", built in #{pretty_duration build_time}" if build_time diff --git a/Library/Homebrew/formula_pin.rb b/Library/Homebrew/formula_pin.rb index c31280800..f9c54097f 100644 --- a/Library/Homebrew/formula_pin.rb +++ b/Library/Homebrew/formula_pin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" class FormulaPin diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index 05347a10d..008c023b2 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Used to track formulae that cannot be installed at the same time. FormulaConflict = Struct.new(:name, :reason) diff --git a/Library/Homebrew/formula_versions.rb b/Library/Homebrew/formula_versions.rb index c4248fbdf..ae1c67063 100644 --- a/Library/Homebrew/formula_versions.rb +++ b/Library/Homebrew/formula_versions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" class FormulaVersions diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 9722eeafd..e884fe744 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "digest/md5" require "extend/cachable" diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 9f976f604..515617907 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "English" require "json" require "json/add/exception" @@ -33,7 +35,7 @@ ARGV.extend(HomebrewArgvExtension) HOMEBREW_PRODUCT = ENV["HOMEBREW_PRODUCT"] HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"] -HOMEBREW_WWW = "https://brew.sh".freeze +HOMEBREW_WWW = "https://brew.sh" require "rbconfig" @@ -42,10 +44,10 @@ RUBY_BIN = RUBY_PATH.dirname.freeze HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"] HOMEBREW_USER_AGENT_RUBY = - "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}".freeze + "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" HOMEBREW_USER_AGENT_FAKE_SAFARI = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 " \ - "(KHTML, like Gecko) Version/10.0.3 Safari/602.4.8".freeze + "(KHTML, like Gecko) Version/10.0.3 Safari/602.4.8" HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"] HOMEBREW_BOTTLE_DOMAIN = ENV["HOMEBREW_BOTTLE_DOMAIN"] @@ -57,9 +59,9 @@ require "os/global" module Homebrew extend FileUtils - DEFAULT_PREFIX ||= "/usr/local".freeze - DEFAULT_CELLAR = "#{DEFAULT_PREFIX}/Cellar".freeze - DEFAULT_REPOSITORY = "#{DEFAULT_PREFIX}/Homebrew".freeze + DEFAULT_PREFIX ||= "/usr/local" + DEFAULT_CELLAR = "#{DEFAULT_PREFIX}/Cellar" + DEFAULT_REPOSITORY = "#{DEFAULT_PREFIX}/Homebrew" class << self attr_writer :failed, :raise_deprecation_exceptions, :auditing, :args diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index cda94a491..37fd2c49c 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Hardware class CPU INTEL_32BIT_ARCHS = [:i386].freeze diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index 6593b1baa..c99e6dae7 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -1,4 +1,6 @@ -HOMEBREW_HELP = <<~EOS.freeze +# frozen_string_literal: true + +HOMEBREW_HELP = <<~EOS Example usage: brew search [TEXT|/REGEX/] brew info [FORMULA...] diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 256993e3d..215845e36 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "diagnostic" require "fileutils" require "hardware" diff --git a/Library/Homebrew/install_renamed.rb b/Library/Homebrew/install_renamed.rb index dc5d4cda8..9fa6f37fa 100644 --- a/Library/Homebrew/install_renamed.rb +++ b/Library/Homebrew/install_renamed.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module InstallRenamed def install_p(_, new_basename) super do |src, dst| diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 39125daa0..a1f480e1f 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg_relocate" require "language/python" require "lock_file" diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 9936ecbe2..b8028ceab 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + class Keg - PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@".freeze - CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@".freeze - REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@".freeze + PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@" + CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@" + REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@" Relocation = Struct.new(:old_prefix, :old_cellar, :old_repository, :new_prefix, :new_cellar, :new_repository) do diff --git a/Library/Homebrew/language/go.rb b/Library/Homebrew/language/go.rb index 90922ddb7..7dbbf5bf8 100644 --- a/Library/Homebrew/language/go.rb +++ b/Library/Homebrew/language/go.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" module Language diff --git a/Library/Homebrew/language/haskell.rb b/Library/Homebrew/language/haskell.rb index bf68441fa..e4b11e307 100644 --- a/Library/Homebrew/language/haskell.rb +++ b/Library/Homebrew/language/haskell.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Haskell module Cabal diff --git a/Library/Homebrew/language/java.rb b/Library/Homebrew/language/java.rb index 01ff28d9e..5311b1f58 100644 --- a/Library/Homebrew/language/java.rb +++ b/Library/Homebrew/language/java.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Java def self.java_home_cmd(_ = nil) diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb index 28d9ee4b8..4ae81f0bc 100644 --- a/Library/Homebrew/language/node.rb +++ b/Library/Homebrew/language/node.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Node def self.npm_cache_config diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index f026e32a6..ce811330d 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/python_virtualenv_constants" module Language diff --git a/Library/Homebrew/language/python_virtualenv_constants.rb b/Library/Homebrew/language/python_virtualenv_constants.rb index f39dd4ff2..67af7da6d 100644 --- a/Library/Homebrew/language/python_virtualenv_constants.rb +++ b/Library/Homebrew/language/python_virtualenv_constants.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + PYTHON_VIRTUALENV_URL = "https://files.pythonhosted.org/packages/37/db" \ "/89d6b043b22052109da35416abc3c397655e4bd3cff031446ba02b9654fa" \ - "/virtualenv-16.4.3.tar.gz".freeze + "/virtualenv-16.4.3.tar.gz" PYTHON_VIRTUALENV_SHA256 = - "984d7e607b0a5d1329425dd8845bd971b957424b5ba664729fab51ab8c11bc39".freeze + "984d7e607b0a5d1329425dd8845bd971b957424b5ba664729fab51ab8c11bc39" diff --git a/Library/Homebrew/lazy_object.rb b/Library/Homebrew/lazy_object.rb index 520ae643d..d54f15ed7 100644 --- a/Library/Homebrew/lazy_object.rb +++ b/Library/Homebrew/lazy_object.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LazyObject < Delegator def initialize(&callable) super(callable) diff --git a/Library/Homebrew/linkage_cache_store.rb b/Library/Homebrew/linkage_cache_store.rb index 408ad0f22..6ab77998e 100644 --- a/Library/Homebrew/linkage_cache_store.rb +++ b/Library/Homebrew/linkage_cache_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "set" require "cache_store" diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index 9e1a34fe6..27a6c0a38 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" require "formula" require "linkage_cache_store" diff --git a/Library/Homebrew/load_path.rb b/Library/Homebrew/load_path.rb index d465c8db8..c3eb98356 100644 --- a/Library/Homebrew/load_path.rb +++ b/Library/Homebrew/load_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pathname" HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze diff --git a/Library/Homebrew/locale.rb b/Library/Homebrew/locale.rb index 4c05be5be..d9c520959 100644 --- a/Library/Homebrew/locale.rb +++ b/Library/Homebrew/locale.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Locale class ParserError < StandardError end diff --git a/Library/Homebrew/lock_file.rb b/Library/Homebrew/lock_file.rb index c694c6222..99c1afda5 100644 --- a/Library/Homebrew/lock_file.rb +++ b/Library/Homebrew/lock_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fcntl" class LockFile diff --git a/Library/Homebrew/messages.rb b/Library/Homebrew/messages.rb index 55cf10264..8ecd36d08 100644 --- a/Library/Homebrew/messages.rb +++ b/Library/Homebrew/messages.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # A Messages object collects messages that may need to be displayed together # at the end of a multi-step `brew` command run. class Messages diff --git a/Library/Homebrew/metafiles.rb b/Library/Homebrew/metafiles.rb index 963f5c45b..5159623f1 100644 --- a/Library/Homebrew/metafiles.rb +++ b/Library/Homebrew/metafiles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Metafiles # https://github.com/github/markup#markups EXTENSIONS = Set.new(%w[ diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index 60bb0ce71..0c11faad7 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "lock_file" require "keg" require "tab" diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 2ab03c4c5..7fe246c33 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formulary" require "cask/cmd/abstract_command" require "cask/cmd/info" @@ -198,9 +200,9 @@ module Homebrew return if silent cask = Cask::CaskLoader.load(name) - reason = "Found a cask named \"#{name}\" instead.\n" + reason = +"Found a cask named \"#{name}\" instead.\n" reason << Cask::Cmd::Info.get_info(cask) if show_info - reason + reason.freeze rescue Cask::CaskUnavailableError nil end diff --git a/Library/Homebrew/mktemp.rb b/Library/Homebrew/mktemp.rb index 2a8d698b4..716c3d269 100644 --- a/Library/Homebrew/mktemp.rb +++ b/Library/Homebrew/mktemp.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Performs `Formula#mktemp`'s functionality, and tracks the results. # Each instance is only intended to be used once. class Mktemp diff --git a/Library/Homebrew/official_taps.rb b/Library/Homebrew/official_taps.rb index 74059c908..44fb54250 100644 --- a/Library/Homebrew/official_taps.rb +++ b/Library/Homebrew/official_taps.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + OFFICIAL_CASK_TAPS = %w[ cask versions diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index fa043c4a9..c386c2ee4 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Option attr_reader :name, :description, :flag diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index 44e169485..2108c279d 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OS def self.mac? return false if ENV["HOMEBREW_TEST_GENERIC_OS"] @@ -20,12 +22,12 @@ module OS !OS::Mac.outdated_release? && ARGV.none? { |v| v.start_with?("--cc=") } && ENV["HOMEBREW_PREFIX"] == "/usr/local" - ISSUES_URL = "https://docs.brew.sh/Troubleshooting".freeze + ISSUES_URL = "https://docs.brew.sh/Troubleshooting" end - PATH_OPEN = "/usr/bin/open".freeze + PATH_OPEN = "/usr/bin/open" elsif OS.linux? require "os/linux" - ISSUES_URL = "https://docs.brew.sh/Troubleshooting".freeze - PATH_OPEN = "xdg-open".freeze + ISSUES_URL = "https://docs.brew.sh/Troubleshooting" + PATH_OPEN = "xdg-open" end end diff --git a/Library/Homebrew/os/global.rb b/Library/Homebrew/os/global.rb index 7808b7e5b..9d6250c23 100644 --- a/Library/Homebrew/os/global.rb +++ b/Library/Homebrew/os/global.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "os/linux/global" if OS.linux? diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb index af0c598b2..cc26893e7 100644 --- a/Library/Homebrew/os/linux.rb +++ b/Library/Homebrew/os/linux.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OS # Define OS::Mac on Linux for formula API compatibility. module Mac diff --git a/Library/Homebrew/os/linux/diagnostic.rb b/Library/Homebrew/os/linux/diagnostic.rb index 66cd7fe8a..1844c658e 100644 --- a/Library/Homebrew/os/linux/diagnostic.rb +++ b/Library/Homebrew/os/linux/diagnostic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Diagnostic class Checks diff --git a/Library/Homebrew/os/linux/elf.rb b/Library/Homebrew/os/linux/elf.rb index b7a1fcb72..4e3a99a49 100644 --- a/Library/Homebrew/os/linux/elf.rb +++ b/Library/Homebrew/os/linux/elf.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + # @see https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header module ELFShim MAGIC_NUMBER_OFFSET = 0 - MAGIC_NUMBER_ASCII = "\x7fELF".freeze + MAGIC_NUMBER_ASCII = "\x7fELF" OS_ABI_OFFSET = 0x07 OS_ABI_SYSTEM_V = 0 diff --git a/Library/Homebrew/os/linux/glibc.rb b/Library/Homebrew/os/linux/glibc.rb index 0d7397c9c..8a7fa5250 100644 --- a/Library/Homebrew/os/linux/glibc.rb +++ b/Library/Homebrew/os/linux/glibc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OS module Linux module Glibc diff --git a/Library/Homebrew/os/linux/global.rb b/Library/Homebrew/os/linux/global.rb index 893cec29e..a4d7e2c0e 100644 --- a/Library/Homebrew/os/linux/global.rb +++ b/Library/Homebrew/os/linux/global.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + module Homebrew DEFAULT_PREFIX ||= if ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] - "/usr/local".freeze + "/usr/local" else - "/home/linuxbrew/.linuxbrew".freeze + "/home/linuxbrew/.linuxbrew" end.freeze end diff --git a/Library/Homebrew/os/linux/kernel.rb b/Library/Homebrew/os/linux/kernel.rb index 4534409e6..b35927dd3 100644 --- a/Library/Homebrew/os/linux/kernel.rb +++ b/Library/Homebrew/os/linux/kernel.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OS module Linux module Kernel diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 3f800e702..078e3fd0c 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "os/mac/version" require "os/mac/xcode" require "os/mac/xquartz" diff --git a/Library/Homebrew/os/mac/architecture_list.rb b/Library/Homebrew/os/mac/architecture_list.rb index aa3c035b7..8ade3fe0c 100644 --- a/Library/Homebrew/os/mac/architecture_list.rb +++ b/Library/Homebrew/os/mac/architecture_list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "hardware" module ArchitectureListExtension diff --git a/Library/Homebrew/os/mac/keg.rb b/Library/Homebrew/os/mac/keg.rb index 631a69916..65d4ceb02 100644 --- a/Library/Homebrew/os/mac/keg.rb +++ b/Library/Homebrew/os/mac/keg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Keg def change_dylib_id(id, file) return if file.dylib_id == id diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 4e7c86e98..aa8baa542 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "macho" require "os/mac/architecture_list" diff --git a/Library/Homebrew/os/mac/sdk.rb b/Library/Homebrew/os/mac/sdk.rb index 1bae724ee..1fa1356f8 100644 --- a/Library/Homebrew/os/mac/sdk.rb +++ b/Library/Homebrew/os/mac/sdk.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "os/mac/version" module OS diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb index 4527bdafe..f0652cf8c 100644 --- a/Library/Homebrew/os/mac/version.rb +++ b/Library/Homebrew/os/mac/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "version" module OS diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 536e20cd9..194bf237b 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -1,11 +1,13 @@ +# frozen_string_literal: true + module OS module Mac module Xcode module_function DEFAULT_BUNDLE_PATH = Pathname.new("/Applications/Xcode.app").freeze - BUNDLE_ID = "com.apple.dt.Xcode".freeze - OLD_BUNDLE_ID = "com.apple.Xcode".freeze + BUNDLE_ID = "com.apple.dt.Xcode" + OLD_BUNDLE_ID = "com.apple.Xcode" def latest_version case MacOS.version @@ -185,12 +187,12 @@ module OS module_function # The original Mavericks CLT package ID - EXECUTABLE_PKG_ID = "com.apple.pkg.CLTools_Executables".freeze - MAVERICKS_NEW_PKG_ID = "com.apple.pkg.CLTools_Base".freeze # obsolete - PKG_PATH = "/Library/Developer/CommandLineTools".freeze + EXECUTABLE_PKG_ID = "com.apple.pkg.CLTools_Executables" + MAVERICKS_NEW_PKG_ID = "com.apple.pkg.CLTools_Base" # obsolete + PKG_PATH = "/Library/Developer/CommandLineTools" HEADER_PKG_PATH = - "/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_:macos_version.pkg".freeze - HEADER_PKG_ID = "com.apple.pkg.macOS_SDK_headers_for_macOS_10.14".freeze + "/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_:macos_version.pkg" + HEADER_PKG_ID = "com.apple.pkg.macOS_SDK_headers_for_macOS_10.14" # Returns true even if outdated tools are installed def installed? diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index 566adb912..5df711276 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OS module Mac X11 = XQuartz = Module.new # rubocop:disable Style/MutableConstant @@ -6,8 +8,8 @@ module OS module_function DEFAULT_BUNDLE_PATH = Pathname.new("Applications/Utilities/XQuartz.app").freeze - FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11".freeze - FORGE_PKG_ID = "org.macosforge.xquartz.pkg".freeze + FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11" + FORGE_PKG_ID = "org.macosforge.xquartz.pkg" PKGINFO_VERSION_MAP = { "2.6.34" => "2.6.3", diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 94d037726..8f0d5a5c0 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" require "erb" diff --git a/Library/Homebrew/pkg_version.rb b/Library/Homebrew/pkg_version.rb index 8838a996a..43b45d60e 100644 --- a/Library/Homebrew/pkg_version.rb +++ b/Library/Homebrew/pkg_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "version" class PkgVersion diff --git a/Library/Homebrew/postinstall.rb b/Library/Homebrew/postinstall.rb index 94c56e48f..3498e03d6 100644 --- a/Library/Homebrew/postinstall.rb +++ b/Library/Homebrew/postinstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + old_trap = trap("INT") { exit! 130 } require "global" diff --git a/Library/Homebrew/readall.rb b/Library/Homebrew/readall.rb index de1ece8d6..327bcef52 100644 --- a/Library/Homebrew/readall.rb +++ b/Library/Homebrew/readall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" module Readall diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index fd131e84c..088be0faf 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula_installer" require "development_tools" require "messages" diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 9474aabfd..ebd2179a2 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependable" require "dependency" require "dependencies" diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb index 0173017e8..cf7cf6be8 100644 --- a/Library/Homebrew/requirements.rb +++ b/Library/Homebrew/requirements.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" require "requirements/arch_requirement" require "requirements/codesign_requirement" diff --git a/Library/Homebrew/requirements/arch_requirement.rb b/Library/Homebrew/requirements/arch_requirement.rb index 9a28daa46..03a988c76 100644 --- a/Library/Homebrew/requirements/arch_requirement.rb +++ b/Library/Homebrew/requirements/arch_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class ArchRequirement < Requirement diff --git a/Library/Homebrew/requirements/codesign_requirement.rb b/Library/Homebrew/requirements/codesign_requirement.rb index aaf4f650f..9a48f204b 100644 --- a/Library/Homebrew/requirements/codesign_requirement.rb +++ b/Library/Homebrew/requirements/codesign_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CodesignRequirement < Requirement fatal true diff --git a/Library/Homebrew/requirements/java_requirement.rb b/Library/Homebrew/requirements/java_requirement.rb index 76992fcfa..d563ac547 100644 --- a/Library/Homebrew/requirements/java_requirement.rb +++ b/Library/Homebrew/requirements/java_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/java" class JavaRequirement < Requirement diff --git a/Library/Homebrew/requirements/linux_requirement.rb b/Library/Homebrew/requirements/linux_requirement.rb index cb4666e56..74daf4cf4 100644 --- a/Library/Homebrew/requirements/linux_requirement.rb +++ b/Library/Homebrew/requirements/linux_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LinuxRequirement < Requirement fatal true diff --git a/Library/Homebrew/requirements/macos_requirement.rb b/Library/Homebrew/requirements/macos_requirement.rb index 7f40d37fe..d984efc6e 100644 --- a/Library/Homebrew/requirements/macos_requirement.rb +++ b/Library/Homebrew/requirements/macos_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class MacOSRequirement < Requirement diff --git a/Library/Homebrew/requirements/maximum_macos_requirement.rb b/Library/Homebrew/requirements/maximum_macos_requirement.rb index 4dd7fd73d..415f862ed 100644 --- a/Library/Homebrew/requirements/maximum_macos_requirement.rb +++ b/Library/Homebrew/requirements/maximum_macos_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class MaximumMacOSRequirement < Requirement diff --git a/Library/Homebrew/requirements/osxfuse_requirement.rb b/Library/Homebrew/requirements/osxfuse_requirement.rb index 2e67a4b05..79712de53 100644 --- a/Library/Homebrew/requirements/osxfuse_requirement.rb +++ b/Library/Homebrew/requirements/osxfuse_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class OsxfuseRequirement < Requirement diff --git a/Library/Homebrew/requirements/tuntap_requirement.rb b/Library/Homebrew/requirements/tuntap_requirement.rb index 3ae142080..80b842977 100644 --- a/Library/Homebrew/requirements/tuntap_requirement.rb +++ b/Library/Homebrew/requirements/tuntap_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class TuntapRequirement < Requirement diff --git a/Library/Homebrew/requirements/x11_requirement.rb b/Library/Homebrew/requirements/x11_requirement.rb index 539d37480..58ecf33cf 100644 --- a/Library/Homebrew/requirements/x11_requirement.rb +++ b/Library/Homebrew/requirements/x11_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class X11Requirement < Requirement diff --git a/Library/Homebrew/requirements/xcode_requirement.rb b/Library/Homebrew/requirements/xcode_requirement.rb index 8d596fbf4..caeb67724 100644 --- a/Library/Homebrew/requirements/xcode_requirement.rb +++ b/Library/Homebrew/requirements/xcode_requirement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirement" class XcodeRequirement < Requirement diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 1ca20ee2b..b4c32f173 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "download_strategy" require "checksum" require "version" diff --git a/Library/Homebrew/rubocops.rb b/Library/Homebrew/rubocops.rb index 78e4a92e0..b3a1fabbe 100644 --- a/Library/Homebrew/rubocops.rb +++ b/Library/Homebrew/rubocops.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "load_path" require "rubocop-rspec" diff --git a/Library/Homebrew/rubocops/cask/ast/cask_block.rb b/Library/Homebrew/rubocops/cask/ast/cask_block.rb index bc8db9590..98e97c0c3 100644 --- a/Library/Homebrew/rubocops/cask/ast/cask_block.rb +++ b/Library/Homebrew/rubocops/cask/ast/cask_block.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" module RuboCop diff --git a/Library/Homebrew/rubocops/cask/ast/cask_header.rb b/Library/Homebrew/rubocops/cask/ast/cask_header.rb index 475dd2d8f..8668c2daa 100644 --- a/Library/Homebrew/rubocops/cask/ast/cask_header.rb +++ b/Library/Homebrew/rubocops/cask/ast/cask_header.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cask module AST diff --git a/Library/Homebrew/rubocops/cask/ast/stanza.rb b/Library/Homebrew/rubocops/cask/ast/stanza.rb index c81e560c2..8a6b7a545 100644 --- a/Library/Homebrew/rubocops/cask/ast/stanza.rb +++ b/Library/Homebrew/rubocops/cask/ast/stanza.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" module RuboCop diff --git a/Library/Homebrew/rubocops/cask/constants/stanza.rb b/Library/Homebrew/rubocops/cask/constants/stanza.rb index 0cdfef8ba..ad7b41ce4 100644 --- a/Library/Homebrew/rubocops/cask/constants/stanza.rb +++ b/Library/Homebrew/rubocops/cask/constants/stanza.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cask # Constants available globally for use in all Cask cops. diff --git a/Library/Homebrew/rubocops/cask/extend/node.rb b/Library/Homebrew/rubocops/cask/extend/node.rb index f8c365d21..8e179e70d 100644 --- a/Library/Homebrew/rubocops/cask/extend/node.rb +++ b/Library/Homebrew/rubocops/cask/extend/node.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module AST # Extensions for RuboCop's AST Node class diff --git a/Library/Homebrew/rubocops/cask/extend/string.rb b/Library/Homebrew/rubocops/cask/extend/string.rb index 45d50157d..73ac1a98b 100644 --- a/Library/Homebrew/rubocops/cask/extend/string.rb +++ b/Library/Homebrew/rubocops/cask/extend/string.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Utility method extensions for String class String def undent diff --git a/Library/Homebrew/rubocops/cask/homepage_matches_url.rb b/Library/Homebrew/rubocops/cask/homepage_matches_url.rb index ddd020f56..850132129 100644 --- a/Library/Homebrew/rubocops/cask/homepage_matches_url.rb +++ b/Library/Homebrew/rubocops/cask/homepage_matches_url.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" module RuboCop @@ -13,11 +15,11 @@ module RuboCop REFERENCE_URL = "https://github.com/Homebrew/homebrew-cask/blob/master/doc/" \ - "cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-a-comment".freeze + "cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-a-comment" COMMENT_FORMAT = /# [^ ]+ was verified as official when first introduced to the cask/.freeze - MSG_NO_MATCH = "`%{url}` does not match `%{full_url}`".freeze + MSG_NO_MATCH = "`%{url}` does not match `%{full_url}`" MSG_MISSING = ("`%{domain}` does not match `%{homepage}`, a comment has to be added " \ "above the `url` stanza. For details, see " + REFERENCE_URL).freeze @@ -26,7 +28,7 @@ module RuboCop "For details, see " + REFERENCE_URL).freeze MSG_UNNECESSARY = "The URL's domain `%{domain}` matches the homepage `%{homepage}`, " \ - "the comment above the `url` stanza is unnecessary".freeze + "the comment above the `url` stanza is unnecessary" def on_cask(cask_block) @cask_block = cask_block diff --git a/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb b/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb index 267ecad2c..ab7f0987a 100644 --- a/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb +++ b/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" require "uri" @@ -9,7 +11,7 @@ module RuboCop class HomepageUrlTrailingSlash < Cop include OnHomepageStanza - MSG_NO_SLASH = "'%{url}' must have a slash after the domain.".freeze + MSG_NO_SLASH = "'%{url}' must have a slash after the domain." def on_homepage_stanza(stanza) url_node = stanza.stanza_node.first_argument diff --git a/Library/Homebrew/rubocops/cask/mixin/cask_help.rb b/Library/Homebrew/rubocops/cask/mixin/cask_help.rb index a8ffea470..9dc0800c9 100644 --- a/Library/Homebrew/rubocops/cask/mixin/cask_help.rb +++ b/Library/Homebrew/rubocops/cask/mixin/cask_help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Cask diff --git a/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb b/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb index 0656bcb52..24d65737c 100644 --- a/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb +++ b/Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RuboCop module Cop module Cask diff --git a/Library/Homebrew/rubocops/cask/no_dsl_version.rb b/Library/Homebrew/rubocops/cask/no_dsl_version.rb index ba6dc3f2c..8fcdd4435 100644 --- a/Library/Homebrew/rubocops/cask/no_dsl_version.rb +++ b/Library/Homebrew/rubocops/cask/no_dsl_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" module RuboCop @@ -19,7 +21,7 @@ module RuboCop extend Forwardable include CaskHelp - MESSAGE = "Use `%{preferred}` instead of `%{current}`".freeze + MESSAGE = "Use `%{preferred}` instead of `%{current}`" def on_cask(cask_block) @cask_header = cask_block.header diff --git a/Library/Homebrew/rubocops/cask/stanza_grouping.rb b/Library/Homebrew/rubocops/cask/stanza_grouping.rb index 279e3d06b..631d2c7e2 100644 --- a/Library/Homebrew/rubocops/cask/stanza_grouping.rb +++ b/Library/Homebrew/rubocops/cask/stanza_grouping.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" module RuboCop @@ -12,10 +14,10 @@ module RuboCop include RangeHelp MISSING_LINE_MSG = "stanza groups should be separated by a single " \ - "empty line".freeze + "empty line" EXTRA_LINE_MSG = "stanzas within the same group should have no lines " \ - "between them".freeze + "between them" def on_cask(cask_block) @cask_block = cask_block diff --git a/Library/Homebrew/rubocops/cask/stanza_order.rb b/Library/Homebrew/rubocops/cask/stanza_order.rb index 0de2e88b7..0c960e843 100644 --- a/Library/Homebrew/rubocops/cask/stanza_order.rb +++ b/Library/Homebrew/rubocops/cask/stanza_order.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "forwardable" module RuboCop @@ -10,7 +12,7 @@ module RuboCop extend Forwardable include CaskHelp - MESSAGE = "`%{stanza}` stanza out of order".freeze + MESSAGE = "`%{stanza}` stanza out of order" def on_cask(cask_block) @cask_block = cask_block diff --git a/Library/Homebrew/rubocops/caveats.rb b/Library/Homebrew/rubocops/caveats.rb index 6b6550a6e..09233e48e 100644 --- a/Library/Homebrew/rubocops/caveats.rb +++ b/Library/Homebrew/rubocops/caveats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/checksum.rb b/Library/Homebrew/rubocops/checksum.rb index 3eb213eba..4feff95e1 100644 --- a/Library/Homebrew/rubocops/checksum.rb +++ b/Library/Homebrew/rubocops/checksum.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/class.rb b/Library/Homebrew/rubocops/class.rb index bba73ea67..ab5edf01b 100644 --- a/Library/Homebrew/rubocops/class.rb +++ b/Library/Homebrew/rubocops/class.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index c60a4c49f..709f0fa1b 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/components_redundancy.rb b/Library/Homebrew/rubocops/components_redundancy.rb index 1a192d178..d0d6298d5 100644 --- a/Library/Homebrew/rubocops/components_redundancy.rb +++ b/Library/Homebrew/rubocops/components_redundancy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop @@ -11,9 +13,9 @@ module RuboCop # - `stable do` should not be present without a `head` or `devel` spec class ComponentsRedundancy < FormulaCop - HEAD_MSG = "`head` and `head do` should not be simultaneously present".freeze - BOTTLE_MSG = "`bottle :modifier` and `bottle do` should not be simultaneously present".freeze - STABLE_MSG = "`stable do` should not be present without a `head` or `devel` spec".freeze + HEAD_MSG = "`head` and `head do` should not be simultaneously present" + BOTTLE_MSG = "`bottle :modifier` and `bottle do` should not be simultaneously present" + STABLE_MSG = "`stable do` should not be present without a `head` or `devel` spec" def audit_formula(_node, _class_node, _parent_class_node, body_node) stable_block = find_block(body_node, :stable) diff --git a/Library/Homebrew/rubocops/conflicts.rb b/Library/Homebrew/rubocops/conflicts.rb index 6dfe46901..ce7385c42 100644 --- a/Library/Homebrew/rubocops/conflicts.rb +++ b/Library/Homebrew/rubocops/conflicts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" require "extend/string" @@ -7,7 +9,7 @@ module RuboCop # This cop audits versioned Formulae for `conflicts_with`. class Conflicts < FormulaCop MSG = "Versioned formulae should not use `conflicts_with`. " \ - "Use `keg_only :versioned_formula` instead.".freeze + "Use `keg_only :versioned_formula` instead." WHITELIST = %w[ bash-completion@ diff --git a/Library/Homebrew/rubocops/dependency_order.rb b/Library/Homebrew/rubocops/dependency_order.rb index 1b7fac34a..1b70f6721 100644 --- a/Library/Homebrew/rubocops/dependency_order.rb +++ b/Library/Homebrew/rubocops/dependency_order.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/extend/formula.rb b/Library/Homebrew/rubocops/extend/formula.rb index 4db4eff87..41ea92d2d 100644 --- a/Library/Homebrew/rubocops/extend/formula.rb +++ b/Library/Homebrew/rubocops/extend/formula.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Silence compatibility warning. begin old_verbosity = $VERBOSE diff --git a/Library/Homebrew/rubocops/formula_desc.rb b/Library/Homebrew/rubocops/formula_desc.rb index ba5608cce..ee6673b0d 100644 --- a/Library/Homebrew/rubocops/formula_desc.rb +++ b/Library/Homebrew/rubocops/formula_desc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" require "extend/string" diff --git a/Library/Homebrew/rubocops/homepage.rb b/Library/Homebrew/rubocops/homepage.rb index 8038e786c..53f06405c 100644 --- a/Library/Homebrew/rubocops/homepage.rb +++ b/Library/Homebrew/rubocops/homepage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index 718f5f806..3e9f8a9cc 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/options.rb b/Library/Homebrew/rubocops/options.rb index a5a0c5e87..665803212 100644 --- a/Library/Homebrew/rubocops/options.rb +++ b/Library/Homebrew/rubocops/options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop @@ -5,11 +7,11 @@ module RuboCop module FormulaAudit # This cop audits `options` in Formulae. class Options < FormulaCop - DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated.".freeze - UNI_DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so universal options are deprecated.".freeze + DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated." + UNI_DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so universal options are deprecated." - DEP_OPTION = "Formulae should not use `deprecated_option`".freeze - OPTION = "Formulae should not have an `option`".freeze + DEP_OPTION = "Formulae should not use `deprecated_option`" + OPTION = "Formulae should not have an `option`" def audit_formula(_node, _class_node, _parent_class_node, body_node) option_call_nodes = find_every_method_call_by_name(body_node, :option) diff --git a/Library/Homebrew/rubocops/patches.rb b/Library/Homebrew/rubocops/patches.rb index 7e912fd30..c5494b037 100644 --- a/Library/Homebrew/rubocops/patches.rb +++ b/Library/Homebrew/rubocops/patches.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" require "extend/string" diff --git a/Library/Homebrew/rubocops/rubocop-cask.rb b/Library/Homebrew/rubocops/rubocop-cask.rb index f528e59b4..3af610ebe 100644 --- a/Library/Homebrew/rubocops/rubocop-cask.rb +++ b/Library/Homebrew/rubocops/rubocop-cask.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocop" require "rubocops/cask/constants/stanza" diff --git a/Library/Homebrew/rubocops/text.rb b/Library/Homebrew/rubocops/text.rb index 78cffd711..482c1a0aa 100644 --- a/Library/Homebrew/rubocops/text.rb +++ b/Library/Homebrew/rubocops/text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 83fb8798f..774364d68 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/extend/formula" module RuboCop diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 413347023..2fd0ae13b 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + require "erb" require "tempfile" class Sandbox - SANDBOX_EXEC = "/usr/bin/sandbox-exec".freeze + SANDBOX_EXEC = "/usr/bin/sandbox-exec" def self.available? OS.mac? && File.executable?(SANDBOX_EXEC) @@ -150,7 +152,7 @@ class Sandbox end class SandboxProfile - SEATBELT_ERB = <<~ERB.freeze + SEATBELT_ERB = <<~ERB (version 1) (debug deny) ; log all denied operations to /var/log/system.log <%= rules.join("\n") %> diff --git a/Library/Homebrew/search.rb b/Library/Homebrew/search.rb index 8d6e8f012..1da53e64a 100644 --- a/Library/Homebrew/search.rb +++ b/Library/Homebrew/search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "searchable" require "description_cache_store" diff --git a/Library/Homebrew/searchable.rb b/Library/Homebrew/searchable.rb index 72079b216..05b00d98f 100644 --- a/Library/Homebrew/searchable.rb +++ b/Library/Homebrew/searchable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Searchable def search(string_or_regex, &block) case string_or_regex diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 2e17a9882..2ea629de8 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" require "checksum" require "version" diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index f4d53e5a1..a0b97c00b 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Style module_function diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index fe2ca7dc4..e365ec1ab 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" require "ostruct" require "plist" diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index 14ab93d0f..50853070f 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "hardware" require "software_spec" require "rexml/document" diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 28c3e6594..b6a208a6d 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cxxstdlib" require "ostruct" require "options" @@ -12,7 +14,7 @@ require "extend/cachable" class Tab < OpenStruct extend Cachable - FILENAME = "INSTALL_RECEIPT.json".freeze + FILENAME = "INSTALL_RECEIPT.json" # Instantiates a Tab for a new installation of a formula. def self.create(formula, compiler, stdlib) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index c395f94db..0d9cacdb6 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/cachable" require "readall" require "description_cache_store" diff --git a/Library/Homebrew/tap_constants.rb b/Library/Homebrew/tap_constants.rb index 0c6bd3adc..c375ba8dc 100644 --- a/Library/Homebrew/tap_constants.rb +++ b/Library/Homebrew/tap_constants.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # match taps' formulae, e.g. someuser/sometap/someformula HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.@]+)$}.freeze # match taps' casks, e.g. someuser/sometap/somecask diff --git a/Library/Homebrew/test.rb b/Library/Homebrew/test.rb index 92ab9dce3..11ed7f37b 100644 --- a/Library/Homebrew/test.rb +++ b/Library/Homebrew/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + old_trap = trap("INT") { exit! 130 } require "global" diff --git a/Library/Homebrew/test/ARGV_spec.rb b/Library/Homebrew/test/ARGV_spec.rb index 04944c4a1..868240a1c 100644 --- a/Library/Homebrew/test/ARGV_spec.rb +++ b/Library/Homebrew/test/ARGV_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ARGV" describe HomebrewArgvExtension do diff --git a/Library/Homebrew/test/ENV_spec.rb b/Library/Homebrew/test/ENV_spec.rb index 050cfb2be..726479c64 100644 --- a/Library/Homebrew/test/ENV_spec.rb +++ b/Library/Homebrew/test/ENV_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV" shared_examples EnvActivation do diff --git a/Library/Homebrew/test/PATH_spec.rb b/Library/Homebrew/test/PATH_spec.rb index db5df9b44..eda4461f6 100644 --- a/Library/Homebrew/test/PATH_spec.rb +++ b/Library/Homebrew/test/PATH_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "PATH" describe PATH do diff --git a/Library/Homebrew/test/bash_spec.rb b/Library/Homebrew/test/bash_spec.rb index 60ce8416a..b3b552249 100644 --- a/Library/Homebrew/test/bash_spec.rb +++ b/Library/Homebrew/test/bash_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" describe "Bash" do diff --git a/Library/Homebrew/test/bottle_filename_spec.rb b/Library/Homebrew/test/bottle_filename_spec.rb index 6ad205c13..f7db07f96 100644 --- a/Library/Homebrew/test/bottle_filename_spec.rb +++ b/Library/Homebrew/test/bottle_filename_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "software_spec" diff --git a/Library/Homebrew/test/build_environment_spec.rb b/Library/Homebrew/test/build_environment_spec.rb index 0675b6aae..e5bc95da3 100644 --- a/Library/Homebrew/test/build_environment_spec.rb +++ b/Library/Homebrew/test/build_environment_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "build_environment" describe BuildEnvironment do diff --git a/Library/Homebrew/test/build_options_spec.rb b/Library/Homebrew/test/build_options_spec.rb index 8c60e128e..fc034eaa2 100644 --- a/Library/Homebrew/test/build_options_spec.rb +++ b/Library/Homebrew/test/build_options_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "build_options" require "options" diff --git a/Library/Homebrew/test/cache_store_spec.rb b/Library/Homebrew/test/cache_store_spec.rb index fb0fbcb0a..8981b741b 100644 --- a/Library/Homebrew/test/cache_store_spec.rb +++ b/Library/Homebrew/test/cache_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cache_store" describe CacheStoreDatabase do diff --git a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb index b2808c420..3fdbe36cb 100644 --- a/Library/Homebrew/test/cask/artifact/alt_target_spec.rb +++ b/Library/Homebrew/test/cask/artifact/alt_target_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::App, :cask do describe "activate to alternate target" do let(:cask) { Cask::CaskLoader.load(cask_path("with-alt-target")) } diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index 14917b4f4..0b318351d 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::App, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("local-caffeine")) } let(:command) { SystemCommand } diff --git a/Library/Homebrew/test/cask/artifact/binary_spec.rb b/Library/Homebrew/test/cask/artifact/binary_spec.rb index 0aa60c38f..d905e8d8f 100644 --- a/Library/Homebrew/test/cask/artifact/binary_spec.rb +++ b/Library/Homebrew/test/cask/artifact/binary_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::Binary, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-binary")).tap do |cask| diff --git a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb index 83fb55fc5..c15b87851 100644 --- a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb +++ b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::Artifact, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-generic-artifact")) } diff --git a/Library/Homebrew/test/cask/artifact/installer_spec.rb b/Library/Homebrew/test/cask/artifact/installer_spec.rb index 68b0e24ed..6bff500bb 100644 --- a/Library/Homebrew/test/cask/artifact/installer_spec.rb +++ b/Library/Homebrew/test/cask/artifact/installer_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::Installer, :cask do subject(:installer) { described_class.new(cask, **args) } diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index 9d3cf6f71..19087acd9 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::Pkg, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-installable")) } let(:fake_system_command) { class_double(SystemCommand) } diff --git a/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb b/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb index 75c6d10d0..52cd1bf0c 100644 --- a/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb +++ b/Library/Homebrew/test/cask/artifact/postflight_block_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::PostflightBlock, :cask do describe "install_phase" do it "calls the specified block after installing, passing a Cask mini-dsl" do diff --git a/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb b/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb index 8d07807f0..7546690b0 100644 --- a/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb +++ b/Library/Homebrew/test/cask/artifact/preflight_block_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::PreflightBlock, :cask do describe "install_phase" do it "calls the specified block before installing, passing a Cask mini-dsl" do diff --git a/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb b/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb index 3a80e6e90..d5b3c7a99 100644 --- a/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb +++ b/Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "benchmark" shared_examples "#uninstall_phase or #zap_phase" do diff --git a/Library/Homebrew/test/cask/artifact/suite_spec.rb b/Library/Homebrew/test/cask/artifact/suite_spec.rb index 3f4a2d6dc..7cf983f05 100644 --- a/Library/Homebrew/test/cask/artifact/suite_spec.rb +++ b/Library/Homebrew/test/cask/artifact/suite_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::Suite, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-suite")) } diff --git a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb index 7381c832b..200823abb 100644 --- a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb +++ b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::App, :cask do describe "multiple apps" do let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-correct")) } diff --git a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb index 863db064e..ae2cce3f9 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Artifact::Zap, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-installable")) } diff --git a/Library/Homebrew/test/cask/artifact/uninstall_spec.rb b/Library/Homebrew/test/cask/artifact/uninstall_spec.rb index 5d5a70c70..8996884ff 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/uninstall_zap" describe Cask::Artifact::Uninstall, :cask do diff --git a/Library/Homebrew/test/cask/artifact/zap_spec.rb b/Library/Homebrew/test/cask/artifact/zap_spec.rb index 15122dda8..3c942ef57 100644 --- a/Library/Homebrew/test/cask/artifact/zap_spec.rb +++ b/Library/Homebrew/test/cask/artifact/zap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/uninstall_zap" describe Cask::Artifact::Zap, :cask do diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index 06f7db4d2..41c7dbf3f 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Audit, :cask do def include_msg?(messages, msg) if msg.is_a?(Regexp) diff --git a/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb index ad9c85a68..36de96505 100644 --- a/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from__path_loader_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::CaskLoader::FromPathLoader do describe "#load" do context "when the file does not contain a cask" do diff --git a/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb index 22f1b8530..41836b9a1 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::CaskLoader::FromContentLoader do alias_matcher :be_able_to_load, :be_can_load diff --git a/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb index 1d919aba8..cb8e02152 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::CaskLoader::FromURILoader do alias_matcher :be_able_to_load, :be_can_load diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb index 5b0687925..986b7561c 100644 --- a/Library/Homebrew/test/cask/cask_spec.rb +++ b/Library/Homebrew/test/cask/cask_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Cask, :cask do let(:cask) { described_class.new("versioned-cask") } diff --git a/Library/Homebrew/test/cask/cmd/audit_spec.rb b/Library/Homebrew/test/cask/cmd/audit_spec.rb index 529019b0c..f8269b687 100644 --- a/Library/Homebrew/test/cask/cmd/audit_spec.rb +++ b/Library/Homebrew/test/cask/cmd/audit_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::Audit, :cask do diff --git a/Library/Homebrew/test/cask/cmd/cat_spec.rb b/Library/Homebrew/test/cask/cmd/cat_spec.rb index 8d8a761d8..5c424e6e6 100644 --- a/Library/Homebrew/test/cask/cmd/cat_spec.rb +++ b/Library/Homebrew/test/cask/cmd/cat_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/create_spec.rb b/Library/Homebrew/test/cask/cmd/create_spec.rb index 89fc13e81..2effe846c 100644 --- a/Library/Homebrew/test/cask/cmd/create_spec.rb +++ b/Library/Homebrew/test/cask/cmd/create_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/doctor_spec.rb b/Library/Homebrew/test/cask/cmd/doctor_spec.rb index 90aa14c93..166808389 100644 --- a/Library/Homebrew/test/cask/cmd/doctor_spec.rb +++ b/Library/Homebrew/test/cask/cmd/doctor_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::Doctor, :cask do diff --git a/Library/Homebrew/test/cask/cmd/edit_spec.rb b/Library/Homebrew/test/cask/cmd/edit_spec.rb index 2d5f2a9a1..58f4d21e4 100644 --- a/Library/Homebrew/test/cask/cmd/edit_spec.rb +++ b/Library/Homebrew/test/cask/cmd/edit_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/fetch_spec.rb b/Library/Homebrew/test/cask/cmd/fetch_spec.rb index 153f5bb42..35ecf6331 100644 --- a/Library/Homebrew/test/cask/cmd/fetch_spec.rb +++ b/Library/Homebrew/test/cask/cmd/fetch_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/home_spec.rb b/Library/Homebrew/test/cask/cmd/home_spec.rb index be115715f..2462b7c4f 100644 --- a/Library/Homebrew/test/cask/cmd/home_spec.rb +++ b/Library/Homebrew/test/cask/cmd/home_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::Home, :cask do diff --git a/Library/Homebrew/test/cask/cmd/info_spec.rb b/Library/Homebrew/test/cask/cmd/info_spec.rb index e2a73c103..2883ca239 100644 --- a/Library/Homebrew/test/cask/cmd/info_spec.rb +++ b/Library/Homebrew/test/cask/cmd/info_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/install_spec.rb b/Library/Homebrew/test/cask/cmd/install_spec.rb index 1efe513b4..a5b0adbf7 100644 --- a/Library/Homebrew/test/cask/cmd/install_spec.rb +++ b/Library/Homebrew/test/cask/cmd/install_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb b/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb index 5ea905673..a208adbfb 100644 --- a/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb +++ b/Library/Homebrew/test/cask/cmd/internal_stanza_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Cmd::InternalStanza, :cask do it "shows stanza of the Specified Cask" do command = described_class.new("homepage", "local-caffeine") diff --git a/Library/Homebrew/test/cask/cmd/list_spec.rb b/Library/Homebrew/test/cask/cmd/list_spec.rb index 7d63076e4..bc285acb7 100644 --- a/Library/Homebrew/test/cask/cmd/list_spec.rb +++ b/Library/Homebrew/test/cask/cmd/list_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::List, :cask do diff --git a/Library/Homebrew/test/cask/cmd/options_spec.rb b/Library/Homebrew/test/cask/cmd/options_spec.rb index 0f254573f..3c95f4bf3 100644 --- a/Library/Homebrew/test/cask/cmd/options_spec.rb +++ b/Library/Homebrew/test/cask/cmd/options_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Cmd, :cask do it "supports setting the appdir" do described_class.new.process_options("help", "--appdir=/some/path/foo") diff --git a/Library/Homebrew/test/cask/cmd/outdated_spec.rb b/Library/Homebrew/test/cask/cmd/outdated_spec.rb index 23f204462..57763d1de 100644 --- a/Library/Homebrew/test/cask/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cask/cmd/outdated_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::Outdated, :cask do diff --git a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb index e011e35b6..dfc16d21f 100644 --- a/Library/Homebrew/test/cask/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/reinstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::Reinstall, :cask do diff --git a/Library/Homebrew/test/cask/cmd/shared_examples/invalid_option.rb b/Library/Homebrew/test/cask/cmd/shared_examples/invalid_option.rb index 12a05be92..467a1be08 100644 --- a/Library/Homebrew/test/cask/cmd/shared_examples/invalid_option.rb +++ b/Library/Homebrew/test/cask/cmd/shared_examples/invalid_option.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples "a command that handles invalid options" do context "when an invalid option is specified" do it "raises an exception when no Cask is specified" do diff --git a/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb b/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb index 8361270fb..0e68acc85 100644 --- a/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb +++ b/Library/Homebrew/test/cask/cmd/shared_examples/requires_cask_token.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples "a command that requires a Cask token" do context "when no Cask is specified" do it "raises an exception " do diff --git a/Library/Homebrew/test/cask/cmd/style_spec.rb b/Library/Homebrew/test/cask/cmd/style_spec.rb index 336fa1140..7e49ab330 100644 --- a/Library/Homebrew/test/cask/cmd/style_spec.rb +++ b/Library/Homebrew/test/cask/cmd/style_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" require "rubygems" diff --git a/Library/Homebrew/test/cask/cmd/uninstall_spec.rb b/Library/Homebrew/test/cask/cmd/uninstall_spec.rb index dc6a07e01..a29977447 100644 --- a/Library/Homebrew/test/cask/cmd/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cmd/uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd/upgrade_spec.rb b/Library/Homebrew/test/cask/cmd/upgrade_spec.rb index 704c8ca3e..503778eb1 100644 --- a/Library/Homebrew/test/cask/cmd/upgrade_spec.rb +++ b/Library/Homebrew/test/cask/cmd/upgrade_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/invalid_option" describe Cask::Cmd::Upgrade, :cask do diff --git a/Library/Homebrew/test/cask/cmd/zap_spec.rb b/Library/Homebrew/test/cask/cmd/zap_spec.rb index fd646477e..66d90c58a 100644 --- a/Library/Homebrew/test/cask/cmd/zap_spec.rb +++ b/Library/Homebrew/test/cask/cmd/zap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples/requires_cask_token" require_relative "shared_examples/invalid_option" diff --git a/Library/Homebrew/test/cask/cmd_spec.rb b/Library/Homebrew/test/cask/cmd_spec.rb index ee2a68fd4..1674d0e6a 100644 --- a/Library/Homebrew/test/cask/cmd_spec.rb +++ b/Library/Homebrew/test/cask/cmd_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Cmd, :cask do it "lists the taps for Casks that show up in two taps" do listing = described_class.nice_listing(%w[ diff --git a/Library/Homebrew/test/cask/config_spec.rb b/Library/Homebrew/test/cask/config_spec.rb index f160104bb..f7cc6aebc 100644 --- a/Library/Homebrew/test/cask/config_spec.rb +++ b/Library/Homebrew/test/cask/config_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Config, :cask do subject(:config) { described_class.new } diff --git a/Library/Homebrew/test/cask/conflicts_with_spec.rb b/Library/Homebrew/test/cask/conflicts_with_spec.rb index 5a8a67633..059685af3 100644 --- a/Library/Homebrew/test/cask/conflicts_with_spec.rb +++ b/Library/Homebrew/test/cask/conflicts_with_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "conflicts_with", :cask do describe "conflicts_with cask" do let(:local_caffeine) { diff --git a/Library/Homebrew/test/cask/depends_on_spec.rb b/Library/Homebrew/test/cask/depends_on_spec.rb index 235c446e2..f8d679e6e 100644 --- a/Library/Homebrew/test/cask/depends_on_spec.rb +++ b/Library/Homebrew/test/cask/depends_on_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # TODO: this test should be named after the corresponding class, once # that class is abstracted from installer.rb describe "Satisfy Dependencies and Requirements", :cask do diff --git a/Library/Homebrew/test/cask/dsl/appcast_spec.rb b/Library/Homebrew/test/cask/dsl/appcast_spec.rb index 437d72e56..a3b1cf671 100644 --- a/Library/Homebrew/test/cask/dsl/appcast_spec.rb +++ b/Library/Homebrew/test/cask/dsl/appcast_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/cask" describe Cask::DSL::Appcast do diff --git a/Library/Homebrew/test/cask/dsl/caveats_spec.rb b/Library/Homebrew/test/cask/dsl/caveats_spec.rb index f44e6ab7c..8c7af8955 100644 --- a/Library/Homebrew/test/cask/dsl/caveats_spec.rb +++ b/Library/Homebrew/test/cask/dsl/caveats_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/cask/dsl/shared_examples/base" describe Cask::DSL::Caveats, :cask do diff --git a/Library/Homebrew/test/cask/dsl/postflight_spec.rb b/Library/Homebrew/test/cask/dsl/postflight_spec.rb index 46479b55b..2c0ea9a01 100644 --- a/Library/Homebrew/test/cask/dsl/postflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/postflight_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/cask/dsl/shared_examples/base" require "test/cask/dsl/shared_examples/staged" diff --git a/Library/Homebrew/test/cask/dsl/preflight_spec.rb b/Library/Homebrew/test/cask/dsl/preflight_spec.rb index 2bcf1f665..1bf38464a 100644 --- a/Library/Homebrew/test/cask/dsl/preflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/preflight_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/cask/dsl/shared_examples/base" require "test/cask/dsl/shared_examples/staged" diff --git a/Library/Homebrew/test/cask/dsl/shared_examples/base.rb b/Library/Homebrew/test/cask/dsl/shared_examples/base.rb index ccb425dd7..c46715d51 100644 --- a/Library/Homebrew/test/cask/dsl/shared_examples/base.rb +++ b/Library/Homebrew/test/cask/dsl/shared_examples/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/dsl/base" shared_examples Cask::DSL::Base do diff --git a/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb b/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb index 78e6ae599..a4d29f84c 100644 --- a/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb +++ b/Library/Homebrew/test/cask/dsl/shared_examples/staged.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/staged" shared_examples Cask::Staged do diff --git a/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb b/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb index 14f02d4eb..846cd9055 100644 --- a/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/cask/dsl/shared_examples/base" describe Cask::DSL::UninstallPostflight, :cask do diff --git a/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb b/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb index 9e8db707a..f32679dd0 100644 --- a/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb +++ b/Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/cask/dsl/shared_examples/base" require "test/cask/dsl/shared_examples/staged" diff --git a/Library/Homebrew/test/cask/dsl/version_spec.rb b/Library/Homebrew/test/cask/dsl/version_spec.rb index ace2e0937..55271f0dd 100644 --- a/Library/Homebrew/test/cask/dsl/version_spec.rb +++ b/Library/Homebrew/test/cask/dsl/version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::DSL::Version, :cask do shared_examples "expectations hash" do |input_name, expectations| expectations.each do |input_value, expected_output| diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index d26f237e2..3e1de25e8 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::DSL, :cask do let(:cask) { Cask::CaskLoader.load(cask_path(token.to_s)) } let(:token) { "basic-cask" } diff --git a/Library/Homebrew/test/cask/installer_spec.rb b/Library/Homebrew/test/cask/installer_spec.rb index 4d2bad775..1c77e811a 100644 --- a/Library/Homebrew/test/cask/installer_spec.rb +++ b/Library/Homebrew/test/cask/installer_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Installer, :cask do describe "install" do let(:empty_depends_on_stub) { diff --git a/Library/Homebrew/test/cask/macos_spec.rb b/Library/Homebrew/test/cask/macos_spec.rb index 2e385acd5..830f5d453 100644 --- a/Library/Homebrew/test/cask/macos_spec.rb +++ b/Library/Homebrew/test/cask/macos_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe MacOS, :cask do it "says '/' is undeletable" do expect(MacOS).to be_undeletable( diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index e64de0d9f..f3eccc97c 100644 --- a/Library/Homebrew/test/cask/pkg_spec.rb +++ b/Library/Homebrew/test/cask/pkg_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Pkg, :cask do describe "#uninstall" do let(:fake_system_command) { NeverSudoSystemCommand } diff --git a/Library/Homebrew/test/cask/quarantine_spec.rb b/Library/Homebrew/test/cask/quarantine_spec.rb index c46706b00..684587bbd 100644 --- a/Library/Homebrew/test/cask/quarantine_spec.rb +++ b/Library/Homebrew/test/cask/quarantine_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Cask::Quarantine, :cask do matcher :be_quarantined do match do |path| diff --git a/Library/Homebrew/test/cask/verify_spec.rb b/Library/Homebrew/test/cask/verify_spec.rb index e5589c4b5..f48f0c5d6 100644 --- a/Library/Homebrew/test/cask/verify_spec.rb +++ b/Library/Homebrew/test/cask/verify_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Cask describe Verify, :cask do describe "::all" do diff --git a/Library/Homebrew/test/caveats_spec.rb b/Library/Homebrew/test/caveats_spec.rb index ad260aebe..ff010ff16 100644 --- a/Library/Homebrew/test/caveats_spec.rb +++ b/Library/Homebrew/test/caveats_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "caveats" diff --git a/Library/Homebrew/test/checksum_spec.rb b/Library/Homebrew/test/checksum_spec.rb index 89658c483..7dc894581 100644 --- a/Library/Homebrew/test/checksum_spec.rb +++ b/Library/Homebrew/test/checksum_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "checksum" describe Checksum do diff --git a/Library/Homebrew/test/checksum_verification_spec.rb b/Library/Homebrew/test/checksum_verification_spec.rb index 247f08688..7f3109ca4 100644 --- a/Library/Homebrew/test/checksum_verification_spec.rb +++ b/Library/Homebrew/test/checksum_verification_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" describe Formula do diff --git a/Library/Homebrew/test/cleaner_spec.rb b/Library/Homebrew/test/cleaner_spec.rb index 62e4c3662..bba23b7b8 100644 --- a/Library/Homebrew/test/cleaner_spec.rb +++ b/Library/Homebrew/test/cleaner_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cleaner" require "formula" diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb index 9b3df12c8..ce6a0f21f 100644 --- a/Library/Homebrew/test/cleanup_spec.rb +++ b/Library/Homebrew/test/cleanup_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/support/fixtures/testball" require "cleanup" require "cask/cache" diff --git a/Library/Homebrew/test/cli/parser_spec.rb b/Library/Homebrew/test/cli/parser_spec.rb index fd911574a..a0cfa8c5c 100644 --- a/Library/Homebrew/test/cli/parser_spec.rb +++ b/Library/Homebrew/test/cli/parser_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "../../cli/parser" describe Homebrew::CLI::Parser do diff --git a/Library/Homebrew/test/cmd/--cache_spec.rb b/Library/Homebrew/test/cmd/--cache_spec.rb index 143f2e6e6..d68256530 100644 --- a/Library/Homebrew/test/cmd/--cache_spec.rb +++ b/Library/Homebrew/test/cmd/--cache_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.__cache_args" do diff --git a/Library/Homebrew/test/cmd/--cellar_spec.rb b/Library/Homebrew/test/cmd/--cellar_spec.rb index fdfeb6b39..5919a2f6a 100644 --- a/Library/Homebrew/test/cmd/--cellar_spec.rb +++ b/Library/Homebrew/test/cmd/--cellar_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.__cellar_args" do diff --git a/Library/Homebrew/test/cmd/--env_spec.rb b/Library/Homebrew/test/cmd/--env_spec.rb index 270e602f7..2f94f1310 100644 --- a/Library/Homebrew/test/cmd/--env_spec.rb +++ b/Library/Homebrew/test/cmd/--env_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.__env_args" do diff --git a/Library/Homebrew/test/cmd/--prefix_spec.rb b/Library/Homebrew/test/cmd/--prefix_spec.rb index 5aec23865..51c34fe22 100644 --- a/Library/Homebrew/test/cmd/--prefix_spec.rb +++ b/Library/Homebrew/test/cmd/--prefix_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.__prefix_args" do diff --git a/Library/Homebrew/test/cmd/--repository_spec.rb b/Library/Homebrew/test/cmd/--repository_spec.rb index 6e56a114d..a6d351d90 100644 --- a/Library/Homebrew/test/cmd/--repository_spec.rb +++ b/Library/Homebrew/test/cmd/--repository_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.__repository_args" do diff --git a/Library/Homebrew/test/cmd/--version_spec.rb b/Library/Homebrew/test/cmd/--version_spec.rb index 2fcd6b0b6..3650b7d44 100644 --- a/Library/Homebrew/test/cmd/--version_spec.rb +++ b/Library/Homebrew/test/cmd/--version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.__version_args" do diff --git a/Library/Homebrew/test/cmd/analytics_spec.rb b/Library/Homebrew/test/cmd/analytics_spec.rb index 7671bdf93..82545513b 100644 --- a/Library/Homebrew/test/cmd/analytics_spec.rb +++ b/Library/Homebrew/test/cmd/analytics_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.analytics_args" do diff --git a/Library/Homebrew/test/cmd/bundle_spec.rb b/Library/Homebrew/test/cmd/bundle_spec.rb index c2434254e..61d7fb225 100644 --- a/Library/Homebrew/test/cmd/bundle_spec.rb +++ b/Library/Homebrew/test/cmd/bundle_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "brew bundle", :integration_test, :needs_test_cmd_taps do describe "check" do it "checks if a Brewfile's dependencies are satisfied", :needs_network do diff --git a/Library/Homebrew/test/cmd/cask_spec.rb b/Library/Homebrew/test/cmd/cask_spec.rb index 0bc178cc5..675ac09e9 100644 --- a/Library/Homebrew/test/cmd/cask_spec.rb +++ b/Library/Homebrew/test/cmd/cask_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "brew cask", :integration_test, :needs_macos, :needs_network do describe "list" do it "returns a list of installed Casks" do diff --git a/Library/Homebrew/test/cmd/cat_spec.rb b/Library/Homebrew/test/cmd/cat_spec.rb index a79878eb9..2a9132e76 100644 --- a/Library/Homebrew/test/cmd/cat_spec.rb +++ b/Library/Homebrew/test/cmd/cat_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.cat_args" do diff --git a/Library/Homebrew/test/cmd/cleanup_spec.rb b/Library/Homebrew/test/cmd/cleanup_spec.rb index 9a5f53b27..a822752c3 100644 --- a/Library/Homebrew/test/cmd/cleanup_spec.rb +++ b/Library/Homebrew/test/cmd/cleanup_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.cleanup_args" do diff --git a/Library/Homebrew/test/cmd/command_spec.rb b/Library/Homebrew/test/cmd/command_spec.rb index 83122f247..1d71661f2 100644 --- a/Library/Homebrew/test/cmd/command_spec.rb +++ b/Library/Homebrew/test/cmd/command_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.command_args" do diff --git a/Library/Homebrew/test/cmd/commands_spec.rb b/Library/Homebrew/test/cmd/commands_spec.rb index 6c0ab0b67..7091a345e 100644 --- a/Library/Homebrew/test/cmd/commands_spec.rb +++ b/Library/Homebrew/test/cmd/commands_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/command" require "cmd/commands" require "fileutils" diff --git a/Library/Homebrew/test/cmd/config_spec.rb b/Library/Homebrew/test/cmd/config_spec.rb index c92a71c4b..2c454e14d 100644 --- a/Library/Homebrew/test/cmd/config_spec.rb +++ b/Library/Homebrew/test/cmd/config_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.config_args" do diff --git a/Library/Homebrew/test/cmd/custom-external-command_spec.rb b/Library/Homebrew/test/cmd/custom-external-command_spec.rb index 7a4e6501d..b6aedd83e 100644 --- a/Library/Homebrew/test/cmd/custom-external-command_spec.rb +++ b/Library/Homebrew/test/cmd/custom-external-command_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "brew custom-external-command", :integration_test do it "is supported" do mktmpdir do |path| diff --git a/Library/Homebrew/test/cmd/deps_spec.rb b/Library/Homebrew/test/cmd/deps_spec.rb index 50a30c5e1..8ec40bffb 100644 --- a/Library/Homebrew/test/cmd/deps_spec.rb +++ b/Library/Homebrew/test/cmd/deps_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + 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/desc_spec.rb b/Library/Homebrew/test/cmd/desc_spec.rb index c820faa8d..356484226 100644 --- a/Library/Homebrew/test/cmd/desc_spec.rb +++ b/Library/Homebrew/test/cmd/desc_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.desc_args" do diff --git a/Library/Homebrew/test/cmd/diy_spec.rb b/Library/Homebrew/test/cmd/diy_spec.rb index 914cd3f40..5168cf552 100644 --- a/Library/Homebrew/test/cmd/diy_spec.rb +++ b/Library/Homebrew/test/cmd/diy_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.diy_args" do diff --git a/Library/Homebrew/test/cmd/doctor_spec.rb b/Library/Homebrew/test/cmd/doctor_spec.rb index 4e3803232..eea6caab7 100644 --- a/Library/Homebrew/test/cmd/doctor_spec.rb +++ b/Library/Homebrew/test/cmd/doctor_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.doctor_args" do diff --git a/Library/Homebrew/test/cmd/fetch_spec.rb b/Library/Homebrew/test/cmd/fetch_spec.rb index 599360dc3..a49cbfd8e 100644 --- a/Library/Homebrew/test/cmd/fetch_spec.rb +++ b/Library/Homebrew/test/cmd/fetch_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.fetch_args" do diff --git a/Library/Homebrew/test/cmd/gist-logs_spec.rb b/Library/Homebrew/test/cmd/gist-logs_spec.rb index 848780f70..490373c7d 100644 --- a/Library/Homebrew/test/cmd/gist-logs_spec.rb +++ b/Library/Homebrew/test/cmd/gist-logs_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.gist_logs_args" do diff --git a/Library/Homebrew/test/cmd/help_spec.rb b/Library/Homebrew/test/cmd/help_spec.rb index 04b7d53c1..b94d8a7ef 100644 --- a/Library/Homebrew/test/cmd/help_spec.rb +++ b/Library/Homebrew/test/cmd/help_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "brew", :integration_test do describe "help" do it "prints help for a documented Ruby command" do diff --git a/Library/Homebrew/test/cmd/home_spec.rb b/Library/Homebrew/test/cmd/home_spec.rb index 421fcdf9b..15aee21eb 100644 --- a/Library/Homebrew/test/cmd/home_spec.rb +++ b/Library/Homebrew/test/cmd/home_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.home_args" do diff --git a/Library/Homebrew/test/cmd/info_spec.rb b/Library/Homebrew/test/cmd/info_spec.rb index 35901269c..acb131e83 100644 --- a/Library/Homebrew/test/cmd/info_spec.rb +++ b/Library/Homebrew/test/cmd/info_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/info" require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index 217dba502..0bc91c86c 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.install_args" do diff --git a/Library/Homebrew/test/cmd/leaves_spec.rb b/Library/Homebrew/test/cmd/leaves_spec.rb index ea6960641..ee56b3cbe 100644 --- a/Library/Homebrew/test/cmd/leaves_spec.rb +++ b/Library/Homebrew/test/cmd/leaves_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.leaves_args" do diff --git a/Library/Homebrew/test/cmd/link_spec.rb b/Library/Homebrew/test/cmd/link_spec.rb index 8460e05e2..f76b5a1d8 100644 --- a/Library/Homebrew/test/cmd/link_spec.rb +++ b/Library/Homebrew/test/cmd/link_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.link_args" do diff --git a/Library/Homebrew/test/cmd/list_spec.rb b/Library/Homebrew/test/cmd/list_spec.rb index c04c5890e..e12a8522d 100644 --- a/Library/Homebrew/test/cmd/list_spec.rb +++ b/Library/Homebrew/test/cmd/list_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.list_args" do diff --git a/Library/Homebrew/test/cmd/log_spec.rb b/Library/Homebrew/test/cmd/log_spec.rb index 31d91607b..7ed48a2d1 100644 --- a/Library/Homebrew/test/cmd/log_spec.rb +++ b/Library/Homebrew/test/cmd/log_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.log_args" do diff --git a/Library/Homebrew/test/cmd/migrate_spec.rb b/Library/Homebrew/test/cmd/migrate_spec.rb index a983d9e19..8c8faee07 100644 --- a/Library/Homebrew/test/cmd/migrate_spec.rb +++ b/Library/Homebrew/test/cmd/migrate_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.migrate_args" do diff --git a/Library/Homebrew/test/cmd/missing_spec.rb b/Library/Homebrew/test/cmd/missing_spec.rb index 180df1b12..8f5a3382f 100644 --- a/Library/Homebrew/test/cmd/missing_spec.rb +++ b/Library/Homebrew/test/cmd/missing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.missing_args" do diff --git a/Library/Homebrew/test/cmd/options_spec.rb b/Library/Homebrew/test/cmd/options_spec.rb index 3a50bab97..655c3fa0e 100644 --- a/Library/Homebrew/test/cmd/options_spec.rb +++ b/Library/Homebrew/test/cmd/options_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.options_args" do diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index 73f41e039..54a659328 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.outdated_args" do diff --git a/Library/Homebrew/test/cmd/pin_spec.rb b/Library/Homebrew/test/cmd/pin_spec.rb index cc1387428..a34a3e21c 100644 --- a/Library/Homebrew/test/cmd/pin_spec.rb +++ b/Library/Homebrew/test/cmd/pin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.pin_args" do diff --git a/Library/Homebrew/test/cmd/postinstall_spec.rb b/Library/Homebrew/test/cmd/postinstall_spec.rb index cf6cd213f..ed676f558 100644 --- a/Library/Homebrew/test/cmd/postinstall_spec.rb +++ b/Library/Homebrew/test/cmd/postinstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.postinstall_args" do diff --git a/Library/Homebrew/test/cmd/readall_spec.rb b/Library/Homebrew/test/cmd/readall_spec.rb index 23772a937..03f3b2ae5 100644 --- a/Library/Homebrew/test/cmd/readall_spec.rb +++ b/Library/Homebrew/test/cmd/readall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.readall_args" do diff --git a/Library/Homebrew/test/cmd/reinstall_spec.rb b/Library/Homebrew/test/cmd/reinstall_spec.rb index d2361e93a..45b5a48ff 100644 --- a/Library/Homebrew/test/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cmd/reinstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV" require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb index c6e4f3361..40932a5c4 100644 --- a/Library/Homebrew/test/cmd/search_spec.rb +++ b/Library/Homebrew/test/cmd/search_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/search" require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/services_spec.rb b/Library/Homebrew/test/cmd/services_spec.rb index 669e84e5f..decee40fa 100644 --- a/Library/Homebrew/test/cmd/services_spec.rb +++ b/Library/Homebrew/test/cmd/services_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "brew services", :integration_test, :needs_macos, :needs_network do it "allows controlling services" do setup_remote_tap "homebrew/services" diff --git a/Library/Homebrew/test/cmd/sh_spec.rb b/Library/Homebrew/test/cmd/sh_spec.rb index 97bf92ce1..52000a549 100644 --- a/Library/Homebrew/test/cmd/sh_spec.rb +++ b/Library/Homebrew/test/cmd/sh_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.sh_args" do diff --git a/Library/Homebrew/test/cmd/shared_examples/args_parse.rb b/Library/Homebrew/test/cmd/shared_examples/args_parse.rb index b95b5eb9b..6230b9e43 100644 --- a/Library/Homebrew/test/cmd/shared_examples/args_parse.rb +++ b/Library/Homebrew/test/cmd/shared_examples/args_parse.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + shared_examples "parseable arguments" do subject(:method_name) do |example| example.metadata[:example_group][:parent_example_group][:description] diff --git a/Library/Homebrew/test/cmd/style_spec.rb b/Library/Homebrew/test/cmd/style_spec.rb index cd71be032..7e4289134 100644 --- a/Library/Homebrew/test/cmd/style_spec.rb +++ b/Library/Homebrew/test/cmd/style_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/style" require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/switch_spec.rb b/Library/Homebrew/test/cmd/switch_spec.rb index b7903256c..d50f993e4 100644 --- a/Library/Homebrew/test/cmd/switch_spec.rb +++ b/Library/Homebrew/test/cmd/switch_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.switch_args" do diff --git a/Library/Homebrew/test/cmd/tap-info_spec.rb b/Library/Homebrew/test/cmd/tap-info_spec.rb index 61e493c1a..d03ca1784 100644 --- a/Library/Homebrew/test/cmd/tap-info_spec.rb +++ b/Library/Homebrew/test/cmd/tap-info_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.tap_info_args" do diff --git a/Library/Homebrew/test/cmd/tap_spec.rb b/Library/Homebrew/test/cmd/tap_spec.rb index d635c903b..69f43ae84 100644 --- a/Library/Homebrew/test/cmd/tap_spec.rb +++ b/Library/Homebrew/test/cmd/tap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.tap_args" do diff --git a/Library/Homebrew/test/cmd/uninstall_spec.rb b/Library/Homebrew/test/cmd/uninstall_spec.rb index 6cc0510fe..696be790e 100644 --- a/Library/Homebrew/test/cmd/uninstall_spec.rb +++ b/Library/Homebrew/test/cmd/uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/uninstall" require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/cmd/unlink_spec.rb b/Library/Homebrew/test/cmd/unlink_spec.rb index 7d38c3741..148939316 100644 --- a/Library/Homebrew/test/cmd/unlink_spec.rb +++ b/Library/Homebrew/test/cmd/unlink_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.unlink_args" do diff --git a/Library/Homebrew/test/cmd/unpack_spec.rb b/Library/Homebrew/test/cmd/unpack_spec.rb index 3ddeedb45..0a0c27eee 100644 --- a/Library/Homebrew/test/cmd/unpack_spec.rb +++ b/Library/Homebrew/test/cmd/unpack_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.unpack_args" do diff --git a/Library/Homebrew/test/cmd/unpin_spec.rb b/Library/Homebrew/test/cmd/unpin_spec.rb index d5c4766fd..be3faa7c8 100644 --- a/Library/Homebrew/test/cmd/unpin_spec.rb +++ b/Library/Homebrew/test/cmd/unpin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.unpin_args" do diff --git a/Library/Homebrew/test/cmd/untap_spec.rb b/Library/Homebrew/test/cmd/untap_spec.rb index caef63c58..9e2568597 100644 --- a/Library/Homebrew/test/cmd/untap_spec.rb +++ b/Library/Homebrew/test/cmd/untap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.untap_args" do diff --git a/Library/Homebrew/test/cmd/update-report_spec.rb b/Library/Homebrew/test/cmd/update-report_spec.rb index 6442c19ff..d07353431 100644 --- a/Library/Homebrew/test/cmd/update-report_spec.rb +++ b/Library/Homebrew/test/cmd/update-report_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/update-report" require "formula_versions" require "yaml" diff --git a/Library/Homebrew/test/cmd/upgrade_spec.rb b/Library/Homebrew/test/cmd/upgrade_spec.rb index 3bc325d1c..9f139fc05 100644 --- a/Library/Homebrew/test/cmd/upgrade_spec.rb +++ b/Library/Homebrew/test/cmd/upgrade_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.upgrade_args" do diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index b09027392..8321777ba 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.uses_args" do diff --git a/Library/Homebrew/test/compiler_failure_spec.rb b/Library/Homebrew/test/compiler_failure_spec.rb index ee71c1f64..08763e33c 100644 --- a/Library/Homebrew/test/compiler_failure_spec.rb +++ b/Library/Homebrew/test/compiler_failure_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "compilers" describe CompilerFailure do diff --git a/Library/Homebrew/test/compiler_selector_spec.rb b/Library/Homebrew/test/compiler_selector_spec.rb index 254fdefeb..f00c58add 100644 --- a/Library/Homebrew/test/compiler_selector_spec.rb +++ b/Library/Homebrew/test/compiler_selector_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "compilers" require "software_spec" diff --git a/Library/Homebrew/test/cxxstdlib_spec.rb b/Library/Homebrew/test/cxxstdlib_spec.rb index ea1631a01..0cd0b2070 100644 --- a/Library/Homebrew/test/cxxstdlib_spec.rb +++ b/Library/Homebrew/test/cxxstdlib_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "cxxstdlib" diff --git a/Library/Homebrew/test/dependable_spec.rb b/Library/Homebrew/test/dependable_spec.rb index 8ffc2506c..2beb3c457 100644 --- a/Library/Homebrew/test/dependable_spec.rb +++ b/Library/Homebrew/test/dependable_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependable" describe Dependable do diff --git a/Library/Homebrew/test/dependencies_spec.rb b/Library/Homebrew/test/dependencies_spec.rb index ed86cb630..07da34497 100644 --- a/Library/Homebrew/test/dependencies_spec.rb +++ b/Library/Homebrew/test/dependencies_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependencies" require "dependency" diff --git a/Library/Homebrew/test/dependency_collector_spec.rb b/Library/Homebrew/test/dependency_collector_spec.rb index b921286a9..d4af7885a 100644 --- a/Library/Homebrew/test/dependency_collector_spec.rb +++ b/Library/Homebrew/test/dependency_collector_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependency_collector" describe DependencyCollector do diff --git a/Library/Homebrew/test/dependency_expansion_spec.rb b/Library/Homebrew/test/dependency_expansion_spec.rb index 16c37b931..c3a1c4b7e 100644 --- a/Library/Homebrew/test/dependency_expansion_spec.rb +++ b/Library/Homebrew/test/dependency_expansion_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependency" describe Dependency do diff --git a/Library/Homebrew/test/dependency_spec.rb b/Library/Homebrew/test/dependency_spec.rb index bc2fa813b..ec772097e 100644 --- a/Library/Homebrew/test/dependency_spec.rb +++ b/Library/Homebrew/test/dependency_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependency" describe Dependency do diff --git a/Library/Homebrew/test/description_cache_store_spec.rb b/Library/Homebrew/test/description_cache_store_spec.rb index d4aa1aa13..a5855a9ce 100644 --- a/Library/Homebrew/test/description_cache_store_spec.rb +++ b/Library/Homebrew/test/description_cache_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "description_cache_store" describe DescriptionCacheStore do diff --git a/Library/Homebrew/test/descriptions_spec.rb b/Library/Homebrew/test/descriptions_spec.rb index 9fe327fd0..01aa00434 100644 --- a/Library/Homebrew/test/descriptions_spec.rb +++ b/Library/Homebrew/test/descriptions_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "descriptions" describe Descriptions do diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index c8fd7b000..246749f96 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dev-cmd/audit" require "formulary" require "cmd/shared_examples/args_parse" diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb index 4180796ea..1acbf4480 100644 --- a/Library/Homebrew/test/dev-cmd/bottle_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.bottle_args" do diff --git a/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb b/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb index 1ca0a2e5b..9cdc95f9a 100644 --- a/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-formula-pr_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.bump_formula_pr_args" do diff --git a/Library/Homebrew/test/dev-cmd/create_spec.rb b/Library/Homebrew/test/dev-cmd/create_spec.rb index 37d119c03..e4e98c207 100644 --- a/Library/Homebrew/test/dev-cmd/create_spec.rb +++ b/Library/Homebrew/test/dev-cmd/create_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.create_args" do diff --git a/Library/Homebrew/test/dev-cmd/edit_spec.rb b/Library/Homebrew/test/dev-cmd/edit_spec.rb index da9f7af21..df88019fa 100644 --- a/Library/Homebrew/test/dev-cmd/edit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/edit_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.edit_args" do diff --git a/Library/Homebrew/test/dev-cmd/extract_spec.rb b/Library/Homebrew/test/dev-cmd/extract_spec.rb index abff3d6d2..169f07807 100644 --- a/Library/Homebrew/test/dev-cmd/extract_spec.rb +++ b/Library/Homebrew/test/dev-cmd/extract_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.extract_args" do diff --git a/Library/Homebrew/test/dev-cmd/formula_spec.rb b/Library/Homebrew/test/dev-cmd/formula_spec.rb index f64817194..d9e96bc7b 100644 --- a/Library/Homebrew/test/dev-cmd/formula_spec.rb +++ b/Library/Homebrew/test/dev-cmd/formula_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.formula_args" do diff --git a/Library/Homebrew/test/dev-cmd/irb_spec.rb b/Library/Homebrew/test/dev-cmd/irb_spec.rb index 291bdc161..666374c87 100644 --- a/Library/Homebrew/test/dev-cmd/irb_spec.rb +++ b/Library/Homebrew/test/dev-cmd/irb_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.irb_args" do diff --git a/Library/Homebrew/test/dev-cmd/linkage_spec.rb b/Library/Homebrew/test/dev-cmd/linkage_spec.rb index 7a0ffa598..f083b5cb6 100644 --- a/Library/Homebrew/test/dev-cmd/linkage_spec.rb +++ b/Library/Homebrew/test/dev-cmd/linkage_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.linkage_args" do diff --git a/Library/Homebrew/test/dev-cmd/man_spec.rb b/Library/Homebrew/test/dev-cmd/man_spec.rb index 5cb905678..07eab3a25 100644 --- a/Library/Homebrew/test/dev-cmd/man_spec.rb +++ b/Library/Homebrew/test/dev-cmd/man_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.man_args" do diff --git a/Library/Homebrew/test/dev-cmd/mirror_spec.rb b/Library/Homebrew/test/dev-cmd/mirror_spec.rb index 2c11572bf..4ad0dc02a 100644 --- a/Library/Homebrew/test/dev-cmd/mirror_spec.rb +++ b/Library/Homebrew/test/dev-cmd/mirror_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.mirror_args" do diff --git a/Library/Homebrew/test/dev-cmd/prof_spec.rb b/Library/Homebrew/test/dev-cmd/prof_spec.rb index a3c39b5c5..c2dc0b3d4 100644 --- a/Library/Homebrew/test/dev-cmd/prof_spec.rb +++ b/Library/Homebrew/test/dev-cmd/prof_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.prof_args" do diff --git a/Library/Homebrew/test/dev-cmd/pull_spec.rb b/Library/Homebrew/test/dev-cmd/pull_spec.rb index aaf11e71f..926b660bc 100644 --- a/Library/Homebrew/test/dev-cmd/pull_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pull_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.pull_args" do diff --git a/Library/Homebrew/test/dev-cmd/release-notes_spec.rb b/Library/Homebrew/test/dev-cmd/release-notes_spec.rb index 973e2b0aa..bbe9bff87 100644 --- a/Library/Homebrew/test/dev-cmd/release-notes_spec.rb +++ b/Library/Homebrew/test/dev-cmd/release-notes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.release_notes_args" do diff --git a/Library/Homebrew/test/dev-cmd/ruby_spec.rb b/Library/Homebrew/test/dev-cmd/ruby_spec.rb index 0f65d6888..42bb98c1f 100644 --- a/Library/Homebrew/test/dev-cmd/ruby_spec.rb +++ b/Library/Homebrew/test/dev-cmd/ruby_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.ruby_args" do diff --git a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb index 868650c7a..316637c04 100644 --- a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb +++ b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.tap_new_args" do diff --git a/Library/Homebrew/test/dev-cmd/test_spec.rb b/Library/Homebrew/test/dev-cmd/test_spec.rb index 8d6bb479c..26f45c421 100644 --- a/Library/Homebrew/test/dev-cmd/test_spec.rb +++ b/Library/Homebrew/test/dev-cmd/test_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.test_args" do diff --git a/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb b/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb index 3d7531339..ac08d2947 100644 --- a/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb +++ b/Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cmd/shared_examples/args_parse" describe "Homebrew.vendor_gems_args" do diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index 76ce1222d..8d75726c5 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "diagnostic" describe Homebrew::Diagnostic::Checks do diff --git a/Library/Homebrew/test/download_strategies_spec.rb b/Library/Homebrew/test/download_strategies_spec.rb index 21df40c50..615daa05f 100644 --- a/Library/Homebrew/test/download_strategies_spec.rb +++ b/Library/Homebrew/test/download_strategies_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "download_strategy" describe AbstractDownloadStrategy do diff --git a/Library/Homebrew/test/emoji_spec.rb b/Library/Homebrew/test/emoji_spec.rb index f2aec7ad2..4343c37d1 100644 --- a/Library/Homebrew/test/emoji_spec.rb +++ b/Library/Homebrew/test/emoji_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "emoji" describe Emoji do diff --git a/Library/Homebrew/test/error_during_execution_spec.rb b/Library/Homebrew/test/error_during_execution_spec.rb index bd3b96e6c..513ff7a50 100644 --- a/Library/Homebrew/test/error_during_execution_spec.rb +++ b/Library/Homebrew/test/error_during_execution_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe ErrorDuringExecution do subject(:error) { described_class.new(command, status: status, output: output) } diff --git a/Library/Homebrew/test/exceptions_spec.rb b/Library/Homebrew/test/exceptions_spec.rb index 934a651d9..63bc8410b 100644 --- a/Library/Homebrew/test/exceptions_spec.rb +++ b/Library/Homebrew/test/exceptions_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "exceptions" describe MultipleVersionsInstalledError do diff --git a/Library/Homebrew/test/formatter_spec.rb b/Library/Homebrew/test/formatter_spec.rb index 168b80ba8..fb348213a 100644 --- a/Library/Homebrew/test/formatter_spec.rb +++ b/Library/Homebrew/test/formatter_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/formatter" require "utils/tty" diff --git a/Library/Homebrew/test/formula_installer_bottle_spec.rb b/Library/Homebrew/test/formula_installer_bottle_spec.rb index 30d19ca3f..3560cc7f9 100644 --- a/Library/Homebrew/test/formula_installer_bottle_spec.rb +++ b/Library/Homebrew/test/formula_installer_bottle_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "formula_installer" require "keg" diff --git a/Library/Homebrew/test/formula_installer_spec.rb b/Library/Homebrew/test/formula_installer_spec.rb index dc4dc9117..682a665a5 100644 --- a/Library/Homebrew/test/formula_installer_spec.rb +++ b/Library/Homebrew/test/formula_installer_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "formula_installer" require "keg" diff --git a/Library/Homebrew/test/formula_pin_spec.rb b/Library/Homebrew/test/formula_pin_spec.rb index b06c5eff9..03e83da67 100644 --- a/Library/Homebrew/test/formula_pin_spec.rb +++ b/Library/Homebrew/test/formula_pin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula_pin" describe FormulaPin do diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index f51548aaa..b76211595 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test/support/fixtures/testball" require "formula" @@ -380,7 +382,7 @@ describe Formula do stamps_with_revisions.each do |stamp, revision| version = "HEAD-#{stamp}" - version << "_#{revision}" unless revision.zero? + version = "#{version}_#{revision}" unless revision.zero? prefix = f.rack/version prefix.mkpath diff --git a/Library/Homebrew/test/formula_spec_selection_spec.rb b/Library/Homebrew/test/formula_spec_selection_spec.rb index 20231ffda..98fb36171 100644 --- a/Library/Homebrew/test/formula_spec_selection_spec.rb +++ b/Library/Homebrew/test/formula_spec_selection_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" describe Formula do diff --git a/Library/Homebrew/test/formula_support_spec.rb b/Library/Homebrew/test/formula_support_spec.rb index 31fc879d8..d20fedddf 100644 --- a/Library/Homebrew/test/formula_support_spec.rb +++ b/Library/Homebrew/test/formula_support_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula_support" describe KegOnlyReason do diff --git a/Library/Homebrew/test/formula_validation_spec.rb b/Library/Homebrew/test/formula_validation_spec.rb index ff50c86d1..53c679e8d 100644 --- a/Library/Homebrew/test/formula_validation_spec.rb +++ b/Library/Homebrew/test/formula_validation_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" describe Formula do diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 14df97fd4..326657456 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" require "formula_installer" require "utils/bottles" diff --git a/Library/Homebrew/test/hardware/cpu_spec.rb b/Library/Homebrew/test/hardware/cpu_spec.rb index c9b5829b2..0a6f2101c 100644 --- a/Library/Homebrew/test/hardware/cpu_spec.rb +++ b/Library/Homebrew/test/hardware/cpu_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "hardware" describe Hardware::CPU do diff --git a/Library/Homebrew/test/inreplace_spec.rb b/Library/Homebrew/test/inreplace_spec.rb index 896b19f5a..2491c8b87 100644 --- a/Library/Homebrew/test/inreplace_spec.rb +++ b/Library/Homebrew/test/inreplace_spec.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + require "extend/string" require "tempfile" require "utils/inreplace" describe StringInreplaceExtension do - subject { string.extend(described_class) } + subject { string.dup.extend(described_class) } describe "#change_make_var!" do context "flag" do diff --git a/Library/Homebrew/test/java_requirement_spec.rb b/Library/Homebrew/test/java_requirement_spec.rb index 859c2d9fb..f851136a0 100644 --- a/Library/Homebrew/test/java_requirement_spec.rb +++ b/Library/Homebrew/test/java_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/java_requirement" describe JavaRequirement do diff --git a/Library/Homebrew/test/keg_spec.rb b/Library/Homebrew/test/keg_spec.rb index 3c06f5b1c..2df44f9b1 100644 --- a/Library/Homebrew/test/keg_spec.rb +++ b/Library/Homebrew/test/keg_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" require "stringio" diff --git a/Library/Homebrew/test/language/go_spec.rb b/Library/Homebrew/test/language/go_spec.rb index 1625b7f78..ac631f38c 100644 --- a/Library/Homebrew/test/language/go_spec.rb +++ b/Library/Homebrew/test/language/go_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/go" describe Language::Go do diff --git a/Library/Homebrew/test/language/java_spec.rb b/Library/Homebrew/test/language/java_spec.rb index 32b6de1b6..59d49e5e6 100644 --- a/Library/Homebrew/test/language/java_spec.rb +++ b/Library/Homebrew/test/language/java_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/java" describe Language::Java do diff --git a/Library/Homebrew/test/language/node_spec.rb b/Library/Homebrew/test/language/node_spec.rb index 7632a5dc0..0501297b7 100644 --- a/Library/Homebrew/test/language/node_spec.rb +++ b/Library/Homebrew/test/language/node_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/node" describe Language::Node do diff --git a/Library/Homebrew/test/language/python_spec.rb b/Library/Homebrew/test/language/python_spec.rb index fb2b92425..a474e04da 100644 --- a/Library/Homebrew/test/language/python_spec.rb +++ b/Library/Homebrew/test/language/python_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/python" require "resource" diff --git a/Library/Homebrew/test/lazy_object_spec.rb b/Library/Homebrew/test/lazy_object_spec.rb index 77e3f23f8..57ca637fa 100644 --- a/Library/Homebrew/test/lazy_object_spec.rb +++ b/Library/Homebrew/test/lazy_object_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "lazy_object" describe LazyObject do diff --git a/Library/Homebrew/test/linkage_cache_store_spec.rb b/Library/Homebrew/test/linkage_cache_store_spec.rb index 0b1d6a8d7..51dec2b1d 100644 --- a/Library/Homebrew/test/linkage_cache_store_spec.rb +++ b/Library/Homebrew/test/linkage_cache_store_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "linkage_cache_store" describe LinkageCacheStore do diff --git a/Library/Homebrew/test/locale_spec.rb b/Library/Homebrew/test/locale_spec.rb index 819a2f275..f76186134 100644 --- a/Library/Homebrew/test/locale_spec.rb +++ b/Library/Homebrew/test/locale_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "locale" describe Locale do diff --git a/Library/Homebrew/test/lock_file_spec.rb b/Library/Homebrew/test/lock_file_spec.rb index 82c47a70a..f9e949648 100644 --- a/Library/Homebrew/test/lock_file_spec.rb +++ b/Library/Homebrew/test/lock_file_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "lock_file" describe LockFile do diff --git a/Library/Homebrew/test/messages_spec.rb b/Library/Homebrew/test/messages_spec.rb index 527b35d23..69a20b92e 100644 --- a/Library/Homebrew/test/messages_spec.rb +++ b/Library/Homebrew/test/messages_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "messages" require "spec_helper" diff --git a/Library/Homebrew/test/migrator_spec.rb b/Library/Homebrew/test/migrator_spec.rb index f189e7a10..e17a4bf44 100644 --- a/Library/Homebrew/test/migrator_spec.rb +++ b/Library/Homebrew/test/migrator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "migrator" require "test/support/fixtures/testball" require "tab" diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index 8fd86c510..30c21b09a 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "missing_formula" describe Homebrew::MissingFormula do diff --git a/Library/Homebrew/test/options_spec.rb b/Library/Homebrew/test/options_spec.rb index 770485cc8..b864fe662 100644 --- a/Library/Homebrew/test/options_spec.rb +++ b/Library/Homebrew/test/options_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "options" describe Option do diff --git a/Library/Homebrew/test/os/linux/dependency_collector_spec.rb b/Library/Homebrew/test/os/linux/dependency_collector_spec.rb index 52f2d750b..0bc48fc0d 100644 --- a/Library/Homebrew/test/os/linux/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/linux/dependency_collector_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependency_collector" describe DependencyCollector do diff --git a/Library/Homebrew/test/os/linux/diagnostic_spec.rb b/Library/Homebrew/test/os/linux/diagnostic_spec.rb index d5d85cc0f..4c1b2cf5a 100644 --- a/Library/Homebrew/test/os/linux/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/linux/diagnostic_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "diagnostic" describe Homebrew::Diagnostic::Checks do diff --git a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb index 90a23f375..842cf3c5f 100644 --- a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dependency_collector" describe DependencyCollector do diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index 91a94eb89..353a4e7b6 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "diagnostic" describe Homebrew::Diagnostic::Checks do diff --git a/Library/Homebrew/test/os/mac/java_requirement_spec.rb b/Library/Homebrew/test/os/mac/java_requirement_spec.rb index afb17d742..97c8606f9 100644 --- a/Library/Homebrew/test/os/mac/java_requirement_spec.rb +++ b/Library/Homebrew/test/os/mac/java_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/java_requirement" require "fileutils" diff --git a/Library/Homebrew/test/os/mac/keg_spec.rb b/Library/Homebrew/test/os/mac/keg_spec.rb index c1786f5d3..b70068c95 100644 --- a/Library/Homebrew/test/os/mac/keg_spec.rb +++ b/Library/Homebrew/test/os/mac/keg_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" describe Keg do diff --git a/Library/Homebrew/test/os/mac/mach_spec.rb b/Library/Homebrew/test/os/mac/mach_spec.rb index f07f45b78..c10a661f9 100644 --- a/Library/Homebrew/test/os/mac/mach_spec.rb +++ b/Library/Homebrew/test/os/mac/mach_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "Mach-O Pathname tests" do specify "fat dylib" do pn = dylib_path("fat") diff --git a/Library/Homebrew/test/os/mac/version_spec.rb b/Library/Homebrew/test/os/mac/version_spec.rb index a74f54146..0901b0aae 100644 --- a/Library/Homebrew/test/os/mac/version_spec.rb +++ b/Library/Homebrew/test/os/mac/version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "version" require "os/mac/version" diff --git a/Library/Homebrew/test/os/mac_spec.rb b/Library/Homebrew/test/os/mac_spec.rb index 97f15dd61..dcb04a77a 100644 --- a/Library/Homebrew/test/os/mac_spec.rb +++ b/Library/Homebrew/test/os/mac_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "locale" require "os/mac" diff --git a/Library/Homebrew/test/patch_spec.rb b/Library/Homebrew/test/patch_spec.rb index d29630c6b..463894ff4 100644 --- a/Library/Homebrew/test/patch_spec.rb +++ b/Library/Homebrew/test/patch_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "patch" describe Patch do diff --git a/Library/Homebrew/test/patching_spec.rb b/Library/Homebrew/test/patching_spec.rb index a03bae8ed..b921bb5d7 100644 --- a/Library/Homebrew/test/patching_spec.rb +++ b/Library/Homebrew/test/patching_spec.rb @@ -1,15 +1,17 @@ +# frozen_string_literal: true + require "formula" describe "patching" do - TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz".freeze - TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze - PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff".freeze - PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff".freeze + TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" + TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz" + PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff" + PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff" PATCH_A_CONTENTS = File.read("#{TEST_FIXTURE_DIR}/patches/noop-a.diff").freeze PATCH_B_CONTENTS = File.read("#{TEST_FIXTURE_DIR}/patches/noop-b.diff").freeze - APPLY_A = "noop-a.diff".freeze - APPLY_B = "noop-b.diff".freeze - APPLY_C = "noop-c.diff".freeze + APPLY_A = "noop-a.diff" + APPLY_B = "noop-b.diff" + APPLY_C = "noop-c.diff" def formula(name = "formula_name", path: Formulary.core_path(name), spec: :stable, alias_path: nil, &block) Class.new(Formula) { diff --git a/Library/Homebrew/test/pathname_spec.rb b/Library/Homebrew/test/pathname_spec.rb index 196742021..454460796 100644 --- a/Library/Homebrew/test/pathname_spec.rb +++ b/Library/Homebrew/test/pathname_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/pathname" require "install_renamed" diff --git a/Library/Homebrew/test/pkg_version_spec.rb b/Library/Homebrew/test/pkg_version_spec.rb index b1cceb32c..8e456ad62 100644 --- a/Library/Homebrew/test/pkg_version_spec.rb +++ b/Library/Homebrew/test/pkg_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pkg_version" describe PkgVersion do diff --git a/Library/Homebrew/test/requirement_spec.rb b/Library/Homebrew/test/requirement_spec.rb index 43a3e34fe..e199ad7df 100644 --- a/Library/Homebrew/test/requirement_spec.rb +++ b/Library/Homebrew/test/requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "extend/ENV" require "requirement" diff --git a/Library/Homebrew/test/requirements/codesign_requirement_spec.rb b/Library/Homebrew/test/requirements/codesign_requirement_spec.rb index 5940c6d6f..483104bce 100644 --- a/Library/Homebrew/test/requirements/codesign_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/codesign_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/codesign_requirement" describe CodesignRequirement do diff --git a/Library/Homebrew/test/requirements/java_requirement_spec.rb b/Library/Homebrew/test/requirements/java_requirement_spec.rb index 50e29b209..969532d0c 100644 --- a/Library/Homebrew/test/requirements/java_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/java_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/java_requirement" describe JavaRequirement do diff --git a/Library/Homebrew/test/requirements/linux_requirement_spec.rb b/Library/Homebrew/test/requirements/linux_requirement_spec.rb index 3d456f1f1..cb8d3a34d 100644 --- a/Library/Homebrew/test/requirements/linux_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/linux_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/linux_requirement" describe LinuxRequirement do diff --git a/Library/Homebrew/test/requirements/macos_requirement_spec.rb b/Library/Homebrew/test/requirements/macos_requirement_spec.rb index 7828e7318..71d080e55 100644 --- a/Library/Homebrew/test/requirements/macos_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/macos_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/macos_requirement" describe MacOSRequirement do diff --git a/Library/Homebrew/test/requirements/osxfuse_requirement_spec.rb b/Library/Homebrew/test/requirements/osxfuse_requirement_spec.rb index 59a355307..0737bd8e5 100644 --- a/Library/Homebrew/test/requirements/osxfuse_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/osxfuse_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/osxfuse_requirement" describe OsxfuseRequirement do diff --git a/Library/Homebrew/test/requirements_spec.rb b/Library/Homebrew/test/requirements_spec.rb index 7ad7cb7f3..f20e7bc9e 100644 --- a/Library/Homebrew/test/requirements_spec.rb +++ b/Library/Homebrew/test/requirements_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements" describe Requirements do diff --git a/Library/Homebrew/test/resource_spec.rb b/Library/Homebrew/test/resource_spec.rb index 6bc514e63..fde2eacac 100644 --- a/Library/Homebrew/test/resource_spec.rb +++ b/Library/Homebrew/test/resource_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" describe Resource do diff --git a/Library/Homebrew/test/rubocop_spec.rb b/Library/Homebrew/test/rubocop_spec.rb index 64f86ad44..7ac9cd58a 100644 --- a/Library/Homebrew/test/rubocop_spec.rb +++ b/Library/Homebrew/test/rubocop_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" describe "RuboCop" do diff --git a/Library/Homebrew/test/rubocops/cask/homepage_matches_url_spec.rb b/Library/Homebrew/test/rubocops/cask/homepage_matches_url_spec.rb index c863e9e06..05c32ba66 100644 --- a/Library/Homebrew/test/rubocops/cask/homepage_matches_url_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/homepage_matches_url_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/rubocop-cask" require "test/rubocops/cask/shared_examples/cask_cop" diff --git a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb index 9eaf31f22..81fea8a00 100644 --- a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/rubocop-cask" require "test/rubocops/cask/shared_examples/cask_cop" diff --git a/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb b/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb index 30e32b47f..9f52bd7bf 100644 --- a/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/rubocop-cask" require "test/rubocops/cask/shared_examples/cask_cop" diff --git a/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb b/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb index 0da2c06b7..3a11d6be0 100644 --- a/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb +++ b/Library/Homebrew/test/rubocops/cask/shared_examples/cask_cop.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CaskCop shared_examples "does not report any offenses" do it "does not report any offenses" do diff --git a/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb index 6e34f7ffb..c8a70a286 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/rubocop-cask" require "test/rubocops/cask/shared_examples/cask_cop" diff --git a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb index a73f2ca3f..7db8ab727 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/rubocop-cask" require "test/rubocops/cask/shared_examples/cask_cop" diff --git a/Library/Homebrew/test/rubocops/caveats_spec.rb b/Library/Homebrew/test/rubocops/caveats_spec.rb index c2b826630..a19e8ab8f 100644 --- a/Library/Homebrew/test/rubocops/caveats_spec.rb +++ b/Library/Homebrew/test/rubocops/caveats_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/caveats" describe RuboCop::Cop::FormulaAudit::Caveats do diff --git a/Library/Homebrew/test/rubocops/checksum_spec.rb b/Library/Homebrew/test/rubocops/checksum_spec.rb index 31206c9f5..0d3f0e542 100644 --- a/Library/Homebrew/test/rubocops/checksum_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/checksum" describe RuboCop::Cop::FormulaAudit::Checksum do diff --git a/Library/Homebrew/test/rubocops/class_spec.rb b/Library/Homebrew/test/rubocops/class_spec.rb index 070f6e9ab..617e7204e 100644 --- a/Library/Homebrew/test/rubocops/class_spec.rb +++ b/Library/Homebrew/test/rubocops/class_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/class" describe RuboCop::Cop::FormulaAudit::ClassName do diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index c47a85cc4..3faa59442 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/components_order" describe RuboCop::Cop::FormulaAudit::ComponentsOrder do diff --git a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb index 9a1943e42..30672ec9d 100644 --- a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb +++ b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/components_redundancy" describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do diff --git a/Library/Homebrew/test/rubocops/conflicts_spec.rb b/Library/Homebrew/test/rubocops/conflicts_spec.rb index 5e45e4593..db8fa42e5 100644 --- a/Library/Homebrew/test/rubocops/conflicts_spec.rb +++ b/Library/Homebrew/test/rubocops/conflicts_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/conflicts" describe RuboCop::Cop::FormulaAudit::Conflicts do diff --git a/Library/Homebrew/test/rubocops/dependency_order_spec.rb b/Library/Homebrew/test/rubocops/dependency_order_spec.rb index 0f76b7dcb..c724b8956 100644 --- a/Library/Homebrew/test/rubocops/dependency_order_spec.rb +++ b/Library/Homebrew/test/rubocops/dependency_order_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/dependency_order" describe RuboCop::Cop::FormulaAudit::DependencyOrder do diff --git a/Library/Homebrew/test/rubocops/formula_desc_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_spec.rb index ed52c6089..9aa51fe93 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/formula_desc" describe RuboCop::Cop::FormulaAudit::DescLength do diff --git a/Library/Homebrew/test/rubocops/homepage_spec.rb b/Library/Homebrew/test/rubocops/homepage_spec.rb index fd41e89fb..284d501df 100644 --- a/Library/Homebrew/test/rubocops/homepage_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/homepage" describe RuboCop::Cop::FormulaAudit::Homepage do diff --git a/Library/Homebrew/test/rubocops/lines_spec.rb b/Library/Homebrew/test/rubocops/lines_spec.rb index 193d2b8cd..2ad249718 100644 --- a/Library/Homebrew/test/rubocops/lines_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/lines" describe RuboCop::Cop::FormulaAudit::Lines do diff --git a/Library/Homebrew/test/rubocops/options_spec.rb b/Library/Homebrew/test/rubocops/options_spec.rb index a2eac92d8..487724def 100644 --- a/Library/Homebrew/test/rubocops/options_spec.rb +++ b/Library/Homebrew/test/rubocops/options_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/options" describe RuboCop::Cop::FormulaAudit::Options do diff --git a/Library/Homebrew/test/rubocops/patches_spec.rb b/Library/Homebrew/test/rubocops/patches_spec.rb index 81f382ecc..efb899d94 100644 --- a/Library/Homebrew/test/rubocops/patches_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/patches" describe RuboCop::Cop::FormulaAudit::Patches do diff --git a/Library/Homebrew/test/rubocops/text_spec.rb b/Library/Homebrew/test/rubocops/text_spec.rb index 39507ba0f..8485c5c4f 100644 --- a/Library/Homebrew/test/rubocops/text_spec.rb +++ b/Library/Homebrew/test/rubocops/text_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/text" describe RuboCop::Cop::FormulaAudit::Text do diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index 415ed10a7..90f160327 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rubocops/urls" describe RuboCop::Cop::FormulaAudit::Urls do diff --git a/Library/Homebrew/test/sandbox_spec.rb b/Library/Homebrew/test/sandbox_spec.rb index 965646c45..d2e969468 100644 --- a/Library/Homebrew/test/sandbox_spec.rb +++ b/Library/Homebrew/test/sandbox_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sandbox" describe Sandbox do diff --git a/Library/Homebrew/test/search_spec.rb b/Library/Homebrew/test/search_spec.rb index ba44025dd..0f3bfbe6a 100644 --- a/Library/Homebrew/test/search_spec.rb +++ b/Library/Homebrew/test/search_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "search" describe Homebrew::Search do diff --git a/Library/Homebrew/test/searchable_spec.rb b/Library/Homebrew/test/searchable_spec.rb index 01f0d00be..aaf88c2ea 100644 --- a/Library/Homebrew/test/searchable_spec.rb +++ b/Library/Homebrew/test/searchable_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "searchable" describe Searchable do diff --git a/Library/Homebrew/test/software_spec_spec.rb b/Library/Homebrew/test/software_spec_spec.rb index a4e81f5db..43293af2f 100644 --- a/Library/Homebrew/test/software_spec_spec.rb +++ b/Library/Homebrew/test/software_spec_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "software_spec" describe SoftwareSpec do diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 70b2b3d71..c67fd38c2 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if ENV["HOMEBREW_TESTS_COVERAGE"] require "simplecov" diff --git a/Library/Homebrew/test/string_spec.rb b/Library/Homebrew/test/string_spec.rb index d698d35ef..ed9cdc2de 100644 --- a/Library/Homebrew/test/string_spec.rb +++ b/Library/Homebrew/test/string_spec.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + require "extend/string" describe StringInreplaceExtension do subject { string.extend(described_class) } - let(:string) { "foobar" } + let(:string) { +"foobar" } describe "#sub!" do it "adds an error to #errors when no replacement was made" do diff --git a/Library/Homebrew/test/support/fixtures/failball.rb b/Library/Homebrew/test/support/fixtures/failball.rb index 125452fec..439645df2 100644 --- a/Library/Homebrew/test/support/fixtures/failball.rb +++ b/Library/Homebrew/test/support/fixtures/failball.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Failball < Formula def initialize(name = "failball", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil) self.class.instance_eval do diff --git a/Library/Homebrew/test/support/fixtures/testball.rb b/Library/Homebrew/test/support/fixtures/testball.rb index ba725f51e..c2d4aa2bb 100644 --- a/Library/Homebrew/test/support/fixtures/testball.rb +++ b/Library/Homebrew/test/support/fixtures/testball.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Testball < Formula def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil) self.class.instance_eval do diff --git a/Library/Homebrew/test/support/fixtures/testball_bottle.rb b/Library/Homebrew/test/support/fixtures/testball_bottle.rb index 5a6be7c5f..f6268ed4f 100644 --- a/Library/Homebrew/test/support/fixtures/testball_bottle.rb +++ b/Library/Homebrew/test/support/fixtures/testball_bottle.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TestballBottle < Formula def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil) self.class.instance_eval do diff --git a/Library/Homebrew/test/support/helper/cask/fake_system_command.rb b/Library/Homebrew/test/support/helper/cask/fake_system_command.rb index dafb8a647..2f767ae9c 100644 --- a/Library/Homebrew/test/support/helper/cask/fake_system_command.rb +++ b/Library/Homebrew/test/support/helper/cask/fake_system_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def sudo(*args) ["/usr/bin/sudo", "-E", "--"] + args.flatten end diff --git a/Library/Homebrew/test/support/helper/cask/install_helper.rb b/Library/Homebrew/test/support/helper/cask/install_helper.rb index eb206c0bd..25ba7ea17 100644 --- a/Library/Homebrew/test/support/helper/cask/install_helper.rb +++ b/Library/Homebrew/test/support/helper/cask/install_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module InstallHelper module_function diff --git a/Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb b/Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb index 7842d4b17..be2570a0c 100644 --- a/Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb +++ b/Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "system_command" class NeverSudoSystemCommand < SystemCommand diff --git a/Library/Homebrew/test/support/helper/fixtures.rb b/Library/Homebrew/test/support/helper/fixtures.rb index 460fb4aef..fc5cf48c8 100644 --- a/Library/Homebrew/test/support/helper/fixtures.rb +++ b/Library/Homebrew/test/support/helper/fixtures.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Test module Helper module Fixtures diff --git a/Library/Homebrew/test/support/helper/formula.rb b/Library/Homebrew/test/support/helper/formula.rb index 7f55f4b66..36fe7f280 100644 --- a/Library/Homebrew/test/support/helper/formula.rb +++ b/Library/Homebrew/test/support/helper/formula.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formulary" module Test diff --git a/Library/Homebrew/test/support/helper/integration_mocks.rb b/Library/Homebrew/test/support/helper/integration_mocks.rb index 6effb0cde..2e4ec4b26 100644 --- a/Library/Homebrew/test/support/helper/integration_mocks.rb +++ b/Library/Homebrew/test/support/helper/integration_mocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Diagnostic class Checks diff --git a/Library/Homebrew/test/support/helper/mktmpdir.rb b/Library/Homebrew/test/support/helper/mktmpdir.rb index 651d08e54..6cb369c41 100644 --- a/Library/Homebrew/test/support/helper/mktmpdir.rb +++ b/Library/Homebrew/test/support/helper/mktmpdir.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Test module Helper module MkTmpDir diff --git a/Library/Homebrew/test/support/helper/output_as_tty.rb b/Library/Homebrew/test/support/helper/output_as_tty.rb index eb5d4c219..ca7f4ca66 100644 --- a/Library/Homebrew/test/support/helper/output_as_tty.rb +++ b/Library/Homebrew/test/support/helper/output_as_tty.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" module Test diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb index 60596a899..21537b41c 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cask/all" require "test/support/helper/cask/fake_system_command" 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 f79df38dd..25a3dffc8 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" require "formula_installer" diff --git a/Library/Homebrew/test/support/lib/config.rb b/Library/Homebrew/test/support/lib/config.rb index 126c66b6c..b9cb738c9 100644 --- a/Library/Homebrew/test/support/lib/config.rb +++ b/Library/Homebrew/test/support/lib/config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] require "pathname" @@ -34,13 +36,13 @@ HOMEBREW_TEMP = (HOMEBREW_PREFIX.parent/"temp").freeze TEST_FIXTURE_DIR = (HOMEBREW_LIBRARY_PATH/"test/support/fixtures").freeze -TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b".freeze -TESTBALL_PATCHES_SHA256 = "799c2d551ac5c3a5759bea7796631a7906a6a24435b52261a317133a0bfb34d9".freeze -PATCH_A_SHA256 = "83404f4936d3257e65f176c4ffb5a5b8d6edd644a21c8d8dcc73e22a6d28fcfa".freeze -PATCH_B_SHA256 = "57958271bb802a59452d0816e0670d16c8b70bdf6530bcf6f78726489ad89b90".freeze +TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b" +TESTBALL_PATCHES_SHA256 = "799c2d551ac5c3a5759bea7796631a7906a6a24435b52261a317133a0bfb34d9" +PATCH_A_SHA256 = "83404f4936d3257e65f176c4ffb5a5b8d6edd644a21c8d8dcc73e22a6d28fcfa" +PATCH_B_SHA256 = "57958271bb802a59452d0816e0670d16c8b70bdf6530bcf6f78726489ad89b90" -TEST_SHA1 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze -TEST_SHA256 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze +TEST_SHA1 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" +TEST_SHA256 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" # For testing's sake always assume the default prefix module Homebrew diff --git a/Library/Homebrew/test/support/no_seed_progress_formatter.rb b/Library/Homebrew/test/support/no_seed_progress_formatter.rb index e87a58143..d6199bd9a 100644 --- a/Library/Homebrew/test/support/no_seed_progress_formatter.rb +++ b/Library/Homebrew/test/support/no_seed_progress_formatter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rspec/core/formatters/progress_formatter" class NoSeedProgressFormatter < RSpec::Core::Formatters::ProgressFormatter diff --git a/Library/Homebrew/test/system_command_result_spec.rb b/Library/Homebrew/test/system_command_result_spec.rb index 9d48d3425..c76cb5d6f 100644 --- a/Library/Homebrew/test/system_command_result_spec.rb +++ b/Library/Homebrew/test/system_command_result_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "system_command" describe SystemCommand::Result do diff --git a/Library/Homebrew/test/system_command_spec.rb b/Library/Homebrew/test/system_command_spec.rb index aeef194d4..56241ac33 100644 --- a/Library/Homebrew/test/system_command_spec.rb +++ b/Library/Homebrew/test/system_command_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe SystemCommand do describe "#initialize" do subject(:command) { diff --git a/Library/Homebrew/test/tab_spec.rb b/Library/Homebrew/test/tab_spec.rb index b3ae241b8..bcb233ef2 100644 --- a/Library/Homebrew/test/tab_spec.rb +++ b/Library/Homebrew/test/tab_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tab" require "formula" diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index 56d6fc9a9..699fb5293 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Tap do alias_matcher :have_formula_file, :be_formula_file alias_matcher :have_custom_remote, :be_custom_remote diff --git a/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb b/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb index dac93a05e..434a76a94 100644 --- a/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/bazaar_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Bazaar do diff --git a/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb b/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb index 5bb2b5dc8..a81f15bab 100644 --- a/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/bzip2_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Bzip2 do diff --git a/Library/Homebrew/test/unpack_strategy/cvs_spec.rb b/Library/Homebrew/test/unpack_strategy/cvs_spec.rb index b3addd4cb..8eebf17da 100644 --- a/Library/Homebrew/test/unpack_strategy/cvs_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/cvs_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Cvs do diff --git a/Library/Homebrew/test/unpack_strategy/directory_spec.rb b/Library/Homebrew/test/unpack_strategy/directory_spec.rb index f7ceedd67..1207454ae 100644 --- a/Library/Homebrew/test/unpack_strategy/directory_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/directory_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Directory do diff --git a/Library/Homebrew/test/unpack_strategy/dmg_spec.rb b/Library/Homebrew/test/unpack_strategy/dmg_spec.rb index a572ea3a0..8a3594f14 100644 --- a/Library/Homebrew/test/unpack_strategy/dmg_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/dmg_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Dmg, :needs_macos do diff --git a/Library/Homebrew/test/unpack_strategy/git_spec.rb b/Library/Homebrew/test/unpack_strategy/git_spec.rb index a499c8a79..738146a78 100644 --- a/Library/Homebrew/test/unpack_strategy/git_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/git_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Git do diff --git a/Library/Homebrew/test/unpack_strategy/gzip_spec.rb b/Library/Homebrew/test/unpack_strategy/gzip_spec.rb index 38d12c173..ebf4a493b 100644 --- a/Library/Homebrew/test/unpack_strategy/gzip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/gzip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Gzip do diff --git a/Library/Homebrew/test/unpack_strategy/jar_spec.rb b/Library/Homebrew/test/unpack_strategy/jar_spec.rb index 3b5f36ed9..f6da64b97 100644 --- a/Library/Homebrew/test/unpack_strategy/jar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/jar_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Jar, :needs_unzip do diff --git a/Library/Homebrew/test/unpack_strategy/lha_spec.rb b/Library/Homebrew/test/unpack_strategy/lha_spec.rb index 7e70844a8..e24a60a65 100644 --- a/Library/Homebrew/test/unpack_strategy/lha_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/lha_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Lha do diff --git a/Library/Homebrew/test/unpack_strategy/lzip_spec.rb b/Library/Homebrew/test/unpack_strategy/lzip_spec.rb index 119eb213b..a74b68add 100644 --- a/Library/Homebrew/test/unpack_strategy/lzip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/lzip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Lzip do diff --git a/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb b/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb index edd22a5bb..76a28e27b 100644 --- a/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/mercurial_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Mercurial do diff --git a/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb b/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb index 33a56923f..c612b13f0 100644 --- a/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/p7zip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::P7Zip do diff --git a/Library/Homebrew/test/unpack_strategy/rar_spec.rb b/Library/Homebrew/test/unpack_strategy/rar_spec.rb index 0f315b174..5e5e59333 100644 --- a/Library/Homebrew/test/unpack_strategy/rar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/rar_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Rar do diff --git a/Library/Homebrew/test/unpack_strategy/shared_examples.rb b/Library/Homebrew/test/unpack_strategy/shared_examples.rb index 285de1c3e..6f3caa475 100644 --- a/Library/Homebrew/test/unpack_strategy/shared_examples.rb +++ b/Library/Homebrew/test/unpack_strategy/shared_examples.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "unpack_strategy" shared_examples "UnpackStrategy::detect" do diff --git a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb index cec416a32..dc818221b 100644 --- a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Subversion, :needs_svn do diff --git a/Library/Homebrew/test/unpack_strategy/tar_spec.rb b/Library/Homebrew/test/unpack_strategy/tar_spec.rb index 0f748f5d6..ae11929b3 100644 --- a/Library/Homebrew/test/unpack_strategy/tar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/tar_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Tar do diff --git a/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb b/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb index 9d0825712..8e8c5d923 100644 --- a/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Uncompressed do diff --git a/Library/Homebrew/test/unpack_strategy/xar_spec.rb b/Library/Homebrew/test/unpack_strategy/xar_spec.rb index 61257d349..f4f11389d 100644 --- a/Library/Homebrew/test/unpack_strategy/xar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/xar_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Xar, :needs_macos do diff --git a/Library/Homebrew/test/unpack_strategy/xz_spec.rb b/Library/Homebrew/test/unpack_strategy/xz_spec.rb index 6374833a7..ffc41369a 100644 --- a/Library/Homebrew/test/unpack_strategy/xz_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/xz_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Xz do diff --git a/Library/Homebrew/test/unpack_strategy/zip_spec.rb b/Library/Homebrew/test/unpack_strategy/zip_spec.rb index 774cf36fe..c579fff51 100644 --- a/Library/Homebrew/test/unpack_strategy/zip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/zip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "shared_examples" describe UnpackStrategy::Zip do diff --git a/Library/Homebrew/test/unpack_strategy_spec.rb b/Library/Homebrew/test/unpack_strategy_spec.rb index 62bbc29ea..bfcbc2421 100644 --- a/Library/Homebrew/test/unpack_strategy_spec.rb +++ b/Library/Homebrew/test/unpack_strategy_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe UnpackStrategy do describe "#extract_nestedly" do subject(:strategy) { described_class.detect(path) } diff --git a/Library/Homebrew/test/utils/analytics_spec.rb b/Library/Homebrew/test/utils/analytics_spec.rb index 29bdd0438..8827c8012 100644 --- a/Library/Homebrew/test/utils/analytics_spec.rb +++ b/Library/Homebrew/test/utils/analytics_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/analytics" require "formula_installer" diff --git a/Library/Homebrew/test/utils/bottles/bintray_spec.rb b/Library/Homebrew/test/utils/bottles/bintray_spec.rb index a7dfc00ea..87a9a7c7e 100644 --- a/Library/Homebrew/test/utils/bottles/bintray_spec.rb +++ b/Library/Homebrew/test/utils/bottles/bintray_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/bottles" describe Utils::Bottles::Bintray do diff --git a/Library/Homebrew/test/utils/bottles/bottles_spec.rb b/Library/Homebrew/test/utils/bottles/bottles_spec.rb index fcaaa1db5..3cb3e7697 100644 --- a/Library/Homebrew/test/utils/bottles/bottles_spec.rb +++ b/Library/Homebrew/test/utils/bottles/bottles_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/bottles" describe Utils::Bottles do diff --git a/Library/Homebrew/test/utils/bottles/collector_spec.rb b/Library/Homebrew/test/utils/bottles/collector_spec.rb index 98c3532bf..2efdb0163 100644 --- a/Library/Homebrew/test/utils/bottles/collector_spec.rb +++ b/Library/Homebrew/test/utils/bottles/collector_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/bottles" describe Utils::Bottles::Collector do diff --git a/Library/Homebrew/test/utils/curl_spec.rb b/Library/Homebrew/test/utils/curl_spec.rb index 3f143c638..a6973aa19 100644 --- a/Library/Homebrew/test/utils/curl_spec.rb +++ b/Library/Homebrew/test/utils/curl_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/curl" describe "curl" do diff --git a/Library/Homebrew/test/utils/fork_spec.rb b/Library/Homebrew/test/utils/fork_spec.rb index 0af9b8f3a..fa1d27fb3 100644 --- a/Library/Homebrew/test/utils/fork_spec.rb +++ b/Library/Homebrew/test/utils/fork_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/fork" describe Utils do diff --git a/Library/Homebrew/test/utils/git_spec.rb b/Library/Homebrew/test/utils/git_spec.rb index 9cb4206f0..4160c1587 100644 --- a/Library/Homebrew/test/utils/git_spec.rb +++ b/Library/Homebrew/test/utils/git_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/git" describe Git do diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb index 6e4b0cd4b..936ae03ae 100644 --- a/Library/Homebrew/test/utils/github_spec.rb +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/github" describe GitHub do diff --git a/Library/Homebrew/test/utils/popen_spec.rb b/Library/Homebrew/test/utils/popen_spec.rb index d1ae12d1c..c3f6027cf 100644 --- a/Library/Homebrew/test/utils/popen_spec.rb +++ b/Library/Homebrew/test/utils/popen_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/popen" describe Utils do diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index f92afd4f2..b3a0ae8f7 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/shell" describe Utils::Shell do diff --git a/Library/Homebrew/test/utils/svn_spec.rb b/Library/Homebrew/test/utils/svn_spec.rb index 69dd9565a..af8b28757 100644 --- a/Library/Homebrew/test/utils/svn_spec.rb +++ b/Library/Homebrew/test/utils/svn_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/svn" describe Utils do diff --git a/Library/Homebrew/test/utils/tty_spec.rb b/Library/Homebrew/test/utils/tty_spec.rb index 27d18e284..32b259e2b 100644 --- a/Library/Homebrew/test/utils/tty_spec.rb +++ b/Library/Homebrew/test/utils/tty_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe Tty do describe "::strip_ansi" do it "removes ANSI escape codes from a string" do diff --git a/Library/Homebrew/test/utils/user_spec.rb b/Library/Homebrew/test/utils/user_spec.rb index 50d7ee42b..c26862dc4 100644 --- a/Library/Homebrew/test/utils/user_spec.rb +++ b/Library/Homebrew/test/utils/user_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/user" describe User do diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index 7e6bb9dd2..d27290ef4 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + describe "globally-scoped helper methods" do let(:dir) { mktmpdir } diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb index 9edffeac3..f5ae3cb65 100644 --- a/Library/Homebrew/test/version_spec.rb +++ b/Library/Homebrew/test/version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "version" describe Version do diff --git a/Library/Homebrew/test/x11_requirement_spec.rb b/Library/Homebrew/test/x11_requirement_spec.rb index 342394bb3..c4b9ce8dd 100644 --- a/Library/Homebrew/test/x11_requirement_spec.rb +++ b/Library/Homebrew/test/x11_requirement_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "requirements/x11_requirement" describe X11Requirement do diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index 26c61e156..8d56e405e 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy module Magic # length of the longest regex (currently Tar) diff --git a/Library/Homebrew/unpack_strategy/bazaar.rb b/Library/Homebrew/unpack_strategy/bazaar.rb index 684a5cad2..fd3d1bd7a 100644 --- a/Library/Homebrew/unpack_strategy/bazaar.rb +++ b/Library/Homebrew/unpack_strategy/bazaar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "directory" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/bzip2.rb b/Library/Homebrew/unpack_strategy/bzip2.rb index 0a8e26925..fd9592d78 100644 --- a/Library/Homebrew/unpack_strategy/bzip2.rb +++ b/Library/Homebrew/unpack_strategy/bzip2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Bzip2 include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/cab.rb b/Library/Homebrew/unpack_strategy/cab.rb index f2510d087..9de498ce0 100644 --- a/Library/Homebrew/unpack_strategy/cab.rb +++ b/Library/Homebrew/unpack_strategy/cab.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Cab include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/compress.rb b/Library/Homebrew/unpack_strategy/compress.rb index d435b9a59..cf9101f72 100644 --- a/Library/Homebrew/unpack_strategy/compress.rb +++ b/Library/Homebrew/unpack_strategy/compress.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "tar" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/cvs.rb b/Library/Homebrew/unpack_strategy/cvs.rb index 4ec2b03c2..7991c674c 100644 --- a/Library/Homebrew/unpack_strategy/cvs.rb +++ b/Library/Homebrew/unpack_strategy/cvs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "directory" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/directory.rb b/Library/Homebrew/unpack_strategy/directory.rb index cbfc75b54..66353f279 100644 --- a/Library/Homebrew/unpack_strategy/directory.rb +++ b/Library/Homebrew/unpack_strategy/directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Directory include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/dmg.rb b/Library/Homebrew/unpack_strategy/dmg.rb index 6130d9b42..085eec617 100644 --- a/Library/Homebrew/unpack_strategy/dmg.rb +++ b/Library/Homebrew/unpack_strategy/dmg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tempfile" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/executable.rb b/Library/Homebrew/unpack_strategy/executable.rb index 3378bb6ff..82a84e144 100644 --- a/Library/Homebrew/unpack_strategy/executable.rb +++ b/Library/Homebrew/unpack_strategy/executable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/fossil.rb b/Library/Homebrew/unpack_strategy/fossil.rb index 3bcfbd472..6b7a5d931 100644 --- a/Library/Homebrew/unpack_strategy/fossil.rb +++ b/Library/Homebrew/unpack_strategy/fossil.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Fossil include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/generic_unar.rb b/Library/Homebrew/unpack_strategy/generic_unar.rb index a0c9fe40d..347dd6ac1 100644 --- a/Library/Homebrew/unpack_strategy/generic_unar.rb +++ b/Library/Homebrew/unpack_strategy/generic_unar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class GenericUnar include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/git.rb b/Library/Homebrew/unpack_strategy/git.rb index 2f5768ca5..4aefb640d 100644 --- a/Library/Homebrew/unpack_strategy/git.rb +++ b/Library/Homebrew/unpack_strategy/git.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "directory" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/gzip.rb b/Library/Homebrew/unpack_strategy/gzip.rb index 930fed4ed..5db11be72 100644 --- a/Library/Homebrew/unpack_strategy/gzip.rb +++ b/Library/Homebrew/unpack_strategy/gzip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Gzip include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/jar.rb b/Library/Homebrew/unpack_strategy/jar.rb index 90d4f6485..9827cc62c 100644 --- a/Library/Homebrew/unpack_strategy/jar.rb +++ b/Library/Homebrew/unpack_strategy/jar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/lha.rb b/Library/Homebrew/unpack_strategy/lha.rb index 2d92e6554..052701320 100644 --- a/Library/Homebrew/unpack_strategy/lha.rb +++ b/Library/Homebrew/unpack_strategy/lha.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Lha include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/lua_rock.rb b/Library/Homebrew/unpack_strategy/lua_rock.rb index fe3d8f130..70759c981 100644 --- a/Library/Homebrew/unpack_strategy/lua_rock.rb +++ b/Library/Homebrew/unpack_strategy/lua_rock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/lzip.rb b/Library/Homebrew/unpack_strategy/lzip.rb index 2a6792be1..121dea7a7 100644 --- a/Library/Homebrew/unpack_strategy/lzip.rb +++ b/Library/Homebrew/unpack_strategy/lzip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Lzip include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/lzma.rb b/Library/Homebrew/unpack_strategy/lzma.rb index a611db87d..257fb7598 100644 --- a/Library/Homebrew/unpack_strategy/lzma.rb +++ b/Library/Homebrew/unpack_strategy/lzma.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Lzma include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/mercurial.rb b/Library/Homebrew/unpack_strategy/mercurial.rb index 18088954d..4799a5e0c 100644 --- a/Library/Homebrew/unpack_strategy/mercurial.rb +++ b/Library/Homebrew/unpack_strategy/mercurial.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "directory" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb b/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb index 50647869e..869c0debb 100644 --- a/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb +++ b/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/otf.rb b/Library/Homebrew/unpack_strategy/otf.rb index a540f7779..ff4c20662 100644 --- a/Library/Homebrew/unpack_strategy/otf.rb +++ b/Library/Homebrew/unpack_strategy/otf.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/p7zip.rb b/Library/Homebrew/unpack_strategy/p7zip.rb index 9241d9dc3..6110a275b 100644 --- a/Library/Homebrew/unpack_strategy/p7zip.rb +++ b/Library/Homebrew/unpack_strategy/p7zip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class P7Zip include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/pax.rb b/Library/Homebrew/unpack_strategy/pax.rb index c4194879f..bd1fe0d1e 100644 --- a/Library/Homebrew/unpack_strategy/pax.rb +++ b/Library/Homebrew/unpack_strategy/pax.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Pax include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/pkg.rb b/Library/Homebrew/unpack_strategy/pkg.rb index f837d4933..10ae04024 100644 --- a/Library/Homebrew/unpack_strategy/pkg.rb +++ b/Library/Homebrew/unpack_strategy/pkg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/rar.rb b/Library/Homebrew/unpack_strategy/rar.rb index 890c04460..64604792a 100644 --- a/Library/Homebrew/unpack_strategy/rar.rb +++ b/Library/Homebrew/unpack_strategy/rar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Rar include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/self_extracting_executable.rb b/Library/Homebrew/unpack_strategy/self_extracting_executable.rb index a502cce54..298070fde 100644 --- a/Library/Homebrew/unpack_strategy/self_extracting_executable.rb +++ b/Library/Homebrew/unpack_strategy/self_extracting_executable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "generic_unar" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/sit.rb b/Library/Homebrew/unpack_strategy/sit.rb index c719de4a0..9f537d64e 100644 --- a/Library/Homebrew/unpack_strategy/sit.rb +++ b/Library/Homebrew/unpack_strategy/sit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "generic_unar" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/subversion.rb b/Library/Homebrew/unpack_strategy/subversion.rb index 0a2f922ba..c9dbfdc64 100644 --- a/Library/Homebrew/unpack_strategy/subversion.rb +++ b/Library/Homebrew/unpack_strategy/subversion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "directory" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/tar.rb b/Library/Homebrew/unpack_strategy/tar.rb index 3ef8fe7b9..70c3198d3 100644 --- a/Library/Homebrew/unpack_strategy/tar.rb +++ b/Library/Homebrew/unpack_strategy/tar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Tar include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/ttf.rb b/Library/Homebrew/unpack_strategy/ttf.rb index e5f0540c0..c3107d659 100644 --- a/Library/Homebrew/unpack_strategy/ttf.rb +++ b/Library/Homebrew/unpack_strategy/ttf.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "uncompressed" module UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/uncompressed.rb b/Library/Homebrew/unpack_strategy/uncompressed.rb index 4ce44acc3..be11b25c2 100644 --- a/Library/Homebrew/unpack_strategy/uncompressed.rb +++ b/Library/Homebrew/unpack_strategy/uncompressed.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Uncompressed include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/xar.rb b/Library/Homebrew/unpack_strategy/xar.rb index ada4386d3..29d0e7178 100644 --- a/Library/Homebrew/unpack_strategy/xar.rb +++ b/Library/Homebrew/unpack_strategy/xar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Xar include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/xz.rb b/Library/Homebrew/unpack_strategy/xz.rb index 0ce1a899c..a0ce3fbc1 100644 --- a/Library/Homebrew/unpack_strategy/xz.rb +++ b/Library/Homebrew/unpack_strategy/xz.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Xz include UnpackStrategy diff --git a/Library/Homebrew/unpack_strategy/zip.rb b/Library/Homebrew/unpack_strategy/zip.rb index 812419909..f7da62019 100644 --- a/Library/Homebrew/unpack_strategy/zip.rb +++ b/Library/Homebrew/unpack_strategy/zip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Zip include UnpackStrategy diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 2305367f8..e68d56178 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "emoji" require "utils/analytics" require "utils/curl" @@ -111,8 +113,9 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call break end - message = "Calling #{method} is #{verb}! #{replacement_message}" + message = +"Calling #{method} is #{verb}! #{replacement_message}" message << tap_message if tap_message + message.freeze if ARGV.homebrew_developer? || disable || Homebrew.raise_deprecation_exceptions? exception = MethodDeprecatedError.new(message) @@ -150,12 +153,12 @@ end def pretty_duration(s) s = s.to_i - res = "" + res = +"" if s > 59 m = s / 60 s %= 60 - res = "#{m} #{"minute".pluralize(m)}" + res = +"#{m} #{"minute".pluralize(m)}" return res.freeze if s.zero? res << " " diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index 31174451e..df025a2ca 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + require "erb" module Utils module Analytics class << self def custom_prefix_label - "custom-prefix".freeze + "custom-prefix" end def clear_os_prefix_ci diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb index 832b815ff..cb2a789ce 100644 --- a/Library/Homebrew/utils/bottles.rb +++ b/Library/Homebrew/utils/bottles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tab" require "extend/ARGV" diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index d66fec1dc..d801dce90 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" def curl_executable diff --git a/Library/Homebrew/utils/fork.rb b/Library/Homebrew/utils/fork.rb index a505835de..df67c7cf4 100644 --- a/Library/Homebrew/utils/fork.rb +++ b/Library/Homebrew/utils/fork.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fcntl" require "socket" diff --git a/Library/Homebrew/utils/formatter.rb b/Library/Homebrew/utils/formatter.rb index f8d012fb3..9cfb74c8d 100644 --- a/Library/Homebrew/utils/formatter.rb +++ b/Library/Homebrew/utils/formatter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/tty" module Formatter diff --git a/Library/Homebrew/utils/gems.rb b/Library/Homebrew/utils/gems.rb index 04beb2c8c..2e86e4f51 100644 --- a/Library/Homebrew/utils/gems.rb +++ b/Library/Homebrew/utils/gems.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Never `require` anything in this file (except English). It needs to be able to # work as the first item in `brew.rb` so we can load gems with Bundler when # needed before anything else is loaded (e.g. `json`). @@ -8,12 +10,12 @@ module Homebrew module_function def ruby_bindir - "#{RbConfig::CONFIG["prefix"]}/bin".freeze + "#{RbConfig::CONFIG["prefix"]}/bin" end def gem_user_bindir require "rubygems" - "#{Gem.user_dir}/bin".freeze + "#{Gem.user_dir}/bin" end def ohai_if_defined(message) @@ -88,7 +90,7 @@ module Homebrew ENV["BUNDLE_GEMFILE"] = "#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/Gemfile" @bundle_installed ||= begin - bundle = "#{gem_user_bindir}/bundle".freeze + bundle = "#{gem_user_bindir}/bundle" bundle_check_output = `#{bundle} check 2>&1` bundle_check_failed = !$CHILD_STATUS.exitstatus.zero? diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb index 875b07dc1..ea479cc79 100644 --- a/Library/Homebrew/utils/git.rb +++ b/Library/Homebrew/utils/git.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open3" module Git diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index d12aaa069..9a4749bd0 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + require "uri" require "tempfile" module GitHub module_function - API_URL = "https://api.github.com".freeze + API_URL = "https://api.github.com" CREATE_GIST_SCOPES = ["gist"].freeze CREATE_ISSUE_FORK_OR_PR_SCOPES = ["public_repo"].freeze @@ -12,7 +14,7 @@ module GitHub ALL_SCOPES_URL = Formatter.url( "https://github.com/settings/tokens/new?scopes=#{ALL_SCOPES.join(",")}&description=Homebrew", ).freeze - PR_ENV_KEY = "HOMEBREW_NEW_FORMULA_PULL_REQUEST_URL".freeze + PR_ENV_KEY = "HOMEBREW_NEW_FORMULA_PULL_REQUEST_URL" PR_ENV = ENV[PR_ENV_KEY] class Error < RuntimeError diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 67881953d..3bce563f7 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + module Utils class InreplaceError < RuntimeError def initialize(errors) - formatted_errors = errors.reduce("inreplace failed\n") do |s, (path, errs)| + formatted_errors = errors.reduce(+"inreplace failed\n") do |s, (path, errs)| s << "#{path}:\n" << errs.map { |e| " #{e}\n" }.join end - super formatted_errors + super formatted_errors.freeze end end diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index a40467334..7c24b13b1 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Utils module Link module_function diff --git a/Library/Homebrew/utils/popen.rb b/Library/Homebrew/utils/popen.rb index fe8004231..f9d189219 100644 --- a/Library/Homebrew/utils/popen.rb +++ b/Library/Homebrew/utils/popen.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Utils def self.popen_read(*args, **options, &block) popen(args, "rb", options, &block) diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 4444f24d4..abab9eed6 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Utils module Shell module_function diff --git a/Library/Homebrew/utils/svn.rb b/Library/Homebrew/utils/svn.rb index 23c9fe13d..6d5d03885 100644 --- a/Library/Homebrew/utils/svn.rb +++ b/Library/Homebrew/utils/svn.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Utils def self.clear_svn_version_cache remove_instance_variable(:@svn) if instance_variable_defined?(:@svn) diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index 6d3558466..76e2867dd 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Tty module_function diff --git a/Library/Homebrew/utils/user.rb b/Library/Homebrew/utils/user.rb index e572a0a8e..cf93d088d 100644 --- a/Library/Homebrew/utils/user.rb +++ b/Library/Homebrew/utils/user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" require "etc" diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index e2af0b3b6..b24d34083 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "version/null" class Version diff --git a/Library/Homebrew/version/null.rb b/Library/Homebrew/version/null.rb index b4e480be1..c8731b0a0 100644 --- a/Library/Homebrew/version/null.rb +++ b/Library/Homebrew/version/null.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Version NULL = Class.new do include Comparable @@ -49,7 +51,7 @@ class Version alias_method :to_str, :to_s def inspect - "#".freeze + "#" end end.new.freeze end