Class: DbVcs::Config
- Inherits:
-
Object
- Object
- DbVcs::Config
- Includes:
- ConfigAttributes
- Defined in:
- lib/db_vcs/config.rb
Instance Attribute Summary collapse
-
#db_basename ⇒ Object
This name will be used as a prefix to all your databases in a project.
-
#dbs_in_use ⇒ Object
A list of databases you want to enable versioning for.
-
#environments ⇒ Object
Environments you want to create database versions for.
-
#main_branch ⇒ Object
A name of branch to be used as a default branch to copy databases from.
-
#mongo_config ⇒ Object
Configuration of dbs clients.
-
#mysql_config ⇒ Object
Configuration of dbs clients.
-
#pg_config ⇒ Object
Configuration of dbs clients.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Methods included from ConfigAttributes
Constructor Details
#initialize ⇒ Config
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_basename ⇒ Object
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_use ⇒ Object
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 |
#environments ⇒ Object
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_branch ⇒ Object
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_config ⇒ Object
Configuration of dbs clients.
15 16 17 |
# File 'lib/db_vcs/config.rb', line 15 def mongo_config @mongo_config end |
#mysql_config ⇒ Object
Configuration of dbs clients.
15 16 17 |
# File 'lib/db_vcs/config.rb', line 15 def mysql_config @mysql_config end |
#pg_config ⇒ Object
Configuration of dbs clients.
15 16 17 |
# File 'lib/db_vcs/config.rb', line 15 def pg_config @pg_config end |