Sha256: d3e52a64e2ed83b5d426f17e0d7840e3a3f24b0bd5c254b08694c3448be01061
Contents?: true
Size: 1.14 KB
Versions: 28
Compression:
Stored size: 1.14 KB
Contents
require File.dirname(__FILE__) + '/config_file' module TaliaUtil module Configuration # This contains some special methods for database config files class DatabaseConfig < ConfigFile def initialize(template) @environments = ['test', 'development', 'production'] super end # Set the credentials for all environments def set_credentials(db_user, db_pass) @environments.each do |env| @config_doc[env]['username'] = db_user @config_doc[env]['password'] = db_pass end end # Sets the database adapter for all environments def set_adapter(db_adapter) @environments.each { |env| @config_doc[env]['adapter'] = db_adapter } end # Sets the database names based on the given application name def set_database_names(app_name) @environments.each { |env| @config_doc[env]['database'] = "#{app_name}_#{env}" } end # Sets the socket file for the db def set_socket(socket) @environments.each { |env| @config_doc[env]['socket'] = socket } end end end end
Version data entries
28 entries across 28 versions & 1 rubygems