Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/update-all
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien Ooms authored Jan 26, 2017
2 parents f93c0a4 + e4a9e44 commit 7c50048
Show file tree
Hide file tree
Showing 63 changed files with 890 additions and 469 deletions.
7 changes: 3 additions & 4 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
languages:
JavaScript: true
exclude_paths:
- "js/dist/*.js"
- "js/dist/**/*.js"
- "test/*.js"
- "test/**/*.js"
- "doc/**"
- "lib/**"
- "test/**"
33 changes: 6 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
jspm_packages

# Users Environment Variables
.lock-wscript
# Coverage directory used by nyc
coverage
.nyc_output

# groc
doc
# Documentation
gh-pages
7 changes: 0 additions & 7 deletions .groc.json

This file was deleted.

15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
language: node_js

node_js:
- "node"
- node

install:
- npm -d install
- npm install

script:
- npm test
- npm run cover

after_success:
- ./node_modules/.bin/coveralls < coverage/lcov.info || true
- ./node_modules/.bin/codeclimate < coverage/lcov.info || true
- bash <(curl -s https://codecov.io/bash) || true
- coveralls < coverage/lcov.info || true
- codeclimate-test-reporter < coverage/lcov.info || true
44 changes: 7 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,19 @@
[js-random](http://aureooms.github.io/js-random)
[@aureooms/js-random](https://aureooms.github.io/js-random)
==

Randomness code bricks for JavaScript.
<img src="https://cdn.rawgit.com/aureooms/js-random/master/media/sketch.png" width="864">

Randomness algorithms for JavaScript.
See [docs](https://aureooms.github.io/js-random).
Parent is [@aureooms/js-algorithms](https://aureooms.github.io/js-algorithms).

[![NPM license](http://img.shields.io/npm/l/aureooms-js-random.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-random/master/LICENSE)
[![NPM version](http://img.shields.io/npm/v/aureooms-js-random.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-random)
[![Bower version](http://img.shields.io/bower/v/aureooms-js-random.svg?style=flat)](http://bower.io/search/?q=aureooms-js-random)
[![Build Status](http://img.shields.io/travis/aureooms/js-random.svg?style=flat)](https://travis-ci.org/aureooms/js-random)
[![Coverage Status](http://img.shields.io/coveralls/aureooms/js-random.svg?style=flat)](https://coveralls.io/r/aureooms/js-random)
[![Dependencies Status](http://img.shields.io/david/aureooms/js-random.svg?style=flat)](https://david-dm.org/aureooms/js-random#info=dependencies)
[![devDependencies Status](http://img.shields.io/david/dev/aureooms/js-random.svg?style=flat)](https://david-dm.org/aureooms/js-random#info=devDependencies)
[![Code Climate](http://img.shields.io/codeclimate/github/aureooms/js-random.svg?style=flat)](https://codeclimate.com/github/aureooms/js-random)
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-random.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-random)
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-random.svg?style=flat)](https://github.com/aureooms/js-random/issues)
[![Inline docs](http://inch-ci.org/github/aureooms/js-random.svg?branch=master&style=shields)](http://inch-ci.org/github/aureooms/js-random)

Can be managed through [duo](https://github.com/duojs/duo),
[component](https://github.com/componentjs/component),
[bower](https://github.com/bower/bower), or
[npm](https://github.com/npm/npm).

```js
let random = require( "aureooms-js-random" ) ;
```

Example usage:

```js
random.randfloat( 0 , 1 ) ; // 0.19876947347074747
random.randfloat( 0 , 1 ) ; // 0.23755912738852203

random.randint( 0 , 100 ) ; // 57
random.randint( 0 , 100 ) ; // 31

let a = [ 0 , 1 , 2 , 3 ] ;

random.sample( 1 , a , 0 , 4 ) ;
a ; // [ 0 , 1 , 2 , 3 ]

random.sample( 1 , a , 0 , 4 ) ;
a ; // [ 1 , 0 , 2 , 3 ]

random.shuffle( a , 0 , 4 ) ;
a ; // [ 1 , 3 , 0 , 2 ]

random.shuffle( a , 0 , 4 ) ;
a ; // [ 3 , 2 , 1 , 0 ]
```
[![Documentation](https://aureooms.github.io/js-random/badge.svg)](https://aureooms.github.io/js-random/source.html)
21 changes: 0 additions & 21 deletions bower.json

This file was deleted.

11 changes: 0 additions & 11 deletions component.json

This file was deleted.

52 changes: 52 additions & 0 deletions doc/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
h1,
h2,
.navigation,
.layout-container > header,
footer
{
border: none;
}

.project-name {
color: #FC913A;
font-weight: bold;
}

.layout-container > header > a.repo-url-github {
font-size: inherit;
display: inline;
background: none;
vertical-align: inherit;
}

.search-box img {
display: none;
}

.search-box::before{
content: "search";
}

.search-input-edge {
height: 0px;
}

.search-result {
width: 300px;
margin-left: 42px;
box-shadow: 1px 1px 13px rgba(0,0,0,0.2);
}

.search-input {
visibility: visible;
}

.search-result li.search-separator {
text-transform: capitalize;
background-color: #ccc;
}

span[data-ice="signature"] > span {
/*font-weight: bold;*/
font-style: italic;
}
23 changes: 23 additions & 0 deletions doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```js
import { randint , randfloat , sample , shuffle } from 'aureooms-js-random' ;

randfloat( 0 , 1 ) ; // 0.19876947347074747
randfloat( 0 , 1 ) ; // 0.23755912738852203

randint( 0 , 100 ) ; // 57
randint( 0 , 100 ) ; // 31

let a = [ 0 , 1 , 2 , 3 ] ;

sample( 1 , a , 0 , 4 ) ;
a ; // [ 0 , 1 , 2 , 3 ]

sample( 1 , a , 0 , 4 ) ;
a ; // [ 1 , 0 , 2 , 3 ]

shuffle( a , 0 , 4 ) ;
a ; // [ 1 , 3 , 0 , 2 ]

shuffle( a , 0 , 4 ) ;
a ; // [ 3 , 2 , 1 , 0 ]
```
13 changes: 13 additions & 0 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Can be managed using
[jspm](http://jspm.io)
or [npm](https://github.com/npm/npm).

### jspm
```terminal
jspm install npm:aureooms-js-random
```

### npm
```terminal
npm install aureooms-js-random --save
```
Empty file added doc/manual/overview.md
Empty file.
14 changes: 14 additions & 0 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The code needs a ES2015+ polyfill to work, for example
[babel-polyfill](https://babeljs.io/docs/usage/polyfill).
```js
require( 'babel-polyfill' ) ;
// or
import 'babel-polyfill' ;
```

Then
```js
const random = require( 'aureooms-js-random' ) ;
// or
import * as random from 'aureooms-js-random' ;
```
34 changes: 34 additions & 0 deletions doc/scripts/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var domReady = function(callback) {
var state = document.readyState ;
if ( state === 'interactive' || state === 'complete' ) {
callback() ;
}
else {
document.addEventListener('DOMContentLoaded', callback);
}
} ;


domReady(function(){

var projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'aureooms/js-random';
projectname.href = './index.html' ;

var header = document.getElementsByTagName('header')[0] ;
header.insertBefore(projectname,header.firstChild);

var testlink = document.querySelector('header > a[data-ice="testLink"]') ;
testlink.href = 'https://coveralls.io/github/aureooms/js-random' ;
testlink.target = '_BLANK' ;

var searchBox = document.querySelector('.search-box');
var input = document.querySelector('.search-input');

// active search box when focus on searchBox.
input.addEventListener('focus', function(){
searchBox.classList.add('active');
});

});
37 changes: 37 additions & 0 deletions esdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"source": "./src",
"destination": "./gh-pages",
"access": [
"public",
"protected",
"private"
],
"debug": false,
"index": "./README.md",
"package": "./package.json",
"title": "aureooms/js-random",
"test": {
"type": "ava",
"source": "./test/src"
},
"manual": {
"overview": [
"./doc/manual/overview.md"
],
"installation": [
"./doc/manual/installation.md"
],
"usage": [
"./doc/manual/usage.md"
],
"example": [
"./doc/manual/example.md"
]
},
"styles": [
"./doc/css/style.css"
],
"scripts": [
"./doc/scripts/header.js"
]
}
5 changes: 0 additions & 5 deletions inch.json

This file was deleted.

Loading

0 comments on commit 7c50048

Please sign in to comment.