Class: Backup::Database::Base
- Inherits:
-
Object
- Object
- Backup::Database::Base
- Includes:
- CLI, Configuration::Helpers
- Defined in:
- lib/backup/database/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dump_path ⇒ Object
Contains the path to where the database should be dumped.
-
#utility_path ⇒ Object
Allows the user to specify the path to a “dump” utility in case it cannot be auto-detected by Backup.
Instance Method Summary collapse
-
#log! ⇒ Object
Logs a message to the console and log file to inform the client that Backup is dumping the database.
-
#prepare! ⇒ Object
Defines the @dump_path and ensures it exists by creating it.
Methods included from Configuration::Helpers
#clear_defaults!, #getter_methods, #load_defaults!, #setter_methods
Methods included from CLI
Instance Attribute Details
#dump_path ⇒ Object
Contains the path to where the database should be dumped
11 12 13 |
# File 'lib/backup/database/base.rb', line 11 def dump_path @dump_path end |
#utility_path ⇒ Object
Allows the user to specify the path to a “dump” utility in case it cannot be auto-detected by Backup
16 17 18 |
# File 'lib/backup/database/base.rb', line 16 def utility_path @utility_path end |
Instance Method Details
#log! ⇒ Object
Logs a message to the console and log file to inform the client that Backup is dumping the database
28 29 30 |
# File 'lib/backup/database/base.rb', line 28 def log! Logger.("#{ self.class } started dumping and archiving \"#{ name }\".") end |
#prepare! ⇒ Object
Defines the @dump_path and ensures it exists by creating it
20 21 22 23 |
# File 'lib/backup/database/base.rb', line 20 def prepare! @dump_path = File.join(TMP_PATH, TRIGGER, self.class.name.split('::').last) mkdir(dump_path) end |