diff --git a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb index 9776a42ae7..735300f084 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb @@ -258,7 +258,7 @@ module Hbc end def trash_paths(*paths, command: nil, **_) - result = command.run!("/usr/bin/osascript", args: ["-e", <<~'EOS', *paths]) + result = command.run!("/usr/bin/osascript", args: ["-e", <<~APPLESCRIPT, *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) @@ -279,7 +279,7 @@ module Hbc return output end tell end run - EOS + APPLESCRIPT # Remove AppleScript's automatic newline. result.tap { |r| r.stdout.sub!(/\n$/, "") } diff --git a/Library/Homebrew/cask/lib/hbc/cli/create.rb b/Library/Homebrew/cask/lib/hbc/cli/create.rb index e6ca3d7bc9..0f5034a54f 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 + <<~RUBY cask '#{cask_token}' do version '' sha256 '' @@ -32,7 +32,7 @@ module Hbc app '' end - EOS + RUBY end def self.help diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb index f534090ced..17aee140e1 100644 --- a/Library/Homebrew/dev-cmd/mirror.rb +++ b/Library/Homebrew/dev-cmd/mirror.rb @@ -27,11 +27,11 @@ module Homebrew package_url = "#{bintray_repo_url}/#{bintray_package}" unless system curl_executable, "--silent", "--fail", "--output", "/dev/null", package_url - package_blob = <<~EOS + package_blob = <<~JSON {"name": "#{bintray_package}", "public_download_numbers": true, "public_stats": true} - EOS + JSON curl "--silent", "--fail", "--user", "#{bintray_user}:#{bintray_key}", "--header", "Content-Type: application/json", "--data", package_blob, bintray_repo_url diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index e29b143c39..368afed2a0 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -30,7 +30,7 @@ module Homebrew (tap.path/"Formula").mkpath - readme = <<~EOS + readme = <<~MARKDOWN # #{titleized_user} #{titleized_repo} ## How do I install these formulae? @@ -46,10 +46,10 @@ module Homebrew ## Documentation `brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh). - EOS + MARKDOWN write_path(tap, "README.md", readme) - travis = <<~EOS + travis = <<~YAML language: c os: osx compiler: clang @@ -71,7 +71,7 @@ module Homebrew script: - brew test-bot - EOS + YAML write_path(tap, ".travis.yml", travis) end end diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 6e37f4ad9e..a138be3e25 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -392,10 +392,10 @@ class Pathname mkpath targets.each do |target| target = Pathname.new(target) # allow pathnames or strings - join(target.basename).write <<~EOS + join(target.basename).write <<~SH #!/bin/bash exec "#{target}" "$@" - EOS + SH end end @@ -404,10 +404,10 @@ class Pathname env_export = "" env.each { |key, value| env_export += "#{key}=\"#{value}\" " } dirname.mkpath - write <<~EOS + write <<~SH #!/bin/bash #{env_export}exec "#{target}" "$@" - EOS + SH end # Writes a wrapper env script and moves all files to the dst @@ -427,10 +427,10 @@ class Pathname java_home = if java_version "JAVA_HOME=\"$(#{Language::Java.java_home_cmd(java_version)})\" " end - join(script_name).write <<~EOS + join(script_name).write <<~SH #!/bin/bash #{java_home}exec java #{java_opts} -jar #{target_jar} "$@" - EOS + SH end def install_metafiles(from = Pathname.pwd) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index b0375cd051..ea7340de96 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1738,10 +1738,10 @@ class Formula # keep Homebrew's site-packages in sys.path when using system Python user_site_packages = home/"Library/Python/2.7/lib/python/site-packages" user_site_packages.mkpath - (user_site_packages/"homebrew.pth").write <<~EOS + (user_site_packages/"homebrew.pth").write <<~PYTHON import site; site.addsitedir("#{HOMEBREW_PREFIX}/lib/python2.7/site-packages") import sys, os; sys.path = (os.environ["PYTHONPATH"].split(os.pathsep) if "PYTHONPATH" in os.environ else []) + ["#{HOMEBREW_PREFIX}/lib/python2.7/site-packages"] + sys.path - EOS + PYTHON end public diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index d3d7494949..6a8fc91ba7 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -77,7 +77,7 @@ module Homebrew end def template - <<~EOS + <<~ERB # Documentation: https://docs.brew.sh/Formula-Cookbook # http://www.rubydoc.info/github/Homebrew/brew/master/Formula # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! @@ -147,7 +147,7 @@ module Homebrew system "false" end end - EOS + ERB end end end diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index b3b882b8a5..e96fd5ee8e 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -46,20 +46,20 @@ module Language end def self.in_sys_path?(python, path) - script = <<~EOS + script = <<~PYTHON import os, sys [os.path.realpath(p) for p in sys.path].index(os.path.realpath("#{path}")) - EOS + PYTHON quiet_system python, "-c", script end def self.setup_install_args(prefix) - shim = <<~EOS + shim = <<~PYTHON import setuptools, tokenize __file__ = 'setup.py' exec(compile(getattr(tokenize, 'open', open)(__file__).read() .replace('\\r\\n', '\\n'), __file__, 'exec')) - EOS + PYTHON %W[ -c #{shim} diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index e59e2a5500..bda767970b 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -138,7 +138,7 @@ class Sandbox end class SandboxProfile - SEATBELT_ERB = <<~EOS.freeze + SEATBELT_ERB = <<~ERB.freeze (version 1) (debug deny) ; log all denied operations to /var/log/system.log <%= rules.join("\n") %> @@ -157,7 +157,7 @@ class Sandbox (with no-sandbox) ) ; allow certain processes running without sandbox (allow default) ; allow everything else - EOS + ERB attr_reader :rules diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index da6016df4f..74dfa5e5fd 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -34,7 +34,7 @@ describe Hbc::Artifact::Pkg, :cask do file = double(path: Pathname.new("/tmp/choices.xml")) - expect(file).to receive(:write).with(<<~EOS) + expect(file).to receive(:write).with <<~XML @@ -49,7 +49,7 @@ describe Hbc::Artifact::Pkg, :cask do \t - EOS + XML expect(file).to receive(:close) expect(file).to receive(:unlink) 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 e735d5eca8..945340d005 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 @@ -3,55 +3,55 @@ describe Hbc::CaskLoader::FromContentLoader do describe "::can_load?" do it "returns true for Casks specified with `cask \"token\" do … end`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask "token" do end - EOS + RUBY end it "returns true for Casks specified with `cask \"token\" do; end`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask "token" do; end - EOS + RUBY end it "returns true for Casks specified with `cask 'token' do … end`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask 'token' do end - EOS + RUBY end it "returns true for Casks specified with `cask 'token' do; end`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask 'token' do; end - EOS + RUBY end it "returns true for Casks specified with `cask(\"token\") { … }`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask("token") { } - EOS + RUBY end it "returns true for Casks specified with `cask(\"token\") {}`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask("token") {} - EOS + RUBY end it "returns true for Casks specified with `cask('token') { … }`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask('token') { } - EOS + RUBY end it "returns true for Casks specified with `cask('token') {}`" do - expect(described_class).to be_able_to_load <<~EOS + expect(described_class).to be_able_to_load <<~RUBY cask('token') {} - EOS + RUBY end end end 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 df2de1f828..8ef1b0a9c8 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 @@ -11,11 +11,11 @@ describe Hbc::CaskLoader::FromURILoader do end it "returns false when given a String with Cask contents containing a URL" do - expect(described_class).not_to be_able_to_load <<~EOS + expect(described_class).not_to be_able_to_load <<~RUBY cask 'token' do url 'http://example.com/' end - EOS + RUBY end end end diff --git a/Library/Homebrew/test/cask/cli/cat_spec.rb b/Library/Homebrew/test/cask/cli/cat_spec.rb index e1db1b17d8..f24e1bb93a 100644 --- a/Library/Homebrew/test/cask/cli/cat_spec.rb +++ b/Library/Homebrew/test/cask/cli/cat_spec.rb @@ -7,7 +7,7 @@ describe Hbc::CLI::Cat, :cask do describe "given a basic Cask" do let(:basic_cask_content) { - <<~EOS + <<~RUBY cask 'basic-cask' do version '1.2.3' sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' @@ -17,7 +17,7 @@ describe Hbc::CLI::Cat, :cask do app 'TestCask.app' end - EOS + RUBY } it "displays the Cask file content about the specified Cask" do diff --git a/Library/Homebrew/test/cask/cli/create_spec.rb b/Library/Homebrew/test/cask/cli/create_spec.rb index 3efd17787d..bc9d28bdec 100644 --- a/Library/Homebrew/test/cask/cli/create_spec.rb +++ b/Library/Homebrew/test/cask/cli/create_spec.rb @@ -28,7 +28,7 @@ describe Hbc::CLI::Create, :cask do it "drops a template down for the specified Cask" do described_class.run("new-cask") template = File.read(Hbc::CaskLoader.path("new-cask")) - expect(template).to eq <<~EOS + expect(template).to eq <<~RUBY cask 'new-cask' do version '' sha256 '' @@ -39,7 +39,7 @@ describe Hbc::CLI::Create, :cask do app '' end - EOS + RUBY end it "raises an exception when more than one Cask is given" do diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb index 0b1f5acfe8..5a34706e9b 100644 --- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb @@ -109,11 +109,11 @@ describe Hbc::CLI::Uninstall, :cask 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 <<~EOS + caskfile.puts <<~RUBY cask '#{token}' do version '#{timestamped_version[0]}' end - EOS + RUBY end caskroom_path.join(timestamped_version[0]).mkpath end @@ -155,13 +155,13 @@ describe Hbc::CLI::Uninstall, :cask do saved_caskfile.dirname.mkpath - IO.write saved_caskfile, <<~EOS + IO.write saved_caskfile, <<~RUBY cask 'ive-been-renamed' do version :latest app 'ive-been-renamed.app' end - EOS + RUBY end it "can still uninstall those Casks" do diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index 027948eaec..eda4f82ce1 100644 --- a/Library/Homebrew/test/cask/pkg_spec.rb +++ b/Library/Homebrew/test/cask/pkg_spec.rb @@ -123,7 +123,7 @@ describe Hbc::Pkg, :cask do end let(:pkg_info_plist) do - <<~EOS + <<~XML @@ -138,7 +138,7 @@ describe Hbc::Pkg, :cask do - EOS + XML end it "correctly parses a Property List" do diff --git a/Library/Homebrew/test/cask/system_command_result_spec.rb b/Library/Homebrew/test/cask/system_command_result_spec.rb index b71838518a..84d8b55fe8 100644 --- a/Library/Homebrew/test/cask/system_command_result_spec.rb +++ b/Library/Homebrew/test/cask/system_command_result_spec.rb @@ -17,7 +17,7 @@ describe Hbc::SystemCommand::Result, :cask do EOS } let(:plist) { - <<~EOS + <<~XML @@ -61,7 +61,7 @@ describe Hbc::SystemCommand::Result, :cask do - EOS + XML } context "when stdout contains garbage before XML" do diff --git a/Library/Homebrew/test/cmd/custom-external-command_spec.rb b/Library/Homebrew/test/cmd/custom-external-command_spec.rb index 8e6ffe2ff2..7a4e6501de 100644 --- a/Library/Homebrew/test/cmd/custom-external-command_spec.rb +++ b/Library/Homebrew/test/cmd/custom-external-command_spec.rb @@ -4,10 +4,10 @@ describe "brew custom-external-command", :integration_test do cmd = "custom-external-command-#{rand}" file = path/"brew-#{cmd}" - file.write <<~EOS + file.write <<~SH #!/bin/sh echo 'I am #{cmd}.' - EOS + SH FileUtils.chmod "+x", file expect { brew cmd, "PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" } diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index 30f5e582df..f6bcb874a7 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -26,9 +26,9 @@ describe "brew install", :integration_test do end specify "install failures" do - path = setup_test_formula "testball1", <<~EOS + path = setup_test_formula "testball1", <<~RUBY version "1.0" - EOS + RUBY expect { brew "install", "testball1" } .to output(%r{#{HOMEBREW_CELLAR}/testball1/1\.0}).to_stdout @@ -36,7 +36,7 @@ describe "brew install", :integration_test do .and be_a_success FileUtils.rm path - setup_test_formula "testball1", <<~EOS + setup_test_formula "testball1", <<~RUBY version "2.0" devel do @@ -44,7 +44,7 @@ describe "brew install", :integration_test do sha256 "#{Formulary.factory("testball1").stable.checksum.hexdigest}" version "3.0" end - EOS + RUBY expect { brew "install", "testball1" } .to output(/`brew upgrade testball1`/).to_stderr @@ -90,11 +90,11 @@ describe "brew install", :integration_test do end it "can install keg-only Formulae" do - path_keg_only = setup_test_formula "testball1", <<~EOS + path_keg_only = setup_test_formula "testball1", <<~RUBY version "1.0" keg_only "test reason" - EOS + RUBY expect { brew "install", "testball1" } .to output(%r{#{HOMEBREW_CELLAR}/testball1/1\.0}).to_stdout @@ -102,11 +102,11 @@ describe "brew install", :integration_test do .and be_a_success FileUtils.rm path_keg_only - setup_test_formula "testball1", <<~EOS + setup_test_formula "testball1", <<~RUBY version "2.0" keg_only "test reason" - EOS + RUBY expect { brew "install", "testball1" } .to output(/testball1 1.0 is already installed/).to_stderr @@ -132,7 +132,7 @@ describe "brew install", :integration_test do system "git", "commit", "-m", "Initial repo commit" end - setup_test_formula "testball1", <<~EOS + setup_test_formula "testball1", <<~RUBY version "1.0" head "file://#{repo_path}", :using => :git @@ -140,7 +140,7 @@ describe "brew install", :integration_test do def install prefix.install Dir["*"] end - EOS + RUBY # Ignore dependencies, because we'll try to resolve requirements in build.rb # and there will be the git requirement, but we cannot instantiate git @@ -175,13 +175,13 @@ describe "brew install", :integration_test do end it "succeeds when a non-fatal requirement isn't satisfied" do - setup_test_formula "testball1", <<~EOS + setup_test_formula "testball1", <<~RUBY class NonFatalRequirement < Requirement satisfy(build_env: false) { false } end depends_on NonFatalRequirement - EOS + RUBY expect { brew "install", "testball1" } .to output(/NonFatalRequirement unsatisfied!/).to_stderr @@ -190,14 +190,14 @@ describe "brew install", :integration_test do end it "fails when a fatal requirement isn't satisfied" do - setup_test_formula "testball1", <<~EOS + setup_test_formula "testball1", <<~RUBY class FatalRequirement < Requirement fatal true satisfy { false } end depends_on FatalRequirement - EOS + RUBY expect { brew "install", "testball1" } .to output(/FatalRequirement unsatisfied!/).to_stderr diff --git a/Library/Homebrew/test/cmd/irb_spec.rb b/Library/Homebrew/test/cmd/irb_spec.rb index 0423c6ab73..d4e153f24a 100644 --- a/Library/Homebrew/test/cmd/irb_spec.rb +++ b/Library/Homebrew/test/cmd/irb_spec.rb @@ -3,11 +3,11 @@ describe "brew irb", :integration_test do setup_test_formula "testball" irb_test = HOMEBREW_TEMP/"irb-test.rb" - irb_test.write <<~EOS + irb_test.write <<~RUBY "testball".f :testball.f exit - EOS + RUBY expect { brew "irb", irb_test } .to output(/Interactive Homebrew Shell/).to_stdout diff --git a/Library/Homebrew/test/cmd/link_spec.rb b/Library/Homebrew/test/cmd/link_spec.rb index 27ccd0bd5b..2632fd02f4 100644 --- a/Library/Homebrew/test/cmd/link_spec.rb +++ b/Library/Homebrew/test/cmd/link_spec.rb @@ -29,9 +29,9 @@ describe "brew link", :integration_test do end it "refuses to link keg-only Formulae" do - setup_test_formula "testball1", <<~EOS + setup_test_formula "testball1", <<~RUBY keg_only "just because" - EOS + RUBY expect { brew "install", "testball1" }.to be_a_success diff --git a/Library/Homebrew/test/cmd/options_spec.rb b/Library/Homebrew/test/cmd/options_spec.rb index bb6b98a47c..ba54f1a2a6 100644 --- a/Library/Homebrew/test/cmd/options_spec.rb +++ b/Library/Homebrew/test/cmd/options_spec.rb @@ -1,8 +1,8 @@ describe "brew options", :integration_test do it "prints a given Formula's options" do - setup_test_formula "testball", <<~EOS + setup_test_formula "testball", <<~RUBY depends_on "bar" => :recommended - EOS + RUBY expect { brew "options", "testball" } .to output("--with-foo\n\tBuild with foo\n--without-bar\n\tBuild without bar support\n\n").to_stdout diff --git a/Library/Homebrew/test/cmd/switch_spec.rb b/Library/Homebrew/test/cmd/switch_spec.rb index 8eba0c7dc3..4e101a9d6a 100644 --- a/Library/Homebrew/test/cmd/switch_spec.rb +++ b/Library/Homebrew/test/cmd/switch_spec.rb @@ -1,8 +1,8 @@ describe "brew switch", :integration_test do it "allows switching between Formula versions" do - setup_test_formula "testball", <<~EOS + setup_test_formula "testball", <<~RUBY keg_only "just because" - EOS + RUBY expect { brew "install", "testball" }.to be_a_success diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index 4a8c446a5c..7b2194d5cf 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -2,10 +2,10 @@ describe "brew uses", :integration_test do it "prints the Formulae a given Formula is used by" do setup_test_formula "foo" setup_test_formula "bar" - setup_test_formula "baz", <<~EOS + setup_test_formula "baz", <<~RUBY url "https://example.com/baz-1.0" depends_on "bar" - EOS + RUBY expect { brew "uses", "baz" } .to be_a_success diff --git a/Library/Homebrew/test/deps_spec.rb b/Library/Homebrew/test/deps_spec.rb index 52cfa6d971..321fede218 100644 --- a/Library/Homebrew/test/deps_spec.rb +++ b/Library/Homebrew/test/deps_spec.rb @@ -2,10 +2,10 @@ describe "brew deps", :integration_test do before do setup_test_formula "foo" setup_test_formula "bar" - setup_test_formula "baz", <<~EOS + setup_test_formula "baz", <<~RUBY url "https://example.com/baz-1.0" depends_on "bar" - EOS + RUBY end it "outputs no dependencies for a Formula that has no dependencies" do diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index ef922315ab..be307cb3ba 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -19,20 +19,20 @@ module Homebrew def formula_text(name, body = nil, options = {}) path = dir/"#{name}.rb" - path.write <<~EOS + path.write <<~RUBY class #{Formulary.class_s(name)} < Formula #{body} end #{options[:patch]} - EOS + RUBY described_class.new(path) end specify "simple valid Formula" do - ft = formula_text "valid", <<~EOS + ft = formula_text "valid", <<~RUBY url "http://www.example.com/valid-1.0.tar.gz" - EOS + RUBY expect(ft).not_to have_data expect(ft).not_to have_end @@ -50,9 +50,9 @@ module Homebrew end specify "#data?" do - ft = formula_text "data", <<~EOS + ft = formula_text "data", <<~RUBY patch :DATA - EOS + RUBY expect(ft).to have_data end @@ -78,11 +78,11 @@ module Homebrew describe "#problems" do it "is empty by default" do - fa = formula_auditor "foo", <<~EOS + fa = formula_auditor "foo", <<~RUBY class Foo < Formula url "http://example.com/foo-1.0.tgz" end - EOS + RUBY expect(fa.problems).to be_empty end @@ -92,11 +92,11 @@ module Homebrew specify "file permissions" do allow(File).to receive(:umask).and_return(022) - fa = formula_auditor "foo", <<~EOS + fa = formula_auditor "foo", <<~RUBY class Foo < Formula url "http://example.com/foo-1.0.tgz" end - EOS + RUBY path = fa.formula.path path.chmod 0400 @@ -107,25 +107,25 @@ module Homebrew end specify "DATA but no __END__" do - fa = formula_auditor "foo", <<~EOS + fa = formula_auditor "foo", <<~RUBY class Foo < Formula url "http://example.com/foo-1.0.tgz" patch :DATA end - EOS + RUBY fa.audit_file expect(fa.problems).to eq(["'DATA' was found, but no '__END__'"]) end specify "__END__ but no DATA" do - fa = formula_auditor "foo", <<~EOS + fa = formula_auditor "foo", <<~RUBY class Foo < Formula url "http://example.com/foo-1.0.tgz" end __END__ a patch goes here - EOS + RUBY fa.audit_file expect(fa.problems).to eq(["'__END__' was found, but 'DATA' is not used"]) @@ -139,12 +139,12 @@ module Homebrew end specify "no issue" do - fa = formula_auditor "foo", <<~EOS + fa = formula_auditor "foo", <<~RUBY class Foo < Formula url "http://example.com/foo-1.0.tgz" homepage "http://example.com" end - EOS + RUBY fa.audit_file expect(fa.problems).to eq([]) @@ -153,11 +153,11 @@ module Homebrew describe "#line_problems" do specify "pkgshare" do - fa = formula_auditor "foo", <<~EOS, strict: true + fa = formula_auditor "foo", <<~RUBY, strict: true class Foo < Formula url "http://example.com/foo-1.0.tgz" end - EOS + RUBY fa.line_problems 'ohai "#{share}/foo"', 3 expect(fa.problems.shift).to eq("Use \#{pkgshare} instead of \#{share}/foo") @@ -185,12 +185,12 @@ module Homebrew # Formulae with "++" in their name would break various audit regexps: # Error: nested *?+ in regexp: /^libxml++3\s/ specify "++ in name" do - fa = formula_auditor "foolibc++", <<~EOS, strict: true + fa = formula_auditor "foolibc++", <<~RUBY, strict: true class Foolibcxx < Formula desc "foolibc++ is a test" url "http://example.com/foo-1.0.tgz" end - EOS + RUBY fa.line_problems 'ohai "#{share}/foolibc++"', 3 expect(fa.problems.shift) @@ -206,12 +206,12 @@ module Homebrew specify "#audit_github_repository when HOMEBREW_NO_GITHUB_API is set" do ENV["HOMEBREW_NO_GITHUB_API"] = "1" - fa = formula_auditor "foo", <<~EOS, strict: true, online: true + fa = formula_auditor "foo", <<~RUBY, strict: true, online: true class Foo < Formula homepage "https://github.com/example/example" url "http://example.com/foo-1.0.tgz" end - EOS + RUBY fa.audit_github_repository expect(fa.problems).to eq([]) @@ -224,14 +224,14 @@ module Homebrew subject { fa } let(:fa) do - formula_auditor "foo", <<~EOS, new_formula: true + formula_auditor "foo", <<~RUBY, new_formula: true class Foo < Formula url "http://example.com/foo-1.0.tgz" homepage "http://example.com" depends_on "openssl" end - EOS + RUBY end let(:f_openssl) do @@ -256,14 +256,14 @@ module Homebrew subject { fa } let(:fa) do - formula_auditor "foo", <<~EOS, new_formula: true + formula_auditor "foo", <<~RUBY, new_formula: true class Foo < Formula url "http://example.com/foo-1.0.tgz" homepage "http://example.com" depends_on "bc" end - EOS + RUBY end let(:f_bc) do @@ -288,13 +288,13 @@ module Homebrew describe "#audit_keg_only_style" do specify "keg_only_needs_downcasing" do - fa = formula_auditor "foo", <<~EOS, strict: true + fa = formula_auditor "foo", <<~RUBY, strict: true class Foo < Formula url "http://example.com/foo-1.0.tgz" keg_only "Because why not" end - EOS + RUBY fa.audit_keg_only_style expect(fa.problems) @@ -302,13 +302,13 @@ module Homebrew end specify "keg_only_redundant_period" do - fa = formula_auditor "foo", <<~EOS, strict: true + fa = formula_auditor "foo", <<~RUBY, strict: true class Foo < Formula url "http://example.com/foo-1.0.tgz" keg_only "because this line ends in a period." end - EOS + RUBY fa.audit_keg_only_style expect(fa.problems) @@ -316,7 +316,7 @@ module Homebrew end specify "keg_only_handles_block_correctly" do - fa = formula_auditor "foo", <<~EOS, strict: true + fa = formula_auditor "foo", <<~RUBY, strict: true class Foo < Formula url "http://example.com/foo-1.0.tgz" @@ -327,7 +327,7 @@ module Homebrew problem EOF end - EOS + RUBY fa.audit_keg_only_style expect(fa.problems) @@ -335,13 +335,13 @@ module Homebrew end specify "keg_only_handles_whitelist_correctly" do - fa = formula_auditor "foo", <<~EOS, strict: true + fa = formula_auditor "foo", <<~RUBY, strict: true class Foo < Formula url "http://example.com/foo-1.0.tgz" keg_only "Apple ships foo in the CLT package" end - EOS + RUBY fa.audit_keg_only_style expect(fa.problems) @@ -364,13 +364,13 @@ module Homebrew let(:formula_path) { tap_path/formula_subpath } before do - origin_formula_path.write <<~EOS + origin_formula_path.write <<~RUBY class Foo#{foo_version} < Formula url "https://example.com/foo-1.0.tar.gz" revision 2 version_scheme 1 end - EOS + RUBY origin_tap_path.mkpath origin_tap_path.cd do @@ -525,11 +525,11 @@ module Homebrew describe "#audit_url_is_not_binary" do specify "it detects a url containing darwin and x86_64" do - fa = formula_auditor "foo", <<~EOS, official_tap: true + fa = formula_auditor "foo", <<~RUBY, official_tap: true class Foo < Formula url "https://example.com/example-darwin.x86_64.tar.gz" end - EOS + RUBY fa.audit_url_is_not_binary @@ -538,11 +538,11 @@ module Homebrew end specify "it detects a url containing darwin and amd64" do - fa = formula_auditor "foo", <<~EOS, official_tap: true + fa = formula_auditor "foo", <<~RUBY, official_tap: true class Foo < Formula url "https://example.com/example-darwin.amd64.tar.gz" end - EOS + RUBY fa.audit_url_is_not_binary @@ -551,7 +551,7 @@ module Homebrew end specify "it works on the devel spec" do - fa = formula_auditor "foo", <<~EOS, official_tap: true + fa = formula_auditor "foo", <<~RUBY, official_tap: true class Foo < Formula url "https://example.com/valid-1.0.tar.gz" @@ -559,7 +559,7 @@ module Homebrew url "https://example.com/example-darwin.x86_64.tar.gz" end end - EOS + RUBY fa.audit_url_is_not_binary @@ -568,7 +568,7 @@ module Homebrew end specify "it works on the head spec" do - fa = formula_auditor "foo", <<~EOS, official_tap: true + fa = formula_auditor "foo", <<~RUBY, official_tap: true class Foo < Formula url "https://example.com/valid-1.0.tar.gz" @@ -576,7 +576,7 @@ module Homebrew url "https://example.com/example-darwin.x86_64.tar.gz" end end - EOS + RUBY fa.audit_url_is_not_binary @@ -585,7 +585,7 @@ module Homebrew end specify "it ignores resource urls" do - fa = formula_auditor "foo", <<~EOS, official_tap: true + fa = formula_auditor "foo", <<~RUBY, official_tap: true class Foo < Formula url "https://example.com/valid-1.0.tar.gz" @@ -593,7 +593,7 @@ module Homebrew url "https://example.com/example-darwin.x86_64.tar.gz" end end - EOS + RUBY fa.audit_url_is_not_binary diff --git a/Library/Homebrew/test/dev-cmd/test_spec.rb b/Library/Homebrew/test/dev-cmd/test_spec.rb index 1ac1d5d911..000018e8b4 100644 --- a/Library/Homebrew/test/dev-cmd/test_spec.rb +++ b/Library/Homebrew/test/dev-cmd/test_spec.rb @@ -1,6 +1,6 @@ describe "brew test", :integration_test do it "tests a given Formula" do - setup_test_formula "testball", <<~EOS + setup_test_formula "testball", <<~RUBY head "https://github.com/example/testball2.git" devel do @@ -12,7 +12,7 @@ describe "brew test", :integration_test do test do end - EOS + RUBY expect { brew "install", "testball" }.to be_a_success diff --git a/Library/Homebrew/test/formula_installer_spec.rb b/Library/Homebrew/test/formula_installer_spec.rb index e9d07b05a1..932738742b 100644 --- a/Library/Homebrew/test/formula_installer_spec.rb +++ b/Library/Homebrew/test/formula_installer_spec.rb @@ -100,12 +100,12 @@ describe FormulaInstaller do specify "check installation sanity pinned dependency" do dep_name = "dependency" dep_path = CoreTap.new.formula_dir/"#{dep_name}.rb" - dep_path.write <<~EOS + dep_path.write <<~RUBY class #{Formulary.class_s(dep_name)} < Formula url "foo" version "0.2" end - EOS + RUBY Formulary.cache.delete(dep_path) dependency = Formulary.factory(dep_name) diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 7e29f61d37..72d7f72fb0 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -6,7 +6,7 @@ describe Formulary do let(:formula_name) { "testball_bottle" } let(:formula_path) { CoreTap.new.formula_dir/"#{formula_name}.rb" } let(:formula_content) do - <<~EOS + <<~RUBY class #{described_class.class_s(formula_name)} < Formula url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" sha256 TESTBALL_SHA256 @@ -22,7 +22,7 @@ describe Formulary do prefix.install "libexec" end end - EOS + RUBY end let(:bottle_dir) { Pathname.new("#{TEST_FIXTURE_DIR}/bottles") } let(:bottle) { bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz" } @@ -81,10 +81,10 @@ describe Formulary do context "when the Formula has the wrong class" do let(:formula_name) { "giraffe" } let(:formula_content) do - <<~EOS + <<~RUBY class Wrong#{described_class.class_s(formula_name)} < Formula end - EOS + RUBY end it "raises an error" do diff --git a/Library/Homebrew/test/java_requirement_spec.rb b/Library/Homebrew/test/java_requirement_spec.rb index 433d41bb7d..3d6b8cebc9 100644 --- a/Library/Homebrew/test/java_requirement_spec.rb +++ b/Library/Homebrew/test/java_requirement_spec.rb @@ -53,10 +53,10 @@ describe JavaRequirement do let(:java) { path/"java" } def setup_java_with_version(version) - IO.write java, <<~EOS + IO.write java, <<~SH #!/bin/sh echo 'java version "#{version}"' - EOS + SH FileUtils.chmod "+x", java end diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index bd17439d2b..0abec2aaed 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -86,9 +86,9 @@ describe Homebrew::MissingFormula do Tap.clear_cache tap_path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" tap_path.mkpath - (tap_path/"tap_migrations.json").write <<~EOS + (tap_path/"tap_migrations.json").write <<~JSON { "migrated-formula": "homebrew/bar" } - EOS + JSON end context "with a migrated formula" do diff --git a/Library/Homebrew/test/rubocops/checksum_cop_spec.rb b/Library/Homebrew/test/rubocops/checksum_cop_spec.rb index 3f720c90fd..f1c6acfc96 100644 --- a/Library/Homebrew/test/rubocops/checksum_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum_cop_spec.rb @@ -111,7 +111,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do context "When auditing checksum with autocorrect" do it "When there is uppercase sha256" do - source = <<~EOS + source = <<~RUBY class Foo < Formula url 'http://example.com/foo-1.0.tgz' stable do @@ -124,9 +124,9 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do end end end - EOS + RUBY - corrected_source = <<~EOS + corrected_source = <<~RUBY class Foo < Formula url 'http://example.com/foo-1.0.tgz' stable do @@ -139,7 +139,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do end end end - EOS + RUBY new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) diff --git a/Library/Homebrew/test/rubocops/class_cop_spec.rb b/Library/Homebrew/test/rubocops/class_cop_spec.rb index 2ea58777ad..71abbda210 100644 --- a/Library/Homebrew/test/rubocops/class_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/class_cop_spec.rb @@ -31,17 +31,17 @@ describe RuboCop::Cop::FormulaAudit::ClassName do end it "supports auto-correcting deprecated parent classes" do - source = <<~EOS + source = <<~RUBY class Foo < AmazonWebServicesFormula url 'http://example.com/foo-1.0.tgz' end - EOS + RUBY - corrected_source = <<~EOS + corrected_source = <<~RUBY class Foo < Formula url 'http://example.com/foo-1.0.tgz' end - EOS + RUBY new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) diff --git a/Library/Homebrew/test/rubocops/components_order_cop_spec.rb b/Library/Homebrew/test/rubocops/components_order_cop_spec.rb index 7466f2d6b6..cd37ddca1c 100644 --- a/Library/Homebrew/test/rubocops/components_order_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_cop_spec.rb @@ -62,26 +62,26 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do context "When auditing formula components order with autocorrect" do it "When url precedes homepage" do - source = <<~EOS + source = <<~RUBY class Foo < Formula url "http://example.com/foo-1.0.tgz" homepage "http://example.com" end - EOS + RUBY - correct_source = <<~EOS + correct_source = <<~RUBY class Foo < Formula homepage "http://example.com" url "http://example.com/foo-1.0.tgz" end - EOS + RUBY corrected_source = autocorrect_source(source) expect(corrected_source).to eq(correct_source) end it "When `resource` precedes `depends_on`" do - source = <<~EOS + source = <<~RUBY class Foo < Formula url "https://example.com/foo-1.0.tgz" @@ -91,9 +91,9 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do depends_on "openssl" end - EOS + RUBY - correct_source = <<~EOS + correct_source = <<~RUBY class Foo < Formula url "https://example.com/foo-1.0.tgz" @@ -103,7 +103,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://example.com/foo-2.0.tgz" end end - EOS + RUBY corrected_source = autocorrect_source(source) expect(corrected_source).to eq(correct_source) diff --git a/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb b/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb index f2c6a66f1e..eccdab411d 100644 --- a/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb @@ -74,23 +74,23 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do context "autocorrect" do it "wrong conditional depends_on order" do - source = <<~EOS + source = <<~RUBY class Foo < Formula homepage "http://example.com" url "http://example.com/foo-1.0.tgz" depends_on "apple" if build.with? "foo" depends_on "foo" => :optional end - EOS + RUBY - correct_source = <<~EOS + correct_source = <<~RUBY class Foo < Formula homepage "http://example.com" url "http://example.com/foo-1.0.tgz" depends_on "foo" => :optional depends_on "apple" if build.with? "foo" end - EOS + RUBY corrected_source = autocorrect_source(source) expect(corrected_source).to eq(correct_source) diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index 20600f071d..cc838a6bfc 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -102,19 +102,19 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do end it "autocorrects all rules" do - source = <<~EOS + source = <<~RUBY class Foo < Formula url 'http://example.com/foo-1.0.tgz' desc ' an bar: commandline foo ' end - EOS + RUBY - correct_source = <<~EOS + correct_source = <<~RUBY class Foo < Formula url 'http://example.com/foo-1.0.tgz' desc 'an bar: command-line' end - EOS + RUBY corrected_source = autocorrect_source(source, "/homebrew-core/Formula/foo.rb") expect(corrected_source).to eq(correct_source) diff --git a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb index d394f94a16..f5ee83f6dc 100644 --- a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb @@ -5,11 +5,11 @@ describe RuboCop::Cop::FormulaAudit::Homepage do context "When auditing homepage" do it "When there is no homepage" do - source = <<~EOS + source = <<~RUBY class Foo < Formula url 'http://example.com/foo-1.0.tgz' end - EOS + RUBY expected_offenses = [{ message: "Formula should have a homepage.", severity: :convention, @@ -25,12 +25,12 @@ describe RuboCop::Cop::FormulaAudit::Homepage do end it "Homepage with ftp" do - source = <<~EOS + source = <<~RUBY class Foo < Formula homepage "ftp://example.com/foo" url "http://example.com/foo-1.0.tgz" end - EOS + RUBY expected_offenses = [{ message: "The homepage should start with http or https (URL is ftp://example.com/foo).", severity: :convention, @@ -62,12 +62,12 @@ describe RuboCop::Cop::FormulaAudit::Homepage do } formula_homepages.each do |name, homepage| - source = <<~EOS + source = <<~RUBY class #{name.capitalize} < Formula homepage "#{homepage}" url "http://example.com/#{name}-1.0.tgz" end - EOS + RUBY inspect_source(source) if homepage =~ %r{http:\/\/www\.freedesktop\.org} diff --git a/Library/Homebrew/test/rubocops/patches_cop_spec.rb b/Library/Homebrew/test/rubocops/patches_cop_spec.rb index 7711711606..1c146c0c51 100644 --- a/Library/Homebrew/test/rubocops/patches_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_cop_spec.rb @@ -113,7 +113,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do end it "Formula with nested `def patches`" do - source = <<~EOS + source = <<~RUBY class Foo < Formula homepage "ftp://example.com/foo" url "http://example.com/foo-1.0.tgz" @@ -125,7 +125,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do } end end - EOS + RUBY expected_offenses = [{ message: "Use the patch DSL instead of defining a 'patches' method", severity: :convention, @@ -162,7 +162,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do "https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch", ] patch_urls.each do |patch_url| - source = <<~EOS + source = <<~RUBY class Foo < Formula homepage "ftp://example.com/foo" url "http://example.com/foo-1.0.tgz" @@ -171,7 +171,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do sha256 "63376b8fdd6613a91976106d9376069274191860cd58f039b29ff16de1925621" end end - EOS + RUBY inspect_source(source) expected_offense = if patch_url =~ %r{/raw\.github\.com/} diff --git a/Library/Homebrew/test/rubocops/urls_cop_spec.rb b/Library/Homebrew/test/rubocops/urls_cop_spec.rb index 9f9f6ded1e..d6b1774dd6 100644 --- a/Library/Homebrew/test/rubocops/urls_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_cop_spec.rb @@ -111,12 +111,12 @@ describe RuboCop::Cop::FormulaAudit::Urls do "col" => 2, }] formulas.each do |formula| - source = <<~EOS + source = <<~RUBY class Foo < Formula desc "foo" url "#{formula["url"]}" end - EOS + RUBY expected_offenses = [{ message: formula["msg"], severity: :convention, line: 3, diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-app.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-app.rb index 885f3b1578..dc90f7f46b 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-app.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-app.rb @@ -8,10 +8,10 @@ cask 'with-uninstall-script-app' do app 'MyFancyApp/MyFancyApp.app' postflight do - IO.write "#{appdir}/MyFancyApp.app/uninstall.sh", <<~EOS + IO.write "#{appdir}/MyFancyApp.app/uninstall.sh", <<~SH #!/bin/sh /bin/rm -r "#{appdir}/MyFancyApp.app" - EOS + SH end uninstall script: { 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 f8e59ad4b4..1a917be37d 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 @@ -127,7 +127,7 @@ RSpec.shared_context "integration test" do else TEST_FIXTURE_DIR/"tarballs/testball-0.1.tbz" end - content = <<~EOS + content = <<~RUBY desc "Some test" homepage "https://example.com/#{name}" url "file://#{tarball}" @@ -147,24 +147,24 @@ RSpec.shared_context "integration test" do #{content} # something here - EOS + RUBY when "foo" - content = <<~EOS + content = <<~RUBY url "https://example.com/#{name}-1.0" - EOS + RUBY when "bar" - content = <<~EOS + content = <<~RUBY url "https://example.com/#{name}-1.0" depends_on "foo" - EOS + RUBY end Formulary.core_path(name).tap do |formula_path| - formula_path.write <<~EOS + formula_path.write <<~RUBY class #{Formulary.class_s(name)} < Formula #{content} end - EOS + RUBY end end diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index fafc8a49af..1bcfa4d33f 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -18,22 +18,22 @@ describe Tap do end def setup_tap_files - formula_file.write <<~EOS + formula_file.write <<~RUBY class Foo < Formula url "https://example.com/foo-1.0.tar.gz" end - EOS + RUBY alias_file.parent.mkpath ln_s formula_file, alias_file - (path/"formula_renames.json").write <<~EOS + (path/"formula_renames.json").write <<~JSON { "oldname": "foo" } - EOS + JSON - (path/"tap_migrations.json").write <<~EOS + (path/"tap_migrations.json").write <<~JSON { "removed-formula": "homebrew/foo" } - EOS + JSON [ cmd_file, @@ -350,11 +350,11 @@ describe CoreTap do specify "files" do formula_file = subject.formula_dir/"foo.rb" - formula_file.write <<~EOS + formula_file.write <<~RUBY class Foo < Formula url "https://example.com/foo-1.0.tar.gz" end - EOS + RUBY alias_file = subject.alias_dir/"bar" alias_file.parent.mkpath diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index aface21c3b..9b5e68d482 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -92,10 +92,10 @@ describe "globally-scoped helper methods" do let(:shell) { dir/"myshell" } it "starts an interactive shell session" do - IO.write shell, <<~EOS + IO.write shell, <<~SH #!/bin/sh echo called > "#{dir}/called" - EOS + SH FileUtils.chmod 0755, shell