lib/combustion/database.rb in combustion-0.7.0 vs lib/combustion/database.rb in combustion-0.8.0

- old
+ new

@@ -1,25 +1,35 @@ +# frozen_string_literal: true + module Combustion module Databases # end class Database + DEFAULT_OPTIONS = { + :database_reset => true, + :load_schema => true, + :database_migrate => true + }.freeze + def self.setup(options = {}) - Combustion::Database::Reset.call if options.fetch(:database_reset, true) - Combustion::Database::LoadSchema.call if options.fetch(:load_schema, true) - Combustion::Database::Migrate.call if options.fetch(:database_migrate, true) + options = DEFAULT_OPTIONS.merge options + + Combustion::Database::Reset.call if options[:database_reset] + Combustion::Database::LoadSchema.call if options[:load_schema] + Combustion::Database::Migrate.call if options[:database_migrate] end end end -require 'combustion/database/load_schema' -require 'combustion/database/migrate' -require 'combustion/database/reset' +require "combustion/databases/base" +require "combustion/databases/firebird" +require "combustion/databases/mysql" +require "combustion/databases/oracle" +require "combustion/databases/postgresql" +require "combustion/databases/sql_server" +require "combustion/databases/sqlite" -require 'combustion/databases/base' -require 'combustion/databases/firebird' -require 'combustion/databases/mysql' -require 'combustion/databases/oracle' -require 'combustion/databases/postgresql' -require 'combustion/databases/sql_server' -require 'combustion/databases/sqlite' +require "combustion/database/load_schema" +require "combustion/database/migrate" +require "combustion/database/reset"