Class: PostRunner::BackedUpFile
- Inherits:
-
File
- Object
- File
- PostRunner::BackedUpFile
- Defined in:
- lib/postrunner/BackedUpFile.rb
Overview
BackUpFile is a specialized version of File that creates a copy on
Class Method Summary collapse
Class Method Details
.open(filename, mode = 'r', *opt, &block) ⇒ Object
18 19 20 21 22 |
# File 'lib/postrunner/BackedUpFile.rb', line 18 def BackedUpFile.open(filename, mode = 'r', *opt, &block) # If the file is opened for writing we create a backup file. create_backup_file(filename) if mode.include?('w') || mode.include?('a') super end |
.write(filename, string) ⇒ Object
24 25 26 27 |
# File 'lib/postrunner/BackedUpFile.rb', line 24 def BackedUpFile.write(filename, string) create_backup_file(filename) super end |