File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
if [[ " $TRAVIS_OS_NAME " == " linux" ]]; then
4
4
sudo apt-get update -qq
5
- sudo apt-get install -qq cvs git mercurial cssc bzr subversion monotone rcs rcs-blame python3 python3-pip pep8;
5
+ sudo apt-get install -qq cvs git mercurial cssc bzr subversion monotone rcs rcs-blame python3 python3-pip pep8 nodejs ;
6
6
sudo ./dev/install-bitkeeper.sh
7
7
sudo pip3 install --upgrade pip
8
8
sudo pip3 install flake8
9
9
elif [[ " $TRAVIS_OS_NAME " == " osx" ]]; then
10
10
brew update
11
- brew install ctags cvs
11
+ brew install ctags cvs node
12
12
brew upgrade python
13
13
pip3 install pep8 flake8
14
14
fi
15
15
16
16
sudo ./dev/install-universal_ctags.sh
17
+
18
+ # for API blueprint verification
19
+ npm install drafter
Original file line number Diff line number Diff line change
1
+ var drafter = require ( 'drafter' ) ;
2
+ var fs = require ( 'fs' ) ;
3
+
4
+ new Promise ( function ( resolve , reject ) {
5
+ fs . readFile ( 'apiary.apib' , 'utf8' , ( error , data ) => {
6
+ if ( error ) {
7
+ console . error ( error ) ;
8
+ reject ( 1 ) ;
9
+ }
10
+
11
+ resolve ( data ) ;
12
+ } ) ;
13
+ } )
14
+ . then ( function ( data ) {
15
+ return new Promise ( ( resolve , reject ) => {
16
+ drafter . parse ( data , function ( error , result ) {
17
+ if ( error ) {
18
+ console . log ( error ) ;
19
+ resolve ( 1 ) ;
20
+ return ;
21
+ } else {
22
+ for ( x in result . content ) {
23
+ var d = result . content [ x ] ;
24
+ // console.log(d);
25
+ if ( d [ 'element' ] != 'category' ) {
26
+ console . log ( 'Error:\n' , d ) ;
27
+ resolve ( 1 ) ;
28
+ return ;
29
+ }
30
+ }
31
+ }
32
+
33
+ console . log ( "Blueprint check passed" ) ;
34
+ resolve ( 0 ) ;
35
+ } ) ;
36
+ } ) ;
37
+ } )
38
+ . then ( process . exit )
39
+ . catch ( process . exit ) ;
You can’t perform that action at this time.
0 commit comments