117 lines
3.3 KiB
Ruby
Raw Normal View History

2016-08-18 22:11:42 +03:00
# Caveats DSL. Each method should handle output, following the
# convention of at least one trailing blank line so that the user
# can distinguish separate caveats.
#
# ( The return value of the last method in the block is also sent
# to the output by the caller, but that feature is only for the
# convenience of Cask authors. )
2016-09-24 13:52:43 +02:00
module Hbc
class DSL
class Caveats < Base
def path_environment_variable(path)
puts <<-EOS.undent
To use #{@cask}, you may need to add the #{path} directory
to your PATH environment variable, eg (for bash shell):
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
export PATH=#{path}:"$PATH"
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def zsh_path_helper(path)
puts <<-EOS.undent
To use #{@cask}, zsh users may need to add the following line to their
~/.zprofile. (Among other effects, #{path} will be added to the
PATH environment variable):
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
eval `/usr/libexec/path_helper -s`
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def files_in_usr_local
localpath = "/usr/local"
return unless HOMEBREW_PREFIX.to_s.downcase.start_with?(localpath)
2016-09-24 13:52:43 +02:00
puts <<-EOS.undent
Cask #{@cask} installs files under "#{localpath}". The presence of such
files can cause warnings when running "brew doctor", which is considered
to be a bug in Homebrew-Cask.
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def depends_on_java(java_version = "any")
if java_version == "any"
puts <<-EOS.undent
#{@cask} requires Java. You can install the latest version with
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
brew cask install java
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
elsif java_version.include?("9") || java_version.include?("+")
2016-09-24 13:52:43 +02:00
puts <<-EOS.undent
#{@cask} requires Java #{java_version}. You can install the latest version with
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
brew cask install java
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
else
puts <<-EOS.undent
#{@cask} requires Java #{java_version}. You can install it with
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
brew cask install caskroom/versions/java#{java_version}
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def logout
puts <<-EOS.undent
You must log out and log back in for the installation of #{@cask}
to take effect.
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def reboot
puts <<-EOS.undent
You must reboot for the installation of #{@cask} to take effect.
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def discontinued
puts <<-EOS.undent
#{@cask} has been officially discontinued upstream.
It may stop working correctly (or at all) in recent versions of macOS.
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def free_license(web_page)
puts <<-EOS.undent
The vendor offers a free license for #{@cask} at
#{web_page}
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def malware(radar_number)
puts <<-EOS.undent
#{@cask} has been reported to bundle malware. Like with any app, use at your own risk.
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
A report has been made to Apple about this app. Their certificate will hopefully be revoked.
See the public report at
2016-09-17 03:21:51 +02:00
#{Formatter.url("https://openradar.appspot.com/#{radar_number}")}
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
If this report is accurate, please duplicate it at
2016-09-17 03:21:51 +02:00
#{Formatter.url("https://bugreport.apple.com/")}
2016-09-24 13:52:43 +02:00
If this report is a mistake, please let us know by opening an issue at
2016-09-17 03:21:51 +02:00
#{Formatter.url("https://github.com/caskroom/homebrew-cask/issues/new")}
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
EOS
end
end
2016-08-18 22:11:42 +03:00
end
end