Class: Storey::SqlDumper
- Inherits:
-
Object
- Object
- Storey::SqlDumper
- Defined in:
- lib/storey/sql_dumper.rb
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(options = {}) ⇒ SqlDumper
constructor
A new instance of SqlDumper.
Constructor Details
#initialize(options = {}) ⇒ SqlDumper
Returns a new instance of SqlDumper.
6 7 8 |
# File 'lib/storey/sql_dumper.rb', line 6 def initialize(={}) @file = [:file] || File.join(Rails.root, "db", "structure.sql") end |
Instance Method Details
#dump ⇒ Object
10 11 12 13 |
# File 'lib/storey/sql_dumper.rb', line 10 def dump stdout_str, stderr_str, status = Open3.capture3(command) raise "Error dumping database: #{stderr_str}" if status.exitstatus != 0 end |