Permalink
Browse files

Merge pull request #105 from my8bird/master

Random fixes required when I first checked out the project.
  • Loading branch information...
2 parents 70160f8 + 95514b1 commit 7adf7ecceb27f3080be1a9999ebf2d1c704e7185 @wmertens wmertens committed Aug 14, 2012
Showing with 18 additions and 5 deletions.
  1. +9 −2 Cakefile
  2. +3 −1 package.json
  3. +6 −2 src/server/model.coffee
View
@@ -1,6 +1,12 @@
{exec} = require 'child_process'
-fs = require 'fs'
-path = require 'path'
+fs = require 'fs'
+path = require 'path'
+os = require 'os'
+
+# Gain access through PATH to all binaries added by `npm install`
+npm_bin = path.resolve(path.join('node_modules', '.bin'))
+path_sep = if os.platform() == 'win32' then ";" else ":"
+process.env.PATH = "#{npm_bin}#{path_sep}#{process.env.PATH}"
task 'test', 'Run all tests', ->
# run directly to get all the delicious output
@@ -9,6 +15,7 @@ task 'test', 'Run all tests', ->
throw err if err
task 'build', 'Build the .js files', (options) ->
+ console.log('Compiling Coffee from src to lib')
exec "coffee --compile --bare --output lib/ src/", (err, stdout, stderr) ->
throw err if err
console.log stdout + stderr
View
@@ -29,7 +29,9 @@
"engine": "node >= 0.6",
"scripts": {
"build": "cake build",
- "test": "nodeunit tests.coffee"
+ "test": "nodeunit tests.coffee",
+ "postinstall": "cake build",
+ "prepublish": "cake build"
},
"licenses": [{
"type": "BSD",
View
@@ -20,8 +20,12 @@ isArray = (o) -> Object.prototype.toString.call(o) == '[object Array]'
# - It calls out to the OT functions when necessary
#
# The model is an event emitter. It emits the following events:
-#
-# create(docName, data): A document has been created with the specified name & data
+# - create(docName, data): A document has been created with the specified name & data
+# - add(docName, data)
+# - load(docName, data)
+# - applyOp(docName, opData, snapshot, oldSnapshot)
+# - applyMetaOp(docName, path, value)
+
module.exports = Model = (db, options) ->
# db can be null if the user doesn't want persistance.

0 comments on commit 7adf7ec

Please sign in to comment.