blob: dbf3d0e880f9785ed74b508704ab7e5dd48ec586 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
require "hbc/verify/checksum"
require "hbc/verify/gpg"
module Hbc
module Verify
module_function
def verifications
[
Hbc::Verify::Checksum
# TODO: Hbc::Verify::Gpg
]
end
def all(cask, downloaded_path)
odebug "Verifying download"
verifications = for_cask(cask)
odebug "#{verifications.size} verifications defined", verifications
verifications.each do |verification|
odebug "Running verification of class #{verification}"
verification.new(cask, downloaded_path).verify
end
end
def for_cask(cask)
odebug "Determining which verifications to run for Cask #{cask}"
verifications.select do |verification|
odebug "Checking for verification class #{verification}"
verification.me?(cask)
end
end
end
end
|