From 9bee9ca5757d1c5f720787737fed6a534a620d72 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 15 Oct 2017 02:28:32 +0200 Subject: Use “squiggly” heredocs. --- .../cask/lib/hbc/artifact/abstract_uninstall.rb | 2 +- .../Homebrew/cask/lib/hbc/artifact/installer.rb | 2 +- Library/Homebrew/cask/lib/hbc/audit.rb | 2 +- Library/Homebrew/cask/lib/hbc/cask_loader.rb | 2 +- Library/Homebrew/cask/lib/hbc/cli.rb | 2 +- Library/Homebrew/cask/lib/hbc/cli/create.rb | 2 +- .../lib/hbc/cli/internal_audit_modified_casks.rb | 4 +- Library/Homebrew/cask/lib/hbc/cli/uninstall.rb | 2 +- Library/Homebrew/cask/lib/hbc/container/air.rb | 2 +- Library/Homebrew/cask/lib/hbc/dsl/caveats.rb | 78 +++++++++++----------- Library/Homebrew/cask/lib/hbc/exceptions.rb | 10 +-- Library/Homebrew/cask/lib/hbc/installer.rb | 4 +- Library/Homebrew/cask/lib/hbc/system_command.rb | 12 ++-- Library/Homebrew/cask/lib/hbc/utils.rb | 2 +- Library/Homebrew/cask/lib/hbc/version.rb | 2 +- 15 files changed, 64 insertions(+), 64 deletions(-) (limited to 'Library/Homebrew/cask') diff --git a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb index 3f63dae8f..7505ac49a 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb @@ -253,7 +253,7 @@ module Hbc end def trash_paths(*paths, command: nil, **_) - result = command.run!("/usr/bin/osascript", args: ["-e", <<-'EOS'.undent, *paths]) + result = command.run!("/usr/bin/osascript", args: ["-e", <<~'EOS', *paths]) on run argv repeat with i from 1 to (count argv) set item i of argv to (item i of argv as POSIX file) diff --git a/Library/Homebrew/cask/lib/hbc/artifact/installer.rb b/Library/Homebrew/cask/lib/hbc/artifact/installer.rb index 588bcabd5..5cd388c7f 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/installer.rb @@ -10,7 +10,7 @@ module Hbc module ManualInstaller def install_phase(**) - puts <<-EOS.undent + puts <<~EOS To complete the installation of Cask #{cask}, you must also run the installer at diff --git a/Library/Homebrew/cask/lib/hbc/audit.rb b/Library/Homebrew/cask/lib/hbc/audit.rb index bd25477ac..5180c5688 100644 --- a/Library/Homebrew/cask/lib/hbc/audit.rb +++ b/Library/Homebrew/cask/lib/hbc/audit.rb @@ -174,7 +174,7 @@ module Hbc add_warning "error retrieving appcast: #{result[:command_result].stderr}" else expected = cask.appcast.checkpoint - add_warning <<-EOS.undent unless expected == actual_checkpoint + add_warning <<~EOS unless expected == actual_checkpoint appcast checkpoint mismatch Expected: #{expected} Actual: #{actual_checkpoint} diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb index 08d457643..c32b35584 100644 --- a/Library/Homebrew/cask/lib/hbc/cask_loader.rb +++ b/Library/Homebrew/cask/lib/hbc/cask_loader.rb @@ -190,7 +190,7 @@ module Hbc when 2..Float::INFINITY loaders = possible_tap_casks.map(&FromTapPathLoader.method(:new)) - raise CaskError, <<-EOS.undent + raise CaskError, <<~EOS Cask #{ref} exists in multiple taps: #{loaders.map { |loader| " #{loader.tap}/#{loader.token}" }.join("\n")} EOS diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index d260be4e3..9283802d5 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -235,7 +235,7 @@ module Hbc end def purpose - puts <<-EOS.undent + puts <<~EOS brew-cask provides a friendly homebrew-style CLI workflow for the administration of macOS applications distributed as binaries. diff --git a/Library/Homebrew/cask/lib/hbc/cli/create.rb b/Library/Homebrew/cask/lib/hbc/cli/create.rb index 8de101092..e6ca3d7bc 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/create.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/create.rb @@ -21,7 +21,7 @@ module Hbc end def self.template(cask_token) - <<-EOS.undent + <<~EOS cask '#{cask_token}' do version '' sha256 '' diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb index b83224fb1..f06e2acc5 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb @@ -16,7 +16,7 @@ module Hbc super if args.count != 1 - raise ArgumentError, <<-EOS.undent + raise ArgumentError, <<~EOS This command requires exactly one argument. #{self.class.usage} @@ -31,7 +31,7 @@ module Hbc end def self.usage - <<-EOS.undent + <<~EOS Usage: brew cask _audit_modified_casks [options...] Given a range of Git commits, find any Casks that were modified and run `brew diff --git a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb index f2059605c..c962632bc 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb @@ -25,7 +25,7 @@ module Hbc single = versions.count == 1 - puts <<-EOS.undent + puts <<~EOS #{cask} #{versions.join(", ")} #{single ? "is" : "are"} still installed. Remove #{single ? "it" : "them all"} with `brew cask uninstall --force #{cask}`. EOS diff --git a/Library/Homebrew/cask/lib/hbc/container/air.rb b/Library/Homebrew/cask/lib/hbc/container/air.rb index 4b083e538..f2ebb6bcd 100644 --- a/Library/Homebrew/cask/lib/hbc/container/air.rb +++ b/Library/Homebrew/cask/lib/hbc/container/air.rb @@ -13,7 +13,7 @@ module Hbc def self.installer_cmd return @installer_cmd ||= INSTALLER_PATHNAME if installer_exist? - raise CaskError, <<-EOS.undent + raise CaskError, <<~EOS Adobe AIR runtime not present, try installing it via brew cask install adobe-air diff --git a/Library/Homebrew/cask/lib/hbc/dsl/caveats.rb b/Library/Homebrew/cask/lib/hbc/dsl/caveats.rb index 7d373b5f3..45ee5d160 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl/caveats.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl/caveats.rb @@ -9,22 +9,22 @@ module Hbc class DSL class Caveats < Base def path_environment_variable(path) - puts <<-EOS.undent - To use #{@cask}, you may need to add the #{path} directory - to your PATH environment variable, eg (for bash shell): + puts <<~EOS + To use #{@cask}, you may need to add the #{path} directory + to your PATH environment variable, eg (for bash shell): - export PATH=#{path}:"$PATH" + export PATH=#{path}:"$PATH" EOS end def zsh_path_helper(path) - puts <<-EOS.undent - To use #{@cask}, zsh users may need to add the following line to their - ~/.zprofile. (Among other effects, #{path} will be added to the - PATH environment variable): + puts <<~EOS + To use #{@cask}, zsh users may need to add the following line to their + ~/.zprofile. (Among other effects, #{path} will be added to the + PATH environment variable): - eval `/usr/libexec/path_helper -s` + eval `/usr/libexec/path_helper -s` EOS end @@ -32,7 +32,7 @@ module Hbc def files_in_usr_local localpath = "/usr/local" return unless HOMEBREW_PREFIX.to_s.downcase.start_with?(localpath) - puts <<-EOS.undent + puts <<~EOS Cask #{@cask} installs files under "#{localpath}". The presence of such files can cause warnings when running "brew doctor", which is considered to be a bug in Homebrew-Cask. @@ -42,72 +42,72 @@ module Hbc def depends_on_java(java_version = "any") if java_version == "any" - puts <<-EOS.undent - #{@cask} requires Java. You can install the latest version with + puts <<~EOS + #{@cask} requires Java. You can install the latest version with - brew cask install java + brew cask install java EOS elsif java_version.include?("9") || java_version.include?("+") - puts <<-EOS.undent - #{@cask} requires Java #{java_version}. You can install the latest version with + puts <<~EOS + #{@cask} requires Java #{java_version}. You can install the latest version with - brew cask install java + brew cask install java EOS else - puts <<-EOS.undent - #{@cask} requires Java #{java_version}. You can install it with + puts <<~EOS + #{@cask} requires Java #{java_version}. You can install it with - brew cask install caskroom/versions/java#{java_version} + brew cask install caskroom/versions/java#{java_version} EOS end end def logout - puts <<-EOS.undent - You must log out and log back in for the installation of #{@cask} - to take effect. + puts <<~EOS + You must log out and log back in for the installation of #{@cask} + to take effect. EOS end def reboot - puts <<-EOS.undent - You must reboot for the installation of #{@cask} to take effect. + puts <<~EOS + You must reboot for the installation of #{@cask} to take effect. EOS end def discontinued - puts <<-EOS.undent - #{@cask} has been officially discontinued upstream. - It may stop working correctly (or at all) in recent versions of macOS. + puts <<~EOS + #{@cask} has been officially discontinued upstream. + It may stop working correctly (or at all) in recent versions of macOS. EOS end def free_license(web_page) - puts <<-EOS.undent - The vendor offers a free license for #{@cask} at - #{web_page} + puts <<~EOS + The vendor offers a free license for #{@cask} at + #{web_page} EOS end def malware(radar_number) - puts <<-EOS.undent - #{@cask} has been reported to bundle malware. Like with any app, use at your own risk. + puts <<~EOS + #{@cask} has been reported to bundle malware. Like with any app, use at your own risk. - A report has been made to Apple about this app. Their certificate will hopefully be revoked. - See the public report at - #{Formatter.url("https://openradar.appspot.com/#{radar_number}")} + A report has been made to Apple about this app. Their certificate will hopefully be revoked. + See the public report at + #{Formatter.url("https://openradar.appspot.com/#{radar_number}")} - If this report is accurate, please duplicate it at - #{Formatter.url("https://bugreport.apple.com/")} - If this report is a mistake, please let us know by opening an issue at - #{Formatter.url("https://github.com/caskroom/homebrew-cask/issues/new")} + If this report is accurate, please duplicate it at + #{Formatter.url("https://bugreport.apple.com/")} + If this report is a mistake, please let us know by opening an issue at + #{Formatter.url("https://github.com/caskroom/homebrew-cask/issues/new")} EOS end diff --git a/Library/Homebrew/cask/lib/hbc/exceptions.rb b/Library/Homebrew/cask/lib/hbc/exceptions.rb index f7f9e43b6..2626a467a 100644 --- a/Library/Homebrew/cask/lib/hbc/exceptions.rb +++ b/Library/Homebrew/cask/lib/hbc/exceptions.rb @@ -44,7 +44,7 @@ module Hbc class CaskAlreadyInstalledError < AbstractCaskErrorWithToken def to_s - <<-EOS.undent + <<~EOS Cask '#{token}' is already installed. To re-install #{token}, run: @@ -80,7 +80,7 @@ module Hbc class CaskX11DependencyError < AbstractCaskErrorWithToken def to_s - <<-EOS.undent + <<~EOS Cask '#{token}' requires XQuartz/X11, which can be installed using Homebrew-Cask by running #{Formatter.identifier("brew cask install xquartz")} @@ -132,7 +132,7 @@ module Hbc class CaskSha256MissingError < CaskSha256Error def to_s - <<-EOS.undent + <<~EOS Cask '#{token}' requires a checksum: #{Formatter.identifier("sha256 '#{actual}'")} EOS @@ -148,7 +148,7 @@ module Hbc end def to_s - <<-EOS.undent + <<~EOS Checksum for Cask '#{token}' does not match. Expected: #{Formatter.success(expected.to_s)} @@ -162,7 +162,7 @@ module Hbc class CaskNoShasumError < CaskSha256Error def to_s - <<-EOS.undent + <<~EOS Cask '#{token}' does not have a sha256 checksum defined and was not installed. This means you have the #{Formatter.identifier("--require-sha")} option set, perhaps in your HOMEBREW_CASK_OPTS. EOS diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb index 68b9595e1..1063f488b 100644 --- a/Library/Homebrew/cask/lib/hbc/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/installer.rb @@ -326,7 +326,7 @@ module Hbc ], sudo: true) else - opoo <<-EOS.undent + opoo <<~EOS Accessibility access cannot be enabled automatically on this version of macOS. See System Preferences to enable it manually. EOS @@ -347,7 +347,7 @@ module Hbc ], sudo: true) else - opoo <<-EOS.undent + opoo <<~EOS Accessibility access cannot be disabled automatically on this version of macOS. See System Preferences to disable it manually. EOS diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index 9ce3de907..3c8311a3b 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -166,12 +166,12 @@ module Hbc _warn_plist_garbage(command, Regexp.last_match[2]) xml = Plist.parse_xml(output) unless xml.respond_to?(:keys) && !xml.keys.empty? - raise CaskError, <<-EOS - Empty result parsing plist output from command. - command was: - #{command} - output we attempted to parse: - #{output} + raise CaskError, <<~EOS + Empty result parsing plist output from command. + command was: + #{command} + output we attempted to parse: + #{output} EOS end xml diff --git a/Library/Homebrew/cask/lib/hbc/utils.rb b/Library/Homebrew/cask/lib/hbc/utils.rb index 22f826e74..0f44c0157 100644 --- a/Library/Homebrew/cask/lib/hbc/utils.rb +++ b/Library/Homebrew/cask/lib/hbc/utils.rb @@ -90,7 +90,7 @@ module Hbc end def self.error_message_with_suggestions - <<-EOS.undent + <<~EOS Follow the instructions here: #{Formatter.url(BUG_REPORTS_URL)} EOS diff --git a/Library/Homebrew/cask/lib/hbc/version.rb b/Library/Homebrew/cask/lib/hbc/version.rb index 2eb942b95..c7ce8e2d8 100644 --- a/Library/Homebrew/cask/lib/hbc/version.rb +++ b/Library/Homebrew/cask/lib/hbc/version.rb @@ -1,7 +1,7 @@ module Hbc def self.full_version @full_version ||= begin - <<-EOS.undent + <<~EOS Homebrew-Cask #{HOMEBREW_VERSION} caskroom/homebrew-cask #{Hbc.default_tap.version_string} EOS -- cgit v1.2.3