temp/WalletCompanionFiles/WalletCompanionFiles/ServerReference/pass_signing/lib/sign_pass.rb
# Creates a json manifest where each files contents has a SHA1 hash
Creates a json manifest where each files contents has a SHA1 hash
Creates a json manifest where each files contents has a SHA1 hash
def generate_json_manifest
    puts "Generating JSON manifest"
    manifest = {}
    Dir.glob(self.temporary_path + "/**").each do |file|
      manifest[File.basename(file)] = Digest::SHA1.hexdigest(File.read(file))
    end
    self.manifest_url = self.temporary_path + "/manifest.json"
    File.open(self.manifest_url, "w") do |f|
      f.write(manifest.to_json)
    end
  end
def generate_json_manifest puts "Generating JSON manifest" manifest = { } Dir . glob ( self . temporary_path + "/**" ) . each do | file | manifest [ File . basename ( file ) ] = Digest :: SHA1 . hexdigest ( File . read ( file ) ) end self . manifest_url = self . temporary_path + "/manifest.json" File . open ( self . manifest_url , "w" ) do | f | f . write ( manifest . to_json ) end end
Creates a json manifest where each files contents has a SHA1 hash
Creates a json manifest where each files contents has a SHA1 hash
# Gather all the files and generate a sha1 hash # Write the hash dictionary out to a manifest file