github_changelog_generator 1.15.0.pre.rc → 1.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +1 -1
  3. data/README.md +134 -81
  4. data/Rakefile +1 -1
  5. data/bin/git-generate-changelog +1 -1
  6. data/lib/github_changelog_generator.rb +10 -6
  7. data/lib/github_changelog_generator/argv_parser.rb +224 -0
  8. data/lib/github_changelog_generator/generator/entry.rb +218 -0
  9. data/lib/github_changelog_generator/generator/generator.rb +120 -121
  10. data/lib/github_changelog_generator/generator/generator_fetcher.rb +138 -23
  11. data/lib/github_changelog_generator/generator/generator_processor.rb +60 -27
  12. data/lib/github_changelog_generator/generator/generator_tags.rb +25 -21
  13. data/lib/github_changelog_generator/generator/section.rb +124 -0
  14. data/lib/github_changelog_generator/helper.rb +1 -1
  15. data/lib/github_changelog_generator/octo_fetcher.rb +250 -96
  16. data/lib/github_changelog_generator/options.rb +39 -4
  17. data/lib/github_changelog_generator/parser.rb +70 -209
  18. data/lib/github_changelog_generator/parser_file.rb +35 -16
  19. data/lib/github_changelog_generator/reader.rb +2 -2
  20. data/lib/github_changelog_generator/ssl_certs/cacert.pem +851 -1680
  21. data/lib/github_changelog_generator/task.rb +4 -4
  22. data/lib/github_changelog_generator/version.rb +1 -1
  23. data/man/git-generate-changelog.1 +160 -74
  24. data/man/git-generate-changelog.1.html +159 -95
  25. data/man/git-generate-changelog.html +36 -24
  26. data/man/git-generate-changelog.md +156 -93
  27. data/spec/files/config_example +5 -0
  28. data/spec/files/github-changelog-generator.md +114 -114
  29. data/spec/{install-gem-in-bundler.gemfile → install_gem_in_bundler.gemfile} +2 -0
  30. data/spec/spec_helper.rb +2 -6
  31. data/spec/unit/generator/entry_spec.rb +766 -0
  32. data/spec/unit/generator/generator_processor_spec.rb +103 -41
  33. data/spec/unit/generator/generator_spec.rb +47 -0
  34. data/spec/unit/generator/generator_tags_spec.rb +51 -24
  35. data/spec/unit/generator/section_spec.rb +34 -0
  36. data/spec/unit/octo_fetcher_spec.rb +247 -197
  37. data/spec/unit/options_spec.rb +24 -0
  38. data/spec/unit/parse_file_spec.rb +2 -2
  39. data/spec/unit/parser_spec.rb +50 -0
  40. data/spec/unit/reader_spec.rb +4 -4
  41. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits/when_API_is_valid/returns_commits.json +1 -0
  42. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits_before/when_API_is_valid/returns_commits.json +1 -1
  43. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid.json +1 -1
  44. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issue_with_proper_key/values.json +1 -1
  45. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues.json +1 -1
  46. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues_with_labels.json +1 -1
  47. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_request_with_proper_key/values.json +1 -1
  48. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_requests_with_labels.json +1 -1
  49. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid.json +1 -1
  50. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_correct_pull_request_keys.json +1 -1
  51. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_pull_requests.json +1 -1
  52. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid.json +1 -1
  53. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid/returns_commit.json +1 -1
  54. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid.json +1 -1
  55. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid/returns_date.json +1 -1
  56. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid.json +1 -1
  57. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid/populates_issues.json +1 -1
  58. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid.json +1 -1
  59. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags.json +1 -1
  60. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags_count.json +1 -1
  61. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided.json +1 -1
  62. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided/should_raise_Unauthorized_error.json +1 -1
  63. metadata +56 -20
  64. data/bin/ghclgen +0 -5
  65. data/lib/github_changelog_generator/generator/generator_generation.rb +0 -181
  66. data/spec/unit/generator/generator_generation_spec.rb +0 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ec76ed478bd8c2cf2500a55c75c1a9f12ffc46d6
4
- data.tar.gz: 50192107d5f4ef52815262e08980c01a4c348781
2
+ SHA256:
3
+ metadata.gz: 2ccac267908f4f46f4660f682da9b2d83f3b14e84f987a2c8929c59a928684e3
4
+ data.tar.gz: ca7866e9ebed6bbfe7dcfd637a63330dafec2d13602a47917faf84ff1cbde656
5
5
  SHA512:
6
- metadata.gz: 2e40ddcaeb4205c6b44aee5ed18728eba7f6b27423055746edd39b180267d41276b86074dfc7d4c612f65f2218553a7d8fe6ccace873fbc7dd2b025f28dddad6
7
- data.tar.gz: 79270b1372d108a8645a246933219804595e88c9226202736926ab511cc0cd780e2bff5654fe32d408363a34904bd5d92e24e39aff8eda49aa7225ee961b51ec
6
+ metadata.gz: d362fbc5862e8170d82175a6e9adf15eae99b578d894b7df7c15531e80326e17947a5c8f88d2964900a296d9760a53ef339d598de2cf2b703242fb391c805457
7
+ data.tar.gz: 3e38da7c8a091c7efc681c295f7d6467a227579cddff107a28f7a51a50c8d808008e012a457afd9faa6f92f2021dac648d634ab04aac4958acb54934f40085f5
data/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
1
  The MIT License (MIT)
2
- Copyright (c) 2016-2017 Petr Korolev
2
+ Copyright (c) 2016-2019 Petr Korolev
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
5
 
data/README.md CHANGED
@@ -1,35 +1,49 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/github_changelog_generator.svg)](http://badge.fury.io/rb/github_changelog_generator)
2
- [![Dependency Status](https://gemnasium.com/skywinder/github-changelog-generator.svg)](https://gemnasium.com/skywinder/github-changelog-generator)
3
- [![Build Status](https://travis-ci.org/skywinder/github-changelog-generator.svg?branch=master)](https://travis-ci.org/skywinder/github-changelog-generator)
4
- [![Build status](https://ci.appveyor.com/api/projects/status/xdfnfmdjfo0upm7m?svg=true)](https://ci.appveyor.com/project/olleolleolle/github-changelog-generator)
5
- [![Inline docs](http://inch-ci.org/github/skywinder/github-changelog-generator.svg)](http://inch-ci.org/github/skywinder/github-changelog-generator)
6
- [![Code Climate](https://codeclimate.com/github/skywinder/github-changelog-generator/badges/gpa.svg)](https://codeclimate.com/github/skywinder/github-changelog-generator)
7
- [![Test Coverage](https://codeclimate.com/github/skywinder/github-changelog-generator/badges/coverage.svg)](https://codeclimate.com/github/skywinder/github-changelog-generator)
2
+ [![CircleCI](https://circleci.com/gh/github-changelog-generator/github-changelog-generator.svg?style=svg)](https://circleci.com/gh/github-changelog-generator/github-changelog-generator)
3
+ [![Inline docs](http://inch-ci.org/github/github-changelog-generator/github-changelog-generator.svg)](http://inch-ci.org/github/github-changelog-generator/github-changelog-generator)
8
4
  [![Join the chat at https://gitter.im/github-changelog-generator/chat](https://badges.gitter.im/github-changelog-generator/chat.svg)](https://gitter.im/github-changelog-generator/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
5
 
10
- GitHub Changelog Generator ![GitHub Logo](../master/images/logo.jpg)
11
- ==================
12
-
13
- - [Installation](#installation)
14
- - [Output example](#output-example)
15
- - [Usage](#usage)
16
- - [Params](#params)
17
- - [GitHub token](#github-token)
18
- - [Features and advantages of this project](#features-and-advantages-of-this-project)
19
- - [Alternatives](#alternatives)
20
- - [Projects using this library](#projects-using-this-library)
21
- - [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
22
- - [Contributing](#contributing)
23
- - [License](#license)
6
+ # github-changelog-generator ![GitHub Logo](../master/images/logo.jpg)
7
+
8
+ <!--
9
+ To update TOC, please run:
10
+ > doctoc ./README.md --github
11
+ -->
12
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
13
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14
+
15
+
16
+ - [Changelog generation has never been so easy](#changelog-generation-has-never-been-so-easy)
17
+ - [*What’s the point of a changelog?*](#whats-the-point-of-a-changelog)
18
+ - [*Why should I care?*](#why-should-i-care)
19
+ - [Installation](#installation)
20
+ - [Running with Docker](#running-with-docker)
21
+ - [Output example](#output-example)
22
+ - [Usage](#usage)
23
+ - [Params](#params)
24
+ - [Params File](#params-file)
25
+ - [GitHub token](#github-token)
26
+ - [Migrating from a manual changelog](#migrating-from-a-manual-changelog)
27
+ - [Rake task](#rake-task)
28
+ - [Features and advantages of this project](#features-and-advantages-of-this-project)
29
+ - [Using the summary section feature](#using-the-summary-section-feature)
30
+ - [Alternatives](#alternatives)
31
+ - [Projects using this library](#projects-using-this-library)
32
+ - [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
33
+ - [FAQ](#faq)
34
+ - [Contributing](#contributing)
35
+ - [License](#license)
36
+
37
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
24
38
 
25
39
 
26
40
  ### Changelog generation has never been so easy
27
41
 
28
- **Fully automated changelog generation** - This gem generates a change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according to labels) from :octocat: GitHub Issue Tracker.
42
+ **Fully automated changelog generation** - This gem generates a changelog file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according to labels) from :octocat: GitHub Issue Tracker.
29
43
 
30
44
  Since you don't have to fill your `CHANGELOG.md` manually now: just run the script, relax and take a cup of :coffee: before your next release! :tada:
31
45
 
32
- ### *What’s the point of a change log?*
46
+ ### *What’s the point of a changelog?*
33
47
 
34
48
  To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
35
49
 
@@ -39,61 +53,84 @@ Because software tools are for _people_. "Changelogs make it easier for users an
39
53
  contributors to see precisely what notable changes have been made between each
40
54
  release (or version) of the project."
41
55
 
42
- :arrow_right: *[http://keepachangelog.com](http://keepachangelog.com)*
56
+ :arrow_right: *[https://keepachangelog.com](https://keepachangelog.com)*
43
57
 
44
58
  ## Installation
45
59
 
46
- gem install github_changelog_generator
60
+ GitHub Changelog Generator is a [Ruby](https://www.ruby-lang.org/)
61
+ program, distributed as a RubyGem. The Ruby language homepage has an [Installation page](https://www.ruby-lang.org/en/documentation/installation/).
62
+
63
+ Install the gem like:
64
+
65
+ $ gem install github_changelog_generator
66
+
67
+ Depending on your system, you _may_ need to run the shell as an Administrator (Windows),
68
+ or use `sudo gem install github_changelog_generator` (Linux).
69
+
70
+
71
+ ## Usage
72
+
73
+
74
+ ### Running with CLI:
75
+
76
+ github_changelog_generator -u github_project_namespace -p github_project
77
+
78
+ (where the project namespace is _likely_ your username if it's a project you own, but it could also be the namespace of the project)
79
+
80
+
81
+ ### Running with Docker
82
+
83
+ Using [Docker](https://www.docker.com/products/docker-desktop) is an alternative to installing Ruby and the gem.
84
+
85
+ Example invocation:
86
+
87
+ $ docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator
88
+
89
+
90
+
91
+ - For Github Enterprise repos, specify *both* `--github-site` and `--github-api` options:
92
+
93
+ $ github_changelog_generator --github-site="https://github.yoursite.com" \
94
+ --github-api="https://github.yoursite.com/api/v3/"
95
+
96
+
97
+ This generates a `CHANGELOG.md`, with pretty Markdown formatting.
47
98
 
48
- See also Troubleshooting.
49
99
 
50
100
  ## Output example
51
101
 
52
- - Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
53
- - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
102
+ - Look at **[CHANGELOG.md](https://github.com/github-changelog-generator/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
103
+ - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/develop/CHANGELOG.md) was generated by command:
54
104
 
55
- github_changelog_generator -u skywinder -p ActionSheetPicker-3.0
105
+ $ github_changelog_generator -u github-changelog-generator -p ActionSheetPicker-3.0
56
106
 
57
107
  - In general, it looks like this:
58
108
 
59
- > ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
109
+ > ## [1.2.5](https://github.com/github-changelog-generator/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
60
110
  >
61
- > [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
111
+ > [Full Changelog](https://github.com/github-changelog-generator/Github-Changelog-Generator/compare/1.2.4...1.2.5)
62
112
  >
63
113
  > **Implemented enhancements:**
64
114
  >
65
- > - Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
115
+ > - Use milestone to specify in which version bug was fixed [\#22](https://github.com/github-changelog-generator/Github-Changelog-Generator/issues/22)
66
116
  >
67
117
  > **Fixed bugs:**
68
118
  >
69
- > - Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
119
+ > - Error when trying to generate log for repo without tags [\#32](https://github.com/github-changelog-generator/Github-Changelog-Generator/issues/32)
70
120
  >
71
121
  > **Merged pull requests:**
72
122
  >
73
- > - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
123
+ > - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/github-changelog-generator/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
74
124
  >
75
- > - support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
76
-
77
-
78
- ## Usage
79
-
80
- - Run this:
81
-
82
- `github_changelog_generator -u github_username -p github_project`
83
- `github_changelog_generator github_username/github_project`
84
-
85
- - For Github Enterprise repos, specify *both* `--github-site` and `--github-api` options:
86
-
87
- github_changelog_generator --github-site="https://github.yoursite.com" \
88
- --github-api="https://github.yoursite.com/api/v3/"
89
-
90
- This generates a `CHANGELOG.md`, with pretty Markdown formatting.
125
+ > - support enterprise github via command line options [\#42](https://github.com/github-changelog-generator/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
91
126
 
92
127
  ### Params
93
128
 
94
- Type `github_changelog_generator --help` for details.
129
+ Print help for all command-line options to learn more details:
130
+
131
+ $ github_changelog_generator --help
95
132
 
96
- For more details about params, read the Wiki page: [**Advanced change log generation examples**](https://github.com/skywinder/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
133
+ For more details about params, read the Wiki page: [**Advanced changelog generation examples**](https://github.com/github-changelog-generator/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
97
134
 
98
135
  ### Params File
99
136
 
@@ -109,7 +146,7 @@ since-tag=1.0.0
109
146
 
110
147
  ### GitHub token
111
148
 
112
- GitHub only allows 50 unauthenticated requests per hour.
149
+ GitHub only allows **50 unauthenticated requests per hour**.
113
150
 
114
151
  Therefore, it's recommended to run this script with authentication by using a **token**.
115
152
 
@@ -120,7 +157,7 @@ Here's how:
120
157
  - Run the script with `--token <your-40-digit-token>`; **OR**
121
158
  - Set the `CHANGELOG_GITHUB_TOKEN` environment variable to your 40 digit token
122
159
 
123
- You can set an environment variable by running the following command at the prompt, or by adding it to your shell profile (e.g., `~/.bash_profile` or `~/.zshrc`):
160
+ You can set an environment variable by running the following command at the prompt, or by adding it to your shell profile (e.g., `.env`, `~/.bash_profile`, `~/.zshrc`, etc):
124
161
 
125
162
  export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"
126
163
 
@@ -154,6 +191,8 @@ Configure the task in your `Rakefile`:
154
191
  require 'github_changelog_generator/task'
155
192
 
156
193
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
194
+ config.user = 'username'
195
+ config.project = 'project-name'
157
196
  config.since_tag = '0.1.14'
158
197
  config.future_release = '0.2.0'
159
198
  end
@@ -163,11 +202,11 @@ All command-line options can be passed to the `rake` task as `config`
163
202
  parameters. And since you're naming the `rake` task yourself, you can create
164
203
  as many as you want.
165
204
 
166
- You can look for params names from the [parser source code (#setup_parser)](https://github.com/skywinder/github-changelog-generator/blob/master/lib/github_changelog_generator/parser.rb). For example, to translate the bugs label to Portuguese, instead of setting `config.bugs_label`, you have to set `config.bug_prefix`, and so on.
205
+ You can look for params names from the [parser source code (#setup_parser)](https://github.com/github-changelog-generator/github-changelog-generator/blob/master/lib/github_changelog_generator/parser.rb). For example, to translate the bugs label to Portuguese, instead of setting `config.bugs_label`, you have to set `config.bug_prefix`, and so on.
167
206
 
168
207
  ## Features and advantages of this project
169
208
 
170
- - Generate canonical, neat change log file, followed by [basic change log guidelines](http://keepachangelog.com) :gem:
209
+ - Generate canonical, neat changelog file, with default sections that follow [basic changelog guidelines](http://keepachangelog.com) :gem:
171
210
  - Optionally generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
172
211
  - **GitHub Enterprise support** via command line options! :factory:
173
212
  - Flexible format **customization**:
@@ -185,27 +224,53 @@ You can look for params names from the [parser source code (#setup_parser)](http
185
224
  - Customize lots more! Tweak the changelog to fit your preferences :tophat:
186
225
  (*See `github_changelog_generator --help` for details)*
187
226
 
227
+ ### Using the summary section feature
228
+
229
+ For each version, you can add a _release summary_ with text, images, gif animations,
230
+ etc, and show new features and notes clearly to the user. This is done using GitHub metadata.
231
+
232
+ **Example**: adding the release summary for v1.0.0:
233
+
234
+ 1. Create a new GitHub Issue
235
+ 2. In the Issue's _Description_ field, add your release summary content
236
+ ```
237
+ ![image](https://user-images.githubusercontent.com/12690315/45935880-006a8200-bfeb-11e8-958e-ff742ae66b96.png)
238
+
239
+ Hello, World! :tada:
240
+ ```
241
+ 3. Set the Issue Label `release-summary` and add it to the GitHub Milestone `v1.0.0`
242
+ 4. Close the Issue and execute `github-changelog-generator`
243
+ 5. The result looks like this:
244
+ > ## [v1.0.0](https://github.com/github-changelog-generator/github-changelog-generator/tree/1.0.0) (2014-11-07)
245
+ > [Full Changelog](https://github.com/github-changelog-generator/github-changelog-generator/compare/0.1.0...1.0.0)
246
+ >
247
+ > ![image](https://user-images.githubusercontent.com/12690315/45935880-006a8200-bfeb-11e8-958e-ff742ae66b96.png)
248
+ >
249
+ > Hello, World! :tada:
250
+ >
251
+ > **Implemented enhancements:**
252
+ > - Add some features
188
253
 
189
254
  ### Alternatives
190
255
 
191
- Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives) that I found. But none satisfied my requirements.
256
+ Here is a [wikipage list of alternatives](https://github.com/github-changelog-generator/Github-Changelog-Generator/wiki/Alternatives) that I found. But none satisfied my requirements.
192
257
 
193
258
  *If you know other projects, feel free to edit this Wiki page!*
194
259
 
195
260
 
196
261
  ### Projects using this library
197
262
 
198
- Here's a [wikipage list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator).
263
+ Here's a [wikipage list of projects](https://github.com/github-changelog-generator/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator).
199
264
 
200
265
  If you've used this project in a live app, please let me know! Nothing makes me happier than seeing someone else take my work and go wild with it.
201
266
 
202
- *If you are using `github_changelog_generator` to generate your project's changelog, or know of other projects using it, please [add it to this list](https://github.com/skywinder/github-changelog-generator/wiki/Projects-using-Github-Changelog-Generator).*
267
+ *If you are using `github_changelog_generator` to generate your project's changelog, or know of other projects using it, please [add it to this list](https://github.com/github-changelog-generator/github-changelog-generator/wiki/Projects-using-Github-Changelog-Generator).*
203
268
 
204
269
  ## Am I missing some essential feature?
205
270
 
206
271
  - **Nothing is impossible!**
207
272
 
208
- - Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make the generator better together!
273
+ - Open an [issue](https://github.com/github-changelog-generator/Github-Changelog-Generator/issues/new) and let's make the generator better together!
209
274
 
210
275
  - *Bug reports, feature requests, patches, and well-wishes are always welcome.* :heavy_exclamation_mark:
211
276
 
@@ -215,33 +280,12 @@ If you've used this project in a live app, please let me know! Nothing makes me
215
280
 
216
281
  GitHub Releases is a very good thing. And it's very good practice to maintain it. (Not a lot of people are using it yet!) :congratulations:
217
282
 
218
- *BTW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
283
+ *BTW: I would like to support GitHub Releases in [next releases](https://github.com/github-changelog-generator/github-changelog-generator/issues/56) ;)*
219
284
 
220
285
  I'm not trying to compare the quality of handwritten and auto-generated logs. That said....
221
286
 
222
287
  An auto-generated changelog really helps, even if you manually fill in the release notes!
223
288
 
224
- For example:
225
-
226
- When you find a closed bug, it is very useful to know which release fixed it.
227
- So that you can easily find the issue by \# in `CHANGELOG.md`.
228
-
229
- - it's not quite as easy to find this in handwritten releases notes
230
- - a generated file saves you the trouble of remembering everything;
231
- sometimes people forget to add things to a handwritten file
232
-
233
- Ultimately, I think GitHub Releases are ideal for end-users.
234
- Meanwhile, `CHANGELOG.md` lives right in the repository, with its detailed list of changes, which is handy for developers.
235
- Finally, there's nothing wrong with using GitHub Releases alongside `CHANGELOG.md` in this combination.
236
-
237
- - ***I received a warning: "GitHub API rate limit exceed" What does this mean?***
238
-
239
- GitHub [limits the number of API requests](https://developer.github.com/v3/#rate-limiting) you can make in an hour. You can make up to 5,000 requests per hour. For unauthenticated requests, the rate limit is only up to 60 requests per hour. Unauthenticated requests are associated with your IP address (not the user making requests).
240
-
241
- If you're seeing this warning, please do the following:
242
-
243
- 1. Make sure you're providing an OAuth token, so you're not making requests anonymously. Using an OAuth token increases your hourly request maximum from 60 to 5000.
244
- 2. If you have a large repo with lots of issues/PRs, you can use `--max-issues NUM` to limit the number of issues that are pulled back. For example: `--max-issues 1000`
245
289
 
246
290
  - ***My Ruby version is very old, can I use this?***
247
291
 
@@ -268,12 +312,21 @@ gem 'rack', '~> 1.6'
268
312
  This way, you can keep on using github_changelog_generator, even if you
269
313
  can't get the latest version of Ruby installed.
270
314
 
315
+ - ***Windows: 1.14.x wants to create a file on an invalid path. Why?***
316
+
317
+ Windows: [v1.14.0 introduced a bug where it attempts to create /tmp/github_changelog-logger.log... which isn't a valid path on Windows and thus fails](https://github.com/github-changelog-generator/github-changelog-generator/issues/458)
318
+
319
+ Workaround: Create a `C:\tmp`.
320
+
271
321
  ## Contributing
272
322
 
273
323
  We have collected notes on how to contribute to this project in [CONTRIBUTING.md].
274
324
 
275
325
  [CONTRIBUTING.md]: CONTRIBUTING.md
276
326
 
327
+ ## Contact us
328
+ [Join the chat at gitter : github-changelog-generator](https://gitter.im/github-changelog-generator/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
329
+
277
330
  ## License
278
331
 
279
332
  Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ RSpec::Core::RakeTask.new
13
13
 
14
14
  desc "When releasing the gem, re-fetch latest cacert.pem from curl.haxx.se. Developer task."
15
15
  task :update_ssl_ca_file do
16
- `pushd lib/github_changelog_generator/ssl_certs && curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem && popd`
16
+ `pushd lib/github_changelog_generator/ssl_certs && curl --remote-name --time-cond cacert.pem https://curl.se/ca/cacert.pem && popd`
17
17
  end
18
18
 
19
19
  task default: %i[rubocop spec]
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env ruby
1
+ #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require_relative "../lib/github_changelog_generator"
@@ -22,22 +22,26 @@ require "github_changelog_generator/reader"
22
22
  module GitHubChangelogGenerator
23
23
  # Main class and entry point for this script.
24
24
  class ChangelogGenerator
25
- # Class, responsible for whole change log generation cycle
25
+ # Class, responsible for whole changelog generation cycle
26
26
  # @return initialised instance of ChangelogGenerator
27
27
  def initialize
28
28
  @options = Parser.parse_options
29
29
  @generator = Generator.new @options
30
30
  end
31
31
 
32
- # The entry point of this script to generate change log
32
+ # The entry point of this script to generate changelog
33
33
  # @raise (ChangelogGeneratorError) Is thrown when one of specified tags was not found in list of tags.
34
34
  def run
35
35
  log = @generator.compound_changelog
36
36
 
37
- output_filename = @options[:output].to_s
38
- File.open(output_filename, "wb") { |file| file.write(log) }
39
- puts "Done!"
40
- puts "Generated log placed in #{Dir.pwd}/#{output_filename}"
37
+ if @options.write_to_file?
38
+ output_filename = @options[:output].to_s
39
+ File.open(output_filename, "wb") { |file| file.write(log) }
40
+ puts "Done!"
41
+ puts "Generated log placed in #{Dir.pwd}/#{output_filename}"
42
+ else
43
+ puts log
44
+ end
41
45
  end
42
46
  end
43
47
  end
@@ -0,0 +1,224 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "optparse"
4
+ require "github_changelog_generator/version"
5
+
6
+ module GitHubChangelogGenerator
7
+ class ArgvParser
8
+ attr_reader :options
9
+
10
+ def initialize(options = {})
11
+ @options = options
12
+ end
13
+
14
+ def parse!(argv)
15
+ parser.parse(argv)
16
+ rescue OptionParser::ParseError => e
17
+ warn [e, parser].join("\n")
18
+ Kernel.abort
19
+ end
20
+
21
+ def parser
22
+ @parser ||= OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength
23
+ opts.banner = "Usage: github_changelog_generator --user USER --project PROJECT [options]"
24
+ opts.on("-u", "--user USER", "Username of the owner of the target GitHub repo OR the namespace of target Github repo if owned by an organization.") do |last|
25
+ options[:user] = last
26
+ end
27
+ opts.on("-p", "--project PROJECT", "Name of project on GitHub.") do |last|
28
+ options[:project] = last
29
+ end
30
+ opts.on("-t", "--token TOKEN", "To make more than 50 requests per hour your GitHub token is required. You can generate it at: https://github.com/settings/tokens/new") do |last|
31
+ options[:token] = last
32
+ end
33
+ opts.on("-f", "--date-format FORMAT", "Date format. Default is %Y-%m-%d.") do |last|
34
+ options[:date_format] = last
35
+ end
36
+ opts.on("-o", "--output NAME", "Output file. To print to STDOUT instead, use blank as path. Default is CHANGELOG.md") do |last|
37
+ options[:output] = last
38
+ end
39
+ opts.on("-b", "--base NAME", "Optional base file to append generated changes to. Default is HISTORY.md") do |last|
40
+ options[:base] = last
41
+ end
42
+ opts.on("--summary-label LABEL", "Set up custom label for the release summary section. Default is \"\".") do |v|
43
+ options[:summary_prefix] = v
44
+ end
45
+ opts.on("--breaking-label LABEL", "Set up custom label for the breaking changes section. Default is \"**Breaking changes:**\".") do |v|
46
+ options[:breaking_prefix] = v
47
+ end
48
+ opts.on("--enhancement-label LABEL", "Set up custom label for enhancements section. Default is \"**Implemented enhancements:**\".") do |v|
49
+ options[:enhancement_prefix] = v
50
+ end
51
+ opts.on("--bugs-label LABEL", "Set up custom label for bug-fixes section. Default is \"**Fixed bugs:**\".") do |v|
52
+ options[:bug_prefix] = v
53
+ end
54
+ opts.on("--deprecated-label LABEL", "Set up custom label for the deprecated changes section. Default is \"**Deprecated:**\".") do |v|
55
+ options[:deprecated_prefix] = v
56
+ end
57
+ opts.on("--removed-label LABEL", "Set up custom label for the removed changes section. Default is \"**Removed:**\".") do |v|
58
+ options[:removed_prefix] = v
59
+ end
60
+ opts.on("--security-label LABEL", "Set up custom label for the security changes section. Default is \"**Security fixes:**\".") do |v|
61
+ options[:security_prefix] = v
62
+ end
63
+ opts.on("--issues-label LABEL", "Set up custom label for closed-issues section. Default is \"**Closed issues:**\".") do |v|
64
+ options[:issue_prefix] = v
65
+ end
66
+ opts.on("--header-label LABEL", "Set up custom header label. Default is \"# Changelog\".") do |v|
67
+ options[:header] = v
68
+ end
69
+ opts.on("--configure-sections HASH, STRING", "Define your own set of sections which overrides all default sections.") do |v|
70
+ options[:configure_sections] = v
71
+ end
72
+ opts.on("--add-sections HASH, STRING", "Add new sections but keep the default sections.") do |v|
73
+ options[:add_sections] = v
74
+ end
75
+ opts.on("--front-matter JSON", "Add YAML front matter. Formatted as JSON because it's easier to add on the command line.") do |v|
76
+ options[:frontmatter] = "#{JSON.parse(v).to_yaml}---\n"
77
+ end
78
+ opts.on("--pr-label LABEL", "Set up custom label for pull requests section. Default is \"**Merged pull requests:**\".") do |v|
79
+ options[:merge_prefix] = v
80
+ end
81
+ opts.on("--[no-]issues", "Include closed issues in changelog. Default is true.") do |v|
82
+ options[:issues] = v
83
+ end
84
+ opts.on("--[no-]issues-wo-labels", "Include closed issues without labels in changelog. Default is true.") do |v|
85
+ options[:add_issues_wo_labels] = v
86
+ end
87
+ opts.on("--[no-]pr-wo-labels", "Include pull requests without labels in changelog. Default is true.") do |v|
88
+ options[:add_pr_wo_labels] = v
89
+ end
90
+ opts.on("--[no-]pull-requests", "Include pull-requests in changelog. Default is true.") do |v|
91
+ options[:pulls] = v
92
+ end
93
+ opts.on("--[no-]filter-by-milestone", "Use milestone to detect when issue was resolved. Default is true.") do |last|
94
+ options[:filter_issues_by_milestone] = last
95
+ end
96
+ opts.on("--[no-]issues-of-open-milestones", "Include issues of open milestones. Default is true.") do |v|
97
+ options[:issues_of_open_milestones] = v
98
+ end
99
+ opts.on("--[no-]author", "Add author of pull request at the end. Default is true.") do |author|
100
+ options[:author] = author
101
+ end
102
+ opts.on("--usernames-as-github-logins", "Use GitHub tags instead of Markdown links for the author of an issue or pull-request.") do |v|
103
+ options[:usernames_as_github_logins] = v
104
+ end
105
+ opts.on("--unreleased-only", "Generate log from unreleased closed issues only.") do |v|
106
+ options[:unreleased_only] = v
107
+ end
108
+ opts.on("--[no-]unreleased", "Add to log unreleased closed issues. Default is true.") do |v|
109
+ options[:unreleased] = v
110
+ end
111
+ opts.on("--unreleased-label LABEL", "Set up custom label for unreleased closed issues section. Default is \"**Unreleased:**\".") do |v|
112
+ options[:unreleased_label] = v
113
+ end
114
+ opts.on("--[no-]compare-link", "Include compare link (Full Changelog) between older version and newer version. Default is true.") do |v|
115
+ options[:compare_link] = v
116
+ end
117
+ opts.on("--include-labels x,y,z", Array, "Of the labeled issues, only include the ones with the specified labels.") do |list|
118
+ options[:include_labels] = list
119
+ end
120
+ opts.on("--exclude-labels x,y,z", Array, "Issues with the specified labels will be excluded from changelog. Default is 'duplicate,question,invalid,wontfix'.") do |list|
121
+ options[:exclude_labels] = list
122
+ end
123
+ opts.on("--summary-labels x,y,z", Array, 'Issues with these labels will be added to a new section, called "Release Summary". The section display only body of issues. Default is \'release-summary,summary\'.') do |list|
124
+ options[:summary_labels] = list
125
+ end
126
+ opts.on("--breaking-labels x,y,z", Array, 'Issues with these labels will be added to a new section, called "Breaking changes". Default is \'backwards-incompatible,breaking\'.') do |list|
127
+ options[:breaking_labels] = list
128
+ end
129
+ opts.on("--enhancement-labels x,y,z", Array, 'Issues with the specified labels will be added to "Implemented enhancements" section. Default is \'enhancement,Enhancement\'.') do |list|
130
+ options[:enhancement_labels] = list
131
+ end
132
+ opts.on("--bug-labels x,y,z", Array, 'Issues with the specified labels will be added to "Fixed bugs" section. Default is \'bug,Bug\'.') do |list|
133
+ options[:bug_labels] = list
134
+ end
135
+ opts.on("--deprecated-labels x,y,z", Array, 'Issues with the specified labels will be added to a section called "Deprecated". Default is \'deprecated,Deprecated\'.') do |list|
136
+ options[:deprecated_labels] = list
137
+ end
138
+ opts.on("--removed-labels x,y,z", Array, 'Issues with the specified labels will be added to a section called "Removed". Default is \'removed,Removed\'.') do |list|
139
+ options[:removed_labels] = list
140
+ end
141
+ opts.on("--security-labels x,y,z", Array, 'Issues with the specified labels will be added to a section called "Security fixes". Default is \'security,Security\'.') do |list|
142
+ options[:security_labels] = list
143
+ end
144
+ opts.on("--issue-line-labels x,y,z", Array, 'The specified labels will be shown in brackets next to each matching issue. Use "ALL" to show all labels. Default is [].') do |list|
145
+ options[:issue_line_labels] = list
146
+ end
147
+ opts.on("--include-tags-regex REGEX", "Apply a regular expression on tag names so that they can be included, for example: --include-tags-regex \".*\+\d{1,}\".") do |last|
148
+ options[:include_tags_regex] = last
149
+ end
150
+ opts.on("--exclude-tags x,y,z", Array, "Changelog will exclude specified tags") do |list|
151
+ options[:exclude_tags] = list
152
+ end
153
+ opts.on("--exclude-tags-regex REGEX", "Apply a regular expression on tag names so that they can be excluded, for example: --exclude-tags-regex \".*\+\d{1,}\".") do |last|
154
+ options[:exclude_tags_regex] = last
155
+ end
156
+ opts.on("--since-tag x", "Changelog will start after specified tag.") do |v|
157
+ options[:since_tag] = v
158
+ end
159
+ opts.on("--due-tag x", "Changelog will end before specified tag.") do |v|
160
+ options[:due_tag] = v
161
+ end
162
+ opts.on("--since-commit x", "Fetch only commits after this time. eg. \"2017-01-01 10:00:00\"") do |v|
163
+ options[:since_commit] = v
164
+ end
165
+ opts.on("--max-issues NUMBER", Integer, "Maximum number of issues to fetch from GitHub. Default is unlimited.") do |max|
166
+ options[:max_issues] = max
167
+ end
168
+ opts.on("--release-url URL", "The URL to point to for release links, in printf format (with the tag as variable).") do |url|
169
+ options[:release_url] = url
170
+ end
171
+ opts.on("--github-site URL", "The Enterprise GitHub site where your project is hosted.") do |last|
172
+ options[:github_site] = last
173
+ end
174
+ opts.on("--github-api URL", "The enterprise endpoint to use for your GitHub API.") do |last|
175
+ options[:github_endpoint] = last
176
+ end
177
+ opts.on("--simple-list", "Create a simple list from issues and pull requests. Default is false.") do |v|
178
+ options[:simple_list] = v
179
+ end
180
+ opts.on("--future-release RELEASE-VERSION", "Put the unreleased changes in the specified release number.") do |future_release|
181
+ options[:future_release] = future_release
182
+ end
183
+ opts.on("--release-branch RELEASE-BRANCH", "Limit pull requests to the release branch, such as master or release.") do |release_branch|
184
+ options[:release_branch] = release_branch
185
+ end
186
+ opts.on("--[no-]http-cache", "Use HTTP Cache to cache GitHub API requests (useful for large repos). Default is true.") do |http_cache|
187
+ options[:http_cache] = http_cache
188
+ end
189
+ opts.on("--cache-file CACHE-FILE", "Filename to use for cache. Default is github-changelog-http-cache in a temporary directory.") do |cache_file|
190
+ options[:cache_file] = cache_file
191
+ end
192
+ opts.on("--cache-log CACHE-LOG", "Filename to use for cache log. Default is github-changelog-logger.log in a temporary directory.") do |cache_log|
193
+ options[:cache_log] = cache_log
194
+ end
195
+ opts.on("--config-file CONFIG-FILE", "Path to configuration file. Default is .github_changelog_generator.") do |config_file|
196
+ options[:config_file] = config_file
197
+ end
198
+ opts.on("--ssl-ca-file PATH", "Path to cacert.pem file. Default is a bundled lib/github_changelog_generator/ssl_certs/cacert.pem. Respects SSL_CA_PATH.") do |ssl_ca_file|
199
+ options[:ssl_ca_file] = ssl_ca_file
200
+ end
201
+ opts.on("--require x,y,z", Array, "Path to Ruby file(s) to require before generating changelog.") do |paths|
202
+ options[:require] = paths
203
+ end
204
+ opts.on("--[no-]verbose", "Run verbosely. Default is true.") do |v|
205
+ options[:verbose] = v
206
+ end
207
+ opts.on("-v", "--version", "Print version number.") do |_v|
208
+ puts "Version: #{GitHubChangelogGenerator::VERSION}"
209
+ exit
210
+ end
211
+ opts.on("-h", "--help", "Displays Help.") do
212
+ puts opts
213
+ exit
214
+ end
215
+ end
216
+ end
217
+
218
+ class << self
219
+ def banner
220
+ new.parser.banner
221
+ end
222
+ end
223
+ end
224
+ end