Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CONTRIBUTING.md #22

Merged
merged 2 commits into from
Jul 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"directory": "bower_components",
"json": "bower.json"
}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ node_modules/
npm-debug.log

# IntelliJ IDEA
.idea
.idea/
*.iml

coverage/Chrome*/*
coverage/Phantom*/*
coverage/Firefox*/*
coverage-*
coverage-*

bower_components/
86 changes: 86 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Contributing Guide

Contributing to `angular-cache` is fairly easy. This document shows you how to
get the project, run all provided tests and generate a production ready build.

It also covers provided grunt tasks, that help you developing on `angular-cache`.

## Dependencies

To make sure, that the following instructions work, please install the following dependecies
on you machine:

- Node.js
- npm
- Git

If you install node through the binary installation file, **npm** will be already there.
When **npm** is installed, use it to install the needed npm packages:

- bower `npm install -g bower`
- grunt-cli `npm install -g grunt-cli`
- karma `npm install -g karma`

## Installation

To get the source of `angular-cache` clone the git repository via:

````
$ git clone https://github.com/jmdobry/angular-cache
````

This will clone the complete source to your local machine. Navigate to the project folder
and install all needed dependencies via **npm** and **bower**:

````
$ npm install
$ bower install
````

`angular-cache` is now installed and ready to be built.

## Building

`angular-cache` comes with a few **grunt tasks** which help you to automate
the development process. The following grunt tasks are provided:

#### `grunt`

Running `grunt` without any parameters, will actually execute the registered
default task. This task is currently nothing more then a **lint task**, to make sure
that your JavaScript code is written well.

#### `grunt test`

`grunt test` executes the unit tests, which are located in `test/`. The task uses **karma** the spectacular test runner to execute the tests with the **jasmine testing framework**.

#### `grunt build`

You only have to use this task, if you want to generate a production ready build of
`angular-cache`. This task will also **lint**, **test** and **minify** the
source. After running this task, you'll find the following files in a generated
`dist` folder:

````
dist/angular-cache-x.x.x.js
dist/angular-cache-x.x.x.min.js
````

## Contributing/Submitting changes

- Checkout a new branch based on `develop` and name it to what you intend to do:
- Example:
````
$ git checkout -b BRANCH_NAME
````
- Use one branch per fix/feature
- Make your changes
- Make sure to provide a spec for unit tests
- Run your tests with either `karma start` or `grunt test`
- When all tests pass, everything's fine
- Commit your changes
- Please provide a git message which explains what you've done
- Commit to the forked repository
- Make a pull request
- Make sure you send the PR to the `develop` branch
- Travis CI is watching you!
3 changes: 3 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-jsdoc');

grunt.registerTask('build', ['clean', 'jshint', 'copy', 'uglify', 'karma:dev']);
grunt.registerTask('default', ['build']);
grunt.registerTask('build:all', ['build', 'jsdoc']);
grunt.registerTask('test', ['karma:dev']);

// Used by the CLI build servers
grunt.registerTask('drone', ['clean', 'jshint', 'copy', 'uglify', 'karma:drone']);
grunt.registerTask('travis', ['clean', 'jshint', 'copy', 'uglify', 'karma:travis']);
};
43 changes: 29 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular-cache (0.8.1 - Beta)
===============
angular-cache (0.8.2)
=====================
angular-cache is a caching system that improves upon the capabilities of the $cacheFactory provided by AngularJS. With angular-cache your caches can periodically clear themselves and flush items that have expired.

The goal of the project is to solve a general problem, not satisfy a specific scenario.
Expand Down Expand Up @@ -56,9 +56,9 @@ e.g. `$angularCacheFactory.get('someCache').setOptions({ capacity: 4500 })`
## Status
| Version | Branch | Build status | Test Coverage |
| ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| 0.8.1 | [master](https://github.com/jmdobry/angular-cache) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=master)](https://travis-ci.org/jmdobry/angular-cache) | [Test Coverage](http://jmdobry.github.io/angular-cache/coverage/) |
| 0.8.1 | [develop](https://github.com/jmdobry/angular-cache/tree/develop) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=develop)](https://travis-ci.org/jmdobry/angular-cache) | |
| 0.8.1 | [all](https://drone.io/github.com/jmdobry/angular-cache) | [![Build Status](https://drone.io/github.com/jmdobry/angular-cache/status.png)](https://drone.io/github.com/jmdobry/angular-cache/latest)
| 0.8.2 | [master](https://github.com/jmdobry/angular-cache) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=master)](https://travis-ci.org/jmdobry/angular-cache) | [Test Coverage](http://jmdobry.github.io/angular-cache/coverage/) |
| 0.8.2 | [develop](https://github.com/jmdobry/angular-cache/tree/develop) | [![Build Status](https://travis-ci.org/jmdobry/angular-cache.png?branch=develop)](https://travis-ci.org/jmdobry/angular-cache) | |
| 0.8.2 | [all](https://drone.io/github.com/jmdobry/angular-cache) | [![Build Status](https://drone.io/github.com/jmdobry/angular-cache/status.png)](https://drone.io/github.com/jmdobry/angular-cache/latest)

<a name='download'></a>
## Download
Expand All @@ -69,8 +69,8 @@ or
#### Latest Stable Version
| Type | From drone.io | From raw.github.com | Size |
| ------------- | ----------------- | ------------------- | ---- |
| Production | [angular-cache-0.8.1.min.js](https://drone.io/github.com/jmdobry/angular-cache/files/dist/angular-cache-0.8.1.min.js) | [angular-cache-0.8.1.min.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-0.8.1.min.js) | 3.3 KB |
| Development | [angular-cache-0.8.1.js](https://drone.io/github.com/jmdobry/angular-cache/files/dist/angular-cache-0.8.1.js) | [angular-cache-0.8.1.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-0.8.1.js) | 28.7 KB |
| Production | [angular-cache-0.8.2.min.js](https://drone.io/github.com/jmdobry/angular-cache/files/dist/angular-cache-0.8.2.min.js) | [angular-cache-0.8.2.min.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-0.8.2.min.js) | 3.3 KB |
| Development | [angular-cache-0.8.2.js](https://drone.io/github.com/jmdobry/angular-cache/files/dist/angular-cache-0.8.2.js) | [angular-cache-0.8.2.js](https://raw.github.com/jmdobry/angular-cache/master/dist/angular-cache-0.8.2.js) | 28.7 KB |

<a name='usage'></a>
## Usage
Expand Down Expand Up @@ -277,13 +277,28 @@ See [AngularCache#info](http://jmdobry.github.io/angular-cache/docs/Cache.html#i
3. Expect prompt feedback.

#### Submitting Pull Requests
1. Fork
2. For hotfixes branch from master, otherwise from develop. Prefix name of branch with issue label. E.g. `hotfix-missing-semicolon`, `feature-my-feature`, etc.
3. Make sure `grunt build` passes with zero warnings/errors.
4. Make sure your code follows the [style guidelines](https://github.com/rwldrn/idiomatic.js).
- This project uses 4-space indentation and single-quotes.
5. Make sure your pull request references/closes the proper issues.
6. For hotfixes submit request to be merged into master, otherwise into develop.

##### Basic Idea
- Checkout a new branch based on `develop` and name it to what you intend to do:
- Example:
````
$ git checkout -b BRANCH_NAME
````
- Use one branch per fix/feature
- Prefix your branch name with `feature-` or `fix-` appropriately.
- Make your changes
- Make sure to provide a spec for unit tests
- Run your tests with either `karma start` or `grunt test`
- Make sure the tests pass
- Commit your changes
- Please provide a git message which explains what you've done
- Commit to the forked repository
- Make a pull request
- Make sure you send the PR to the `develop` branch
- Travis CI is watching you!

##### More details
Read the detailed [Contributing Guide](https://github.com/jmdobry/angular-cache/blob/master/CONTRIBUTING.md)

<a name='license'></a>
## License
Expand Down
23 changes: 12 additions & 11 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"author": "Jason Dobry",
"name": "angular-cache",
"version": "0.8.1",
"main": [
"src/angular-cache.js"
],
"description": "angular-cache provides capabilities that improve upon the $cacheFactory provided by AngularJS.",
"version": "0.8.2",
"homepage": "http://jmdobry.github.io/angular-cache/",
"repository": {
"type": "git",
"url": "git://github.com/jmdobry/angular-cache.git"
},
"main": "./src/angular-cache.js",
"ignore": [
"dist/",
".idea/",
"*.iml",
"coverage/",
"demo/",
"node_modules/",
"src/",
"test/",
".gitignore",
".travis.yml",
"Gruntfile.js",
"package.json"
".travis.yml"
]
}
}
2 changes: 1 addition & 1 deletion coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h2>
</div>
</div>
<div class='footer'>
<div class='meta'>Generated by <a href='http://istanbul-js.org' target='_blank'>istanbul</a> at Tue Jul 09 2013 10:25:12 GMT-0600 (Mountain Daylight Time)</div>
<div class='meta'>Generated by <a href='http://istanbul-js.org' target='_blank'>istanbul</a> at Tue Jul 09 2013 21:29:58 GMT-0600 (Mountain Daylight Time)</div>
</div>
</body>

Expand Down
4 changes: 2 additions & 2 deletions coverage/src/angular-cache.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ <h2>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* @author Jason Dobry &lt;[email protected]&gt;
* @file angular-cache-&lt;%= pkg.version %&gt;.js
* @version &lt;%= pkg.version %&gt;
* @version &lt;%= pkg.version %&gt; - [Homepage]{@link http://jmdobry.github.io/angular-cache/}
* @copyright (c) 2013 Jason Dobry &lt;http://jmdobry.github.io/angular-cache&gt;
* @license MIT &lt;https://github.com/jmdobry/angular-cache/blob/master/LICENSE&gt;
*
Expand Down Expand Up @@ -2317,7 +2317,7 @@ <h2>

</div>
<div class='footer'>
<div class='meta'>Generated by <a href='http://istanbul-js.org' target='_blank'>istanbul</a> at Tue Jul 09 2013 10:25:12 GMT-0600 (Mountain Daylight Time)</div>
<div class='meta'>Generated by <a href='http://istanbul-js.org' target='_blank'>istanbul</a> at Tue Jul 09 2013 21:29:58 GMT-0600 (Mountain Daylight Time)</div>
</div>
</body>

Expand Down
2 changes: 1 addition & 1 deletion coverage/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h2>
</div>
</div>
<div class='footer'>
<div class='meta'>Generated by <a href='http://istanbul-js.org' target='_blank'>istanbul</a> at Tue Jul 09 2013 10:25:12 GMT-0600 (Mountain Daylight Time)</div>
<div class='meta'>Generated by <a href='http://istanbul-js.org' target='_blank'>istanbul</a> at Tue Jul 09 2013 21:29:58 GMT-0600 (Mountain Daylight Time)</div>
</div>
</body>

Expand Down
4 changes: 2 additions & 2 deletions dist/angular-cache-0.8.1.js → dist/angular-cache-0.8.2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @author Jason Dobry <[email protected]>
* @file angular-cache-0.8.1.js
* @version 0.8.1
* @file angular-cache-0.8.2.js
* @version 0.8.2 - [Homepage]{@link http://jmdobry.github.io/angular-cache/}
* @copyright (c) 2013 Jason Dobry <http://jmdobry.github.io/angular-cache>
* @license MIT <https://github.com/jmdobry/angular-cache/blob/master/LICENSE>
*
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/$AngularCacheFactoryProvider.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h4 class="name" id="$AngularCacheFactoryProvider"><span class="type-signature">

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 26
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 26
</li></ul></dd>


Expand Down Expand Up @@ -144,7 +144,7 @@ <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-a
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Jul 09 2013 10:25:16 GMT-0600 (MDT)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Jul 09 2013 21:30:01 GMT-0600 (MDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
22 changes: 11 additions & 11 deletions docs/AngularCache.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 73
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 73
</li></ul></dd>


Expand Down Expand Up @@ -286,7 +286,7 @@ <h4 class="name" id="destroy"><span class="type-signature">&lt;static> </span>de

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 497
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 497
</li></ul></dd>


Expand Down Expand Up @@ -408,7 +408,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 417
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 417
</li></ul></dd>


Expand Down Expand Up @@ -503,7 +503,7 @@ <h4 class="name" id="info"><span class="type-signature">&lt;static> </span>info<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 517
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 517
</li></ul></dd>


Expand Down Expand Up @@ -595,7 +595,7 @@ <h4 class="name" id="keys"><span class="type-signature">&lt;static> </span>keys<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 555
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 555
</li></ul></dd>


Expand Down Expand Up @@ -698,7 +698,7 @@ <h4 class="name" id="keySet"><span class="type-signature">&lt;static> </span>key

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 530
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 530
</li></ul></dd>


Expand Down Expand Up @@ -924,7 +924,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 350
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 350
</li></ul></dd>


Expand Down Expand Up @@ -1078,7 +1078,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 442
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 442
</li></ul></dd>


Expand Down Expand Up @@ -1152,7 +1152,7 @@ <h4 class="name" id="removeAll"><span class="type-signature">&lt;static> </span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 475
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 475
</li></ul></dd>


Expand Down Expand Up @@ -1299,7 +1299,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="angular-cache-0.8.1.js.html">angular-cache-0.8.1.js</a>, line 579
<a href="angular-cache-0.8.2.js.html">angular-cache-0.8.2.js</a>, line 579
</li></ul></dd>


Expand Down Expand Up @@ -1342,7 +1342,7 @@ <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-a
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Jul 09 2013 10:25:16 GMT-0600 (MDT)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Jul 09 2013 21:30:01 GMT-0600 (MDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading