Class: DbVcs::Config

Inherits:
Object
  • Object
show all
Includes:
ConfigAttributes
Defined in:
lib/db_vcs/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConfigAttributes

#assign_attributes

Constructor Details

#initializeConfig

Returns a new instance of Config.



19
20
21
22
23
24
25
26
27
# File 'lib/db_vcs/config.rb', line 19

def initialize
  @environments = %w(development test)
  @dbs_in_use = []
  @db_basename = Dir.pwd.split(File::SEPARATOR).last
  @main_branch = "main"
  @pg_config = DbVcs::Adapters::Postgres::Config.new
  @mongo_config = DbVcs::Adapters::Mongo::Config.new
  @mysql_config = DbVcs::Adapters::Mysql::Config.new
end

Instance Attribute Details

#db_basenameObject

This name will be used as a prefix to all your databases in a project.



10
11
12
# File 'lib/db_vcs/config.rb', line 10

def db_basename
  @db_basename
end

#dbs_in_useObject

A list of databases you want to enable versioning for. See Manager::ADAPTERS keys for the list of available values. Defaults to empty array.



13
14
15
# File 'lib/db_vcs/config.rb', line 13

def dbs_in_use
  @dbs_in_use
end

#environmentsObject

Environments you want to create database versions for. Default is [“development”, “test”].



8
9
10
# File 'lib/db_vcs/config.rb', line 8

def environments
  @environments
end

#main_branchObject

A name of branch to be used as a default branch to copy databases from.



17
18
19
# File 'lib/db_vcs/config.rb', line 17

def main_branch
  @main_branch
end

#mongo_configObject

Configuration of dbs clients.



15
16
17
# File 'lib/db_vcs/config.rb', line 15

def mongo_config
  @mongo_config
end

#mysql_configObject

Configuration of dbs clients.



15
16
17
# File 'lib/db_vcs/config.rb', line 15

def mysql_config
  @mysql_config
end

#pg_configObject

Configuration of dbs clients.



15
16
17
# File 'lib/db_vcs/config.rb', line 15

def pg_config
  @pg_config
end