Created
February 13, 2013 15:04
-
-
Save g3d/4945221 to your computer and use it in GitHub Desktop.
Some Espresso improvement
This file contains 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
require File.expand_path('../base/boot', __FILE__) |
This file contains 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
if Cfg.db[:type] && Cfg.db[:name] | |
values = Cfg.db.values_at(:type, :user, :pass, :host, :name) | |
if Cfg.db[:type] == 'sqlite' | |
values = [values.first, Cfg.root_path(values.last)] | |
connection_string = '%s://%s' % values | |
else | |
values = Cfg.db.values_at(:type, :user, :pass, :host, :name) | |
connection_string = '%s://%s:%s@%s/%s' % values | |
end | |
DataMapper.setup :default, connection_string | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment