lib/picky/index/file/basic.rb in picky-0.12.1 vs lib/picky/index/file/basic.rb in picky-0.12.2
- old
+ new
@@ -31,19 +31,17 @@
# Will copy the index file to a location that
# is in a directory named "backup" right under
# the directory the index file is in.
#
def backup
- prepare_backup backup_path
+ prepare_backup backup_directory
FileUtils.cp cache_path, target, verbose: true
end
# The backup directory of this file.
# Equal to the file's dirname plus /backup
#
- # TODO: Rename to backup_dir.
- #
- def backup_path
+ def backup_directory
::File.join ::File.dirname(cache_path), 'backup'
end
# Prepares the backup directory for the file.
#
def prepare_backup target
@@ -55,11 +53,9 @@
#
def restore
FileUtils.cp backup_file_path_of(cache_path), cache_path, verbose: true
end
# The backup filename.
- #
- # TODO: Duplicate work done here?
#
def backup_file_path_of path
dir, name = ::File.split path
::File.join dir, 'backup', name
end
\ No newline at end of file