Permalink
Browse files

[syntax] i prefer **/ over */ now, corrected

  • Loading branch information...
1 parent d9408cd commit 5bac0f76b0e37eb86a77b89d38f05e2e24252007 Edward Hotchkiss committed Jun 9, 2012
Showing with 15 additions and 18 deletions.
  1. +8 −8 lib/short.js
  2. +4 −7 models/ShortURL.js
  3. +3 −3 test/index.test.js
View
@@ -1,7 +1,7 @@
/**
* Core Modules
- */
+ **/
var mongoose = require('mongoose')
, ShortURL;
@@ -10,7 +10,7 @@ var mongoose = require('mongoose')
* @method hasher
* @param {String} URL URL to be hashed
* @returns {String} hash Base 62 hash representation of the URL
- */
+ **/
var hasher = exports.hasher = function(URL, length) {
if (!length) length = 6;
@@ -25,7 +25,7 @@ var hasher = exports.hasher = function(URL, length) {
/**
* @method connect
* @param {String} mongdb Mongo DB String to connect to
- */
+ **/
var connect = exports.connect = function(mongodb) {
mongoose.connect(mongodb);
@@ -37,7 +37,7 @@ var connect = exports.connect = function(mongodb) {
/**
* @expose createConnection
* This will create a connection, instead of using the global mongo connection.
- */
+ **/
exports.createConnection = function createConnection(MongoURI) {
var connection = exports.connection = mongoose.createConnection(MongoURI, function(error) {
@@ -56,7 +56,7 @@ exports.createConnection = function createConnection(MongoURI) {
* @method createModel
* Connect after a connection has been declared
* it is OK if not connected yet, mongoose buffers request
- */
+ **/
function createModel() {
ShortURL = exports.ShortURL = require('../models/ShortURL');
@@ -66,7 +66,7 @@ function createModel() {
* @method generate
* @param {String} URL URL to create a Short URL of
* @param {Functon} callback Callback to execute on completion
- */
+ **/
var generate = exports.generate = function(URL, options, callback) {
var hashedURL
@@ -106,7 +106,7 @@ var generate = exports.generate = function(URL, options, callback) {
* @method retrieve
* @param {String} hash Hashed Base 62 URL to retrieve
* @param {Functon} callback Callback to execute on completion
- */
+ **/
var retrieve = exports.retrieve = function(hash, options, callback) {
if (arguments.length === 2 && arguments[1] instanceof Function) {
@@ -133,7 +133,7 @@ var retrieve = exports.retrieve = function(hash, options, callback) {
* @method list
* @param {Function} callback
* List all Shortened URLs
- */
+ **/
var list = exports.list = function(callback) {
ShortURL.find({}, function(error, urls) {
View
@@ -1,10 +1,7 @@
/**
- *
- * Mongoose Model:
- * - ShortURL
- *
- */
+ * @model ShortURL
+ **/
var mongoose = require('mongoose')
, Schema = mongoose.Schema
@@ -29,7 +26,7 @@ var ShortURL = mongoose.model('ShortURL', ShortURLSchema);
* @method findByHash
* @param {String} hash
* @param {Function} callback
- */
+ **/
ShortURL.findByHash = function (hash, options, callback) {
options.hash = hash;
@@ -51,7 +48,7 @@ ShortURL.findByHash = function (hash, options, callback) {
* @method updatehitsById
* @param {ObjectId} id
* @param {Function} callback
-*/
+**/
ShortURL.updateHitsById = function (URL, options, callback) {
if (options && options.visitor && URL.visitors.indexOf(options.visitor) === -1) {
View
@@ -1,7 +1,7 @@
/**
* requires
- */
+ **/
var vows = require('vows')
, assert = require('assert')
@@ -10,7 +10,7 @@ var vows = require('vows')
/**
* connect to mongodb
- */
+ **/
var MONGO_DB = process.env.MONGO_DB || 'mongodb://localhost/short';
@@ -22,7 +22,7 @@ short.connection.on('error', function(error) {
/**
* add suites to vows
- */
+ **/
vows.describe('general module tests').addBatch({

0 comments on commit 5bac0f7

Please sign in to comment.