Skip to content

Commit

Permalink
"Initial commit"
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalparadox committed Dec 3, 2012
0 parents commit 03a2a0e
Show file tree
Hide file tree
Showing 12 changed files with 251 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .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
11 changes: 11 additions & 0 deletions .npmignore
@@ -0,0 +1,11 @@
docs/
test/
build/
components/
support/
coverage.html
component.json
lib-cov
.travis.yml
Makefile
*.swp
6 changes: 6 additions & 0 deletions .travis.yml
@@ -0,0 +1,6 @@
language: node_js
node_js:
- 0.8
branches:
only:
- master
Empty file added History.md
Empty file.
64 changes: 64 additions & 0 deletions 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
41 changes: 41 additions & 0 deletions 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 <jake@qualiancy.com> (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.
15 changes: 15 additions & 0 deletions 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": {}
}
3 changes: 3 additions & 0 deletions index.js
@@ -0,0 +1,3 @@
module.exports = process.env.qs_COV
? require('./lib-cov/qs')
: require('./lib/qs');
2 changes: 2 additions & 0 deletions lib/qs.js
@@ -0,0 +1,2 @@

exports.version = '0.0.0';
28 changes: 28 additions & 0 deletions 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 <jake@qualiancy.com> (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": "*"
}
}
35 changes: 35 additions & 0 deletions 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 = {};
27 changes: 27 additions & 0 deletions test/browser/index.html
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>Browser Tests (hyperion-qs)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
<script src="../../node_modules/mocha/mocha.js"></script>
<script src="../../node_modules/chai/chai.js"></script>
<script>
mocha.setup('bdd')
var should = chai.should();
</script>
<script src="../../build/build.js"></script>
<script>
qs = require('hyperion-qs');
</script>
<!-- <script src="../test.js"></script> -->
<script>onload = function () {
if (window.mochaPhantomJS) mochaPhantomJS.run()
else mocha.run();
}
</script>
</head>
<body>
<div id="mocha"></div>
</body>
</html>

0 comments on commit 03a2a0e

Please sign in to comment.