diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 92a5c99971..6e0c581902 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -153,13 +153,17 @@ class Build end if args.interactive? ohai "Entering interactive mode" - puts "Type `exit` to return and finalize the installation." - puts "Install to this prefix: #{formula.prefix}" + puts <<~EOS + Type `exit` to return and finalize the installation. + Install to this prefix: #{formula.prefix} + EOS if args.git? - puts "This directory is now a Git repo. Make your changes and then use:" - puts " git diff | pbcopy" - puts "to copy the diff to the clipboard." + puts <<~EOS + This directory is now a Git repository. Make your changes and then use: + git diff | pbcopy + to copy the diff to the clipboard. + EOS end interactive_shell(formula) diff --git a/Library/Homebrew/cask/artifact/installer.rb b/Library/Homebrew/cask/artifact/installer.rb index c2fa6543c5..b9d181d0e7 100644 --- a/Library/Homebrew/cask/artifact/installer.rb +++ b/Library/Homebrew/cask/artifact/installer.rb @@ -23,7 +23,7 @@ module Cask puts <<~EOS To complete the installation of Cask #{cask}, you must also run the installer at: - '#{cask.staged_path.join(path)}' + #{cask.staged_path.join(path)} EOS end end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 08e7e09675..7a4b36c0a7 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -185,7 +185,8 @@ module Homebrew if !args.HEAD? && f.stable.nil? odie <<~EOS #{f.full_name} is a head-only formula - Install with `brew install --HEAD #{f.full_name}` + To install it, run: + brew install --HEAD #{f.full_name} EOS end @@ -208,14 +209,16 @@ module Homebrew optlinked_version = Keg.for(f.opt_prefix).version onoe <<~EOS #{f.full_name} #{optlinked_version} is already installed - To upgrade to #{f.version}, run `brew upgrade #{f.full_name}` + To upgrade to #{f.version}, run: + brew upgrade #{f.full_name} EOS elsif args.only_dependencies? installed_formulae << f elsif !args.quiet? opoo <<~EOS #{f.full_name} #{f.pkg_version} is already installed and up-to-date - To reinstall #{f.pkg_version}, run `brew reinstall #{f.name}` + To reinstall #{f.pkg_version}, run: + brew reinstall #{f.name} EOS end elsif (args.HEAD? && new_head_installed) || prefix_installed @@ -243,7 +246,8 @@ module Homebrew elsif !f.linked? || f.keg_only? msg = <<~EOS #{msg}, it's just not linked - You can use `brew link #{f}` to link this version. + To link this version, run: + brew link #{f} EOS elsif args.only_dependencies? msg = nil @@ -254,7 +258,8 @@ module Homebrew else <<~EOS #{msg} and up-to-date - To reinstall #{f.pkg_version}, run `brew reinstall #{f.name}` + To reinstall #{f.pkg_version}, run: + brew reinstall #{f.name} EOS end end @@ -264,7 +269,8 @@ module Homebrew if !old_formula.linked? && !old_formula.keg_only? msg = <<~EOS #{msg}, it's just not linked. - You can use `brew link #{old_formula.full_name}` to link this version. + To link this version, run: + brew link #{old_formula.full_name} EOS elsif args.quiet? msg = nil @@ -275,8 +281,10 @@ module Homebrew # but not migrated one. If --force is passed then install anyway. opoo <<~EOS #{f.oldname} is already installed, it's just not migrated - You can migrate this formula with `brew migrate #{f}` - Or you can force install it with `brew install #{f} --force` + To migrate this formula, run: + brew migrate #{f} + Or to force-install it, run: + brew install #{f} --force EOS else # If none of the above is true and the formula is linked, then diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index f9ee8b6ff8..ffbc2feab4 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -116,9 +116,11 @@ module Homebrew end ohai title - puts "Current formula version: #{current_version}" - puts "Latest Repology version: #{repology_latest}" - puts "Latest livecheck version: #{livecheck_latest}" - puts "Open pull requests: #{pull_requests}" + puts <<~EOS + Current formula version: #{current_version} + Latest Repology version: #{repology_latest} + Latest livecheck version: #{livecheck_latest} + Open pull requests: #{pull_requests} + EOS end end diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 2fc25c2e28..a7efb2582a 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -40,10 +40,12 @@ module Homebrew args = irb_args.parse(ARGV.dup.freeze) if args.examples? - puts "'v8'.f # => instance of the v8 formula" - puts ":hub.f.latest_version_installed?" - puts ":lua.f.methods - 1.methods" - puts ":mpd.f.recursive_dependencies.reject(&:installed?)" + puts <<~EOS + 'v8'.f # => instance of the v8 formula + :hub.f.latest_version_installed? + :lua.f.methods - 1.methods + :mpd.f.recursive_dependencies.reject(&:installed?) + EOS return end diff --git a/Library/Homebrew/dev-cmd/pr-upload.rb b/Library/Homebrew/dev-cmd/pr-upload.rb index a710ab7a96..09fb40e08c 100644 --- a/Library/Homebrew/dev-cmd/pr-upload.rb +++ b/Library/Homebrew/dev-cmd/pr-upload.rb @@ -81,8 +81,11 @@ module Homebrew else "Bintray" end - puts "brew #{bottle_args.join " "}" - puts "Upload bottles described by these JSON files to #{service}:\n #{json_files.join("\n ")}" + puts <<~EOS + brew #{bottle_args.join " "} + Upload bottles described by these JSON files to #{service}: + #{json_files.join("\n ")} + EOS return end diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 3d8063a569..227ea0a9c7 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -95,8 +95,10 @@ module Homebrew end end - puts "Start commit: #{start_commit}" - puts " End commit: #{end_commit}" + puts <<~EOS + Start commit: #{start_commit} + End commit: #{end_commit} + EOS mkdir "update-test" chdir "update-test" do diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 60ac07a04a..6f26f2db8d 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -335,7 +335,8 @@ module Homebrew <<~EOS #{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set. - Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal. + To set it, run the following command: + sudo chmod +t #{HOMEBREW_TEMP} EOS end alias generic_check_tmpdir_sticky_bit check_tmpdir_sticky_bit @@ -897,7 +898,8 @@ module Homebrew <<~EOS The staging path #{user_tilde(path.to_s)} is not writable by the current user. - To fix, run \'sudo chown -R $(whoami):staff #{user_tilde(path.to_s)}' + To fix, run: + sudo chown -R $(whoami):staff #{user_tilde(path.to_s)} EOS end @@ -970,12 +972,14 @@ module Homebrew if result.include? "Python 2.7" <<~EOS Your Python installation has a broken version of setuptools. - To fix, reinstall macOS or run 'sudo /usr/bin/python -m pip install -I setuptools'. + To fix, reinstall macOS or run: + sudo /usr/bin/python -m pip install -I setuptools EOS else <<~EOS The system Python version is wrong. - To fix, run 'defaults write com.apple.versioner.python Version 2.7'. + To fix, run: + defaults write com.apple.versioner.python Version 2.7 EOS end elsif result.stderr.include? "pkg_resources.DistributionNotFound" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index dd2e64d76d..8722df1f67 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -362,14 +362,16 @@ class FormulaInstaller EOS if formula.outdated? && !formula.head? message += <<~EOS - To upgrade to #{formula.pkg_version}, run `brew upgrade #{formula.full_name}`. + To upgrade to #{formula.pkg_version}, run: + brew upgrade #{formula.full_name} EOS elsif only_deps? message = nil else # some other version is already installed *and* linked message += <<~EOS - To install #{formula.pkg_version}, first run `brew unlink #{formula.name}`. + To install #{formula.pkg_version}, first run: + brew unlink #{formula.name} EOS end raise CannotInstallFormulaError, message if message @@ -805,7 +807,8 @@ class FormulaInstaller if build_bottle? ohai "Not running post_install as we're building a bottle" - puts "You can run it manually using `brew postinstall #{formula.full_name}`" + puts "You can run it manually using:" + puts " brew postinstall #{formula.full_name}" else post_install end @@ -1097,7 +1100,8 @@ class FormulaInstaller end rescue Exception => e # rubocop:disable Lint/RescueException opoo "The post-install step did not complete successfully" - puts "You can try again using `brew postinstall #{formula.full_name}`" + puts "You can try again using:" + puts " brew postinstall #{formula.full_name}" odebug e, e.backtrace, always_display: Homebrew::EnvConfig.developer? Homebrew.failed = true @show_summary_heading = true diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index e065a2de63..67bff176ad 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -17,8 +17,8 @@ class Migrator class MigrationNeededError < RuntimeError def initialize(formula) super <<~EOS - #{formula.oldname} was renamed to #{formula.name} and needs to be migrated. - Please run `brew migrate #{formula.oldname}` + #{formula.oldname} was renamed to #{formula.name} and needs to be migrated by running: + brew migrate #{formula.oldname} EOS end end @@ -48,7 +48,8 @@ class Migrator super <<~EOS #{formula.name} from #{formula.tap} is given, but old name #{formula.oldname} was installed from #{tap || "path or url"}. - #{msg}To force migration use `brew migrate --force #{formula.oldname}`. + #{msg}To force migration, run: + brew migrate --force #{formula.oldname} EOS end end diff --git a/Library/Homebrew/test/cask/artifact/installer_spec.rb b/Library/Homebrew/test/cask/artifact/installer_spec.rb index 1feb893391..7f47a31d9c 100644 --- a/Library/Homebrew/test/cask/artifact/installer_spec.rb +++ b/Library/Homebrew/test/cask/artifact/installer_spec.rb @@ -18,7 +18,7 @@ describe Cask::Artifact::Installer, :cask do it "shows a message prompting to run the installer manually" do expect { installer.install_phase(command: command) - }.to output(%r{run the installer at:\s+'#{staged_path}/installer'}).to_stdout + }.to output(%r{run the installer at:\s+#{staged_path}/installer}).to_stdout end end diff --git a/Library/Homebrew/test/cask/installer_spec.rb b/Library/Homebrew/test/cask/installer_spec.rb index 6a9a1bc67a..f205bd7074 100644 --- a/Library/Homebrew/test/cask/installer_spec.rb +++ b/Library/Homebrew/test/cask/installer_spec.rb @@ -119,7 +119,7 @@ describe Cask::Installer, :cask do ==> Installing Cask with-installer-manual To complete the installation of Cask with-installer-manual, you must also run the installer at: - '#{with_installer_manual.staged_path.join("Caffeine.app")}' + #{with_installer_manual.staged_path.join("Caffeine.app")} 🍺 with-installer-manual was successfully installed! EOS ).to_stdout diff --git a/Library/Homebrew/uninstall.rb b/Library/Homebrew/uninstall.rb index 156d74478e..cabb18f627 100644 --- a/Library/Homebrew/uninstall.rb +++ b/Library/Homebrew/uninstall.rb @@ -50,8 +50,11 @@ module Homebrew if rack.directory? versions = rack.subdirs.map(&:basename) - puts "#{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed." - puts "Run `brew uninstall --force #{keg.name}` to remove all versions." + puts <<~EOS + #{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed. + To remove all versions, run: + brew uninstall --force #{keg.name} + EOS end next unless f diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index 8078390f60..c33d5ca335 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -36,7 +36,8 @@ module Utils Could not link: #{conflicts.join("\n")} - Please delete these paths and run `#{command}`. + Please delete these paths and run: + #{command} EOS end private_class_method :link_src_dst_dirs