Class: RosettAi::Backup::FileDestination
- Inherits:
-
Destination
- Object
- Destination
- RosettAi::Backup::FileDestination
- Defined in:
- lib/rosett_ai/backup/destination.rb
Overview
Writes archive to local filesystem
Constant Summary
Constants inherited from Destination
Destination::SUPPORTED_SCHEMES
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Destination
Instance Method Summary collapse
-
#initialize(path) ⇒ FileDestination
constructor
A new instance of FileDestination.
-
#write(archive_path) ⇒ String
Copies the archive to the local filesystem destination.
Methods inherited from Destination
Constructor Details
#initialize(path) ⇒ FileDestination
Returns a new instance of FileDestination.
60 61 62 63 |
# File 'lib/rosett_ai/backup/destination.rb', line 60 def initialize(path) super("file://#{path}") @path = File.(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
58 59 60 |
# File 'lib/rosett_ai/backup/destination.rb', line 58 def path @path end |
Instance Method Details
#write(archive_path) ⇒ String
Copies the archive to the local filesystem destination.
69 70 71 72 73 |
# File 'lib/rosett_ai/backup/destination.rb', line 69 def write(archive_path) FileUtils.mkdir_p(File.dirname(@path)) FileUtils.cp(archive_path, @path) @path end |