Skip to content
Browse files

Merge pull request #20 from joefiorini/dot-in-pathname

Allow '.' in pathname
  • Loading branch information...
2 parents 6235827 + 27d51fd commit 5713bec1041e92ed8f100d5791893c48723bf250 @ryankee committed
Showing with 9 additions and 2 deletions.
  1. +8 −1 lib/jobs.js
  2. +1 −1 src/jobs.coffee
View
9 lib/jobs.js
@@ -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) {
View
2 src/jobs.coffee
@@ -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

0 comments on commit 5713bec

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