Class: TinyBackup::Config
- Inherits:
-
Object
- Object
- TinyBackup::Config
- Defined in:
- lib/configure.rb
Instance Attribute Summary collapse
-
#backup_folder ⇒ String
The folder name that is used to keep the backup files and temporary files.
-
#date_format ⇒ String
The date format that will be appended and used to time-stamp the backup files.
-
#max_versions ⇒ Integer
Maximum number of versions that can exist.
-
#per_page ⇒ Integer
Maximum number of rows fetched by a single query to avoid memory crashes.
-
#silent ⇒ Boolean
true if the debug info will be provided in the process.
-
#version_prefix ⇒ String
The prefix used to name each .diff file that contains changes from the last version.
-
#zip_prefix ⇒ String
The prefix used to name the starting .zip file that contains a schema.rb file and a .csv file for each non-empty table.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
41 42 43 44 45 46 47 48 49 |
# File 'lib/configure.rb', line 41 def initialize @backup_folder = "db/backup" @date_format = "%d-%m-%Y_%H:%M" @version_prefix = "ver_" @zip_prefix = "origin" @max_versions = 32 @per_page = 100000 @silent = false end |
Instance Attribute Details
#backup_folder ⇒ String
The folder name that is used to keep the backup files and temporary files.
15 16 17 |
# File 'lib/configure.rb', line 15 def backup_folder @backup_folder end |
#date_format ⇒ String
The date format that will be appended and used to time-stamp the backup files. Can be any valid date format similar with the ISO C and POSIX directives.
19 20 21 |
# File 'lib/configure.rb', line 19 def date_format @date_format end |
#max_versions ⇒ Integer
Maximum number of versions that can exist. If this number is exceeded, the first .diff version is merged in the starting .zip file and cannot be reversed.
31 32 33 |
# File 'lib/configure.rb', line 31 def max_versions @max_versions end |
#per_page ⇒ Integer
Maximum number of rows fetched by a single query to avoid memory crashes. If your table has more rows it will be used multiple query to fetch all the data.
35 36 37 |
# File 'lib/configure.rb', line 35 def per_page @per_page end |
#silent ⇒ Boolean
true if the debug info will be provided in the process.
39 40 41 |
# File 'lib/configure.rb', line 39 def silent @silent end |
#version_prefix ⇒ String
The prefix used to name each .diff file that contains changes from the last version. Automatically generated version_number
will be appended to the version_prefix
.
23 24 25 |
# File 'lib/configure.rb', line 23 def version_prefix @version_prefix end |
#zip_prefix ⇒ String
The prefix used to name the starting .zip file that contains a schema.rb file and a .csv file for each non-empty table.
27 28 29 |
# File 'lib/configure.rb', line 27 def zip_prefix @zip_prefix end |