Skip to content

Commit

Permalink
Use Hbc::Verify in Hbc::Installer
Browse files Browse the repository at this point in the history
as a distinct step serving the general purpose of verification, e.g. of
integrity with sha, authenticity with gpg…
  • Loading branch information
ndr committed Jan 24, 2015
1 parent dd93689 commit eb25dc5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/hbc/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'hbc/cask_dependencies'
require 'hbc/staged'
require 'hbc/verify'

class Hbc::Installer

Expand All @@ -11,6 +12,7 @@ class Hbc::Installer
# should be explicit checks on whether staged state is valid in
# every method.
include Hbc::Staged
include Hbc::Verify

PERSISTENT_METADATA_SUBDIRS = [ 'gpg' ]

Expand Down Expand Up @@ -59,6 +61,7 @@ def install(force=false, skip_cask_deps=false)
begin
satisfy_dependencies(skip_cask_deps)
download
verify
extract_primary_container
install_artifacts
save_caskfile force
Expand Down Expand Up @@ -88,6 +91,10 @@ def download
@downloaded_path
end

def verify
Hbc::Verify.all(@downloaded_path, @cask)
end

def extract_primary_container
odebug "Extracting primary container"
FileUtils.mkdir_p @cask.staged_path
Expand Down

0 comments on commit eb25dc5

Please sign in to comment.