diff --git a/.gitignore b/.gitignore index f8f6df66..db02cd10 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ v8.log .DS_Store benchmark.js analyse.r +docs/html +docs/man diff --git a/Makefile b/Makefile index 7ad36363..d100b43e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,33 @@ -doc: - makedoc lib/abstract-class.js lib/schema.js lib/validatable.js -t "JugglingDB API docs" +# doc: +# makedoc lib/abstract-class.js lib/schema.js lib/validatable.js -t "JugglingDB API docs" test: @./node_modules/.bin/mocha --require should test/*.test.js -.PHONY: test -.PHONY: doc +MAN_DOCS = $(shell find docs -name '*.md' \ + |sed 's|.md|.3|g' \ + |sed 's|docs/|docs/man/|g' ) + +HTML_DOCS = $(shell find docs -name '*.md' \ + |sed 's|.md|.3.html|g' \ + |sed 's|docs/|docs/html/|g' ) \ + docs/html/index.html + +docs/man/%.3: docs/%.md scripts/doc.sh + scripts/doc.sh $< $@ + +docs/html/%.3.html: docs/%.md scripts/doc.sh + scripts/doc.sh $< $@ + +docs/html/index.html: docs/jugglingdb.md scripts/doc.sh + scripts/doc.sh $< $@ + +man: $(MAN_DOCS) +html: $(HTML_DOCS) + +release: man + +web: html + rsync ./docs/html/* jugglingdb.co:/var/www/apps/jugglingdb.co/public + +.PHONY: test docs diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 00000000..36a5233a --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,17 @@ +jugglingdb-changelog(3) - The History of JugglingDB +=================================================== + +## HISTORY + +### upcoming release + +### 0.2.1 + +### 0.2.0 + +### 0.1.27 +### 0.1.23 +### 0.1.21 +### 0.1.1 +### 0.0.4 +### 0.0.2 diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 00000000..be1ed638 --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,197 @@ + + + + + + JugglingDB(3) - cross-database ORM for nodejs and browser + + + + + +
+ + + +
    +
  1. JugglingDB(3)
  2. +
  3. JugglingDB
  4. +
  5. JugglingDB(3)
  6. +
+ +

NAME

+

+ JugglingDB - cross-database ORM for nodejs and browser +

+ +

DESCRIPTION

+ +

JugglingDB is cross-db ORM for nodejs, providing common interface to access +most popular database formats. Currently supported are: mysql, sqlite3, +postgres, couchdb, mongodb, redis, neo4j and in-memory-storage.

+ +

JugglingDB also works on client-side (using WebService and Memory adapters), +which allows to write rich client-side apps talking to server using JSON API.

+ +

INSTALLATION

+ +

Use npm to install core package:

+ +
npm install jugglingdb --save
+
+ +

Alternatively you can install jugglingdb core from github:

+ +
npm install 1602/jugglingdb
+
+ +

Then install adapter for specific database, for example jugglingdb-redis:

+ +
npm install jugglingdb-redis
+
+ +

See jugglingdb-adapters(3) for list of available adapters.

+ +

DOCUMENTATION

+ +

Autogenerated documentation available at jsdoc.info/1602/jugglingdb. Human-written manual sections are:

+ +
+
jugglingdb-schema(3)

Everything about schema, data types and model definition.

+
jugglingdb-model(3)

Model methods, features and internals.

+
jugglingdb-validations(3)

Built-in validators, creating custom validations, syncronous and asyncronous +object validation.

+
jugglingdb-hooks(3)

Hooks and object lifecycle.

+
+ + +

ADAPTERS

+ +

CONTRIBUTION

+ +

FUTURE

+ +

See jugglingdb-roadmap(3) and [github issues][issues] to catch up current +development and see how you can help jugglingdb to grow up.

+ +

BUGS

+ +

When you find issues, please report them:

+ +
+
github/core
https://github.com/1602/jugglingdb/issues
+
github/adapters
https://github.com/jugglingdb
+
email
compoundjs@googlegroups.com
+
+ + +

HISTORY

+ +

See jugglingdb-changelog(3)

+ +

LICENSE

+ +

JugglingDB has MIT license, see jugglingdb-license(3) for details.

+ +

AUTHOR

+ + + + +

CONTRIBUTORS

+ +

core contributors (more than 1%)

+ +
410 Anatoliy Chakkaev       73.9%
+ 31 Sébastien Drouyer      5.6%
+ 25 1602                    4.5%
+  9 Muneeb Samuels          1.6%
+  6 Henri Bergius           1.1%
+
+ +

adapters maintainers

+ + + + +

SEE ALSO

+ + +
    +
  1. 1602 Software
  2. +
  3. March 2013
  4. +
  5. JugglingDB(3)
  6. +
+ +
+ + diff --git a/docs/index.txt b/docs/index.txt new file mode 100644 index 00000000..e30d28dc --- /dev/null +++ b/docs/index.txt @@ -0,0 +1,9 @@ +jugglingdb(3) index +jugglingdb-changelog(3) changelog.3 +jugglingdb-roadmap(3) roadmap.3 +jugglingdb-validations(3) validations.3 +jugglingdb-hooks(3) hooks.3 +jugglingdb-schema(3) schema.3 +jugglingdb-model(3) model.3 + +jugglingdb-nano https://github.com/jugglingdb/nano-adapter diff --git a/docs/jugglingdb.md b/docs/jugglingdb.md new file mode 100644 index 00000000..d2fcc1d1 --- /dev/null +++ b/docs/jugglingdb.md @@ -0,0 +1,101 @@ +JugglingDB(3) - cross-database ORM for nodejs and browser +========================================================= + +## DESCRIPTION + +JugglingDB is cross-db ORM for nodejs, providing **common interface** to access +most popular database formats. Currently supported are: mysql, sqlite3, +postgres, couchdb, mongodb, redis, neo4j and in-memory-storage. + +JugglingDB also works on client-side (using WebService and Memory adapters), +which allows to write rich client-side apps talking to server using JSON API. + + +## INSTALLATION + +Use npm to install core package: + + npm install jugglingdb --save + +Alternatively you can install jugglingdb core from github: + + npm install 1602/jugglingdb + +Then install adapter for specific database, for example `jugglingdb-redis`: + + npm install jugglingdb-redis + +See jugglingdb-adapters(3) for list of available adapters. + +## DOCUMENTATION + +Autogenerated documentation available at [jsdoc.info/1602/jugglingdb](https://jsdoc.info/1602/jugglingdb). Human-written manual sections are: + +* jugglingdb-schema(3): + Everything about schema, data types and model definition. + +* jugglingdb-model(3): + Model methods, features and internals. + +* jugglingdb-validations(3): + Built-in validators, creating custom validations, syncronous and asyncronous + object validation. + +* jugglingdb-hooks(3): + Hooks and object lifecycle. + +## ADAPTERS + +## CONTRIBUTION + +## FUTURE + +See jugglingdb-roadmap(3) and [github issues][issues] to catch up current +development and see how you can help jugglingdb to grow up. + +## BUGS + +When you find issues, please report them: + +* github/core: + +* github/adapters: + +* email: + + +## HISTORY + +See jugglingdb-changelog(3) + +## LICENSE + +JugglingDB has MIT license, see jugglingdb-license(3) for details. + +## AUTHOR + +* [blog](http://anatoliy.in/) +* [github/1602](https://github.com/1602/) +* [github/anatoliychakkaev](https://github.com/anatoliychakkaev/) +* [twitter@1602](http://twitter.com/1602) +* + +## CONTRIBUTORS + +### core contributors (more than 1%) + 410 Anatoliy Chakkaev 73.9% + 31 Sébastien Drouyer 5.6% + 25 1602 4.5% + 9 Muneeb Samuels 1.6% + 6 Henri Bergius 1.1% + +### adapters maintainers + +* [jugglingdb-nano] - [Nicholas Westlake](https://github.com/nrw) +* [jugglingdb-mysql] - [dgsan](https://github.com/dgsan) +* [jugglingdb-firebird] - [Henri Gourvest](https://github.com/hgourvest) + +*NOTE:* Other adapters waits for their maintainers, drop a line to +mail@anatoliy.in if you want to maintain some adapter on regular basis. + +## SEE ALSO diff --git a/docs/roadmap.md b/docs/roadmap.md new file mode 100644 index 00000000..43617852 --- /dev/null +++ b/docs/roadmap.md @@ -0,0 +1,29 @@ +jugglingdb-roadmap - The Future of JugglingDB +============================================= + +## DOCUMENTATION + +### ENGINE + +* web +* man + +### SECTIONS + +* hooks +* validations +* schema +* model +* adapters +* testing + +## MODEL CORE + +* virtual attributes +* object presentation modes +* mass-assignment protection +* destroy by query + +## SCHEMA + +* models merging diff --git a/lib/schema.js b/lib/schema.js index 6696cf45..681d873f 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -158,6 +158,8 @@ Schema.prototype.define = function defineClass(className, properties, settings) if (args.length == 1) properties = {}, args.push(properties); if (args.length == 2) settings = {}, args.push(settings); + settings = settings || {}; + standartize(properties, settings); // every class can receive hash of data as optional param diff --git a/scripts/doc.sh b/scripts/doc.sh new file mode 100755 index 00000000..505bc6ee --- /dev/null +++ b/scripts/doc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +src=$1 +dest=$2 + +if ! [ `which ronn` ]; then + echo 'ronn rubygem is not installed, run "gem install ronn"' + exit 0 +fi + +mkdir -p $(dirname $dest) + +# VERSION=$(grep version package.json | perl -pi -e 's/[^-\d\.]//g') + +case $dest in + *.[13]) + ronn --roff $1 --pipe --organization=1602\ Software --manual=JugglingDB > $2 + exit $? + ;; + + *.html) + ronn -5 $1 --pipe\ + --style=toc\ + --organization=1602\ Software\ + --manual=JugglingDB > $2 + exit $? + ;; +esac