Class: Promotion::Application
- Inherits:
-
Object
- Object
- Promotion::Application
- Defined in:
- lib/promotion/application.rb
Overview
The Promotion::Application coordinates the activity of the components:
-
Enforcer
-
Generator
-
Evolver
Instance Method Summary collapse
-
#devolve(target = nil) ⇒ Object
Devolve a database back to an earlier version.
-
#evolve(target = nil) ⇒ Object
Evolves the database to a target version, or as far as possible, by executing database migration scripts in the
evolve
folder. -
#initialize(appname) ⇒ Application
constructor
Creates a new Promotion::Application instance for a specific app to be promoted.
-
#promote ⇒ Object
Promotes an application into production.
Constructor Details
#initialize(appname) ⇒ Application
Creates a new Promotion::Application instance for a specific app to be promoted. A global $log logger is also created.
19 20 21 22 23 24 25 26 |
# File 'lib/promotion/application.rb', line 19 def initialize(appname) @appname = appname $log = Logger.new(Files::Log, 0) # rotate log file at 1M limit $log.formatter = proc { |severity, datetime, progname, | "#{datetime.iso8601()} #{severity} #{}\n" } $log.level = Logger::INFO end |
Instance Method Details
#devolve(target = nil) ⇒ Object
Devolve a database back to an earlier version
44 45 46 47 |
# File 'lib/promotion/application.rb', line 44 def devolve(target=nil) evolver = Promotion::Evolver.new(@appname, false, target) evolver.start() end |
#evolve(target = nil) ⇒ Object
Evolves the database to a target version, or as far as possible, by executing database migration scripts in the evolve
folder
38 39 40 41 |
# File 'lib/promotion/application.rb', line 38 def evolve(target=nil) evolver = Promotion::Evolver.new(@appname, true, target) evolver.start() end |