Class: Inferno::Terminology::Tasks::CleanupPrecursors

Inherits:
Object
  • Object
show all
Includes:
TempDir
Defined in:
lib/inferno/terminology/tasks/cleanup_precursors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TempDir

#pipe_files, #umls_dir, #umls_subset_dir, #umls_zip_path, #versioned_temp_dir

Constructor Details

#initialize(version:) ⇒ CleanupPrecursors

Returns a new instance of CleanupPrecursors.



11
12
13
# File 'lib/inferno/terminology/tasks/cleanup_precursors.rb', line 11

def initialize(version:)
  @version = version
end

Instance Attribute Details

#versionObject (readonly)

Returns the value of attribute version.



9
10
11
# File 'lib/inferno/terminology/tasks/cleanup_precursors.rb', line 9

def version
  @version
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
# File 'lib/inferno/terminology/tasks/cleanup_precursors.rb', line 15

def run
  Inferno.logger.info "removing terminology precursor files in #{versioned_temp_dir}"
  FileUtils.remove_dir(umls_dir, true)
  FileUtils.remove_dir(umls_subset_dir, true)
  FileUtils.rm(umls_zip_path, force: true)
  FileUtils.rm(pipe_files, force: true)
end