1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 module ManifestExamples
6 def make_manifest opts={}
13 datablip = "x" * opts[:bytes_per_block]
14 locator = Blob.sign_locator(Digest::MD5.hexdigest(datablip) +
15 '+' + datablip.length.to_s,
16 api_token: opts[:api_token])
17 filesize = datablip.length * opts[:blocks_per_file]
19 (1..opts[:streams]).each do |s|
20 streamtoken = "./stream#{s}"
24 (1..opts[:files_per_stream]).each do |f|
25 filetokens << "#{streamsize}:#{filesize}:file#{f}.txt"
26 (1..opts[:blocks_per_file]).each do |b|
27 blocktokens << locator
29 streamsize += filesize
31 txt << ([streamtoken] + blocktokens + filetokens).join(' ') + "\n"