Skip to content

Commit

Permalink
primer control
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilio authored and Emilio committed May 13, 2016
1 parent 9e993f0 commit 27fccc9
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ node_modules

# Optional REPL history
.node_repl_history

# Local configs
local-*
*-local.*
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js:
- "0.12.7"
- "4"
- "6"
matrix:
fast_finish: true
allow_failures:
- node_js: "6"
script: "npm run-script test-ci"
after_script: "npm install coveralls@2.11.8 && cat ./coverage/lcov.info | coveralls"
38 changes: 38 additions & 0 deletions LEEME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--multilang v0 es:LEEME.md en:README.md -->
# discrepances
show discrepances in several flavors

<!--lang:es-->
# Instalación
<!--lang:en--]
# Install
[!--lang:*-->
```sh
$ npm install discrepances
```

<!-- cucardas -->
![designing](https://img.shields.io/badge/stability-designing-red.svg)
[![npm-version](https://img.shields.io/npm/v/discrepances.svg)](https://npmjs.org/package/discrepances)
[![downloads](https://img.shields.io/npm/dm/discrepances.svg)](https://npmjs.org/package/discrepances)
[![build](https://img.shields.io/travis/codenautas/discrepances/master.svg)](https://travis-ci.org/codenautas/discrepances)
[![coverage](https://img.shields.io/coveralls/codenautas/discrepances/master.svg)](https://coveralls.io/r/codenautas/discrepances)
[![climate](https://img.shields.io/codeclimate/github/codenautas/discrepances.svg)](https://codeclimate.com/github/codenautas/discrepances)
[![dependencies](https://img.shields.io/david/codenautas/discrepances.svg)](https://david-dm.org/codenautas/discrepances)
[![qa-control](http://codenautas.com/github/codenautas/discrepances.svg)](http://codenautas.com/github/codenautas/discrepances)


<!--multilang buttons-->

idioma: ![castellano](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)
también disponible en:
[![inglés](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)](README.md)

<!--lang:es-->
## Licencia
<!--lang:en--]
## License
[!--lang:*-->

[MIT](LICENSE)

3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Codenautas
Copyright (c) 2016 Codenautas <codenautas@googlegroups.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
Expand All @@ -19,3 +19,4 @@ 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.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# discrepances
show discrepances in several flavors

# Install
```sh
$ npm install discrepances
```

![designing](https://img.shields.io/badge/stability-designing-red.svg)
[![npm-version](https://img.shields.io/npm/v/discrepances.svg)](https://npmjs.org/package/discrepances)
[![downloads](https://img.shields.io/npm/dm/discrepances.svg)](https://npmjs.org/package/discrepances)
[![build](https://img.shields.io/travis/codenautas/discrepances/master.svg)](https://travis-ci.org/codenautas/discrepances)
[![coverage](https://img.shields.io/coveralls/codenautas/discrepances/master.svg)](https://coveralls.io/r/codenautas/discrepances)
[![climate](https://img.shields.io/codeclimate/github/codenautas/discrepances.svg)](https://codeclimate.com/github/codenautas/discrepances)
[![dependencies](https://img.shields.io/david/codenautas/discrepances.svg)](https://david-dm.org/codenautas/discrepances)
[![qa-control](http://codenautas.com/github/codenautas/discrepances.svg)](http://codenautas.com/github/codenautas/discrepances)



language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)
also available in:
[![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](LEEME.md)

## License

[MIT](LICENSE)

16 changes: 16 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
environment:
matrix:
- nodejs_version: "0.12.7"
- nodejs_version: "4"
- nodejs_version: "6"
matrix:
fast_finish: true
install:
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)
- npm install
build: off
test_script:
- node --version
- npm --version
- npm run test-ci
version: "{build}"
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";
/*jshint eqnull:true */
/*jshint globalstrict:true */
/*jshint node:true */
/*eslint-disable no-console */

var Discrepances = {};

module.exports = Discrepances;
39 changes: 39 additions & 0 deletions lib/discrepances.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";
/*jshint eqnull:true */
/*jshint node:true */

(function codenautasModuleDefinition(root, name, factory) {
/* global define */
/* istanbul ignore next */
if(typeof root.globalModuleName !== 'string'){
root.globalModuleName = name;
}
/* istanbul ignore next */
if(typeof exports === 'object' && typeof module === 'object'){
module.exports = factory();
}else if(typeof define === 'function' && define.amd){
define(factory);
}else if(typeof exports === 'object'){
exports[root.globalModuleName] = factory();
}else{
root[root.globalModuleName] = factory();
}
root.globalModuleName = null;
})(/*jshint -W040 */this, 'discrepances', function() {
/*jshint +W040 */

/*jshint -W004 */
var discrepances = {};
/*jshint +W004 */

discrepances = function discrepances(obj, def){
var rta='';
if(def.typeof && typeof obj !== def.typeof){
rta+='typeof '+JSON.stringify(obj)+' !== '+JSON.stringify(def.typeof);
}
return rta || null;
}

return discrepances;

});
62 changes: 62 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "discrepances",
"description": "show discrepances in several flavors",
"version": "0.0.1",
"author": "Codenautas <codenautas@googlegroups.com>",
"repository": "codenautas/discrepances",
"license": "MIT",
"contributors": [
{
"name": "Emilio Platzer",
"email": "emilioplatzer@gmail.com"
}
],
"main": "lib/discrepances.js",
"files": ["lib"],
"dependencies": {
"fs-extra": "~0.30.0",
"fs-promise": "~0.5.0",

"best-promise": "~0.2.4"
},
"devDependencies": {
"expect.js": "~0.3.1",
"istanbul": "~0.4.3",
"mocha": "~2.4.5",

"best-globals": "~0.2.4",
"self-explain": "~0.0.6"
},
"engines": {
"node": ">= 0.12"
},
"scripts": {
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
"start": "node example/server.js"
},
"jshintConfig": {
"asi": false,
"forin": true,
"curly": true

},
"eslintConfig": {
"env": {
"node": false
},
"rules": {
"strict": 0,
"no-console": 1,
"no-unused-vars": 1
}
},
"qa-control": {
"package-version": "0.2.0",
"coverage": 90,
"run-in": "both",
"stability": "extending",
"type": "lib"
}
}
17 changes: 17 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

var assert = require('self-explain').assert;
var expect = require('expect.js');
var discrepances = require('../lib/discrepances.js');

describe("discrepances", function(){
[
{obj:4 , structure:{typeof: "number"}, expect: null},
{obj:"4", structure:{typeof: "number"}, expect: 'typeof "4" !== "number"'}
].forEach(function(fixture){
it("controls discrepances via fixture: "+JSON.stringify(fixture), function(){
eval(assert(discrepances(fixture.obj, fixture.structure) === fixture.expect));
expect(discrepances(fixture.obj, fixture.structure)).to.eql(fixture.expect);
});
});
});

0 comments on commit 27fccc9

Please sign in to comment.