# Global

##

### Methods

#### clearTasks(gren)

Clears all the tasks that are still running

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes |

Since:
  - 0.6.0
Source:
  - utils.js, line 55

#### (private) commitMessages(commits) → {Array.<String>}

Transforms the commits to commit messages

##### Parameters:

Name | Type | Description
--- | --- | ---
`commits` | Array.<Object> | The array of object containing the commits

Since:
  - 0.1.0
Source:
  - gren.js, line 458

##### Returns:

Type
  Array.<String>

#### (private) compareIssueLabels(ignoreLabels, labels) → {boolean}

Compare the ignored labels with the passed ones

##### Parameters:

Name | Type | Description
--- | --- | ---
`ignoreLabels` | Array | The labels to ignore
`labels` | Array | The labels to check

Since:
  - 0.6.0
Source:
  - gren.js, line 532

##### Returns:

If the labels array contain any of the ignore ones

Type
  boolean

#### convertStringToArray(arrayLike) → {Array}

Converts an array like string to an actual Array, converting also underscores to spaces

##### Parameters:

Name | Type | Description
--- | --- | ---
`arrayLike` | string | The string of items e.g. "wont_fix, duplicate, bug"

Since:
  - 0.6.0
Source:
  - utils.js, line 140

##### Returns:

The items with spaces instead of underscores.

Type
  Array

#### (private) createChangelog(body) → {boolean}

Create the CHANGELOG.md file

##### Parameters:

Name | Type | Description
--- | --- | ---
`body` | string |

Since:
  - 0.5.0
Source:
  - gren.js, line 700

##### Returns:

Type
  boolean

#### (private) createRelease(gren, releaseOptions) → {Promise}

Create a release from a given tag (in the options)

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object
`releaseOptions` | Object | The options to build the release:

Since:
  - 0.1.0
Source:
  - gren.js, line 87

##### Returns:

Type
  Promise

##### Example

    {
      "tag_name": "1.0.0",
      "target_commitish": "master",
      "name": "v1.0.0",
      "body": "Description of the release",
      "draft": false,
      "prerelease": false
    }

#### (private) createReleaseRanges(gren, releaseDates) → {Array}

Create the ranges of release dates

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes |
`releaseDates` | Array | The release dates

Since:
  - 0.5.0
Source:
  - gren.js, line 638

##### Returns:

Type
  Array

#### dashToCamelCase(value) → {string}

Transforms a dasherize string into a camel case one.

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | string | The dasherize string

Since:
  - 0.3.2
Source:
  - utils.js, line 95

##### Returns:

The camel case string

Type
  string

#### (private) editRelease(gren, releaseId, releaseOptions) → {Promise}

Edit a release from a given tag (in the options)

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object
`releaseId` | number | The id of the release to edit
`releaseOptions` | Object | The options to build the release:

Since:
  - 0.5.0
Source:
  - gren.js, line 53

##### Returns:

Type
  Promise

##### Example

    {
      "tag_name": "v1.0.0",
      "target_commitish": "master",
      "name": "v1.0.0",
      "body": "Description of the release",
      "draft": false,
      "prerelease": false
    }

#### (private) executeCommand(command, callback) → {Promise}

Execute a command in the bash and run a callback

##### Parameters:

Name | Type | Description
--- | --- | ---
`command` | string | The command to execute
`callback` | function | The callback which returns the stdout

Since:
  - 0.5.0
Source:
  - github-info.js, line 18

##### Returns:

Type
  Promise

#### formatDate(date) → {string}

Format a date into a string

##### Parameters:

Name | Type | Description
--- | --- | ---
`date` | Date |

Since:
  - 0.5.0
Source:
  - utils.js, line 168

##### Returns:

Type
  string

#### (private) generateCommitsBody(message) → {string}

Return a commit messages generated body

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | string |

Since:
  - 0.1.0
Source:
  - gren.js, line 421

##### Returns:

Type
  string

#### (private) generateOptions() → {Array.<Promise>}

Generate the GithubReleaseNotes getting the options from the git config

Since:
  - 0.5.0
Source:
  - gren.js, line 753

##### Returns:

Type
  Array.<Promise>

#### (private) generateReleaseDatesChangelogBody() → {Array.<Promise>}

Generate a CHANGELOG.md file based on Time and issues

Since:
  - 0.5.0
Source:
  - gren.js, line 665

##### Returns:

Type
  Array.<Promise>

#### getBashOptions(args) → {Object}

Create a literal object of the node module options

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | Array | The array of arguments (the module arguments start from index 2)

Since:
  - 0.1.0
Source:
  - utils.js, line 113

##### Returns:

The object containg the key/value options

Type
  Object

#### (private) getClosedIssues(gren, releaseRanges) → {Promise}

Get all the closed issues from the current repo

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object
`releaseRanges` | Array | The array of date ranges

Since:
  - 0.5.0
Source:
  - gren.js, line 552

##### Returns:

The promise which resolves the list of the issues

Type
  Promise

#### (private) getCommitBlocks(gren, releaseRanges) → {Array.<Promise>}

Get the blocks of commits based on release dates

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes |
`releaseRanges` | Array | The array of date ranges

Since:
  - 0.5.0
Source:
  - gren.js, line 502

##### Returns:

Type
  Array.<Promise>

#### (private) getCommitsBetweenTwo(gren, since, until) → {Promise}

Gets all the commits between two dates

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object
`since` | string | The since date in ISO
`until` | string | The until date in ISO

Since:
  - 0.1.0
Source:
  - gren.js, line 476

##### Returns:

The promise which resolves the [Array] commit messages

Type
  Promise

#### getConfigFromFile(path) → {Object}

Get configuration from the one of the config files

##### Parameters:

Name | Type | Description
--- | --- | ---
`path` | string | Path where to look for config files

Since:
  - 0.6.0
Source:
  - utils.js, line 202

##### Returns:

The configuration from the first found file or empty object

Type
  Object

#### (private) getIssueBlocks(gren, releaseRanges) → {Array.<Promise>}

Get the blocks of issues based on release dates

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes |
`releaseRanges` | Array | The array of date ranges

Since:
  - 0.5.0
Source:
  - gren.js, line 583

##### Returns:

Type
  Array.<Promise>

#### (private) getLastTags(gren) → {Promise}

Get all the tags of the repo

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object

Since:
  - 0.1.0
Source:
  - gren.js, line 177

##### Returns:

Type
  Promise

#### (private) getLastTwoReleases(gren) → {Promise}

Get the latest releases

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object

Since:
  - 0.5.0
Source:
  - gren.js, line 287

##### Returns:

The promise which resolves the tag name of the release

Type
  Promise

#### (private) getListReleases(gren) → {Promise}

Get all releases

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object

Since:
  - 0.5.0
Source:
  - gren.js, line 262

##### Returns:

The promise which resolves an array of releases

Type
  Promise

#### (private) getReleaseDates(releases) → {Array}

Get all releases

##### Parameters:

Name | Type | Description
--- | --- | ---
`releases` | Array.<Object> | A list of release Objects

Since:
  - 0.5.0
Source:
  - gren.js, line 240

##### Returns:

The list of the dates

Type
  Array

#### (private) getSelectedTags(selectedTags, tags) → {Boolean|Array}

Get the tags information from the given ones, and adds the next one in case only one is given

##### Parameters:

Name | Type | Description
--- | --- | ---
`selectedTags` | Array | string |
`tags` | Array.<Object> |

Since:
  - 0.5.0
Source:
  - gren.js, line 146

##### Returns:

Type
  Boolean | Array

#### (private) getTagDates(gren, tags) → {Array.<Promise>}

Get the dates of the last two tags

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object
`tags` | Array.<Object> | List of all the tags in the repo

Since:
  - 0.1.0
Source:
  - gren.js, line 217

##### Returns:

The promises which returns the dates

Type
  Array.<Promise>

#### (private) hasNetwork() → {Promise}

Check if there is connectivity

Since:
  - 0.5.0
Source:
  - gren.js, line 769

##### Returns:

Type
  Promise

#### isInRange(value, min, max) → {Boolean}

Check if e value is between a min and a max

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | number |
`min` | number |
`max` | number |

Since:
  - 0.5.0
Source:
  - utils.js, line 81

##### Returns:

Type
  Boolean

#### (private) prepareRelease(gren, tags) → {Promise}

Creates the options to make the release

##### Parameters:

Name | Type | Description
--- | --- | ---
`gren` | GithubReleaseNotes | The gren object
`tags` | Array.<Object> | The collection of tags

Since:
  - 0.2.0
Source:
  - gren.js, line 112

##### Returns:

Type
  Promise

#### printTask(name)

Print a task name in a custom format

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | The name of the task

Since:
  - 0.5.0
Source:
  - utils.js, line 15

#### repo(callback) → {Promise}

Get repo informations

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function |

Since:
  - 0.5.0
Source:
  - github-info.js, line 63

##### Returns:

The promise that resolves repo informations ({user: user, name: name})

Type
  Promise

#### requireConfig(filepath) → {Object|boolean}

Gets the content from a filepath a returns an object

##### Parameters:

Name | Type | Description
--- | --- | ---
`filepath` | string |

Since:
  - 0.6.0
Source:
  - utils.js, line 181

##### Returns:

Type
  Object | boolean

#### (private) sortReleasesByDate(releaseDates) → {Array}

Sort releases by dates

##### Parameters:

Name | Type | Description
--- | --- | ---
`releaseDates` | Array |

Since:
  - 0.5.0
Source:
  - gren.js, line 621

##### Returns:

Type
  Array

#### task(taskName) → {function}

Outputs the task status

##### Parameters:

Name | Type | Description
--- | --- | ---
`taskName` | string | The task name

Since:
  - 0.5.0
Source:
  - utils.js, line 28

##### Returns:

The function to be fired when is loaded

Type
  function

#### (private) templateBlock(block) → {string}

Generate the MD template a block

##### Parameters:

Name | Type | Description
--- | --- | ---
`block` | Object | ({name: 'v1.2.3', body: []})

Since:
  - 0.5.0
Source:
  - gren.js, line 346

##### Returns:

Type
  string

#### (private) templateChangelog(blocks) → {string}

Generate the Changelog MD template

##### Parameters:

Name | Type | Description
--- | --- | ---
`blocks` | Array.<Object> |

Since:
  - 0.5.0
Source:
  - gren.js, line 390

##### Returns:

Type
  string

#### (private) templateCommits(message) → {string}

Return a string with a - to be a bulvar list (used for a mapping)

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | string |

Since:
  - 0.1.0
Source:
  - gren.js, line 304

##### Returns:

Type
  string

#### (private) templateIssue(issue) → {string}

Generate the MD template for each issue

##### Parameters:

Name | Type | Description
--- | --- | ---
`issue` | Object |

Since:
  - 0.5.0
Source:
  - gren.js, line 366

##### Returns:

Type
  string

#### (private) templateIssueBody(blocks) → {string}

Generate the Changelog issues body template

##### Parameters:

Name | Type | Description
--- | --- | ---
`blocks` | Array.<Object> |

Since:
  - 0.5.0
Source:
  - gren.js, line 407

##### Returns:

Type
  string

#### (private) templateLabels(issue) → {string}

Generate the MD template from all the labels of a specific issue

##### Parameters:

Name | Type | Description
--- | --- | ---
`issue` | Object |

Since:
  - 0.5.0
Source:
  - gren.js, line 320

##### Returns:

Type
  string

#### token(callback) → {Promise}

Get token informations

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function |

Since:
  - 0.5.0
Source:
  - github-info.js, line 89

##### Returns:

The promise that resolves token informations ({token: token})

Type
  Promise

#### user(callback) → {Promise}

Get user informations

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function |

Since:
  - 0.5.0
Source:
  - github-info.js, line 44

##### Returns:

The promise that resolves user informations ({ user: username})

Type
  Promise