Commit Graph

18 Commits

Author SHA1 Message Date
Eric Putnam
587557e1ac
Refactor generation code and allow custom sections
There's a lot in this PR.
- Added a Section class to more easily make the other changes and
  hopefully add flexibility for the future
- Added an option called `configure_sections` that allows you create
  your own custom sections. It blows away all other sections and uses
only the ones you give it.
- Added an option called `add_sections` that allows you to add_sections
  to the default section set
- Added an option called `include_merged` that can be used when
  configure_sections is defined. Configure sections blows away any and
all default sections so to get this one back, you have to set this
option.
- Added tests for this stuff

@HAIL9000 was a co-author. Because of a little git snafu, I accidentally
squashed all of our work into one so it looks like it was just me.

---

Refactor details:

Before this change, the code in generator.rb and generator_generation.rb was conflated and
method call flow went back and forth between the two files seemingly
randomly. They also both defined the exact same class, which is
un-ruby-ish. I tried to separate methods used for the whole changelog
generation from methods used for specific parts of the changelog and
move them into specific classes.

I reasoned that a changelog is a series of "entries" of all tagged
releases plus an extra entry for the unreleased entry. Each entry is
comprised of a header and a series of "sections" for that entry. Each
section is comprized of a list of issues and/or pull requests for that
entry. So the log contains entries, entries contain sections, and
sections contain issues & prs. I have structured the classes around this idea.

- lib/github_changelog_generator/generator/generator.rb is for code
related to generating the entire changelog.
- lib/github_changelog_generator/generator/entry.rb is for code related
to generating entries.
- lib/github_changelog_generator/generator/section.rb is for code
relating to geneating entry sections.

Issues and PRs are already special objects, so it doesn't make sense to
break those out into their own class.
2017-12-14 16:13:41 -08:00
Saugat Acharya
d9cf6ffd94 Make 'change log' a single word (#579) 2017-12-13 22:06:00 +01:00
Olle Jonsson
deb902ae13 Add Rake options reported missing 2017-10-26 01:35:51 +02:00
Olle Jonsson
b36d85eb53 Drop Project-and-Username-finding code (#451)
* Remove Project-and-Username finding code and usages

* Remove "github_remote" option, now unused

* Update README: Usage has changed
2017-10-10 19:53:21 +02:00
Olle Jonsson
874c23c64f Chore: Rubocop 0.49.0 (#516)
* Rubocoping
2017-05-25 00:11:02 +02:00
Olle Jonsson
04215618a2 Lint: frozen-string-literal 2016-09-22 19:16:29 +02:00
Petr Korolev
4f57845465 rename methods to match of it's actions 2016-07-21 17:47:52 +03:00
Per Lundberg
408b12111d Added a missing OPTION
I noted that this was missing when trying to use it. 😄
2016-07-06 15:12:22 +03:00
Petr Korolev
857b9e6f53 rubocop updates 2016-02-23 17:19:14 +02:00
Petr Korolev
2691a3ef96 Revert "Rubocop fixes"
This reverts commit fa0267b586.
2016-02-23 17:19:14 +02:00
Petr Korolev
fa0267b586 Rubocop fixes 2016-02-23 12:25:55 +02:00
Steve Gilvarry
12bc3550e1 Fix Trailing Whitespace error
Rubocop was stopping this from building on Travis.
2016-01-03 07:11:49 +11:00
Steve Gilvarry
06a8fe8169 Add release-branch option to filter the Pull Requests by those applied on a partcular release branch 2015-11-18 16:56:27 +11:00
Olle Jonsson
3fb75c825f Lint: rename to avoid getter naming
- fixed Rake task, too
2015-10-22 00:09:25 +02:00
John Keiser
fdb89ea805 Add base option to RakeTask 2015-09-30 11:28:21 -07:00
Olle Jonsson
14d7c29808 Rake task: Be able to set false value in config 2015-09-15 00:35:07 +02:00
Raphaël Pinson
73d4415e14 Add release_url to rake task options 2015-08-24 14:55:57 +02:00
Raphaël Pinson
5d9b44eac3 Add a rake task 2015-08-05 10:26:29 +02:00