Class: Parity::Backup
- Inherits:
-
Object
- Object
- Parity::Backup
- Defined in:
- lib/parity/backup.rb
Constant Summary collapse
- BLANK_ARGUMENTS =
"".freeze
- DATABASE_YML_RELATIVE_PATH =
"config/database.yml".freeze
- DEVELOPMENT_ENVIRONMENT_KEY_NAME =
"development".freeze
- DATABASE_KEY_NAME =
"database".freeze
Instance Method Summary collapse
-
#initialize(args) ⇒ Backup
constructor
A new instance of Backup.
- #restore ⇒ Object
Constructor Details
#initialize(args) ⇒ Backup
Returns a new instance of Backup.
10 11 12 13 14 |
# File 'lib/parity/backup.rb', line 10 def initialize(args) @from, @to = args.values_at(:from, :to) @additional_args = args[:additional_args] || BLANK_ARGUMENTS @parallelize = args[:parallelize] || false end |
Instance Method Details
#restore ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/parity/backup.rb', line 16 def restore if to == DEVELOPMENT_ENVIRONMENT_KEY_NAME restore_to_development elsif from == DEVELOPMENT_ENVIRONMENT_KEY_NAME restore_from_development else restore_to_remote_environment end end |