-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BugProof into parser, Add TEstCoverage
- Loading branch information
Showing
6 changed files
with
99 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules/ | ||
npm-debug.log | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- 'iojs' | ||
- '0.10' | ||
- '0.12' | ||
before_script: | ||
- npm install -g istanbul | ||
- npm install -g mocha | ||
- npm install -g codeclimate-test-reporter | ||
after_success: | ||
- NODE_ENV=test LOG_LV=info istanbul cover _mocha -- -R spec test/node.js --timeout 20000 | ||
- codeclimate < ./coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,44 @@ | ||
'use strict'; | ||
|
||
var Server = require('./server') | ||
, Owner = require('./owner') | ||
, Players = require('./players') | ||
, Map = require('./map') | ||
, Rates = require('./rates'); | ||
var Server = require('./server'), | ||
Owner = require('./owner'), | ||
Players = require('./players'), | ||
Map = require('./map'), | ||
Rates = require('./rates'); | ||
|
||
function ServerInfo(obj) { | ||
obj = obj.tsqp; | ||
|
||
this.server = new Server(obj.serverinfo[0].$); | ||
this.owner = new Owner(obj.owner[0].$); | ||
this.players = new Players(obj.players[0].$); | ||
this.monsters = parseInt(obj.monsters[0].$.total); | ||
this.map = new Map(obj.map[0].$); | ||
this.rates = new Rates(obj.rates[0].$); | ||
this.motd = obj.motd[0]; | ||
var keys = Object.keys(obj); | ||
|
||
if (keys.indexOf('serverinfo') !== -1) { | ||
this.server = new Server(obj.serverinfo[0].$); | ||
} | ||
|
||
if (keys.indexOf('owner') !== -1) { | ||
this.owner = new Owner(obj.owner[0].$); | ||
} | ||
|
||
if (keys.indexOf('players') !== -1) { | ||
this.players = new Players(obj.players[0].$); | ||
} | ||
|
||
if (keys.indexOf('monsters') !== -1) { | ||
this.monsters = parseInt(obj.monsters[0].$.total); | ||
} | ||
|
||
if (keys.indexOf('map') !== -1) { | ||
this.map = new Map(obj.map[0].$); | ||
} | ||
|
||
if (keys.indexOf('rates') !== -1) { | ||
this.rates = new Rates(obj.rates[0].$); | ||
} | ||
|
||
if (keys.indexOf('motd') !== -1) { | ||
this.motd = obj.motd[0]; | ||
} | ||
|
||
} | ||
|
||
module.exports = ServerInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters