Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce version :latest as a symbol #7504

Merged
merged 1 commit into from
Nov 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions lib/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ def initialize(cask)

def run!(download = false)
_check_required_fields
# todo: enable this test before 0.50.0
# _check_no_string_version_latest
_check_no_string_version_latest
_check_checksums
_check_sha256_no_check_if_latest
_check_sha256_if_versioned
Expand Down Expand Up @@ -49,16 +48,14 @@ def _check_no_string_version_latest

def _check_sha256_no_check_if_latest
odebug "Verifying sha256 :no_check with version :latest"
# todo: remove this string test before 0.50.0
if ((cask.version == 'latest' or cask.version == :latest) and cask.sums.is_a?(Array))
if cask.version == :latest and cask.sums.is_a?(Array)
add_error "you should use sha256 :no_check when version is :latest"
end
end

def _check_sha256_if_versioned
odebug "Verifying a sha256 is present when versioned"
# todo: remove this string test before 0.50.0
if ((cask.version != 'latest' and cask.version != :latest) and cask.sums == :no_check)
if cask.version != :latest and cask.sums == :no_check
add_error "you must include a sha256 when version is not :latest"
end
end
Expand Down