Use ENV['MONGODB_URI'] if available #99

Merged
merged 1 commit into from Jun 2, 2012

3 participants

@seamusabshere

hi,

There's a growing trend to use _URL-style environment variables in database drivers:

Note that I followed the convention already established in the MongoDB code of calling it a "URI" and not a "URL", so that is one difference from the general trend.

Fundamentally, this change will make MongoDB a lot easier to deploy on services like Heroku that encourage environment variables.

Thanks!
Seamus

PS. rake test:ruby and rake test:c all pass - plus I added more tests.

@seamusabshere

@banker yah, no reason to touch that in this pull request - i'll do more research and submit it separately

@seamusabshere

@banker how do you feel about the rest?

@seamusabshere

hi @banker I removed the offending commit and force-pushed to my branch, so it's cleaner now.

@banker

Thanks, @seamusabshere. We'll look into merging this in soon.

@seamusabshere

hi @banker - hope this is still in the queue!

@seamusabshere

hey @TylerBrock - saw you merging some pull requests - still willing to make any changes you guys want on this.

@TylerBrock

@seamusabshere Yeah, as a Heroku fan, I like this. Hold tight, I just need to review it carefully. Thank you for your patience on this one.

@TylerBrock

Ok, this looks great. Thank you for all the hard work.

@TylerBrock TylerBrock merged commit 2cfacbd into mongodb:master Jun 2, 2012
@TylerBrock

Tests didn't pass in 1.8.7, might have to revert this one until I have more time.

@seamusabshere

fix using CGI.parse instead of URI.decode_www_form on its way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment