Class: DBRotator
- Inherits:
-
Object
- Object
- DBRotator
- Defined in:
- lib/db_rotator.rb
Defined Under Namespace
Classes: Schema
Constant Summary collapse
- TIME_FORMAT =
"%Y%m%d"
Instance Method Summary collapse
- #import ⇒ Object
-
#initialize(config) ⇒ DBRotator
constructor
A new instance of DBRotator.
- #refresh ⇒ Object
- #rotate ⇒ Object
Constructor Details
#initialize(config) ⇒ DBRotator
Returns a new instance of DBRotator.
6 7 8 9 10 11 12 13 |
# File 'lib/db_rotator.rb', line 6 def initialize(config) @config = config.config @schemas = [] populate_schemas rescue on_failure $! end |
Instance Method Details
#import ⇒ Object
31 32 33 34 |
# File 'lib/db_rotator.rb', line 31 def import import_dump populate_schemas end |
#refresh ⇒ Object
24 25 26 27 28 29 |
# File 'lib/db_rotator.rb', line 24 def refresh download_dump import prune grant_access end |
#rotate ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/db_rotator.rb', line 15 def rotate refresh update_db_yaml on_success rescue on_failure $! end |