Permalink
Browse files

Merge pull request #41 from goodybag/master

Added Jam Install
  • Loading branch information...
2 parents f12e150 + 4c9f2f6 commit 5cdf75a22c13cb3348e5a33edab0e77fa15d7def @Baggz committed Dec 26, 2012
Showing with 15 additions and 7 deletions.
  1. +9 −2 README.md
  2. +6 −5 src/engines/json/errorMessages.js
View
11 README.md
@@ -1,7 +1,7 @@
<a name="amanda"></a>
# Amanda
-[Amanda](https://github.com/Baggz/Amanda) is aiming to be **an 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 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
@@ -82,6 +82,12 @@ To install **Amanda**, use [NPM](http://npmjs.org/).
$ npm install amanda
```
+Or use use [JAM](http://groundcomputing.co.uk/code/jam).
+
+```
+$ jam install amanda
+```
+
Releases for a browser are available for download from GitHub.
| **Version** | **Description** | **Size** | **Action** |
@@ -205,4 +211,5 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
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.
+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
11 src/engines/json/errorMessages.js
@@ -2,7 +2,8 @@
* Messages
* --------------------
*/
-var errorMessages = {
+var vowels = "aeiou",
+errorMessages = {
/**
* Maximum
@@ -38,7 +39,7 @@ var errorMessages = {
*/
maxLength: function(property, propertyValue, attributeValue) {
return [
- 'The ' + property + ' property must not exceed ' + attributeValue + ' characters.',
+ 'The ' + property + ' property must not exceed ' + attributeValue + ' character' + (attributeValue > 1 ? 's' : '') + '.',
'The length of the property is ' + propertyValue.length + '.'
].join(' ');
},
@@ -52,7 +53,7 @@ var errorMessages = {
*/
length: function(property, propertyValue, attributeValue) {
return [
- 'The ' + property + ' property must be exactly ' + attributeValue + ' characters.',
+ 'The ' + property + ' property must be exactly ' + attributeValue + ' character' + (attributeValue > 1 ? 's' : '') + '.',
'The length of the property is ' + propertyValue.length + '.'
].join(' ');
},
@@ -80,7 +81,7 @@ var errorMessages = {
*/
type: function(property, propertyValue, attributeValue) {
return [
- 'The ‘' + property + '’ property must be a/an' + attributeValue + '’.',
+ 'The ‘' + property + '’ property must be ' + (vowels.indexOf(attributeValue[0]) > -1 ? 'an' : 'a') + '' + attributeValue + '’.',
'The type of the property is ‘' + detectType(propertyValue) + ''
].join(' ');
},
@@ -142,7 +143,7 @@ var errorMessages = {
* @param {any} propertyValue
* @param {string} attributeValue
*/
- maxItems: function(property, propertyValue, attributeValue) {
+ maxItems: function(property, propertyValue, attributeValue) {
return [
'The ‘' + property + '’ property must not contain more than ‘' + attributeValue + '’ items.',
'Currently it contains ‘' + propertyValue.items + '’ items.'

0 comments on commit 5cdf75a

Please sign in to comment.