Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow '.' in pathname #20

Merged
merged 1 commit into from

2 participants

Joe Fiorini Ryan Kee
Joe Fiorini

MongoDB doesn't allow . in database names, but I have github repos that do. This enables me to use those repos without having to rename them.

Ryan Kee ryankee merged commit 5713bec into from
Ryan Kee
Owner

Fantastic, concise commits. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 21, 2012
  1. Joe Fiorini

    Allow '.' in pathname

    joefiorini authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +8 −1 lib/jobs.js
  2. +1 −1  src/jobs.coffee
9 lib/jobs.js
View
@@ -1,17 +1,24 @@
+// Generated by CoffeeScript 1.3.1
(function() {
var ObjectID, db, getJobs, jobs, mongo, path;
+
mongo = require('mongodb');
+
path = require('path');
- db = new mongo.Db("concrete_" + (path.basename(process.cwd())), new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {
+
+ db = new mongo.Db("concrete_" + (path.basename(process.cwd()).replace(/\./, "-")), new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {
auto_reconnect: true
}), {});
+
db.open(function(error) {
if (error) {
console.log('There was an error creating a connection with the Mongo database. Please check that MongoDB is properly installed and running.'.red);
return process.exit(1);
}
});
+
ObjectID = mongo.BSONPure.ObjectID;
+
jobs = module.exports = {
current: null,
addJob: function(next) {
2  src/jobs.coffee
View
@@ -1,6 +1,6 @@
mongo = require 'mongodb'
path = require 'path'
-db = new mongo.Db "concrete_#{path.basename process.cwd()}", new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {auto_reconnect: true}), {}
+db = new mongo.Db "concrete_#{path.basename(process.cwd()).replace(/\./, "-")}", new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {auto_reconnect: true}), {}
db.open (error) ->
if error
console.log 'There was an error creating a connection with the Mongo database. Please check that MongoDB is properly installed and running.'.red
Something went wrong with that request. Please try again.