Permalink
Browse files

change over

  • Loading branch information...
1 parent a0ef630 commit 48bcb5d6d438a487eab7bcb69309664b99e8cd21 @weepy committed Mar 10, 2011
Showing with 49 additions and 64 deletions.
  1. +11 −0 History.md
  2. +14 −0 Makefile
  3. +10 −7 README.md
  4. +1 −1 docs/index.html
  5. +2 −0 index.js
  6. +2 −3 lib/edge_query.js
  7. 0 lib/{index.js → mmmodel.js}
  8. +0 −5 make_docs
  9. +6 −11 package.json
  10. +1 −3 test/lib/app.js
  11. +1 −1 test/lib/task.js
  12. +0 −27 test/lib/task2.js
  13. +1 −6 test/test_memory.js
View
@@ -0,0 +1,11 @@
+0.0.2 / 2010-01-03
+==================
+
+ * Complete rewrite
+ * Use z lists for redis graph api
+ * REST store now working
+
+0.0.1 / 2010-01-01
+==================
+
+ * Initial release
View
@@ -0,0 +1,14 @@
+
+test:
+ @echo "testing"
+ @expresso \
+ -s test/test* \
+ -t 5000
+
+docs:
+ @ echo "... generating docs"
+ @dox --desc "Homer's favoriate Javascript ORM" --ribbon http://github.com/weepy/mmmodel > docs/index.html --title mmmodel lib/*.js
+
+.PHONY: test docs
+
+
View
@@ -1,9 +1,9 @@
-MMMODEL
+mmmodel
======
-Homer Simpson's favorite Javascript ORM
+Homer's favorite Javascript ORM
-MMmodel is a Javascript ORM for Redis and client side use through a REST api.
+mmmodel is an ORM for Redis and client side use through a REST api.
It has multiple backends - using the same API. There's also a memory store.
@@ -31,14 +31,17 @@ npm install mmmodel
Create Documenation
-------
-./make_docs
-needs dox installed
+<pre>make docs</pre>
+
+NB: needs dox installed
Tests
----
To run the TDD tests:
<pre>
-expresso -s test/test_* -t 5000
-</pre>
+make test
+</pre>
+
+NB: needs expresso installed
View
@@ -543,7 +543,7 @@
<td class="code">
</td>
-</tr><tr class="filename"><td><h2 id="lib/index.js"><a href="#">index</a></h2></td><td>lib/index.js</td></tr><tr class="code">
+</tr><tr class="filename"><td><h2 id="lib/mmmodel.js"><a href="#">mmmodel</a></h2></td><td>lib/mmmodel.js</td></tr><tr class="code">
<td class="docs">
<p>exports.core = require("./core")</p>
View
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/mmmodel');
View
@@ -1,6 +1,7 @@
function EdgeQuery(x, self) {
this.key = x
this.self = self
+ this.client = self.client || self.constructor.client
}
EdgeQuery.prototype.range = function(low, high) {
@@ -54,9 +55,7 @@ EdgeQuery.prototype.all = function(cb) {
else cb.call(context, data)
})
- var client = self.constructor.client
-
- client[method].apply(client, args)
+ this.client[method].apply(this.client, args)
}
File renamed without changes.
View
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-dox --desc "Homer Simpson's favoriate Javascript ORM" --ribbon http://github.com/weepy/mmmodel > docs/index.html --title mmmodel lib/*.js
-
-
View
@@ -1,16 +1,11 @@
{
"name": "mmmodel",
"version": "0.0.2",
- "author": "weepy",
- "licenses": [{
- "type": "MIT",
- "url": "http://github.com/weepy/mmmodel/raw/master/LICENSE"
- }],
- "directories" : {
- "lib" : "./lib"
- },
+ "description": "Homer's favorite Javascript ORM",
+ "keywords": ["javascript", "orm", "redis", "rest"],
+ "author": "Jonah Fox <jonah@boodigital.com>",
"repository": "http://github.com/weepy/mmmodel",
- "engines" : { "node": ">= 0.4.0" },
- "main": "./lib/index"
+ "dependencies": {},
+ "main": "index",
+ "engines": { "node": "0.4.x" }
}
-
View
@@ -1,8 +1,6 @@
var express = require("express"),
app = express.createServer(),
- Task = require("./task2")("memory") // we need a different version ! otherwise the different stores get clobbered
-
-Task._set_store("memory")
+ Task = require("./task")("memory")
// find
app.get("/tasks/:id", function(req, res) {
View
@@ -1,6 +1,6 @@
module.exports = function(store) {
- var Task = require("../../lib/index")[store]("Task", {
+ var Task = require("../..")[store]("Task", {
id: { type: "number", auto_inc: true },
user: { type: "string", required: "true" },
created_at: { type: "date" },
View
@@ -1,27 +0,0 @@
-
-module.exports = function(store) {
- var Task = require("../../lib/index")[store]("Task", {
- id: { type: "number", auto_inc: true },
- user: { type: "string", required: "true" },
- created_at: { type: "date" },
- title: { type:"string", "default": "no title!" },
- keywords: { type:"json", "default": ["books"] },
- })
-
- Task.bind("saving", function updateCreatedAt(done) {
- this.created_at || (this.created_at = new Date())
- delete this._saved
- done()
- }, true) // async
-
- Task.bind("saved", function setSaved() {
- this._saved = true
- }) // async
-
- Task.bind("initialize", function(done) {
- this.test = 123
- done()
- }, true)
-
- return Task
-}
View
@@ -1,10 +1,9 @@
var x = {},
assert = require('assert'),
is = require('should'),
- mmmodel = require('../lib/index'),
+ mmmodel = require('..'),
Task = require("./lib/task")("memory")
-
var task, o
exports.zero_tasks = function(done) {
@@ -21,10 +20,6 @@ exports.unsaved_task_has_no_id = function(done) {
}
-
-
-
-
exports.save_valid_saved = function(done) {
var t = new Task({user: "billy"})

0 comments on commit 48bcb5d

Please sign in to comment.