Skip to content

Commit

Permalink
[UPDATE] dotfiles, Makefile, README
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed May 25, 2015
1 parent de9265b commit bc41ec7
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 82 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
14 changes: 14 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Directories #
###############
build/
reports/
dist/

# Node.js #
###########
/node_modules/

# Git #
#######
.git*
71 changes: 71 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"bitwise": false,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": true,
"freeze": true,
"immed": true,
"indent": 4,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": false,
"nonbsp": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true,
"maxparams": 10,
"maxdepth": 5,
"maxstatements": 100,
"maxcomplexity": false,
"maxlen": 1000,
"asi": false,
"boss": false,
"debug": false,
"eqnull": false,
"esnext": false,
"evil": false,
"expr": false,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"maxerr": 1000,
"moz": false,
"multistr": false,
"notypeof": false,
"proto": false,
"scripturl": false,
"shadow": false,
"sub": true,
"supernew": false,
"validthis": false,
"noyield": false,
"browser": true,
"browserify": true,
"couch": false,
"devel": true,
"dojo": false,
"jasmine": false,
"jquery": false,
"mocha": true,
"mootools": false,
"node": true,
"nonstandard": false,
"prototypejs": false,
"qunit": false,
"rhino": false,
"shelljs": false,
"worker": false,
"wsh": false,
"yui": false,
"globals": {}
}
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ examples/
reports/
support/
test/
benchmark/

# Node.js #
###########
Expand Down Expand Up @@ -46,4 +47,6 @@ Desktop.ini
# Utilities #
#############
.jshintrc
.travis.yml
.jshintignore
.travis.yml
.editorconfig
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
language: node_js
node_js:
- "0.10"
- '0.12'
- '0.11'
- '0.10'
- '0.8'
- 'iojs'
before_install:
- npm update -g npm
after_script:
- npm run coveralls
- npm run coveralls

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

Copyright (c) 2014 Athan Reines.
Copyright (c) 2014-2015 The Compute.io Authors. All rights reserved.

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 @@ -18,4 +18,4 @@ 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.
SOFTWARE.
34 changes: 27 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,42 @@
# Set the node.js environment to test:
NODE_ENV ?= test

# Kernel name:
KERNEL ?= $(shell uname -s)

ifeq ($(KERNEL), Darwin)
OPEN ?= open
else
OPEN ?= xdg-open
endif

# NOTES #

NOTES ?= 'TODO|FIXME'
NOTES ?= 'TODO|FIXME|WARNING|HACK|NOTE'


# MOCHA #

# Specify the test framework bin locations:
MOCHA ?= ./node_modules/.bin/mocha
_MOCHA ?= ./node_modules/.bin/_mocha

# Specify the mocha reporter:
MOCHA_REPORTER ?= spec


# ISTANBUL #

# Istanbul configuration:
ISTANBUL ?= ./node_modules/.bin/istanbul
ISTANBUL_OUT ?= ./reports/coverage
ISTANBUL_REPORT ?= lcov
ISTANBUL_LCOV_INFO_PATH ?= $(ISTANBUL_OUT)/lcov.info
ISTANBUL_HTML_REPORT_PATH ?= $(ISTANBUL_OUT)/lcov-report/index.html


# JSHINT #

JSHINT ?= ./node_modules/.bin/jshint
JSHINT_REPORTER ?= ./node_modules/jshint-stylish/stylish.js



# FILES #

Expand Down Expand Up @@ -96,9 +106,20 @@ test-istanbul-mocha: node_modules
view-cov: view-istanbul-report

view-istanbul-report:
open $(ISTANBUL_HTML_REPORT_PATH)
$(OPEN) $(ISTANBUL_HTML_REPORT_PATH)


# LINT #

.PHONY: lint lint-jshint

lint: lint-jshint

lint-jshint: node_modules
$(JSHINT) \
--reporter $(JSHINT_REPORTER) \
./


# NODE #

Expand All @@ -117,7 +138,6 @@ clean-node:


# CLEAN #

.PHONY: clean

clean:
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ For use in the browser, use [browserify](https://github.com/substack/node-browse

## Usage

To use the module,

``` javascript
var incrmax = require( 'compute-incrmax' );
Expand Down Expand Up @@ -104,15 +103,15 @@ $ make view-cov
```


---
## License

[MIT license](http://opensource.org/licenses/MIT).
[MIT license](http://opensource.org/licenses/MIT).


---
## Copyright

Copyright © 2014. Athan Reines.
Copyright © 2014-2015. The Compute.io Authors.


[npm-image]: http://img.shields.io/npm/v/compute-incrmax.svg
Expand All @@ -131,4 +130,4 @@ Copyright © 2014. Athan Reines.
[dev-dependencies-url]: https://david-dm.org/dev/compute-io/incrmax

[github-issues-image]: http://img.shields.io/github/issues/compute-io/incrmax.svg
[github-issues-url]: https://github.com/compute-io/incrmax/issues
[github-issues-url]: https://github.com/compute-io/incrmax/issues
2 changes: 2 additions & 0 deletions examples/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var incrmax = require( './../lib' );

// Initialize a method to calculate the maximum value incrementally:
Expand Down
79 changes: 24 additions & 55 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,34 @@
'use strict';

// INCREMENTAL MAX //

/**
* FUNCTION: incrmax()
* Returns a method to compute the maximum value incrementally.
*
* COMPUTE: incrmax
*
*
* DESCRIPTION:
* - Provides a method to compute a maximum value incrementally.
*
*
* NOTES:
* [1]
*
*
* TODO:
* [1]
*
*
* LICENSE:
* MIT
*
* Copyright (c) 2014. Athan Reines.
*
*
* AUTHOR:
* Athan Reines. kgryte@gmail.com. 2014.
*
* @returns {Function} method to compute the max incrementally
*/

(function() {
'use strict';

// INCREMENTAL MAX //

function incrmax() {
var max = null;
/**
* FUNCTION: incrmax()
* Returns a method to compute the maximum value incrementally.
* FUNCTION: incrmax( [value] )
* If a `value` is provided, updates and returns the updated max. If no `value` is provided, returns the current max.
*
* @returns {Function} method to compute the max incrementally
* @param {Number} [value] - value used to update the max
* @returns {Number} max value
*/
function incrmax() {
var max = null;
/**
* FUNCTION: incrmax( [value] )
* If a `value` is provided, updates and returns the updated max. If no `value` is provided, returns the current max.
*
* @param {Number} [value] - value used to update the max
* @returns {Number} max value
*/
return function incrmax( x ) {
if ( !arguments.length ) {
return max;
}
if ( x > max || max === null ) {
max = x;
}
return function incrmax( x ) {
if ( !arguments.length ) {
return max;
};
} // end FUNCTION incrmax()

}
if ( x > max || max === null ) {
max = x;
}
return max;
};
} // end FUNCTION incrmax()

// EXPORTS //

module.exports = incrmax;
// EXPORTS //

})();
module.exports = incrmax;
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
{
"name": "Athan Reines",
"email": "kgryte@gmail.com"
},
{
"name": "Philipp Burckhardt",
"email": "pburckhardt@outlook.com"
}
],
"scripts": {
Expand Down Expand Up @@ -39,15 +43,10 @@
},
"dependencies": {},
"devDependencies": {
"chai": "1.x.x",
"mocha": "1.x.x",
"chai": "2.x.x",
"mocha": "2.x.x",
"coveralls": "^2.11.1",
"istanbul": "^0.3.0"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/MIT"
}
]
"licenses":"MIT"
}
Loading

0 comments on commit bc41ec7

Please sign in to comment.