Method: Moab::StorageObjectVersion#ingest_dir
- Defined in:
- lib/moab/storage_object_version.rb
#ingest_dir(source_dir, target_dir, use_links = true) ⇒ void
This method returns an undefined value.
Returns recursively link or copy the source directory contents to the target directory.
157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/moab/storage_object_version.rb', line 157 def ingest_dir(source_dir, target_dir, use_links = true) raise(MoabRuntimeError, "cannot copy - target already exists: #{target_dir.}") if target_dir.exist? target_dir.mkpath source_dir.children.each do |child| if child.directory? ingest_dir(child, target_dir.join(child.basename), use_links) else ingest_file(child, target_dir, use_links) end end end |