From 03a2a0e02006d7fedc0d5619bcbdc6c37551ad51 Mon Sep 17 00:00:00 2001 From: Jake Luer Date: Sun, 2 Dec 2012 19:02:20 -0500 Subject: [PATCH] "Initial commit" --- .gitignore | 19 ++++++++++++ .npmignore | 11 +++++++ .travis.yml | 6 ++++ History.md | 0 Makefile | 64 +++++++++++++++++++++++++++++++++++++++++ README.md | 41 ++++++++++++++++++++++++++ component.json | 15 ++++++++++ index.js | 3 ++ lib/qs.js | 2 ++ package.json | 28 ++++++++++++++++++ test/bootstrap/index.js | 35 ++++++++++++++++++++++ test/browser/index.html | 27 +++++++++++++++++ 12 files changed, 251 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 .travis.yml create mode 100644 History.md create mode 100644 Makefile create mode 100644 README.md create mode 100644 component.json create mode 100644 index.js create mode 100644 lib/qs.js create mode 100644 package.json create mode 100644 test/bootstrap/index.js create mode 100644 test/browser/index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8972bd0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results +build +components + +node_modules +npm-debug.log + +coverage.html diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..f105953 --- /dev/null +++ b/.npmignore @@ -0,0 +1,11 @@ +docs/ +test/ +build/ +components/ +support/ +coverage.html +component.json +lib-cov +.travis.yml +Makefile +*.swp diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fe1e598 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - 0.8 +branches: + only: + - master diff --git a/History.md b/History.md new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c32d1ba --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ + +TESTS = test/*.js +REPORTER = spec + +# +# Tests +# + +test: test-node test-browser + +test-node: + @printf "\n ==> [Node.js]" + @NODE_ENV=test ./node_modules/.bin/mocha \ + --require ./test/bootstrap \ + --reporter $(REPORTER) \ + $(TESTS) + +test-browser: build + @printf "\n ==> [Phantom.Js]" + @./node_modules/.bin/mocha-phantomjs \ + --R ${REPORTER} \ + ./test/browser/index.html + +test-cov: lib-cov + @qs_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \ + --require ./test/bootstrap \ + --reporter html-cov \ + $(TESTS) \ + > coverage.html + +# +# Components +# + +build: components lib/* + @./node_modules/.bin/component-build --dev + +components: component.json + @./node_modules/.bin/component-install --dev + +# +# Coverage +# + +lib-cov: + @rm -rf lib-cov + @jscoverage lib lib-cov + +# +# Clean up +# + +clean: clean-components clean-cov + +clean-components: + @rm -rf build + @rm -rf components + +clean-cov: + @rm -rf lib-cov + @rm -f coverage.html + + +.PHONY: clean clean-components clean-cov test test-cov test-node test-browser lib-cov diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc1b844 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# hyperion-qs + +> Querystrin encode/decode for node.js and the browser. + +## Installation + +### Node.js + +`hyperion-qs` is available on [npm](http://npmjs.org). + + $ npm install hyperion-qs + +### Component + +`hyperion-qs` is available as a [component](https://github.com/component/component). + + $ component install qualiancy/hyperion-qs + +## License + +(The MIT License) + +Copyright (c) 2012 Jake Luer (http://qualiancy.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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +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. diff --git a/component.json b/component.json new file mode 100644 index 0000000..3c082a8 --- /dev/null +++ b/component.json @@ -0,0 +1,15 @@ +{ + "name": "hyperion-qs" + , "repo": "qualiancy/hyperion-qs" + , "version": "0.0.0" + , "description": "Querystrin encode/decode for node.js and the browser." + , "license": "MIT" + , "keywords": [ + ] + , "main": "lib/qs.js" + , "scripts": [ + "lib/qs.js" + ] + , "dependencies": {} + , "development": {} +} diff --git a/index.js b/index.js new file mode 100644 index 0000000..d2d10d6 --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +module.exports = process.env.qs_COV + ? require('./lib-cov/qs') + : require('./lib/qs'); diff --git a/lib/qs.js b/lib/qs.js new file mode 100644 index 0000000..4d33b58 --- /dev/null +++ b/lib/qs.js @@ -0,0 +1,2 @@ + +exports.version = '0.0.0'; diff --git a/package.json b/package.json new file mode 100644 index 0000000..eefe9b4 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "hyperion-qs" + , "version": "0.0.0" + , "description": "Querystrin encode/decode for node.js and the browser." + , "author": "Jake Luer (http://qualiancy.com)" + , "license": "MIT" + , "keywords": [ + ] + , "repository": { + "type": "git" + , "url": "git@github.com:qualiancy/hyperion-qs.git" + } + , "engines": { + "node": "*" + } + , "main": "./index" + , "scripts": { + "test": "make test" + } + , "dependencies": { + } + , "devDependencies": { + "chai": "*" + , "component": "*" + , "mocha": "*" + , "mocha-phantomjs": "*" + } +} diff --git a/test/bootstrap/index.js b/test/bootstrap/index.js new file mode 100644 index 0000000..0a3ef0b --- /dev/null +++ b/test/bootstrap/index.js @@ -0,0 +1,35 @@ +/*! + * Attach chai to global should + */ + +global.chai = require('chai'); +global.should = global.chai.should(); + +/*! + * Chai Plugins + */ + +//global.chai.use(require('chai-spies')); +//global.chai.use(require('chai-http')); + +/*! + * Import project + */ + +global.qs = require('../..'); + +/*! + * Helper to load internals for cov unit tests + */ + +function req (name) { + return process.env.qs_COV + ? require('../../lib-cov/qs/' + name) + : require('../../lib/qs/' + name); +} + +/*! + * Load unexposed modules for unit tests + */ + +global.__qs = {}; diff --git a/test/browser/index.html b/test/browser/index.html new file mode 100644 index 0000000..4a51774 --- /dev/null +++ b/test/browser/index.html @@ -0,0 +1,27 @@ + + + + Browser Tests (hyperion-qs) + + + + + + + + + + + +
+ +