Skip to content
This repository

Allow '.' in pathname #20

Merged
merged 1 commit into from about 2 years ago

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 ryankee closed this
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

Showing 1 unique commit by 1 author.

Jun 21, 2012
Joe Fiorini joefiorini Allow '.' in pathname 27d51fd
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. +8 1 lib/jobs.js
  2. +1 1  src/jobs.coffee
9 lib/jobs.js
... ... @@ -1,17 +1,24 @@
  1 +// Generated by CoffeeScript 1.3.1
1 2 (function() {
2 3 var ObjectID, db, getJobs, jobs, mongo, path;
  4 +
3 5 mongo = require('mongodb');
  6 +
4 7 path = require('path');
5   - db = new mongo.Db("concrete_" + (path.basename(process.cwd())), new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {
  8 +
  9 + db = new mongo.Db("concrete_" + (path.basename(process.cwd()).replace(/\./, "-")), new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {
6 10 auto_reconnect: true
7 11 }), {});
  12 +
8 13 db.open(function(error) {
9 14 if (error) {
10 15 console.log('There was an error creating a connection with the Mongo database. Please check that MongoDB is properly installed and running.'.red);
11 16 return process.exit(1);
12 17 }
13 18 });
  19 +
14 20 ObjectID = mongo.BSONPure.ObjectID;
  21 +
15 22 jobs = module.exports = {
16 23 current: null,
17 24 addJob: function(next) {
2  src/jobs.coffee
... ... @@ -1,6 +1,6 @@
1 1 mongo = require 'mongodb'
2 2 path = require 'path'
3   -db = new mongo.Db "concrete_#{path.basename process.cwd()}", new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {auto_reconnect: true}), {}
  3 +db = new mongo.Db "concrete_#{path.basename(process.cwd()).replace(/\./, "-")}", new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {auto_reconnect: true}), {}
4 4 db.open (error) ->
5 5 if error
6 6 console.log 'There was an error creating a connection with the Mongo database. Please check that MongoDB is properly installed and running.'.red

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.