Class: Deeby

Inherits:
Object
  • Object
show all
Defined in:
lib/deeby.rb

Constant Summary collapse

VERSION =
"1.0.0"
ACTIVE =
"config/database.yml"
BACKUP =
"config/database.yml.deeby"

Class Method Summary collapse

Class Method Details

.swap(engine) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/deeby.rb', line 7

def self.swap engine
  temp = "config/database.#{engine}.yml"

  cp ACTIVE, BACKUP
  cp temp, ACTIVE
  at_exit { cp BACKUP, ACTIVE ; rm BACKUP }
end