Class: Matrixeval::ExtraMountFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/matrixeval/extra_mount_files.rb

Class Method Summary collapse

Class Method Details

.createObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/matrixeval/extra_mount_files.rb', line 5

def create
  Config.all_mounts.each do |mount|
    local_path, _ = mount.split(':')
    next mount if Pathname.new(local_path).absolute?

    local_path = Matrixeval.working_dir.join(local_path)
    next if local_path.extname.empty?
    next if local_path.ascend.none? { |path| path == Matrixeval.working_dir }

    FileUtils.mkdir_p local_path.dirname
    FileUtils.touch local_path
  end
end