print_caveats and get_info return heredocs
This commit is contained in:
parent
ed80b60834
commit
330ae8c6fa
@ -27,14 +27,12 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.get_info(cask)
|
def self.get_info(cask)
|
||||||
"#{title_info(cask)}\n"\
|
<<~EOS.chomp
|
||||||
"#{Formatter.url(cask.homepage) if cask.homepage}\n"\
|
#{title_info(cask)}
|
||||||
"#{installation_info(cask)}\n"\
|
#{Formatter.url(cask.homepage) if cask.homepage}
|
||||||
"#{repo_info(cask)}"\
|
#{installation_info(cask)}
|
||||||
"#{name_info(cask)}"\
|
#{repo_info(cask)}#{name_info(cask)}#{language_info(cask)}#{artifact_info(cask)}#{Installer.print_caveats(cask)}
|
||||||
"#{language_info(cask)}"\
|
EOS
|
||||||
"#{artifact_info(cask)}"\
|
|
||||||
"#{Installer.print_caveats(cask)}"\
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.info(cask)
|
def self.info(cask)
|
||||||
@ -57,12 +55,16 @@ module Cask
|
|||||||
cask.versions.each do |version|
|
cask.versions.each do |version|
|
||||||
versioned_staged_path = cask.caskroom_path.join(version)
|
versioned_staged_path = cask.caskroom_path.join(version)
|
||||||
install_info << versioned_staged_path.to_s
|
install_info << versioned_staged_path.to_s
|
||||||
.concat(" (")
|
.concat(" (")
|
||||||
.concat(versioned_staged_path.exist? ? versioned_staged_path.abv : Formatter.error("does not exist"))
|
.concat(
|
||||||
.concat(")")
|
if versioned_staged_path.exist?
|
||||||
|
then versioned_staged_path.abv
|
||||||
|
else Formatter.error("does not exist")
|
||||||
|
end,
|
||||||
|
).concat(")")
|
||||||
install_info << "\n"
|
install_info << "\n"
|
||||||
end
|
end
|
||||||
return install_info.strip
|
return install_info.strip
|
||||||
else
|
else
|
||||||
"Not installed"
|
"Not installed"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -49,8 +49,10 @@ module Cask
|
|||||||
caveats = cask.caveats
|
caveats = cask.caveats
|
||||||
return if caveats.empty?
|
return if caveats.empty?
|
||||||
|
|
||||||
"#{ohai_title "Caveats"}\n"\
|
<<~EOS
|
||||||
"#{caveats}\n"
|
#{ohai_title "Caveats"}
|
||||||
|
#{caveats}
|
||||||
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user