Sha256: 7afb3d3c9831e0719b7955250999153ab2761d0f898a55ea465c9376bbc09a2e

Contents?: true

Size: 529 Bytes

Versions: 24

Compression:

Stored size: 529 Bytes

Contents

require 'active_record'
require 'ardb/runner'

class Ardb::Runner::CreateCommand

  def initialize
    @adapter = Ardb::Adapter.send(Ardb.config.db.adapter)
  end

  def run
    begin
      @adapter.create_db
      $stdout.puts "created #{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 creating #{Ardb.config.db.database.inspect} database"
      raise Ardb::Runner::CmdFail
    end
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ardb-0.24.0 lib/ardb/runner/create_command.rb
ardb-0.23.0 lib/ardb/runner/create_command.rb
ardb-0.22.1 lib/ardb/runner/create_command.rb
ardb-0.22.0 lib/ardb/runner/create_command.rb
ardb-0.21.0 lib/ardb/runner/create_command.rb
ardb-0.20.0 lib/ardb/runner/create_command.rb
ardb-0.19.0 lib/ardb/runner/create_command.rb
ardb-0.18.0 lib/ardb/runner/create_command.rb
ardb-0.17.0 lib/ardb/runner/create_command.rb
ardb-0.16.0 lib/ardb/runner/create_command.rb
ardb-0.15.0 lib/ardb/runner/create_command.rb
ardb-0.14.0 lib/ardb/runner/create_command.rb
ardb-0.13.0 lib/ardb/runner/create_command.rb
ardb-0.12.0 lib/ardb/runner/create_command.rb
ardb-0.11.0 lib/ardb/runner/create_command.rb
ardb-0.10.0 lib/ardb/runner/create_command.rb
ardb-0.9.0 lib/ardb/runner/create_command.rb
ardb-0.8.0 lib/ardb/runner/create_command.rb
ardb-0.7.0 lib/ardb/runner/create_command.rb
ardb-0.6.0 lib/ardb/runner/create_command.rb