Permalink
Browse files

Merge pull request #49 from Baggz/dev

Amanda v0.4.3
  • Loading branch information...
2 parents 5cdf75a + cfc55c2 commit 7410d02bd692c148fc1b8fc6447ea41c4b13c39e @Baggz committed Dec 26, 2012
Showing with 3,818 additions and 1,699 deletions.
  1. +2 −0 .travis.yml
  2. +9 −0 LICENSE
  3. +77 −80 README.md
  4. +6 −18 docs/README.md
  5. +6 −6 package.json
  6. +2,016 −0 releases/0.4.3/amanda.js
  7. +26 −0 releases/0.4.3/amanda.min.js
  8. +1,646 −1,566 releases/latest/amanda.js
  9. +25 −25 releases/latest/amanda.min.js
  10. +5 −4 src/engines/json/getProperty.js
View
@@ -1,5 +1,7 @@
language: node_js
node_js:
+ - 0.9
+ - 0.8
- 0.6
script: "make && npm test"
View
@@ -0,0 +1,9 @@
+(The MIT License)
+
+Copyright (c) 2011 František Hába <hello@frantisekhaba.com>;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
157 README.md
@@ -1,10 +1,10 @@
<a name="amanda"></a>
# Amanda
-[Amanda](https://github.com/Baggz/Amanda) is aiming to be **a universal validation library**. Currently it supports only the [JSON Schema Internet Draft](http://tools.ietf.org/html/draft-zyp-json-schema-03), but I'm planning to add [Orderly](http://orderly-json.org/), [Relax NG](http://relaxng.org/) and others very soon.
+[Amanda](https://github.com/Baggz/Amanda) is aiming to be **a universal schema validation library**. Currently it supports only the [JSON Schema Internet Draft](http://tools.ietf.org/html/draft-zyp-json-schema-03), but I'm planning to add [Orderly](http://orderly-json.org/), [Relax NG](http://relaxng.org/) and others very soon.
<a name="example"></a>
-#### Example
+### Example
```javascript
/**
@@ -15,8 +15,7 @@ var schema = {
properties: {
name: {
required: true,
- type: 'string',
- length: 7
+ type: 'string'
}
}
};
@@ -28,95 +27,111 @@ var data = {
name: 'Kenneth'
};
-// Initialize a JSON Schema validator
+// Initialize a JSON Schema validator.
var jsonSchemaValidator = amanda('json');
-// Validate the data against the schema
+// Validate the data against the schema.
jsonSchemaValidator.validate(data, schema, function(error) {
+
// Do something...
+
});
```
+# Contents
+
+<ul>
+ <li><a href="#features">Features</a></li>
+ <li><a href="#download">Download</a></li>
+ <li><a href="#status">Status</a></li>
+ <li><a href="#documentation">Documentation</a></li>
+ <li><a href="#compatibility">compatibility</a></li>
+ <li><a href="#building">Building</a></li>
+ <li><a href="#tests">Tests</a></li>
+ <li><a href="#versioning">Versioning</a></li>
+ <li><a href="#release-notes">Release Notes</a></li>
+ <li><a href="#authors">authors</a></li>
+ <li><a href="#license">License</a></li>
+</ul>
+
<a name="features"></a>
-#### Features
+## Features
* **Extendable**, you can create **your own attributes**
* Can be used with **Node.js** and **in a browser**
* Amanda has **no dependencies**
-* **AMD compatible**, you can load it via [RequireJS](https://github.com/jrburke/requirejs)
+* **AMD compatible**, you can load it via [RequireJS](http://requirejs.org/)
* Lightweight
* Fully **documented**
* Tested
-<a name="status"></a>
-#### Status
-
-| **Branch** | **Status** |
-|:-----------|:----------|
-| master | [![Build Status](https://secure.travis-ci.org/Baggz/Amanda.png?branch=master)](http://travis-ci.org/Baggz/Amanda) |
-| dev | [![Build Status](https://secure.travis-ci.org/Baggz/Amanda.png?branch=dev)](http://travis-ci.org/Baggz/Amanda) |
-
-<a name="contents"></a>
-### Contents
+## Download
<ul>
- <li><a href="#Download">Download</a></li>
- <li><a href="#Usage">Usage</a></li>
- <li><a href="#Documentation">Documentation</a></li>
- <li><a href="#Compatibility">Compatibility</a></li>
- <li><a href="#Building">Building</a></li>
- <li><a href="#Tests">Tests</a></li>
- <li><a href="#Versioning">Versioning</a></li>
- <li><a href="#Tests">Tests</a></li>
- <li><a href="#Release Notes">Release Notes</a></li>
- <li><a href="#Contributors">Contributors</a></li>
- <li><a href="#License">License</a></li>
+ <li><a href="#node.js">Node.js</a></li>
+ <li><a href="#browser">Browser</a></li>
</ul>
-<a name="Download"></a>
-## Download [&uarr;](#Contents)
+### Node.js
To install **Amanda**, use [NPM](http://npmjs.org/).
```
$ npm install amanda
```
-Or use use [JAM](http://groundcomputing.co.uk/code/jam).
+Then you can load the library via `require`.
+```javascript
+var amanda = require('amanda');
```
-$ jam install amanda
+
+If you prefer [RequireJS](http://requirejs.org/), go ahead.
+
+```javascript
+// Configuration options, the path should not include the .js extension.
+require.config({
+ paths: {
+ 'amanda': 'path/to/amanda'
+ }
+});
+
+// Load Amanda
+require(['amanda'], function(amanda) {
+
+ // Do something...
+
+});
```
-Releases for a browser are available for download from GitHub.
+### Browser
+
+Releases for the browser are available for download from GitHub.
| **Version** | **Description** | **Size** | **Action** |
|:------------|:----------------|:---------|:-----------|
| `amanda.js` | *uncompressed, with comments* | 36.01 KB (7.11 KB gzipped) | [Download](https://raw.github.com/Baggz/Amanda/master/releases/latest/amanda.js) |
| `amanda.min.js` | *compressed, without comments* | 13.62 KB (3.99 KB gzipped) | [Download](https://raw.github.com/Baggz/Amanda/master/releases/latest/amanda.min.js) |
-<a name="Uage"></a>
-## Usage [&uarr;](#Contents)
-
-### Browser
+Or you can use [JAM](http://jamjs.org/).
```
-<script src="amanda.js"></script>
+$ jam install amanda
```
-### Node.js, RingoJS, Narwhal
+Then you can load the library via the `<script>` tag.
-```javascript
-var amanda = require('amanda');
+```html
+<script src="/path/to/amanda.js"></script>
```
-### RequireJS
+...or via [RequireJS](http://requirejs.org/).
```javascript
-// Configuration options, the path should not include the .js extension
+// Configuration options, the path should not include the .js extension.
require.config({
paths: {
- "robb": "path/to/amanda"
+ 'amanda': 'path/to/amanda'
}
});
@@ -128,42 +143,42 @@ require(['amanda'], function(amanda) {
});
```
-<a name="Documentation"></a>
-## Documentation [&uarr;](#Contents)
+## Status
+
+| **Branch** | **Status** |
+|:-----------|:----------|
+| master | [![Build Status](https://secure.travis-ci.org/Baggz/Amanda.png?branch=master)](http://travis-ci.org/Baggz/Amanda) |
+| dev | [![Build Status](https://secure.travis-ci.org/Baggz/Amanda.png?branch=dev)](http://travis-ci.org/Baggz/Amanda) |
+
+## Documentation
All documentation is available in the [/docs/](https://github.com/Baggz/Amanda/tree/master/examples) folder.
-<a name="Compatibility"></a>
-## Compatibility [&uarr;](#Contents)
+## Compatibility
### Node.js
From version **0.6.0**.
-***Note:** Earlier versions might work OK, but are not tested.*
-
### Browsers
*Testing in progress...*
-<a name="Building"></a>
-## Building [&uarr;](#Contents)
+## Building
I have included a `Makefile` with convenience methods for working with the library.
<ul>
<li><code>make</code> Builds the library</li>
</ul>
-<a name="Tests"></a>
-## Tests [&uarr;](#Contents)
+## Tests
```
$ npm test
```
-<a name="Versioning"></a>
-## Versioning [&uarr;](#Contents)
+## Versioning
Releases will be numbered with the following format.
@@ -179,8 +194,7 @@ And constructed with the following guidelines.
For more information on *semantic versioning*, please visit http://semver.org/.
-<a name="ReleaseNotes"></a>
-## Release Notes [&uarr;](#Contents)
+## Release Notes
* [v0.4.0](https://github.com/Baggz/Amanda/pull/35)
* [v0.3.0](https://github.com/Baggz/Amanda/pull/26)
@@ -189,27 +203,10 @@ For more information on *semantic versioning*, please visit http://semver.org/.
* [v0.2.0](https://github.com/Baggz/Amanda/pull/2)
* [v0.0.2](https://github.com/Baggz/Amanda/pull/1)
-<a name="Contributors"></a>
-## Contributors [&uarr;](#Contents)
-
-The following are the major contributors of Amanda (in random order).
-
-* **František Hába** ([@Baggz](https://github.com/Baggz))
-* **Jakub Nešetřil** ([@zzen](https://github.com/zzen))
-* **Iain Carsberg** ([@iaincarsberg](https://github.com/iaincarsberg))
-* **Adrian Rossouw** ([@Vertice](https://github.com/Vertice))
-* **Leon de Almeida** ([@leondealmeida](https://github.com/leondealmeida))
-
-<a name="License"></a>
-## License [&uarr;](#Contents)
-
-(The MIT License)
-
-Copyright (c) 2011 František Hába &lt;hello@frantisekhaba.com&gt;
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+## Authors
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+František Hába ([@Baggz](https://github.com/Baggz)) created [Amanda](https://github.com/Baggz/Amanda) and [these people](https://github.com/Baggz/Amanda/graphs/contributors) have contributed.
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+## License
+Please see the [LICENSE](https://github.com/Baggz/Amanda/blob/master/LICENSE) file.
View
@@ -1,4 +1,3 @@
-<a name="documentation"></a>
# Documentation
### Engines
@@ -8,25 +7,14 @@
<a name="jsonSchema"></a>
## JSON Schema
-diff.md
-
-### Example
-
-```
-// Initialize a JSON Schema validator
-var jsonSchemaValidator = amanda('json');
-```
-
-<a name="methods"></a>
### Methods
-* [validate](https://github.com/Baggz/Amanda/tree/master/docs/json/methods/validate.md#validate)
-* [addAttribute](https://github.com/Baggz/Amanda/tree/master/docs/json/methods/validate.md#addAttribute)
-* [addAttributeConstructor](https://github.com/Baggz/Amanda/tree/master/docs/json/methods/validate.md#addAttributeConstructor)
+* [validate](./json/methods/validate.md)
+* [addAttribute](./json/methods/addAttribute.md)
+* [addAttributeConstructor](./json/methods/addAttributeConstructor.md)
-<a name="objects"></a>
### Objects
-* [Schema](https://github.com/Baggz/Amanda/tree/master/docs/json/objects/schema.md)
-* [Error](https://github.com/Baggz/Amanda/tree/master/docs/json/objects/error.md)
-* [Options](https://github.com/Baggz/Amanda/tree/master/docs/json/objects/options.md)
+* [Schema](./json/objects/schema.md)
+* [Error](./json/objects/error.md)
+* [Options](./json/objects/options.md)
View
@@ -2,15 +2,15 @@
"name": "amanda",
"description": "JSON Schema validator",
- "version": "0.4.2",
+ "version": "0.4.3",
"author": "František Hába <hello@frantisekhaba.com>",
"devDependencies": {
- "mocha": "0.14.0",
- "expect.js": "0.1.2",
- "debug": "0.5.0",
- "async": "0.1.18",
- "uglify-js": "1.2.5"
+ "mocha": "1.7.4",
+ "expect.js": "0.2.0",
+ "debug": "0.7.0",
+ "async": "0.1.22",
+ "uglify-js": "2.2.2"
},
"keywords": [
Oops, something went wrong.

0 comments on commit 7410d02

Please sign in to comment.