diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index b63cebb006..10fecf1579 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -70,7 +70,7 @@ class BuildEnvironment keys.each do |key| value = env.fetch(key) - string = +"#{key}: #{value}" + string = "#{key}: #{value}" case key when "CC", "CXX", "LD" string << " => #{Pathname.new(value).realpath}" if value.present? && File.symlink?(value) diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 1b9bde4b5d..36b7aea555 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -125,8 +125,8 @@ 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(Dir.home).freeze } unless sudo paths = paths.map { |elt| Pathname(elt) }.select(&:exist?) diff --git a/Library/Homebrew/cask/exceptions.rb b/Library/Homebrew/cask/exceptions.rb index 6430517a48..7b681704fc 100644 --- a/Library/Homebrew/cask/exceptions.rb +++ b/Library/Homebrew/cask/exceptions.rb @@ -193,7 +193,7 @@ module Cask sig { returns(String) } def to_s - s = +"Failed to quarantine #{path}." + s = "Failed to quarantine #{path}." unless reason.empty? s << " Here's the reason:\n" @@ -209,7 +209,7 @@ module Cask class CaskQuarantinePropagationError < CaskQuarantineError sig { returns(String) } def to_s - s = +"Failed to quarantine one or more files within #{path}." + s = "Failed to quarantine one or more files within #{path}." unless reason.empty? s << " Here's the reason:\n" @@ -225,7 +225,7 @@ module Cask class CaskQuarantineReleaseError < CaskQuarantineError sig { returns(String) } def to_s - s = +"Failed to release #{path} from quarantine." + s = "Failed to release #{path} from quarantine." unless reason.empty? s << " Here's the reason:\n" diff --git a/Library/Homebrew/cask/info.rb b/Library/Homebrew/cask/info.rb index 11b6149428..e2e6b3f4de 100644 --- a/Library/Homebrew/cask/info.rb +++ b/Library/Homebrew/cask/info.rb @@ -9,7 +9,7 @@ module Cask def self.get_info(cask) require "cask/installer" - output = +"#{title_info(cask)}\n" + output = "#{title_info(cask)}\n" output << "#{Formatter.url(cask.homepage)}\n" if cask.homepage deprecate_disable = DeprecateDisable.message(cask) output << "#{deprecate_disable.capitalize}\n" if deprecate_disable diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 729f014711..66bd4412c0 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -602,8 +602,8 @@ on_request: true) next if dep_tap.blank? || (dep_tap.allowed_by_env? && !dep_tap.forbidden_by_env?) dep_full_name = cask_or_formula.full_name - error_message = +"The installation of #{@cask} has a dependency #{dep_full_name}\n" \ - "from the #{dep_tap} tap but #{owner} " + error_message = "The installation of #{@cask} has a dependency #{dep_full_name}\n" \ + "from the #{dep_tap} tap but #{owner} " error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless dep_tap.allowed_by_env? error_message << " and\n" if !dep_tap.allowed_by_env? && dep_tap.forbidden_by_env? error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if dep_tap.forbidden_by_env? @@ -616,8 +616,8 @@ on_request: true) cask_tap = @cask.tap return if cask_tap.blank? || (cask_tap.allowed_by_env? && !cask_tap.forbidden_by_env?) - error_message = +"The installation of #{@cask.full_name} has the tap #{cask_tap}\n" \ - "but #{owner} " + error_message = "The installation of #{@cask.full_name} has the tap #{cask_tap}\n" \ + "but #{owner} " error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless cask_tap.allowed_by_env? error_message << " and\n" if !cask_tap.allowed_by_env? && cask_tap.forbidden_by_env? error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if cask_tap.forbidden_by_env? diff --git a/Library/Homebrew/cask/utils.rb b/Library/Homebrew/cask/utils.rb index dff67823d8..b90dbfdad6 100644 --- a/Library/Homebrew/cask/utils.rb +++ b/Library/Homebrew/cask/utils.rb @@ -128,7 +128,7 @@ module Cask end def self.method_missing_message(method, token, section = nil) - message = +"Unexpected method '#{method}' called " + message = "Unexpected method '#{method}' called " message << "during #{section} " if section message << "on Cask #{token}." diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index f01c6774d8..4a233a0acd 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -134,7 +134,7 @@ class Caveats #{root_dir}/etc/bash_completion.d 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.freeze diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index dd3b5e71b0..25407fa07a 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -92,7 +92,7 @@ module Homebrew sig { params(formula: Formula, with_hostname: T::Boolean).returns(String) } def brief_build_info(formula, with_hostname:) build_time_string = formula.logs.ctime.strftime("%Y-%m-%d %H:%M:%S") - string = +<<~EOS + string = <<~EOS Homebrew build logs for #{formula.full_name} on #{OS_VERSION} EOS if with_hostname diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index baede0cbc3..36a7a3ff43 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -562,7 +562,7 @@ class UnbottledError < RuntimeError def initialize(formulae) require "utils" - msg = +<<~EOS + msg = <<~EOS The following #{Utils.pluralize("formula", formulae.count, plural: "e")} cannot be installed from #{Utils.pluralize("bottle", formulae.count)} and must be built from source. #{formulae.to_sentence} @@ -686,7 +686,7 @@ class ErrorDuringExecution < RuntimeError raise ArgumentError, "Status neither has `exitstatus` nor `termsig`." end - s = +"Failure while executing; `#{redacted_cmd}` #{reason}." + s = "Failure while executing; `#{redacted_cmd}` #{reason}." if Array(output).present? format_output_line = lambda do |type_line| diff --git a/Library/Homebrew/extend/array.rb b/Library/Homebrew/extend/array.rb index e68b1277a1..7382084b69 100644 --- a/Library/Homebrew/extend/array.rb +++ b/Library/Homebrew/extend/array.rb @@ -98,9 +98,9 @@ class Array # This is not typesafe, if the array contains a BasicObject +T.unsafe(self[0]).to_s when 2 - +"#{self[0]}#{two_words_connector}#{self[1]}" + "#{self[0]}#{two_words_connector}#{self[1]}" else - +"#{T.must(self[0...-1]).join(words_connector)}#{last_word_connector}#{self[-1]}" + "#{T.must(self[0...-1]).join(words_connector)}#{last_word_connector}#{self[-1]}" end end end diff --git a/Library/Homebrew/extend/kernel.rb b/Library/Homebrew/extend/kernel.rb index e248325ac0..7bf0c0d9da 100644 --- a/Library/Homebrew/extend/kernel.rb +++ b/Library/Homebrew/extend/kernel.rb @@ -156,8 +156,8 @@ module Kernel require "tap" - tap = Tap.fetch(match[:user], match[:repository]) - tap_message = +"\nPlease report this issue to the #{tap.full_name} tap" + tap = Tap.fetch(match[:user], match[:repo]) + tap_message = "\nPlease report this issue to the #{tap.full_name} tap" tap_message += " (not Homebrew/brew or Homebrew/homebrew-core)" unless tap.official? tap_message += ", or even better, submit a PR to fix it" if replacement tap_message << ":\n #{line.sub(/^(.*:\d+):.*$/, '\1')}\n\n" @@ -166,7 +166,7 @@ module Kernel file, line, = backtrace.first.split(":") line = line.to_i if line.present? - message = +"Calling #{method} is #{verb}! #{replacement_message}" + message = "Calling #{method} is #{verb}! #{replacement_message}" message << tap_message if tap_message message.freeze diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 74ab4a987b..30072c2298 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -4196,7 +4196,7 @@ class Formula when :default_prefix lambda do |_| T.bind(self, PourBottleCheck) - reason(+<<~EOS) + reason(<<~EOS) The bottle (and many others) needs to be installed into #{Homebrew::DEFAULT_PREFIX}. EOS satisfy { HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX } diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index e09a55a869..47bdd56e61 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -1503,8 +1503,8 @@ on_request: installed_on_request?, options:) dep_tap = dep.tap next if dep_tap.blank? || (dep_tap.allowed_by_env? && !dep_tap.forbidden_by_env?) - error_message = +"The installation of #{formula.name} has a dependency #{dep.name}\n" \ - "from the #{dep_tap} tap but #{owner} " + error_message = "The installation of #{formula.name} has a dependency #{dep.name}\n" \ + "from the #{dep_tap} tap but #{owner} " error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless dep_tap.allowed_by_env? error_message << " and\n" if !dep_tap.allowed_by_env? && dep_tap.forbidden_by_env? error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if dep_tap.forbidden_by_env? @@ -1519,8 +1519,8 @@ on_request: installed_on_request?, options:) formula_tap = formula.tap return if formula_tap.blank? || (formula_tap.allowed_by_env? && !formula_tap.forbidden_by_env?) - error_message = +"The installation of #{formula.full_name} has the tap #{formula_tap}\n" \ - "but #{owner} " + error_message = "The installation of #{formula.full_name} has the tap #{formula_tap}\n" \ + "but #{owner} " error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless formula_tap.allowed_by_env? error_message << " and\n" if !formula_tap.allowed_by_env? && formula_tap.forbidden_by_env? error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if formula_tap.forbidden_by_env? diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index 9d77eee7e0..70ccfe07c2 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -149,7 +149,7 @@ class GitHubRunnerMatrix use_github_runner ||= @dependent_matrix use_github_runner &&= runner_timeout <= GITHUB_ACTIONS_RUNNER_TIMEOUT - ephemeral_suffix = +"-#{github_run_id}" + ephemeral_suffix = "-#{github_run_id}" ephemeral_suffix << "-deps" if @dependent_matrix ephemeral_suffix << "-long" if runner_timeout == GITHUB_ACTIONS_LONG_TIMEOUT ephemeral_suffix.freeze diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index eaee138af9..d2502c753b 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -459,7 +459,7 @@ class Tap "\n#{contact}" end - error_message = +"The installation of the #{full_name} was requested but #{owner}\n" + error_message = "The installation of the #{full_name} was requested but #{owner}\n" error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless allowed_by_env? error_message << " and\n" if !allowed_by_env? && forbidden_by_env? error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if forbidden_by_env? diff --git a/Library/Homebrew/test/installed_dependents_spec.rb b/Library/Homebrew/test/installed_dependents_spec.rb index 35823954ee..f10228c7e5 100644 --- a/Library/Homebrew/test/installed_dependents_spec.rb +++ b/Library/Homebrew/test/installed_dependents_spec.rb @@ -175,7 +175,7 @@ RSpec.describe InstalledDependents do end def stub_cask_name(name, version, dependency) - c = Cask::CaskLoader.load(+<<-RUBY) + c = Cask::CaskLoader.load(<<-RUBY) cask "#{name}" do version "#{version}" diff --git a/Library/Homebrew/test/keg_relocate/relocation_spec.rb b/Library/Homebrew/test/keg_relocate/relocation_spec.rb index 2faca61856..a4e0f15be5 100644 --- a/Library/Homebrew/test/keg_relocate/relocation_spec.rb +++ b/Library/Homebrew/test/keg_relocate/relocation_spec.rb @@ -39,7 +39,7 @@ RSpec.describe Keg::Relocation do relocation.replace_text(text) expect(text).to eq "foo" - text = +<<~TEXT + text = <<~TEXT #{prefix}/foo #{cellar}/foo foo#{prefix}/bar diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index e24b78af61..bcc2bcbe3b 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -80,7 +80,7 @@ module GitHub class AuthenticationFailedError < Error def initialize(credentials_type, github_message) @github_message = github_message - message = +"GitHub API Error: #{github_message}\n" + message = "GitHub API Error: #{github_message}\n" message << case credentials_type when :github_cli_token <<~EOS