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.
8 9 10 11 |
# File 'lib/dumpdb/runner.rb', line 8 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.
6 7 8 |
# File 'lib/dumpdb/runner.rb', line 6 def cmd_runner @cmd_runner end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
6 7 8 |
# File 'lib/dumpdb/runner.rb', line 6 def script @script end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dumpdb/runner.rb', line 13 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 |