Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

updated readme with my var changes and heroku/mongohq config

  • Loading branch information...
commit 9c8a5a7b4a9e6a60ae1f8b0ef8a968765f1568d9 1 parent 7711205
Sean Porter authored June 09, 2010 croaky committed June 09, 2010

Showing 1 changed file with 18 additions and 5 deletions. Show diff stats Hide diff stats

  1. 23  README.md
23  README.md
Source Rendered
@@ -35,11 +35,24 @@ All Sinatra options you can set are:
35 35
 
36 36
 Their default values are:
37 37
 
38  
-    ENV['MONGO_HOST'] || 'localhost'
39  
-    ENV['MONGO_DB']   || 'changme'
40  
-    ENV['MONGO_PORT'] || Mongo::Connection::DEFAULT_PORT
41  
-    ENV['MONGO_USER']
42  
-    ENV['MONGO_PASSWORD']
  38
+    ENV['MONGOID_HOST']		|| 'localhost'
  39
+    ENV['MONGOID_DATABASE']	|| 'changme'
  40
+    ENV['MONGOID_PORT']		|| Mongo::Connection::DEFAULT_PORT
  41
+    ENV['MONGOID_USERNAME']
  42
+    ENV['MONGOID_PASSWORD']
  43
+
  44
+Heroku & MongoHQ:
  45
+
  46
+require 'uri'
  47
+
  48
+if ENV['MONGOHQ_URL']
  49
+  mongo_uri = URI.parse(ENV['MONGOHQ_URL'])
  50
+  ENV['MONGOID_HOST'] = mongo_uri.host
  51
+  ENV['MONGOID_PORT'] = mongo_uri.port.to_s
  52
+  ENV['MONGOID_USERNAME'] = mongo_uri.user
  53
+  ENV['MONGOID_PASSWORD'] = mongo_uri.password
  54
+  ENV['MONGOID_DATABASE'] = mongo_uri.path.gsub("/", "")
  55
+end
43 56
 
44 57
 Resources
45 58
 ---------

0 notes on commit 9c8a5a7

Please sign in to comment.
Something went wrong with that request. Please try again.