51 lines
1.1 KiB
Crystal
51 lines
1.1 KiB
Crystal
class DODB::SpecDataBase(V) < DODB::Storage::Basic(V)
|
|
property storage_dir : String
|
|
def initialize(storage_ext = "", remove_previous_data = true)
|
|
@storage_dir = "specdb-storage-uncached#{storage_ext}"
|
|
|
|
if remove_previous_data
|
|
::FileUtils.rm_rf storage_dir
|
|
end
|
|
|
|
super storage_dir
|
|
end
|
|
|
|
def rm_storage_dir
|
|
::FileUtils.rm_rf @storage_dir
|
|
end
|
|
end
|
|
|
|
class DODB::CachedSpecDataBase(V) < DODB::Storage::Cached(V)
|
|
property storage_dir : String
|
|
def initialize(storage_ext = "", remove_previous_data = true)
|
|
@storage_dir = "specdb-storage-cached#{storage_ext}"
|
|
|
|
if remove_previous_data
|
|
::FileUtils.rm_rf storage_dir
|
|
end
|
|
|
|
super storage_dir
|
|
end
|
|
|
|
def rm_storage_dir
|
|
::FileUtils.rm_rf @storage_dir
|
|
end
|
|
end
|
|
|
|
class DODB::RAMOnlySpecDataBase(V) < DODB::Storage::RAMOnly(V)
|
|
property storage_dir : String
|
|
def initialize(storage_ext = "", remove_previous_data = true)
|
|
@storage_dir = "specdb-storage-ram#{storage_ext}"
|
|
|
|
if remove_previous_data
|
|
::FileUtils.rm_rf storage_dir
|
|
end
|
|
|
|
super storage_dir
|
|
end
|
|
|
|
def rm_storage_dir
|
|
::FileUtils.rm_rf @storage_dir
|
|
end
|
|
end
|