Class: Ardb::Runner::DropCommand
- Inherits:
-
Object
- Object
- Ardb::Runner::DropCommand
- Defined in:
- lib/ardb/runner/drop_command.rb
Instance Method Summary collapse
-
#initialize ⇒ DropCommand
constructor
A new instance of DropCommand.
- #run ⇒ Object
Constructor Details
#initialize ⇒ DropCommand
Returns a new instance of DropCommand.
6 7 8 |
# File 'lib/ardb/runner/drop_command.rb', line 6 def initialize @adapter = Ardb::Adapter.send(Ardb.config.db.adapter) end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ardb/runner/drop_command.rb', line 10 def run begin @adapter.drop_db $stdout.puts "dropped #{Ardb.config.db.adapter} db `#{Ardb.config.db.database}`" rescue Ardb::Runner::CmdError => e raise e rescue Exception => e $stderr.puts e $stderr.puts "error dropping #{Ardb.config.db.database.inspect} database" raise Ardb::Runner::CmdFail end end |