Module: Dotbox::Api
- Defined in:
- lib/dotbox/api.rb
Instance Method Summary collapse
- #create_backup(path) ⇒ Object
- #create_backup_directory(path) ⇒ Object
- #create_backup_file(path) ⇒ Object
Instance Method Details
#create_backup(path) ⇒ Object
9 10 11 12 13 |
# File 'lib/dotbox/api.rb', line 9 def create_backup(path) file = Dotbox::File.new(path) file.backup Dotbox::Record.new.add file end |
#create_backup_directory(path) ⇒ Object
22 23 24 25 26 |
# File 'lib/dotbox/api.rb', line 22 def create_backup_directory(path) FileUtils.mkdir_p path create_backup path FileUtils.rm_r path end |
#create_backup_file(path) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/dotbox/api.rb', line 15 def create_backup_file(path) FileUtils.mkdir ::File.dirname(path) FileUtils.touch path create_backup path FileUtils.rm path end |