From 50fee143583b129a86a56bdc21d1f4ff4b9f5812 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 24 Aug 2016 13:23:27 +0200 Subject: [PATCH] Unify heredoc style. --- Library/Homebrew/cask/lib/hbc/cli.rb | 8 ++++---- Library/Homebrew/cask/lib/hbc/cli/uninstall.rb | 4 ++-- Library/Homebrew/cask/lib/hbc/container/air.rb | 4 ++-- Library/Homebrew/cask/lib/hbc/system_command.rb | 8 ++++---- Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb | 12 ++++++------ .../cask/test/cask/artifact/uninstall_test.rb | 8 ++++---- Library/Homebrew/cask/test/cask/artifact/zap_test.rb | 8 ++++---- Library/Homebrew/cask/test/cask/cli/cat_test.rb | 4 ++-- Library/Homebrew/cask/test/cask/cli/create_test.rb | 4 ++-- Library/Homebrew/cask/test/cask/cli/search_test.rb | 4 ++-- .../Homebrew/cask/test/cask/cli/uninstall_test.rb | 8 ++++---- Library/Homebrew/cask/test/cask/dsl_test.rb | 4 ++-- Library/Homebrew/cask/test/cask/url_checker_test.rb | 4 ++-- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index d1fb991084..1378176da7 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -187,10 +187,10 @@ class Hbc::CLI end opts.on("--binarydir=PATH") do - opoo <<-EOF.undent + opoo <<-EOS.undent Option --binarydir is obsolete! Homebrew-Cask now uses the same location as your Homebrew installation for executable links. - EOF + EOS end FLAGS.each do |flag, method| @@ -246,11 +246,11 @@ class Hbc::CLI end def purpose - puts <<-PURPOSE.undent + puts <<-EOS.undent brew-cask provides a friendly homebrew-style CLI workflow for the administration of macOS applications distributed as binaries. - PURPOSE + EOS end def usage diff --git a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb index cd98b6e616..ae15414b72 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb @@ -27,10 +27,10 @@ class Hbc::CLI::Uninstall < Hbc::CLI::Base single = versions.count == 1 - puts <<-EOF.undent + puts <<-EOS.undent #{cask_token} #{versions.join(', ')} #{single ? 'is' : 'are'} still installed. Remove #{single ? 'it' : 'them all'} with `brew cask uninstall --force #{cask_token}`. - EOF + EOS end end diff --git a/Library/Homebrew/cask/lib/hbc/container/air.rb b/Library/Homebrew/cask/lib/hbc/container/air.rb index e82b677e9c..fc618db831 100644 --- a/Library/Homebrew/cask/lib/hbc/container/air.rb +++ b/Library/Homebrew/cask/lib/hbc/container/air.rb @@ -11,12 +11,12 @@ class Hbc::Container::Air < Hbc::Container::Base def self.installer_cmd return @installer_cmd ||= INSTALLER_PATHNAME if installer_exist? - raise Hbc::CaskError, <<-ERRMSG.undent + raise Hbc::CaskError, <<-EOS.undent Adobe AIR runtime not present, try installing it via brew cask install adobe-air - ERRMSG + EOS end def self.installer_exist? diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index 6fa8a901fa..bb8d91504e 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -150,17 +150,17 @@ class Hbc::SystemCommand::Result _warn_plist_garbage(command, Regexp.last_match[2]) xml = Plist.parse_xml(output) unless xml.respond_to?(:keys) && !xml.keys.empty? - raise Hbc::CaskError, <<-ERRMSG + raise Hbc::CaskError, <<-EOS Empty result parsing plist output from command. command was: #{command.utf8_inspect} output we attempted to parse: #{output} - ERRMSG + EOS end xml rescue Plist::ParseError => e - raise Hbc::CaskError, <<-ERRMSG + raise Hbc::CaskError, <<-EOS Error parsing plist output from command. command was: #{command.utf8_inspect} @@ -168,6 +168,6 @@ Error parsing plist output from command. #{e} output we attempted to parse: #{output} - ERRMSG + EOS end end diff --git a/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb b/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb index e77576ae32..5753834e0c 100644 --- a/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb +++ b/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb @@ -18,11 +18,11 @@ describe Hbc::CLI::Cleanup do expect { subject.cleanup! - }.to output(<<-OUTPUT.undent).to_stdout + }.to output(<<-EOS.undent).to_stdout ==> Removing cached downloads #{cached_download} ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space. - OUTPUT + EOS expect(cached_download.exist?).to eq(false) end @@ -38,11 +38,11 @@ describe Hbc::CLI::Cleanup do expect { subject.cleanup! - }.to output(<<-OUTPUT.undent).to_stdout + }.to output(<<-EOS.undent).to_stdout ==> Removing cached downloads skipping: #{cached_download} is locked ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space. - OUTPUT + EOS expect(cached_download.exist?).to eq(true) end @@ -56,10 +56,10 @@ describe Hbc::CLI::Cleanup do expect { subject.cleanup! - }.to output(<<-OUTPUT.undent).to_stdout + }.to output(<<-EOS.undent).to_stdout ==> Removing cached downloads older than 10 days old Nothing to do - OUTPUT + EOS expect(cached_download.exist?).to eq(true) end diff --git a/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb b/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb index 4d6c5df1b5..4ab2dc3d28 100644 --- a/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/uninstall_test.rb @@ -42,7 +42,7 @@ describe Hbc::Artifact::Uninstall do let(:launchctl_remove_cmd) { %w[/bin/launchctl remove my.fancy.package.service] } let(:unknown_response) { "launchctl list returned unknown response\n" } let(:service_info) { - <<-PLIST.undent + <<-EOS.undent { "LimitLoadToSessionType" = "Aqua"; "Label" = "my.fancy.package.service"; @@ -53,7 +53,7 @@ describe Hbc::Artifact::Uninstall do "argument"; ); }; - PLIST + EOS } describe "when launchctl job is owned by user" do @@ -124,7 +124,7 @@ describe Hbc::Artifact::Uninstall do ] } let(:pkg_info_plist) { - <<-PLIST.undent + <<-EOS.undent @@ -135,7 +135,7 @@ describe Hbc::Artifact::Uninstall do / - PLIST + EOS } it "can uninstall" do diff --git a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb index 8ffa1c5e30..489299eca3 100644 --- a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb @@ -43,7 +43,7 @@ describe Hbc::Artifact::Zap do let(:launchctl_remove_cmd) { %w[/bin/launchctl remove my.fancy.package.service] } let(:unknown_response) { "launchctl list returned unknown response\n" } let(:service_info) { - <<-PLIST.undent + <<-EOS.undent { "LimitLoadToSessionType" = "Aqua"; "Label" = "my.fancy.package.service"; @@ -54,7 +54,7 @@ describe Hbc::Artifact::Zap do "argument"; ); }; - PLIST + EOS } describe "when launchctl job is owned by user" do @@ -125,7 +125,7 @@ describe Hbc::Artifact::Zap do ] } let(:pkg_info_plist) { - <<-PLIST.undent + <<-EOS.undent @@ -136,7 +136,7 @@ describe Hbc::Artifact::Zap do / - PLIST + EOS } it "can zap" do diff --git a/Library/Homebrew/cask/test/cask/cli/cat_test.rb b/Library/Homebrew/cask/test/cask/cli/cat_test.rb index f51fe4be09..df49efda07 100644 --- a/Library/Homebrew/cask/test/cask/cli/cat_test.rb +++ b/Library/Homebrew/cask/test/cask/cli/cat_test.rb @@ -3,7 +3,7 @@ require "test_helper" describe Hbc::CLI::Cat do describe "given a basic Cask" do before do - @expected_output = <<-CLIOUTPUT.undent + @expected_output = <<-EOS.undent test_cask 'basic-cask' do version '1.2.3' sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' @@ -13,7 +13,7 @@ describe Hbc::CLI::Cat do app 'TestCask.app' end - CLIOUTPUT + EOS end it "displays the Cask file content about the specified Cask" do diff --git a/Library/Homebrew/cask/test/cask/cli/create_test.rb b/Library/Homebrew/cask/test/cask/cli/create_test.rb index 85d888cfae..cf3cf28a36 100644 --- a/Library/Homebrew/cask/test/cask/cli/create_test.rb +++ b/Library/Homebrew/cask/test/cask/cli/create_test.rb @@ -37,7 +37,7 @@ describe Hbc::CLI::Create do it "drops a template down for the specified Cask" do Hbc::CLI::Create.run("new-cask") template = File.read(Hbc.path("new-cask")) - template.must_equal <<-TEMPLATE.undent + template.must_equal <<-EOS.undent cask 'new-cask' do version '' sha256 '' @@ -49,7 +49,7 @@ describe Hbc::CLI::Create do app '' end - TEMPLATE + EOS end it "throws away additional Cask arguments and uses the first" do diff --git a/Library/Homebrew/cask/test/cask/cli/search_test.rb b/Library/Homebrew/cask/test/cask/cli/search_test.rb index a0365862ed..4b15d8eab8 100644 --- a/Library/Homebrew/cask/test/cask/cli/search_test.rb +++ b/Library/Homebrew/cask/test/cask/cli/search_test.rb @@ -4,11 +4,11 @@ describe Hbc::CLI::Search do it "lists the available Casks that match the search term" do lambda { Hbc::CLI::Search.run("photoshop") - }.must_output <<-OUTPUT.gsub(%r{^ *}, "") + }.must_output <<-EOS.undent ==> Partial matches adobe-photoshop-cc adobe-photoshop-lightroom - OUTPUT + EOS end it "shows that there are no Casks matching a search term that did not result in anything" do diff --git a/Library/Homebrew/cask/test/cask/cli/uninstall_test.rb b/Library/Homebrew/cask/test/cask/cli/uninstall_test.rb index e2909873a6..80d4576cd3 100644 --- a/Library/Homebrew/cask/test/cask/cli/uninstall_test.rb +++ b/Library/Homebrew/cask/test/cask/cli/uninstall_test.rb @@ -57,11 +57,11 @@ describe Hbc::CLI::Uninstall do timestamped_versions.each do |timestamped_version| caskroom_path.join(".metadata", *timestamped_version, "Casks").tap(&:mkpath) .join("#{token}.rb").open("w") do |caskfile| - caskfile.puts <<-EOF.undent + caskfile.puts <<-EOS.undent cask '#{token}' do version '#{timestamped_version[0]}' end - EOF + EOS end caskroom_path.join(timestamped_version[0]).mkpath end @@ -112,13 +112,13 @@ describe Hbc::CLI::Uninstall do saved_caskfile.dirname.mkpath - IO.write saved_caskfile, <<-EOF.undent + IO.write saved_caskfile, <<-EOS.undent cask 'ive-been-renamed' do version :latest app 'ive-been-renamed.app' end - EOF + EOS end after do diff --git a/Library/Homebrew/cask/test/cask/dsl_test.rb b/Library/Homebrew/cask/test/cask/dsl_test.rb index 4cd30d2414..ce57e0b078 100644 --- a/Library/Homebrew/cask/test/cask/dsl_test.rb +++ b/Library/Homebrew/cask/test/cask/dsl_test.rb @@ -20,7 +20,7 @@ describe Hbc::DSL do end it "prints a warning that it has encountered an unexpected method" do - expected = Regexp.compile(<<-EOREGEX.undent.lines.map(&:chomp).join("")) + expected = Regexp.compile(<<-EOS.undent.lines.map(&:chomp).join("")) (?m) Warning: .* @@ -29,7 +29,7 @@ describe Hbc::DSL do brew update; brew cleanup; brew cask cleanup .* https://github.com/caskroom/homebrew-cask#reporting-bugs - EOREGEX + EOS TestHelper.must_output(self, attempt_unknown_method, expected) end diff --git a/Library/Homebrew/cask/test/cask/url_checker_test.rb b/Library/Homebrew/cask/test/cask/url_checker_test.rb index cb0e50d575..2dfed62d3e 100644 --- a/Library/Homebrew/cask/test/cask/url_checker_test.rb +++ b/Library/Homebrew/cask/test/cask/url_checker_test.rb @@ -11,13 +11,13 @@ describe Hbc::UrlChecker do end it "properly populates the response code and headers from an http response" do - TestHelper.fake_response_for(TestHelper.test_cask.url, <<-RESPONSE.gsub(%r{^ *}, "")) + TestHelper.fake_response_for(TestHelper.test_cask.url, <<-EOS.undent) HTTP/1.1 200 OK Content-Type: application/x-apple-diskimage ETag: "b4208f3e84967be4b078ecaa03fba941" Content-Length: 23726161 Last-Modified: Sun, 12 Aug 2012 21:17:21 GMT - RESPONSE + EOS checker = Hbc::UrlChecker.new(TestHelper.test_cask, TestHelper.fake_fetcher) checker.run