Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiel committed Apr 18, 2015
2 parents e6d45fb + f4cfa41 commit 08b3cac
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .jsdoc.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"copyright" : " ",
"navType" : "vertical",
"theme" : "cerulean",
"linenums" : "true"
"linenums" : "true",
"analytics" : {"ua":"UA-42285704-1", "domain":"auto"}
}
}
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Router.js
=========

[![Build Status](https://travis-ci.org/ramiel/router.js.svg?branch=master)](https://travis-ci.org/ramiel/router.js)
[![devDependency Status](https://david-dm.org/ramiel/router.js/dev-status.svg)](https://david-dm.org/ramiel/router.js#info=devDependencies)

Discover on [Ramiel's creations](http://ramielcreations.com/projects/router-js/ "Ramiel's creations page") or fork me on [github](https://ramiel.github.com/router.js/)

Expand All @@ -12,7 +13,7 @@ Router.js helps you to intercept request done trough fragment and match them usi

If you have code for version prior of 1.0.0 you should remember that something has changed.
To be sure that another matching route exists, you have to check `req.hasNext` and not controlling that `next` is a function, as previous indicated.
Here an exemple of migration
Here an example of migration

```javascript
router.get('#/home',function(erq, next){
Expand All @@ -32,23 +33,54 @@ router.get('#/home',function(erq, next){

Include Router.js in your application

### Installation

#### Download

Simply download a release from github <https://github.com/ramiel/router.js/releases>.

#### Bower

`bower install router.js`

#### npm

This library is available on npm to be used with tool like `browserify`

`npm install router.js`

#### Git

Clone this repository

`https://github.com/ramiel/router.js.git`


### Include the library

#### Standard

```html
<script type="text/javascript" src="js/router.js">
```
####RequireJS
#### RequireJS
```javascript
//Example
require(["router", ...], function(Router, ...) {
var router = new Router();
//...
});
```
according to your directory template.
#### CommonJS
according to your directory template.
```javascript
var Router = require('router.js');
```
### Usage
Now just define a simple route. A route is made of two components
Expand All @@ -64,7 +96,7 @@ var router = new Router()
});
```
There are three noticeble aspects. Your router object and all its functions are chainable. So after an `addRoute` you can chain onther one and so on.
There are three noticeable aspects. Your router object and all its functions are chainable. So after an `addRoute` you can chain onther one and so on.
The matching string is `#/users`, so if your fragment match this pattern your callback will be fired.
Callback is populated with two arguments:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "router.js",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "https://github.com/ramiel/router.js",
"authors": [
"Fabrizio Ruggeri <fabrizio.ruggeri@gmail.com>"
Expand Down
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "router.js",
"basename": "router",
"version": "1.0.1",
"version": "1.0.2",
"description": "Lightweight and powerful router for javascript applications",
"author": "Fabrizio Ruggeri <fabrizio.ruggeri@gmail.com>",
"website": "http://ramielcreations.com/projects/router-js/",
Expand All @@ -11,28 +11,29 @@
},
"dependencies": {},
"devDependencies": {
"chai": "^1.9.1",
"grunt": "^0.4.4",
"chai": "^2.2.0",
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.4.0",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-jsdoc": "^0.6.1",
"grunt-karma": "^0.8.2",
"grunt-newer": "^0.7.0",
"karma": "^0.12.0",
"grunt-jsdoc": "^0.5.8",
"grunt-karma": "^0.10.1",
"grunt-newer": "^1.1.0",
"karma": "^0.12.31",
"karma-chai": "^0.1.0",
"karma-chai-plugins": "^0.2.0",
"karma-chrome-launcher": "^0.1.2",
"karma-firefox-launcher": "^0.1.3",
"karma-mocha": "^0.1.3",
"karma-mocha-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^0.1.2",
"karma-requirejs": "^0.2.1",
"mocha": "^1.18.2",
"requirejs": "^2.1.11"
"karma-chai-plugins": "^0.5.0",
"karma-chrome-launcher": "^0.1.8",
"karma-firefox-launcher": "^0.1.4",
"karma-mocha": "^0.1.10",
"karma-mocha-reporter": "^1.0.2",
"karma-phantomjs-launcher": "^0.1.4",
"karma-requirejs": "^0.2.2",
"mocha": "^2.2.4",
"requirejs": "^2.1.17"
},
"scripts": {
"main": "dist/router.min.js",
"test": "./node_modules/karma/bin/karma start"
},
"license": "GPL2",
Expand Down

0 comments on commit 08b3cac

Please sign in to comment.