Created
May 27, 2015 10:44
-
-
Save brgnepal/6696ba586d780dad07c8 to your computer and use it in GitHub Desktop.
Setting database config params from config file in Sinatra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_CONFIG = YAML.load(File.open('config/database.yml')) | |
EXCEPTIONS = ['[email protected]', '[email protected]'] | |
LDAP = Ldap.setup | |
set :public_folder, 'public' | |
db_config = <<END | |
mysql2://#{DB_CONFIG['username']}:\ | |
#{DB_CONFIG['password']}@#{DB_CONFIG['host']}:\ | |
#{DB_CONFIG['port']}/#{DB_CONFIG['database']} | |
END | |
set :database, db_config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment