diff options
Diffstat (limited to 'Library/Homebrew/test')
60 files changed, 299 insertions, 299 deletions
| diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index 4ead8b7f9..285cc4f31 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -82,12 +82,12 @@ describe Hbc::Artifact::App, :cask do          describe "target is both writable and user-owned" do            it "overwrites the existing app" do -            stdout = <<-EOS.undent +            stdout = <<~EOS                ==> Removing App '#{target_path}'.                ==> Moving App 'Caffeine.app' to '#{target_path}'.              EOS -            stderr = <<-EOS.undent +            stderr = <<~EOS                Warning: It seems there is already an App at '#{target_path}'; overwriting.              EOS @@ -117,12 +117,12 @@ describe Hbc::Artifact::App, :cask do              expect(command).to receive(:run).with("/usr/bin/chflags", args: ["-R", "--", "000", target_path], must_succeed: false)                .and_call_original -            stdout = <<-EOS.undent +            stdout = <<~EOS                ==> Removing App '#{target_path}'.                ==> Moving App 'Caffeine.app' to '#{target_path}'.              EOS -            stderr = <<-EOS.undent +            stderr = <<~EOS                Warning: It seems there is already an App at '#{target_path}'; overwriting.              EOS @@ -162,12 +162,12 @@ describe Hbc::Artifact::App, :cask do          let(:force) { true }          it "overwrites the existing app" do -          stdout = <<-EOS.undent +          stdout = <<~EOS              ==> Removing App '#{target_path}'.              ==> Moving App 'Caffeine.app' to '#{target_path}'.            EOS -          stderr = <<-EOS.undent +          stderr = <<~EOS              Warning: It seems there is already an App at '#{target_path}'; overwriting.            EOS diff --git a/Library/Homebrew/test/cask/artifact/pkg_spec.rb b/Library/Homebrew/test/cask/artifact/pkg_spec.rb index 7f1b64d1a..89916d283 100644 --- a/Library/Homebrew/test/cask/artifact/pkg_spec.rb +++ b/Library/Homebrew/test/cask/artifact/pkg_spec.rb @@ -29,7 +29,7 @@ describe Hbc::Artifact::Pkg, :cask do        file = double(path: Pathname.new("/tmp/choices.xml")) -      expect(file).to receive(:write).with(<<-EOS.undent) +      expect(file).to receive(:write).with(<<~EOS)          <?xml version="1.0" encoding="UTF-8"?>          <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">          <plist version="1.0"> diff --git a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb index 7f2ef75b3..8367dc27d 100644 --- a/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb +++ b/Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb @@ -61,7 +61,7 @@ describe Hbc::Artifact::App, :cask do          target_path_mini.mkpath          expect { -          expect(install_phase).to output(<<-EOS.undent).to_stdout +          expect(install_phase).to output(<<~EOS).to_stdout              ==> Moving App 'Caffeine Pro.app' to '#{target_path_pro}'            EOS          }.to raise_error(Hbc::CaskError, "It seems there is already an App at '#{target_path_mini}'.") @@ -75,7 +75,7 @@ describe Hbc::Artifact::App, :cask do          target_path_pro.mkpath          expect { -          expect(install_phase).to output(<<-EOS.undent).to_stdout +          expect(install_phase).to output(<<~EOS).to_stdout              ==> Moving App 'Caffeine Mini.app' to '#{target_path_mini}'            EOS          }.to raise_error(Hbc::CaskError, "It seems there is already an App at '#{target_path_pro}'.") diff --git a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb index b9872ab9e..7edfb9e1c 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb @@ -11,7 +11,7 @@ shared_examples "#uninstall_phase or #zap_phase" 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) do -      <<-EOS.undent +      <<~EOS          {                  "LimitLoadToSessionType" = "Aqua";                  "Label" = "my.fancy.package.service"; diff --git a/Library/Homebrew/test/cask/cli/cat_spec.rb b/Library/Homebrew/test/cask/cli/cat_spec.rb index 6b54a2e4b..e1db1b17d 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.undent +      <<~EOS          cask 'basic-cask' do            version '1.2.3'            sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' diff --git a/Library/Homebrew/test/cask/cli/cleanup_spec.rb b/Library/Homebrew/test/cask/cli/cleanup_spec.rb index 7cf00352d..cbef71be8 100644 --- a/Library/Homebrew/test/cask/cli/cleanup_spec.rb +++ b/Library/Homebrew/test/cask/cli/cleanup_spec.rb @@ -32,7 +32,7 @@ describe Hbc::CLI::Cleanup, :cask do        expect {          subject.run -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          ==> Removing cached downloads for #{cask_token}          #{cached_downloads[0]}          ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space. @@ -52,7 +52,7 @@ describe Hbc::CLI::Cleanup, :cask do          expect {            subject.run -        }.to output(<<-EOS.undent).to_stdout +        }.to output(<<~EOS).to_stdout            ==> Removing cached downloads            #{cached_download}            ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space. @@ -70,7 +70,7 @@ describe Hbc::CLI::Cleanup, :cask do            expect {              subject.run -          }.to output(<<-EOS.undent).to_stdout +          }.to output(<<~EOS).to_stdout              ==> Removing cached downloads older than 10 days old              Nothing to do            EOS diff --git a/Library/Homebrew/test/cask/cli/create_spec.rb b/Library/Homebrew/test/cask/cli/create_spec.rb index 60c03db75..1b15ecd40 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.undent +    expect(template).to eq <<~EOS        cask 'new-cask' do          version ''          sha256 '' diff --git a/Library/Homebrew/test/cask/cli/info_spec.rb b/Library/Homebrew/test/cask/cli/info_spec.rb index e24eead11..0fc751e06 100644 --- a/Library/Homebrew/test/cask/cli/info_spec.rb +++ b/Library/Homebrew/test/cask/cli/info_spec.rb @@ -8,7 +8,7 @@ describe Hbc::CLI::Info, :cask do    it "displays some nice info about the specified Cask" do      expect {        described_class.run("local-caffeine") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        local-caffeine: 1.2.3        http://example.com/local-caffeine        Not installed @@ -22,7 +22,7 @@ describe Hbc::CLI::Info, :cask do    describe "given multiple Casks" do      let(:expected_output) { -      <<-EOS.undent +      <<~EOS          local-caffeine: 1.2.3          http://example.com/local-caffeine          Not installed @@ -52,7 +52,7 @@ describe Hbc::CLI::Info, :cask do    it "should print caveats if the Cask provided one" do      expect {        described_class.run("with-caveats") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        with-caveats: 1.2.3        http://example.com/local-caffeine        Not installed @@ -78,7 +78,7 @@ describe Hbc::CLI::Info, :cask do    it 'should not print "Caveats" section divider if the caveats block has no output' do      expect {        described_class.run("with-conditional-caveats") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        with-conditional-caveats: 1.2.3        http://example.com/local-caffeine        Not installed @@ -93,7 +93,7 @@ describe Hbc::CLI::Info, :cask do    it "prints languages specified in the Cask" do      expect {        described_class.run("with-languages") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        with-languages: 1.2.3        http://example.com/local-caffeine        Not installed @@ -110,7 +110,7 @@ describe Hbc::CLI::Info, :cask do    it 'does not print "Languages" section divider if the languages block has no output' do      expect {        described_class.run("without-languages") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        without-languages: 1.2.3        http://example.com/local-caffeine        Not installed diff --git a/Library/Homebrew/test/cask/cli/install_spec.rb b/Library/Homebrew/test/cask/cli/install_spec.rb index c918a3529..25d6cdc93 100644 --- a/Library/Homebrew/test/cask/cli/install_spec.rb +++ b/Library/Homebrew/test/cask/cli/install_spec.rb @@ -6,7 +6,7 @@ describe Hbc::CLI::Install, :cask do    it_behaves_like "a command that handles invalid options"    it "displays the installation progress" do -    output = Regexp.new <<-EOS.undent +    output = Regexp.new <<~EOS        ==> Downloading file:.*caffeine.zip        ==> Verifying checksum for Cask local-caffeine        ==> Installing Cask local-caffeine diff --git a/Library/Homebrew/test/cask/cli/list_spec.rb b/Library/Homebrew/test/cask/cli/list_spec.rb index 301ca9b89..eef233acc 100644 --- a/Library/Homebrew/test/cask/cli/list_spec.rb +++ b/Library/Homebrew/test/cask/cli/list_spec.rb @@ -12,7 +12,7 @@ describe Hbc::CLI::List, :cask do      expect {        described_class.run -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        local-caffeine        local-transmission      EOS @@ -31,7 +31,7 @@ describe Hbc::CLI::List, :cask do      expect {        described_class.run("--full-name") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        local-caffeine        local-transmission        third-party/tap/third-party-cask @@ -41,7 +41,7 @@ describe Hbc::CLI::List, :cask do    describe "lists versions" do      let(:casks) { ["local-caffeine", "local-transmission"] }      let(:expected_output) { -      <<-EOS.undent +      <<~EOS          local-caffeine 1.2.3          local-transmission 2.61        EOS @@ -78,7 +78,7 @@ describe Hbc::CLI::List, :cask do        expect {          described_class.run("local-transmission", "local-caffeine") -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          ==> Apps          #{Hbc.appdir.join("Transmission.app")} (#{Hbc.appdir.join("Transmission.app").abv})          ==> Apps diff --git a/Library/Homebrew/test/cask/cli/outdated_spec.rb b/Library/Homebrew/test/cask/cli/outdated_spec.rb index 5bbf18d21..1ee6a6d7d 100644 --- a/Library/Homebrew/test/cask/cli/outdated_spec.rb +++ b/Library/Homebrew/test/cask/cli/outdated_spec.rb @@ -23,7 +23,7 @@ describe Hbc::CLI::Outdated, :cask do      it "checks all the installed Casks when no token is provided" do        expect {          described_class.run -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          local-caffeine (1.2.2) != 1.2.3          local-transmission (2.60) != 2.61        EOS @@ -32,7 +32,7 @@ describe Hbc::CLI::Outdated, :cask do      it "checks only the tokens specified in the command line" do        expect {          described_class.run("local-caffeine") -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          local-caffeine (1.2.2) != 1.2.3        EOS      end @@ -40,7 +40,7 @@ describe Hbc::CLI::Outdated, :cask do      it 'ignores "auto_updates" and "latest" Casks even when their tokens are provided in the command line' do        expect {          described_class.run("local-caffeine", "auto-updates", "version-latest-string") -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          local-caffeine (1.2.2) != 1.2.3        EOS      end @@ -54,7 +54,7 @@ describe Hbc::CLI::Outdated, :cask do      it "lists only the names (no versions) of the outdated Casks with --quiet" do        expect {          described_class.run("--verbose", "--quiet") -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          local-caffeine          local-transmission        EOS @@ -65,7 +65,7 @@ describe Hbc::CLI::Outdated, :cask do      it 'includes the Casks with "auto_updates true" or "version latest" with --greedy' do        expect {          described_class.run("--greedy") -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          auto-updates (2.57) != 2.61          local-caffeine (1.2.2) != 1.2.3          local-transmission (2.60) != 2.61 @@ -79,7 +79,7 @@ describe Hbc::CLI::Outdated, :cask do        expect {          described_class.run("--greedy") -      }.to output(<<-EOS.undent).to_stdout +      }.to output(<<~EOS).to_stdout          local-caffeine (1.2.2) != 1.2.3          local-transmission (2.60) != 2.61          version-latest-string (latest) != latest diff --git a/Library/Homebrew/test/cask/cli/reinstall_spec.rb b/Library/Homebrew/test/cask/cli/reinstall_spec.rb index 95294b695..5e551e5b5 100644 --- a/Library/Homebrew/test/cask/cli/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/reinstall_spec.rb @@ -8,7 +8,7 @@ describe Hbc::CLI::Reinstall, :cask do      Hbc::Installer.new(caffeine).install -    output = Regexp.new <<-EOS.undent +    output = Regexp.new <<~EOS        ==> Downloading file:.*caffeine.zip        Already downloaded: .*local-caffeine--1.2.3.zip        ==> Verifying checksum for Cask local-caffeine diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb index a4f796f3c..cd1a7bd43 100644 --- a/Library/Homebrew/test/cask/cli/search_spec.rb +++ b/Library/Homebrew/test/cask/cli/search_spec.rb @@ -12,7 +12,7 @@ describe Hbc::CLI::Search, :cask do      expect {        Hbc::CLI::Search.run("local") -    }.to output(<<-EOS.undent).to_stdout.as_tty +    }.to output(<<~EOS).to_stdout.as_tty        ==> Partial Matches        local-caffeine        local-transmission @@ -24,7 +24,7 @@ describe Hbc::CLI::Search, :cask do      expect {        Hbc::CLI::Search.run("local") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        local-caffeine        local-transmission      EOS @@ -35,7 +35,7 @@ describe Hbc::CLI::Search, :cask do      expect {        Hbc::CLI::Search.run("local") -    }.to output(<<-EOS.undent).to_stdout +    }.to output(<<~EOS).to_stdout        local-caffeine        local-transmission      EOS @@ -45,7 +45,7 @@ describe Hbc::CLI::Search, :cask do    it "shows that there are no Casks matching a search term that did not result in anything" do      expect {        Hbc::CLI::Search.run("foo-bar-baz") -    }.to output(<<-EOS.undent).to_stdout.as_tty +    }.to output(<<~EOS).to_stdout.as_tty        No Cask found for "foo-bar-baz".      EOS    end @@ -84,7 +84,7 @@ describe Hbc::CLI::Search, :cask do    it "accepts a regexp argument" do      expect {        Hbc::CLI::Search.run("/^local-c[a-z]ffeine$/") -    }.to output(<<-EOS.undent).to_stdout.as_tty +    }.to output(<<~EOS).to_stdout.as_tty        ==> Regexp Matches        local-caffeine      EOS @@ -93,7 +93,7 @@ describe Hbc::CLI::Search, :cask do    it "returns both exact and partial matches" do      expect {        Hbc::CLI::Search.run("test-opera") -    }.to output(<<-EOS.undent).to_stdout.as_tty +    }.to output(<<~EOS).to_stdout.as_tty        ==> Exact Match        test-opera        ==> Partial Matches @@ -104,7 +104,7 @@ describe Hbc::CLI::Search, :cask do    it "does not search the Tap name" do      expect {        Hbc::CLI::Search.run("caskroom") -    }.to output(<<-EOS.undent).to_stdout.as_tty +    }.to output(<<~EOS).to_stdout.as_tty        No Cask found for "caskroom".      EOS    end diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb index 80b7edbd3..1ab8f7e4d 100644 --- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb @@ -10,7 +10,7 @@ describe Hbc::CLI::Uninstall, :cask do      Hbc::Installer.new(caffeine).install -    output = Regexp.new <<-EOS.undent +    output = Regexp.new <<~EOS        ==> Uninstalling Cask local-caffeine        ==> Removing App '.*Caffeine.app'.      EOS @@ -107,7 +107,7 @@ 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.undent +                       caskfile.puts <<~EOS                           cask '#{token}' do                             version '#{timestamped_version[0]}'                           end @@ -153,7 +153,7 @@ describe Hbc::CLI::Uninstall, :cask do        saved_caskfile.dirname.mkpath -      IO.write saved_caskfile, <<-EOS.undent +      IO.write saved_caskfile, <<~EOS          cask 'ive-been-renamed' do            version :latest diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index 28cf6f4b2..a17acfca6 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -20,7 +20,7 @@ describe Hbc::DSL, :cask do      }      it "prints a warning that it has encountered an unexpected method" do -      expected = Regexp.compile(<<-EOS.undent.lines.map(&:chomp).join("")) +      expected = Regexp.compile(<<~EOS.lines.map(&:chomp).join(""))          (?m)          Warning:          .* @@ -232,7 +232,7 @@ describe Hbc::DSL, :cask do        expect(cask.caveats).to be_empty        cask = Hbc::Cask.new("cask-with-caveats") do -        def caveats; <<-EOS.undent +        def caveats; <<~EOS            When you install this Cask, you probably want to know this.            EOS          end diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index 07443e76e..f92d6854e 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.undent +      <<~EOS          <?xml version="1.0" encoding="UTF-8"?>          <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">          <plist version="1.0"> diff --git a/Library/Homebrew/test/cask/system_command_result_spec.rb b/Library/Homebrew/test/cask/system_command_result_spec.rb index 4a077de7b..d09f1220c 100644 --- a/Library/Homebrew/test/cask/system_command_result_spec.rb +++ b/Library/Homebrew/test/cask/system_command_result_spec.rb @@ -5,7 +5,7 @@ describe Hbc::SystemCommand::Result, :cask do      subject { described_class._parse_plist(command, input) }      let(:command) { Hbc::SystemCommand.new("/usr/bin/true", {}) }      let(:plist) { -      <<-EOS.undent +      <<~EOS          <?xml version="1.0" encoding="UTF-8"?>          <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">          <plist version="1.0"> @@ -54,7 +54,7 @@ describe Hbc::SystemCommand::Result, :cask do      context "when output contains garbage" do        let(:input) { -        <<-EOS.undent +        <<~EOS            Hello there! I am in no way XML am I?!?!              That's a little silly... you were expexting XML here! diff --git a/Library/Homebrew/test/cmd/custom-external-command_spec.rb b/Library/Homebrew/test/cmd/custom-external-command_spec.rb index d649786ec..8e6ffe2ff 100644 --- a/Library/Homebrew/test/cmd/custom-external-command_spec.rb +++ b/Library/Homebrew/test/cmd/custom-external-command_spec.rb @@ -4,7 +4,7 @@ describe "brew custom-external-command", :integration_test do        cmd = "custom-external-command-#{rand}"        file = path/"brew-#{cmd}" -      file.write <<-EOS.undent +      file.write <<~EOS          #!/bin/sh          echo 'I am #{cmd}.'        EOS diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index b6030f26a..8a9f7a0d2 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -56,7 +56,7 @@ describe "brew install", :integration_test do    end    specify "install failures" do -    path = setup_test_formula "testball1", <<-EOS.undent +    path = setup_test_formula "testball1", <<~EOS        version "1.0"      EOS @@ -66,7 +66,7 @@ describe "brew install", :integration_test do        .and be_a_success      FileUtils.rm path -    setup_test_formula "testball1", <<-EOS.undent +    setup_test_formula "testball1", <<~EOS        version "2.0"        devel do @@ -120,7 +120,7 @@ describe "brew install", :integration_test do    end    it "can install keg-only Formulae" do -    path_keg_only = setup_test_formula "testball1", <<-EOS.undent +    path_keg_only = setup_test_formula "testball1", <<~EOS        version "1.0"        keg_only "test reason" @@ -132,7 +132,7 @@ describe "brew install", :integration_test do        .and be_a_success      FileUtils.rm path_keg_only -    setup_test_formula "testball1", <<-EOS.undent +    setup_test_formula "testball1", <<~EOS        version "2.0"        keg_only "test reason" @@ -162,7 +162,7 @@ describe "brew install", :integration_test do        system "git", "commit", "-m", "Initial repo commit"      end -    setup_test_formula "testball1", <<-EOS.undent +    setup_test_formula "testball1", <<~EOS        version "1.0"        head "file://#{repo_path}", :using => :git @@ -205,7 +205,7 @@ describe "brew install", :integration_test do    end    it "succeeds when a non-fatal requirement isn't satisfied" do -    setup_test_formula "testball1", <<-EOS.undent +    setup_test_formula "testball1", <<~EOS        class NonFatalRequirement < Requirement          satisfy { false }        end @@ -220,7 +220,7 @@ describe "brew install", :integration_test do    end    it "fails when a fatal requirement isn't satisfied" do -    setup_test_formula "testball1", <<-EOS.undent +    setup_test_formula "testball1", <<~EOS        class FatalRequirement < Requirement          fatal true          satisfy { false } diff --git a/Library/Homebrew/test/cmd/irb_spec.rb b/Library/Homebrew/test/cmd/irb_spec.rb index 44410fabe..0423c6ab7 100644 --- a/Library/Homebrew/test/cmd/irb_spec.rb +++ b/Library/Homebrew/test/cmd/irb_spec.rb @@ -3,7 +3,7 @@ describe "brew irb", :integration_test do      setup_test_formula "testball"      irb_test = HOMEBREW_TEMP/"irb-test.rb" -    irb_test.write <<-EOS.undent +    irb_test.write <<~EOS        "testball".f        :testball.f        exit diff --git a/Library/Homebrew/test/cmd/link_spec.rb b/Library/Homebrew/test/cmd/link_spec.rb index 78942b7a8..bde321e4c 100644 --- a/Library/Homebrew/test/cmd/link_spec.rb +++ b/Library/Homebrew/test/cmd/link_spec.rb @@ -36,7 +36,7 @@ describe "brew link", :integration_test do    end    it "refuses to link keg-only Formulae" do -    setup_test_formula "testball1", <<-EOS.undent +    setup_test_formula "testball1", <<~EOS        keg_only "just because"      EOS diff --git a/Library/Homebrew/test/cmd/options_spec.rb b/Library/Homebrew/test/cmd/options_spec.rb index 33fe8b107..bb6b98a47 100644 --- a/Library/Homebrew/test/cmd/options_spec.rb +++ b/Library/Homebrew/test/cmd/options_spec.rb @@ -1,6 +1,6 @@  describe "brew options", :integration_test do    it "prints a given Formula's options" do -    setup_test_formula "testball", <<-EOS.undent +    setup_test_formula "testball", <<~EOS        depends_on "bar" => :recommended      EOS diff --git a/Library/Homebrew/test/cmd/style_spec.rb b/Library/Homebrew/test/cmd/style_spec.rb index 9bc8fcab1..5c118f32e 100644 --- a/Library/Homebrew/test/cmd/style_spec.rb +++ b/Library/Homebrew/test/cmd/style_spec.rb @@ -19,7 +19,7 @@ describe "brew style" do      it "returns RubocopResults when RuboCop reports offenses" do        formula = dir/"my-formula.rb" -      formula.write <<-'EOS'.undent +      formula.write <<~'EOS'          class MyFormula < Formula          end diff --git a/Library/Homebrew/test/cmd/switch_spec.rb b/Library/Homebrew/test/cmd/switch_spec.rb index 00fe4ace6..48d7dcdd0 100644 --- a/Library/Homebrew/test/cmd/switch_spec.rb +++ b/Library/Homebrew/test/cmd/switch_spec.rb @@ -10,7 +10,7 @@ describe "brew switch", :integration_test do        .and not_to_output.to_stdout        .and be_a_failure -    setup_test_formula "testball", <<-EOS.undent +    setup_test_formula "testball", <<~EOS        keg_only "just because"      EOS diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index 2a6f48cb7..4a8c446a5 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -2,7 +2,7 @@ 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.undent +    setup_test_formula "baz", <<~EOS        url "https://example.com/baz-1.0"        depends_on "bar"      EOS diff --git a/Library/Homebrew/test/deps_spec.rb b/Library/Homebrew/test/deps_spec.rb index 4c892c93d..f0ec514d9 100644 --- a/Library/Homebrew/test/deps_spec.rb +++ b/Library/Homebrew/test/deps_spec.rb @@ -2,7 +2,7 @@ describe "brew deps", :integration_test do    before(:each) do      setup_test_formula "foo"      setup_test_formula "bar" -    setup_test_formula "baz", <<-EOS.undent +    setup_test_formula "baz", <<~EOS        url "https://example.com/baz-1.0"        depends_on "bar"      EOS diff --git a/Library/Homebrew/test/descriptions_spec.rb b/Library/Homebrew/test/descriptions_spec.rb index e873c73b4..c4f67cc4c 100644 --- a/Library/Homebrew/test/descriptions_spec.rb +++ b/Library/Homebrew/test/descriptions_spec.rb @@ -19,7 +19,7 @@ describe Descriptions do      descriptions_hash["somedev/external/foo"] = "External foo"      expect { subject.print }.to output( -      <<-EOS.undent +      <<~EOS          homebrew/core/foo: Core foo          somedev/external/foo: External foo        EOS @@ -32,7 +32,7 @@ describe Descriptions do      descriptions_hash["otherdev/external/foo"] = "Other external foo"      expect { subject.print }.to output( -      <<-EOS.undent +      <<~EOS          homebrew/core/foo: Core foo          otherdev/external/foo: Other external foo          somedev/external/foo: External foo diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 3e99bd06b..8dd3aee72 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -18,7 +18,7 @@ describe FormulaText do    def formula_text(name, body = nil, options = {})      path = dir/"#{name}.rb" -    path.write <<-EOS.undent +    path.write <<~EOS        class #{Formulary.class_s(name)} < Formula          #{body}        end @@ -29,7 +29,7 @@ describe FormulaText do    end    specify "simple valid Formula" do -    ft = formula_text "valid", <<-EOS.undent +    ft = formula_text "valid", <<~EOS        url "http://www.example.com/valid-1.0.tar.gz"      EOS @@ -49,7 +49,7 @@ describe FormulaText do    end    specify "#data?" do -    ft = formula_text "data", <<-EOS.undent +    ft = formula_text "data", <<~EOS        patch :DATA      EOS @@ -77,7 +77,7 @@ describe FormulaAuditor do    describe "#problems" do      it "is empty by default" do -      fa = formula_auditor "foo", <<-EOS.undent +      fa = formula_auditor "foo", <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"          end @@ -91,7 +91,7 @@ describe FormulaAuditor do      specify "file permissions" do        allow(File).to receive(:umask).and_return(022) -      fa = formula_auditor "foo", <<-EOS.undent +      fa = formula_auditor "foo", <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"          end @@ -106,7 +106,7 @@ describe FormulaAuditor do      end      specify "DATA but no __END__" do -      fa = formula_auditor "foo", <<-EOS.undent +      fa = formula_auditor "foo", <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            patch :DATA @@ -118,7 +118,7 @@ describe FormulaAuditor do      end      specify "__END__ but no DATA" do -      fa = formula_auditor "foo", <<-EOS.undent +      fa = formula_auditor "foo", <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"          end @@ -138,7 +138,7 @@ describe FormulaAuditor do      end      specify "no issue" do -      fa = formula_auditor "foo", <<-EOS.undent +      fa = formula_auditor "foo", <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -152,7 +152,7 @@ describe FormulaAuditor do    describe "#line_problems" do      specify "pkgshare" do -      fa = formula_auditor "foo", <<-EOS.undent, strict: true +      fa = formula_auditor "foo", <<~EOS, strict: true          class Foo < Formula            url "http://example.com/foo-1.0.tgz"          end @@ -184,7 +184,7 @@ describe FormulaAuditor do      # 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.undent, strict: true +      fa = formula_auditor "foolibc++", <<~EOS, strict: true          class Foolibcxx < Formula            desc "foolibc++ is a test"            url "http://example.com/foo-1.0.tgz" @@ -205,7 +205,7 @@ describe FormulaAuditor do      specify "#audit_github_repository when HOMEBREW_NO_GITHUB_API is set" do        ENV["HOMEBREW_NO_GITHUB_API"] = "1" -      fa = formula_auditor "foo", <<-EOS.undent, strict: true, online: true +      fa = formula_auditor "foo", <<~EOS, strict: true, online: true          class Foo < Formula            homepage "https://github.com/example/example"            url "http://example.com/foo-1.0.tgz" @@ -219,7 +219,7 @@ describe FormulaAuditor do    describe "#audit_keg_only_style" do      specify "keg_only_needs_downcasing" do -      fa = formula_auditor "foo", <<-EOS.undent, strict: true +      fa = formula_auditor "foo", <<~EOS, strict: true          class Foo < Formula            url "http://example.com/foo-1.0.tgz" @@ -233,7 +233,7 @@ describe FormulaAuditor do      end      specify "keg_only_redundant_period" do -      fa = formula_auditor "foo", <<-EOS.undent, strict: true +      fa = formula_auditor "foo", <<~EOS, strict: true          class Foo < Formula            url "http://example.com/foo-1.0.tgz" @@ -247,11 +247,11 @@ describe FormulaAuditor do      end      specify "keg_only_handles_block_correctly" do -      fa = formula_auditor "foo", <<-EOS.undent, strict: true +      fa = formula_auditor "foo", <<~EOS, strict: true          class Foo < Formula            url "http://example.com/foo-1.0.tgz" -          keg_only <<-EOF.undent +          keg_only <<~EOF              this line starts with a lowercase word.              This line does not but that shouldn't be a @@ -266,7 +266,7 @@ describe FormulaAuditor do      end      specify "keg_only_handles_whitelist_correctly" do -      fa = formula_auditor "foo", <<-EOS.undent, strict: true +      fa = formula_auditor "foo", <<~EOS, strict: true          class Foo < Formula            url "http://example.com/foo-1.0.tgz" @@ -290,7 +290,7 @@ describe FormulaAuditor do      before(:each) do        @foo_version = Count.increment -      origin_formula_path.write <<-EOS.undent +      origin_formula_path.write <<~EOS          class Foo#{@foo_version} < Formula            url "https://example.com/foo-1.0.tar.gz"            revision 2 diff --git a/Library/Homebrew/test/dev-cmd/test_spec.rb b/Library/Homebrew/test/dev-cmd/test_spec.rb index 9ff365bfb..6e5d822bc 100644 --- a/Library/Homebrew/test/dev-cmd/test_spec.rb +++ b/Library/Homebrew/test/dev-cmd/test_spec.rb @@ -23,7 +23,7 @@ describe "brew test", :integration_test do    end    it "tests a given Formula" do -    setup_test_formula "testball", <<-EOS.undent +    setup_test_formula "testball", <<~EOS        head "https://github.com/example/testball2.git"        devel do diff --git a/Library/Homebrew/test/formula_installer_spec.rb b/Library/Homebrew/test/formula_installer_spec.rb index 7b729312b..1e3c04b68 100644 --- a/Library/Homebrew/test/formula_installer_spec.rb +++ b/Library/Homebrew/test/formula_installer_spec.rb @@ -100,7 +100,7 @@ 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.undent +    dep_path.write <<~EOS        class #{Formulary.class_s(dep_name)} < Formula          url "foo"          version "0.2" diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 3180ad9a7..f091fdd03 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.undent +    <<~EOS        class #{subject.class_s(formula_name)} < Formula          url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"          sha256 TESTBALL_SHA256 @@ -66,7 +66,7 @@ describe Formulary do      context "if the Formula has the wrong class" do        let(:formula_name) { "giraffe" }        let(:formula_content) do -        <<-EOS.undent +        <<~EOS            class Wrong#{subject.class_s(formula_name)} < Formula            end          EOS diff --git a/Library/Homebrew/test/gpg2_requirement_spec.rb b/Library/Homebrew/test/gpg2_requirement_spec.rb index a5501c84e..8b9040b82 100644 --- a/Library/Homebrew/test/gpg2_requirement_spec.rb +++ b/Library/Homebrew/test/gpg2_requirement_spec.rb @@ -7,7 +7,7 @@ describe GPG2Requirement do    describe "#satisfied?" do      it "returns true if GPG2 is installed" do        ENV["PATH"] = dir/"bin" -      (dir/"bin/gpg").write <<-EOS.undent +      (dir/"bin/gpg").write <<~EOS          #!/bin/bash          echo 2.1.20        EOS diff --git a/Library/Homebrew/test/inreplace_spec.rb b/Library/Homebrew/test/inreplace_spec.rb index 5be44f50d..330943be4 100644 --- a/Library/Homebrew/test/inreplace_spec.rb +++ b/Library/Homebrew/test/inreplace_spec.rb @@ -9,7 +9,7 @@ describe StringInreplaceExtension do      context "flag" do        context "with spaces" do          let(:string) do -          <<-EOS.undent +          <<~EOS              OTHER=def              FLAG = abc              FLAG2=abc @@ -18,7 +18,7 @@ describe StringInreplaceExtension do          it "is successfully replaced" do            subject.change_make_var! "FLAG", "def" -          expect(subject).to eq <<-EOS.undent +          expect(subject).to eq <<~EOS              OTHER=def              FLAG=def              FLAG2=abc @@ -27,7 +27,7 @@ describe StringInreplaceExtension do          it "is successfully appended" do            subject.change_make_var! "FLAG", "\\1 def" -          expect(subject).to eq <<-EOS.undent +          expect(subject).to eq <<~EOS              OTHER=def              FLAG=abc def              FLAG2=abc @@ -37,7 +37,7 @@ describe StringInreplaceExtension do        context "with tabs" do          let(:string) do -          <<-EOS.undent +          <<~EOS              CFLAGS\t=\t-Wall -O2              LDFLAGS\t=\t-lcrypto -lssl            EOS @@ -45,7 +45,7 @@ describe StringInreplaceExtension do          it "is successfully replaced" do            subject.change_make_var! "CFLAGS", "-O3" -          expect(subject).to eq <<-EOS.undent +          expect(subject).to eq <<~EOS              CFLAGS=-O3              LDFLAGS\t=\t-lcrypto -lssl            EOS @@ -55,7 +55,7 @@ describe StringInreplaceExtension do      context "empty flag between other flags" do        let(:string) do -        <<-EOS.undent +        <<~EOS            OTHER=def            FLAG =            FLAG2=abc @@ -64,7 +64,7 @@ describe StringInreplaceExtension do        it "is successfully replaced" do          subject.change_make_var! "FLAG", "def" -        expect(subject).to eq <<-EOS.undent +        expect(subject).to eq <<~EOS            OTHER=def            FLAG=def            FLAG2=abc @@ -74,7 +74,7 @@ describe StringInreplaceExtension do      context "empty flag" do        let(:string) do -        <<-EOS.undent +        <<~EOS            FLAG =            mv file_a file_b          EOS @@ -82,7 +82,7 @@ describe StringInreplaceExtension do        it "is successfully replaced" do          subject.change_make_var! "FLAG", "def" -        expect(subject).to eq <<-EOS.undent +        expect(subject).to eq <<~EOS            FLAG=def            mv file_a file_b          EOS @@ -91,7 +91,7 @@ describe StringInreplaceExtension do      context "shell-style variable" do        let(:string) do -        <<-EOS.undent +        <<~EOS            OTHER=def            FLAG=abc            FLAG2=abc @@ -100,7 +100,7 @@ describe StringInreplaceExtension do        it "is successfully replaced" do          subject.change_make_var! "FLAG", "def" -        expect(subject).to eq <<-EOS.undent +        expect(subject).to eq <<~EOS            OTHER=def            FLAG=def            FLAG2=abc @@ -113,7 +113,7 @@ describe StringInreplaceExtension do      context "flag" do        context "with spaces" do          let(:string) do -          <<-EOS.undent +          <<~EOS              OTHER=def              FLAG = abc              FLAG2 = def @@ -122,7 +122,7 @@ describe StringInreplaceExtension do          it "is successfully removed" do            subject.remove_make_var! "FLAG" -          expect(subject).to eq <<-EOS.undent +          expect(subject).to eq <<~EOS              OTHER=def              FLAG2 = def            EOS @@ -131,7 +131,7 @@ describe StringInreplaceExtension do        context "with tabs" do          let(:string) do -          <<-EOS.undent +          <<~EOS              CFLAGS\t=\t-Wall -O2              LDFLAGS\t=\t-lcrypto -lssl            EOS @@ -139,7 +139,7 @@ describe StringInreplaceExtension do          it "is successfully removed" do            subject.remove_make_var! "LDFLAGS" -          expect(subject).to eq <<-EOS.undent +          expect(subject).to eq <<~EOS              CFLAGS\t=\t-Wall -O2            EOS          end @@ -148,7 +148,7 @@ describe StringInreplaceExtension do      context "multiple flags" do        let(:string) do -        <<-EOS.undent +        <<~EOS            OTHER=def            FLAG = abc            FLAG2 = def @@ -158,7 +158,7 @@ describe StringInreplaceExtension do        specify "are be successfully removed" do          subject.remove_make_var! ["FLAG", "FLAG2"] -        expect(subject).to eq <<-EOS.undent +        expect(subject).to eq <<~EOS            OTHER=def            OTHER2=def          EOS @@ -169,7 +169,7 @@ describe StringInreplaceExtension do    describe "#get_make_var" do      context "with spaces" do        let(:string) do -        <<-EOS.undent +        <<~EOS            CFLAGS = -Wall -O2            LDFLAGS = -lcrypto -lssl          EOS @@ -182,7 +182,7 @@ describe StringInreplaceExtension do      context "with tabs" do        let(:string) do -        <<-EOS.undent +        <<~EOS            CFLAGS\t=\t-Wall -O2            LDFLAGS\t=\t-lcrypto -lssl          EOS @@ -217,7 +217,7 @@ describe Utils::Inreplace do    let(:file) { Tempfile.new("test") }    before(:each) do -    file.write <<-EOS.undent +    file.write <<~EOS        a        b        c diff --git a/Library/Homebrew/test/java_requirement_spec.rb b/Library/Homebrew/test/java_requirement_spec.rb index 05d4f3cda..685e250e0 100644 --- a/Library/Homebrew/test/java_requirement_spec.rb +++ b/Library/Homebrew/test/java_requirement_spec.rb @@ -50,7 +50,7 @@ describe JavaRequirement do        let(:java) { path/"java" }        def setup_java_with_version(version) -        IO.write java, <<-EOS.undent +        IO.write java, <<~EOS            #!/bin/sh            echo 'java version "#{version}"'          EOS diff --git a/Library/Homebrew/test/language/python_spec.rb b/Library/Homebrew/test/language/python_spec.rb index 02f6bf8d2..d384ce602 100644 --- a/Library/Homebrew/test/language/python_spec.rb +++ b/Library/Homebrew/test/language/python_spec.rb @@ -41,7 +41,7 @@ describe Language::Python::Virtualenv::Virtualenv do                "--no-binary", ":all:", "--ignore-installed", "foo", "bar")          .and_return(true) -      subject.pip_install <<-EOS.undent +      subject.pip_install <<~EOS          foo          bar        EOS diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index 0a905004b..830ecb6aa 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -116,7 +116,7 @@ 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.undent +      (tap_path/"tap_migrations.json").write <<~EOS          { "migrated-formula": "homebrew/bar" }        EOS      end diff --git a/Library/Homebrew/test/pathname_spec.rb b/Library/Homebrew/test/pathname_spec.rb index 69314e5f4..1349e602b 100644 --- a/Library/Homebrew/test/pathname_spec.rb +++ b/Library/Homebrew/test/pathname_spec.rb @@ -79,12 +79,12 @@ describe Pathname do        touch file        file.append_lines("CONTENT") -      expect(File.read(file)).to eq <<-EOS.undent +      expect(File.read(file)).to eq <<~EOS          CONTENT        EOS        file.append_lines("CONTENTS") -      expect(File.read(file)).to eq <<-EOS.undent +      expect(File.read(file)).to eq <<~EOS          CONTENT          CONTENTS        EOS diff --git a/Library/Homebrew/test/rubocops/bottle_block_cop_spec.rb b/Library/Homebrew/test/rubocops/bottle_block_cop_spec.rb index b1afdc3f9..659750858 100644 --- a/Library/Homebrew/test/rubocops/bottle_block_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle_block_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAuditStrict::BottleBlock do    context "When auditing Bottle Block" do      it "When there is revision in bottle block" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            bottle do @@ -41,7 +41,7 @@ describe RuboCop::Cop::FormulaAuditStrict::BottleBlock do    context "When auditing Bottle Block with auto correct" do      it "When there is revision in bottle block" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            bottle do @@ -50,7 +50,7 @@ describe RuboCop::Cop::FormulaAuditStrict::BottleBlock do            end          end        EOS -      corrected_source = <<-EOS.undent +      corrected_source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            bottle do diff --git a/Library/Homebrew/test/rubocops/caveats_cop_spec.rb b/Library/Homebrew/test/rubocops/caveats_cop_spec.rb index 4dbe65cfb..68f79e08a 100644 --- a/Library/Homebrew/test/rubocops/caveats_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/caveats_cop_spec.rb @@ -8,20 +8,19 @@ describe RuboCop::Cop::FormulaAudit::Caveats do    context "When auditing caveats" do      it "When there is setuid mentioned in caveats" do -      source = <<-EOS.undent -      class Foo < Formula -        homepage "http://example.com/foo" -        url "http://example.com/foo-1.0.tgz" - -        def caveats -          "setuid" +      source = <<~EOS +        class Foo < Formula +          homepage "http://example.com/foo" +          url "http://example.com/foo-1.0.tgz" +           def caveats +            "setuid" +          end          end -      end        EOS        expected_offenses = [{  message: "Don't recommend setuid in the caveats, suggest sudo instead.",                                severity: :convention, -                              line: 6, +                              line: 5,                                column: 5,                                source: source }] diff --git a/Library/Homebrew/test/rubocops/checksum_cop_spec.rb b/Library/Homebrew/test/rubocops/checksum_cop_spec.rb index 2f508bbf5..ab70f2dcf 100644 --- a/Library/Homebrew/test/rubocops/checksum_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do    context "When auditing spec checksums" do      it "When the checksum is empty" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            stable do @@ -42,7 +42,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do      end      it "When the checksum is not 64 characters" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            stable do @@ -76,7 +76,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do      end      it "When the checksum has invalid chars" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            stable do @@ -116,7 +116,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do    context "When auditing spec checksums" do      it "When the checksum has upper case characters" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            stable do @@ -150,7 +150,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do      end      it "When auditing stable blocks outside spec blocks" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            resource "foo-outside" do @@ -185,7 +185,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do    context "When auditing checksum with autocorrect" do      it "When there is uppercase sha256" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            stable do @@ -200,7 +200,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do          end        EOS -      corrected_source = <<-EOS.undent +      corrected_source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            stable do diff --git a/Library/Homebrew/test/rubocops/class_cop_spec.rb b/Library/Homebrew/test/rubocops/class_cop_spec.rb index 59252587c..3f210af11 100644 --- a/Library/Homebrew/test/rubocops/class_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/class_cop_spec.rb @@ -17,10 +17,10 @@ describe RuboCop::Cop::FormulaAudit::ClassName do        }]        formulas.each do |formula| -        source = <<-EOS.undent -        class Foo < #{formula["class"]} -          url 'http://example.com/foo-1.0.tgz' -        end +        source = <<~EOS +          class Foo < #{formula["class"]} +            url 'http://example.com/foo-1.0.tgz' +          end          EOS          expected_offenses = [{  message: "#{formula["class"]} is deprecated, use Formula instead", @@ -38,12 +38,12 @@ describe RuboCop::Cop::FormulaAudit::ClassName do      end      it "with deprecated inheritance and autocorrect" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < AmazonWebServicesFormula            url 'http://example.com/foo-1.0.tgz'          end        EOS -      corrected_source = <<-EOS.undent +      corrected_source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'          end @@ -60,7 +60,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Test do    context "When auditing formula" do      it "without a test block" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'          end diff --git a/Library/Homebrew/test/rubocops/components_order_cop_spec.rb b/Library/Homebrew/test/rubocops/components_order_cop_spec.rb index f093f4927..a4726c001 100644 --- a/Library/Homebrew/test/rubocops/components_order_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do    context "When auditing formula components order" do      it "When url precedes homepage" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -29,7 +29,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do      end      it "When `resource` precedes `depends_on`" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "https://example.com/foo-1.0.tgz" @@ -55,7 +55,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do      end      it "When `test` precedes `plist`" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "https://example.com/foo-1.0.tgz" @@ -82,7 +82,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do      end      it "When only one of many `depends_on` precedes `conflicts_with`" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            depends_on "autoconf" => :build            conflicts_with "visionmedia-watch" @@ -116,13 +116,13 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do    context "When auditing formula components order with autocorrect" do      it "When url precedes homepage" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com"          end        EOS -      correct_source = <<-EOS.undent +      correct_source = <<~EOS          class Foo < Formula            homepage "http://example.com"            url "http://example.com/foo-1.0.tgz" @@ -134,7 +134,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do      end      it "When `resource` precedes `depends_on`" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "https://example.com/foo-1.0.tgz" @@ -145,7 +145,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do            depends_on "openssl"          end        EOS -      correct_source = <<-EOS.undent +      correct_source = <<~EOS          class Foo < Formula            url "https://example.com/foo-1.0.tgz" diff --git a/Library/Homebrew/test/rubocops/components_redundancy_cop_spec.rb b/Library/Homebrew/test/rubocops/components_redundancy_cop_spec.rb index 9fbe15904..e899a9b07 100644 --- a/Library/Homebrew/test/rubocops/components_redundancy_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/components_redundancy_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsRedundancy do    context "When auditing formula components common errors" do      it "When url outside stable block" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            stable do @@ -31,7 +31,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsRedundancy do      end      it "When both `head` and `head do` are present" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            head "http://example.com/foo.git"            head do @@ -54,7 +54,7 @@ describe RuboCop::Cop::FormulaAuditStrict::ComponentsRedundancy do      end      it "When both `bottle :modifier` and `bottle do` are present" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            bottle do diff --git a/Library/Homebrew/test/rubocops/conflicts_cop_spec.rb b/Library/Homebrew/test/rubocops/conflicts_cop_spec.rb index 8874ecc96..40efe8545 100644 --- a/Library/Homebrew/test/rubocops/conflicts_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/conflicts_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do    context "When auditing formula for conflicts with" do      it "multiple conflicts_with" do -      source = <<-EOS.undent +      source = <<~EOS          class FooAT20 < Formula            url 'http://example.com/foo-2.0.tgz'            conflicts_with "mysql", "mariadb", "percona-server", @@ -30,7 +30,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do      end      it "no conflicts_with" do -      source = <<-EOS.undent +      source = <<~EOS          class FooAT20 < Formula            url 'http://example.com/foo-2.0.tgz'            desc 'Bar' diff --git a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb index 4816c3b26..0f0189aa8 100644 --- a/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do    context "When auditing formula desc" do      it "When there is no desc" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'          end @@ -28,7 +28,7 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do      end      it "reports an offense when desc is an empty string" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc '' @@ -49,14 +49,14 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do      end      it "When desc is too long" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'Bar#{"bar" * 29}'          end        EOS -      msg = <<-EOS.undent +      msg = <<~EOS          Description is too long. "name: desc" should be less than 80 characters.          Length is calculated as foo + desc. (currently 95)        EOS @@ -73,7 +73,7 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do      end      it "When desc is multiline string" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'Bar#{"bar" * 9}'\ @@ -81,7 +81,7 @@ describe RuboCop::Cop::FormulaAuditStrict::DescLength do          end        EOS -      msg = <<-EOS.undent +      msg = <<~EOS          Description is too long. "name: desc" should be less than 80 characters.          Length is calculated as foo + desc. (currently 98)        EOS @@ -104,7 +104,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do    context "When auditing formula desc" do      it "When wrong \"command-line\" usage in desc" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'command line' @@ -124,7 +124,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do      end      it "When an article is used in desc" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'An ' @@ -144,7 +144,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do      end      it "When an lowercase letter starts a desc" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'bar' @@ -164,7 +164,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do      end      it "When formula name is in desc" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'Foo is a foobar' @@ -184,13 +184,13 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do      end      it "autocorrects all rules" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc ' an bar: commandline foo '          end        EOS -      correct_source = <<-EOS.undent +      correct_source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            desc 'an bar: command-line' diff --git a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb index 6c7f248ba..be9dddae6 100644 --- a/Library/Homebrew/test/rubocops/homepage_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do    context "When auditing homepage" do      it "When there is no homepage" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'          end @@ -28,7 +28,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do      end      it "Homepage with ftp" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            homepage "ftp://example.com/foo"            url "http://example.com/foo-1.0.tgz" @@ -65,7 +65,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do        }        formula_homepages.each do |name, homepage| -        source = <<-EOS.undent +        source = <<~EOS            class #{name.capitalize} < Formula              homepage "#{homepage}"              url "http://example.com/#{name}-1.0.tgz" diff --git a/Library/Homebrew/test/rubocops/lines_cop_spec.rb b/Library/Homebrew/test/rubocops/lines_cop_spec.rb index af816a5a9..7e93bee75 100644 --- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb @@ -25,11 +25,11 @@ describe RuboCop::Cop::FormulaAudit::Lines do        }]        formulae.each do |formula| -        source = <<-EOS.undent -        class Foo < Formula -          url 'http://example.com/foo-1.0.tgz' -          depends_on :#{formula["dependency"]} -        end +        source = <<~EOS +          class Foo < Formula +            url 'http://example.com/foo-1.0.tgz' +            depends_on :#{formula["dependency"]} +          end          EOS          if formula.key?("correct")            offense = ":#{formula["dependency"]} is deprecated. Usage should be \"#{formula["correct"]}\"" @@ -57,7 +57,7 @@ describe RuboCop::Cop::FormulaAudit::ClassInheritance do    context "When auditing lines" do      it "with no space in class inheritance" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo<Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -84,7 +84,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do    context "When auditing formulae" do      it "with commented cmake call" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -106,7 +106,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do      end      it "with default template comments" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            # PLEASE REMOVE            desc "foo" @@ -128,7 +128,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do      end      it "with commented out depends_on" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -156,7 +156,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do    context "When auditing formulae" do      it "with FileUtils" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -178,7 +178,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with long inreplace block vars" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -202,7 +202,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with invalid rebuild" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -227,7 +227,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with OS.linux? check" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -254,7 +254,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with fails_with :llvm" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -282,7 +282,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with def test" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -307,7 +307,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with def options" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -332,7 +332,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with deprecated skip_clean call" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -340,9 +340,9 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do          end        EOS -      expected_offenses = [{ message: <<-EOS.undent.chomp, -                              `skip_clean :all` is deprecated; brew no longer strips symbols -                                      Pass explicit paths to prevent Homebrew from removing empty folders. +      expected_offenses = [{ message: <<~EOS.chomp, +        `skip_clean :all` is deprecated; brew no longer strips symbols +                Pass explicit paths to prevent Homebrew from removing empty folders.                               EOS                               severity: :convention,                               line: 4, @@ -357,7 +357,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with build.universal?" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -381,7 +381,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with a build.universal? exemption reports no offenses" do -      source = <<-EOS.undent +      source = <<~EOS          class Wine < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -396,7 +396,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with ENV.universal_binary" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -420,7 +420,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with an ENV.universal_binary exemption reports no offenses" do -      source = <<-EOS.undent +      source = <<~EOS          class Wine < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -435,7 +435,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with ENV.x11" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -459,7 +459,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with ruby-macho alternatives" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -481,7 +481,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with ruby-macho alternatives audit exempted formula" do -      source = <<-EOS.undent +      source = <<~EOS          class Cctools < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -494,7 +494,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with npm install without language::Node args" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' @@ -516,7 +516,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do      end      it "with npm install without language::Node args in kibana" do -      source = <<-EOS.undent +      source = <<~EOS          class KibanaAT44 < Formula            desc "foo"            url 'http://example.com/foo-1.0.tgz' diff --git a/Library/Homebrew/test/rubocops/options_cop_spec.rb b/Library/Homebrew/test/rubocops/options_cop_spec.rb index c27389a68..1ed6ee740 100644 --- a/Library/Homebrew/test/rubocops/options_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/options_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::Options do    context "When auditing options" do      it "32-bit" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            option "32-bit", "with 32-bit" @@ -35,7 +35,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do    context "When auditing options strictly" do      it "with universal" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            option :universal @@ -56,7 +56,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do      end      it "with deprecated options" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            option :cxx11 @@ -80,7 +80,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do      end      it "with misc deprecated options" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            option "without-check" @@ -109,7 +109,7 @@ describe RuboCop::Cop::NewFormulaAudit::Options do    context "When auditing options for a new formula" do      it "with deprecated options" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'            deprecated_option "examples" => "with-examples" diff --git a/Library/Homebrew/test/rubocops/patches_cop_spec.rb b/Library/Homebrew/test/rubocops/patches_cop_spec.rb index 4f9ca2df8..fdecb676e 100644 --- a/Library/Homebrew/test/rubocops/patches_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do    context "When auditing legacy patches" do      it "When there is no legacy patch" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url 'http://example.com/foo-1.0.tgz'          end @@ -18,7 +18,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do      end      it "Formula with `def patches`" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            homepage "ftp://example.com/foo"            url "http://example.com/foo-1.0.tgz" @@ -51,7 +51,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do          "https://github.com/dlang/dub/pull/1221.patch",        ]        patch_urls.each do |patch_url| -        source = <<-EOS.undent +        source = <<~EOS            class Foo < Formula              homepage "ftp://example.com/foo"              url "http://example.com/foo-1.0.tgz" @@ -63,56 +63,56 @@ describe RuboCop::Cop::FormulaAudit::Patches do          inspect_source(source)          expected_offense = if patch_url =~ %r{/raw\.github\.com/} -          [{ message: <<-EOS.undent.chomp, -               GitHub/Gist patches should specify a revision: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            GitHub/Gist patches should specify a revision: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 12,               source: source }]          elsif patch_url =~ %r{macports/trunk} -          [{ message: <<-EOS.undent.chomp, -               MacPorts patches should specify a revision instead of trunk: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            MacPorts patches should specify a revision instead of trunk: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 33,               source: source }]          elsif patch_url =~ %r{^http://trac\.macports\.org} -          [{ message: <<-EOS.undent.chomp, -               Patches from MacPorts Trac should be https://, not http: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            Patches from MacPorts Trac should be https://, not http: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 5,               source: source }]          elsif patch_url =~ %r{^http://bugs\.debian\.org} -          [{ message: <<-EOS.undent.chomp, -               Patches from Debian should be https://, not http: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            Patches from Debian should be https://, not http: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 5,               source: source }]          elsif patch_url =~ %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)} -          [{ message: <<-EOS.undent, -               use GitHub pull request URLs: -                 https://github.com/foo/foo-bar/pull/100.patch -               Rather than patch-diff: -                 https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch +          [{ message: <<~EOS, +            use GitHub pull request URLs: +              https://github.com/foo/foo-bar/pull/100.patch +            Rather than patch-diff: +              https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch               EOS               severity: :convention,               line: 5,               column: 5,               source: source }]          elsif patch_url =~ %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)} -          [{ message: <<-EOS.undent, -               GitHub patches should use the full_index parameter: -                 #{patch_url}?full_index=1 +          [{ message: <<~EOS, +            GitHub patches should use the full_index parameter: +              #{patch_url}?full_index=1               EOS               severity: :convention,               line: 5, @@ -126,7 +126,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do      end      it "Formula with nested `def patches`" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            homepage "ftp://example.com/foo"            url "http://example.com/foo-1.0.tgz" @@ -145,9 +145,9 @@ describe RuboCop::Cop::FormulaAudit::Patches do                               line: 4,                               column: 2,                               source: source }, -                           { message: <<-EOS.undent.chomp, -                               Patches from MacPorts Trac should be https://, not http: -                               http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/ +                           { message: <<~EOS.chomp, +                             Patches from MacPorts Trac should be https://, not http: +                             http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/                               EOS                               severity: :convention,                               line: 8, @@ -172,7 +172,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.undent +        source = <<~EOS            class Foo < Formula              homepage "ftp://example.com/foo"              url "http://example.com/foo-1.0.tgz" @@ -185,47 +185,47 @@ describe RuboCop::Cop::FormulaAudit::Patches do          inspect_source(source)          expected_offense = if patch_url =~ %r{/raw\.github\.com/} -          [{ message: <<-EOS.undent.chomp, -               GitHub/Gist patches should specify a revision: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            GitHub/Gist patches should specify a revision: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 16,               source: source }]          elsif patch_url =~ %r{macports/trunk} -          [{ message: <<-EOS.undent.chomp, -               MacPorts patches should specify a revision instead of trunk: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            MacPorts patches should specify a revision instead of trunk: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 37,               source: source }]          elsif patch_url =~ %r{^http://trac\.macports\.org} -          [{ message: <<-EOS.undent.chomp, -               Patches from MacPorts Trac should be https://, not http: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            Patches from MacPorts Trac should be https://, not http: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 9,               source: source }]          elsif patch_url =~ %r{^http://bugs\.debian\.org} -          [{ message: <<-EOS.undent.chomp, -               Patches from Debian should be https://, not http: -               #{patch_url} +          [{ message: <<~EOS.chomp, +            Patches from Debian should be https://, not http: +            #{patch_url}               EOS               severity: :convention,               line: 5,               column: 9,               source: source }]          elsif patch_url =~ %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)} -          [{ message: <<-EOS.undent, -               use GitHub pull request URLs: -                 https://github.com/foo/foo-bar/pull/100.patch -               Rather than patch-diff: -                 https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch +          [{ message: <<~EOS, +            use GitHub pull request URLs: +              https://github.com/foo/foo-bar/pull/100.patch +            Rather than patch-diff: +              https://patch-diff.githubusercontent.com/raw/foo/foo-bar/pull/100.patch               EOS               severity: :convention,               line: 5, diff --git a/Library/Homebrew/test/rubocops/text_cop_spec.rb b/Library/Homebrew/test/rubocops/text_cop_spec.rb index 490801770..dbddff1ad 100644 --- a/Library/Homebrew/test/rubocops/text_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/text_cop_spec.rb @@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::Text do    context "When auditing formula text" do      it "with both openssl and libressl optional dependencies" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -32,7 +32,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "with both openssl and libressl dependencies" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -56,7 +56,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When xcodebuild is called without SYMROOT" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -81,7 +81,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When xcodebuild is called without any args" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -106,7 +106,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When go get is executed" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -131,7 +131,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When xcodebuild is executed" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -156,7 +156,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When scons is executed" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -180,8 +180,8 @@ describe RuboCop::Cop::FormulaAudit::Text do        end      end -    it "When plist_options are not defined when using a formula-defined plist" do -      source = <<-EOS.undent +    it "When plist_options are not defined when using a formula-defined plist", :ruby23 do +      source = <<~RUBY          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -190,19 +190,20 @@ describe RuboCop::Cop::FormulaAudit::Text do              system "xcodebuild", "foo", "bar"            end -          def plist; <<-EOS.undent -            <?xml version="1.0" encoding="UTF-8"?> -            <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -            <plist version="1.0"> -            <dict> -              <key>Label</key> -              <string>org.nrpe.agent</string> -            </dict> -            </plist> -            \EOS +          def plist +            <<~XML +              <?xml version="1.0" encoding="UTF-8"?> +              <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +              <plist version="1.0"> +              <dict> +                <key>Label</key> +                <string>org.nrpe.agent</string> +              </dict> +              </plist> +            XML            end          end -      EOS +      RUBY        expected_offenses = [{  message: "Please set plist_options when using a formula-defined plist.",                                severity: :convention, @@ -218,7 +219,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When language/go is require'd" do -      source = <<-EOS.undent +      source = <<~EOS          require "language/go"          class Foo < Formula @@ -245,7 +246,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When formula uses virtualenv and also `setuptools` resource" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" @@ -275,7 +276,7 @@ describe RuboCop::Cop::FormulaAudit::Text do      end      it "When Formula.factory(name) is used" do -      source = <<-EOS.undent +      source = <<~EOS          class Foo < Formula            url "http://example.com/foo-1.0.tgz"            homepage "http://example.com" diff --git a/Library/Homebrew/test/rubocops/urls_cop_spec.rb b/Library/Homebrew/test/rubocops/urls_cop_spec.rb index ad939a1a2..0bda7f110 100644 --- a/Library/Homebrew/test/rubocops/urls_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_cop_spec.rb @@ -54,7 +54,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do          "col" => 2,        }, {          "url" => "http://prdownloads.sourceforge.net/foo/foo-1.tar.gz", -        "msg" => <<-EOS.undent.chomp, +        "msg" => <<~EOS.chomp,            Don't use prdownloads in SourceForge urls (url is http://prdownloads.sourceforge.net/foo/foo-1.tar.gz).                    See: http://librelist.com/browser/homebrew/2011/1/12/prdownloads-is-bad/          EOS @@ -69,7 +69,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do          "col" => 2,        }, {          "url" => "http://http.debian.net/debian/dists/foo/", -        "msg" => <<-EOS.undent, +        "msg" => <<~EOS,            Please use a secure mirror for Debian URLs.            We recommend:              https://mirrors.ocf.berkeley.edu/debian/dists/foo/ @@ -101,7 +101,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do          "col" => 2,        }, {          "url" => "https://codeload.github.com/foo/bar/tar.gz/v0.1.1", -        "msg" => <<-EOS.undent, +        "msg" => <<~EOS,            Use GitHub archive URLs:              https://github.com/foo/bar/archive/v0.1.1.tar.gz            Rather than codeload: @@ -114,7 +114,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do          "col" => 2,        }]        formulas.each do |formula| -        source = <<-EOS.undent +        source = <<~EOS            class Foo < Formula              desc "foo"              url "#{formula["url"]}" @@ -141,7 +141,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do          "col" => 4,        }]        formulas.each do |formula| -        source = <<-EOS.undent +        source = <<~EOS            class Foo < Formula              desc "foo"              url "https://foo.com" @@ -169,12 +169,12 @@ describe RuboCop::Cop::FormulaAudit::Urls do      end      it "with duplicate mirror" do -      source = <<-EOS.undent -          class Foo < Formula -            desc "foo" -            url "https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz" -            mirror "https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz" -          end +      source = <<~EOS +        class Foo < Formula +          desc "foo" +          url "https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz" +          mirror "https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz" +        end        EOS        expected_offenses = [{ message: "URL should not be duplicated as a mirror: https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz", @@ -204,13 +204,13 @@ describe RuboCop::Cop::FormulaAuditStrict::PyPiUrls do          "corrected_url" =>"https://files.pythonhosted.org/packages/source/foo/foo-0.1.tar.gz",        }]        formulas.each do |formula| -        source = <<-EOS.undent +        source = <<~EOS            class Foo < Formula              desc "foo"              url "#{formula["url"]}"            end          EOS -        corrected_source = <<-EOS.undent +        corrected_source = <<~EOS            class Foo < Formula              desc "foo"              url "#{formula["corrected_url"]}" diff --git a/Library/Homebrew/test/sandbox_spec.rb b/Library/Homebrew/test/sandbox_spec.rb index 38ff4da75..774337967 100644 --- a/Library/Homebrew/test/sandbox_spec.rb +++ b/Library/Homebrew/test/sandbox_spec.rb @@ -49,7 +49,7 @@ describe Sandbox do      it "ignores bogus Python error" do        ENV["HOMEBREW_VERBOSE"] = "1" -      with_bogus_error = <<-EOS.undent +      with_bogus_error = <<~EOS          foo          Mar 17 02:55:06 sandboxd[342]: Python(49765) deny file-write-unlink /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/errors.pyc          bar diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index a4ac84547..a5821ee14 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -131,7 +131,7 @@ RSpec.configure do |config|        files_after_test = find_files        diff = Set.new(@__files_before_test) ^ Set.new(files_after_test) -      expect(diff).to be_empty, <<-EOS.undent +      expect(diff).to be_empty, <<~EOS          file leak detected:          #{diff.map { |f| "  #{f}" }.join("\n")}        EOS diff --git a/Library/Homebrew/test/string_spec.rb b/Library/Homebrew/test/string_spec.rb index ce26d70d4..dba6753bf 100644 --- a/Library/Homebrew/test/string_spec.rb +++ b/Library/Homebrew/test/string_spec.rb @@ -22,11 +22,11 @@ describe String do      end      it "can be nested" do -      nested_string = <<-EOS.undent +      nested_string = <<~EOS          goodbye        EOS -      string = <<-EOS.undent +      string = <<~EOS          hello          #{nested_string}        EOS diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb index d5d90114a..5624f486e 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb @@ -8,7 +8,7 @@ cask 'with-caveats' do    app 'Caffeine.app'    # simple string is evaluated at compile-time -  caveats <<-EOS.undent +  caveats <<~EOS      Here are some things you might want to know.    EOS    # do block is evaluated at install-time 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 f5f3ae5dd..885f3b157 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,7 +8,7 @@ cask 'with-uninstall-script-app' do    app 'MyFancyApp/MyFancyApp.app'    postflight do -    IO.write "#{appdir}/MyFancyApp.app/uninstall.sh", <<-EOS.undent +    IO.write "#{appdir}/MyFancyApp.app/uninstall.sh", <<~EOS        #!/bin/sh        /bin/rm -r "#{appdir}/MyFancyApp.app"      EOS 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 7bf2ce96a..da01580c2 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 @@ -123,7 +123,7 @@ RSpec.shared_context "integration test" do    def setup_test_formula(name, content = nil)      case name      when /^testball/ -      content = <<-EOS.undent +      content = <<~EOS          desc "Some test"          homepage "https://example.com/#{name}"          url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" @@ -145,18 +145,18 @@ RSpec.shared_context "integration test" do          # something here        EOS      when "foo" -      content = <<-EOS.undent +      content = <<~EOS          url "https://example.com/#{name}-1.0"        EOS      when "bar" -      content = <<-EOS.undent +      content = <<~EOS          url "https://example.com/#{name}-1.0"          depends_on "foo"        EOS      end      Formulary.core_path(name).tap do |formula_path| -      formula_path.write <<-EOS.undent +      formula_path.write <<~EOS          class #{Formulary.class_s(name)} < Formula            #{content}          end diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index 957f9bdd2..d69eb615c 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -19,7 +19,7 @@ describe Tap do    end    def setup_tap_files -    formula_file.write <<-EOS.undent +    formula_file.write <<~EOS        class Foo < Formula          url "https://example.com/foo-1.0.tar.gz"        end @@ -28,11 +28,11 @@ describe Tap do      alias_file.parent.mkpath      ln_s formula_file, alias_file -    (path/"formula_renames.json").write <<-EOS.undent +    (path/"formula_renames.json").write <<~EOS        { "oldname": "foo" }      EOS -    (path/"tap_migrations.json").write <<-EOS.undent +    (path/"tap_migrations.json").write <<~EOS        { "removed-formula": "homebrew/foo" }      EOS @@ -327,7 +327,7 @@ describe CoreTap do    specify "files" do      formula_file = subject.formula_dir/"foo.rb" -    formula_file.write <<-EOS.undent +    formula_file.write <<~EOS        class Foo < Formula          url "https://example.com/foo-1.0.tar.gz"        end diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index 3b5355b15..0c2ae5161 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -98,7 +98,7 @@ describe "globally-scoped helper methods" do      let(:shell) { dir/"myshell" }      it "starts an interactive shell session" do -      IO.write shell, <<-EOS.undent +      IO.write shell, <<~EOS          #!/bin/sh          echo called > "#{dir}/called"        EOS diff --git a/Library/Homebrew/test/version_spec.rb b/Library/Homebrew/test/version_spec.rb index d0393afa6..7d3e129f6 100644 --- a/Library/Homebrew/test/version_spec.rb +++ b/Library/Homebrew/test/version_spec.rb @@ -248,9 +248,9 @@ describe Version do        end        failure_message do |expected| -        message = <<-EOS -        expected: %s -        detected: %s +        message = <<~EOS +          expected: %s +          detected: %s          EOS          format(message, expected, detected)        end | 
