diff --git a/.travis.yml b/.travis.yml index bd6014e87..35ef1040f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,4 @@ node_js: after_script: - codeclimate-test-reporter < coverage/lcov.info - coveralls < coverage/lcov.info + - scripts/travis-gh-pages diff --git a/COERCION.md b/COERCION.md index 12f645a9f..2183b0778 100644 --- a/COERCION.md +++ b/COERCION.md @@ -17,8 +17,8 @@ Possible type coercions: |---|:-:|:-:|:-:|:-:| |string |-|`x`→`""+x`|`false`→`"false"`
`true`→`"true"`|`null`→`""`| |number /
integer|Valid number /
integer: `x`→`+x`
|-|`false`→`0`
`true`→`1`|`null`→`0`| -|boolean |`"false"`→`false`
`"true"`→`true`
`"abc"`↛
`""`↛|`0`→`false`
`1`→`true`
`x`↛|-|`null`→`false`| -|null |`""`→`null`
`"null"`↛
`"abc"`↛|`0`→`null`
`x`↛|`false`→`null`
`true`↛|-| +|boolean |`"false"`→`false`
`"true"`→`true`
`"abc"`⇸
`""`⇸|`0`→`false`
`1`→`true`
`x`⇸|-|`null`→`false`| +|null |`""`→`null`
`"null"`⇸
`"abc"`⇸|`0`→`null`
`x`⇸|`false`→`null`
`true`⇸|-| ## Coersion from string values diff --git a/README.md b/README.md index 76602793d..3253e9b2a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ajv - Another JSON Schema Validator +# Ajv: Another JSON Schema Validator Currently the fastest JSON Schema validator for node.js and browser. diff --git a/scripts/travis-gh-pages b/scripts/travis-gh-pages new file mode 100755 index 000000000..2da88aa96 --- /dev/null +++ b/scripts/travis-gh-pages @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$' && { + rm -rf ../gh-pages + git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv.git ../gh-pages + cp *.md ../gh-pages/_source + cp LICENSE ../gh-pages/_source + cd ../gh-pages + ./generate + git add . + git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push origin gh-pages + } +fi