1 module ManifestExamples
2 def make_manifest opts={}
9 datablip = "x" * opts[:bytes_per_block]
10 locator = Blob.sign_locator(Digest::MD5.hexdigest(datablip) +
11 '+' + datablip.length.to_s,
12 api_token: opts[:api_token])
13 filesize = datablip.length * opts[:blocks_per_file]
15 (1..opts[:streams]).each do |s|
16 streamtoken = "./stream#{s}"
20 (1..opts[:files_per_stream]).each do |f|
21 filetokens << "#{streamsize}:#{filesize}:file#{f}.txt"
22 (1..opts[:blocks_per_file]).each do |b|
23 blocktokens << locator
25 streamsize += filesize
27 txt << ([streamtoken] + blocktokens + filetokens).join(' ') + "\n"