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