Class: Dumpdb::Runner
- Inherits:
-
Object
- Object
- Dumpdb::Runner
- Defined in:
- lib/dumpdb/runner.rb
Instance Attribute Summary collapse
-
#cmd_runner ⇒ Object
readonly
Returns the value of attribute cmd_runner.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Instance Method Summary collapse
-
#initialize(script, opts = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(script, opts = {}) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 |
# File 'lib/dumpdb/runner.rb', line 9 def initialize(script, opts={}) @script = script @cmd_runner = opts[:cmd_runner] || scmd_cmd_runner end |
Instance Attribute Details
#cmd_runner ⇒ Object (readonly)
Returns the value of attribute cmd_runner.
7 8 9 |
# File 'lib/dumpdb/runner.rb', line 7 def cmd_runner @cmd_runner end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
7 8 9 |
# File 'lib/dumpdb/runner.rb', line 7 def script @script end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dumpdb/runner.rb', line 14 def run run_callback 'before_run' run_callback 'before_setup' run_setup begin run_callback 'after_setup' [:dump, :copy_dump, :restore].each{ |phase_name| run_phase phase_name } ensure run_phase 'teardown' run_callback 'after_run' end end |