Skip to content

Instantly share code, notes, and snippets.

@yayugu
Created October 13, 2011 11:35
Show Gist options
  • Save yayugu/1284021 to your computer and use it in GitHub Desktop.
Save yayugu/1284021 to your computer and use it in GitHub Desktop.
diff --git a/config.sample.yml b/config.sample.yml
index 0dab043..5ed6aa8 100644
--- a/config.sample.yml
+++ b/config.sample.yml
@@ -1,5 +1,5 @@
production:
- dsn: <%= ENV['DATABASE_URL'] || ENV['DUOSTACK_DB_MYSQL'] %>
+ dsn: mysql://sampleuser:samplepassword@localhost/db_name
development:
dsn: sqlite3://<%= root %>/db/development.sqlite3
test:
diff --git a/lib/lokka.rb b/lib/lokka.rb
index 5d298c4..d14be48 100644
--- a/lib/lokka.rb
+++ b/lib/lokka.rb
@@ -55,7 +55,10 @@ module Lokka
end
def self.config
- YAML.load(ERB.new(File.read("#{Lokka.root}/config.yml")).result(binding))
+ if File.exists("#{Lokka.root}/config.yml")
+ YAML.load(ERB.new(File.read("#{Lokka.root}/config.yml")).result(binding))
+ else
+ {'production' => {'dsn' => ENV['DATABASE_URL']}}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment