Class: DbEntropy::Mysql

Inherits:
Base
  • Object
show all
Defined in:
lib/db-entropy/mysql.rb

Instance Attribute Summary

Attributes inherited from Base

#extra_environments

Instance Method Summary collapse

Methods inherited from Base

#generate_random_name, #generate_yaml, #initialize, #write_to_yaml

Constructor Details

This class inherits a constructor from DbEntropy::Base

Instance Method Details

#generate_database_configObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/db-entropy/mysql.rb', line 3

def generate_database_config
  db_config = %w(development test).inject({}) do |conf, env|
    conf[env] = {'database' => "entropy_#{generate_random_name}",
                 'adapter'  => 'mysql',
                 'hostname' => 'localhost',
                 'username' => 'root',
                 'password' => nil}
    conf
  end
  extra_environments.each do |env|
    db_config[env] = db_config['test']
  end
  db_config
end