Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / test / helpers / download_helper.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 module DownloadHelper
6   module_function
7
8   def path
9     Rails.root.join 'tmp', 'downloads'
10   end
11
12   def clear
13     if File.exist? path
14       FileUtils.rm_r path
15     end
16     begin
17       Dir.mkdir path
18     rescue Errno::EEXIST
19     end
20   end
21
22   def done
23     Dir[path.join '*'].reject do |f|
24       /\.part$/ =~ f
25     end
26   end
27 end