Compare commits
161 Commits
abonas-fix
...
1.10.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
670ced30e3 | ||
|
|
af97beeb60 | ||
|
|
384b080ad0 | ||
|
|
0e4c775ce4 | ||
|
|
c6eac743b6 | ||
|
|
033c7e8d79 | ||
|
|
bffe7cd9ff | ||
|
|
9832dce93c | ||
|
|
d2fa9d3565 | ||
|
|
8f7af37d1e | ||
|
|
12bc3550e1 | ||
|
|
5d5a48e00e | ||
|
|
35b581240f | ||
|
|
01a0c05a02 | ||
|
|
90ea75c471 | ||
|
|
46aaa5f205 | ||
|
|
95d32abbcb | ||
|
|
47c0332b55 | ||
|
|
c63b2e1fb9 | ||
|
|
29fd202ed0 | ||
|
|
fc1fb2eb9a | ||
|
|
afbb47ecf3 | ||
|
|
1d1965e7fb | ||
|
|
06a8fe8169 | ||
|
|
138abfe676 | ||
|
|
3fdf0c64df | ||
|
|
645f96ace6 | ||
|
|
dfdeb0e633 | ||
|
|
8d44b16e73 | ||
|
|
a6e6363cdd | ||
|
|
dd0d82ab91 | ||
|
|
8a87be8f4e | ||
|
|
8f78bb0cc6 | ||
|
|
b1d2b7d828 | ||
|
|
3fb75c825f | ||
|
|
d227464c33 | ||
|
|
5a9928c18a | ||
|
|
2dda090e6b | ||
|
|
38ddf055ae | ||
|
|
92ade3a625 | ||
|
|
3d1789a2d1 | ||
|
|
4f64cdb7d5 | ||
|
|
99ffa3692b | ||
|
|
fdb89ea805 | ||
|
|
b7fff7b764 | ||
|
|
6d36d007ad | ||
|
|
9dea79fe40 | ||
|
|
693f5ee2ee | ||
|
|
e6eb9f5bb6 | ||
|
|
916df554af | ||
|
|
d959639e2a | ||
|
|
8f61c7fc7e | ||
|
|
d79e70b267 | ||
|
|
ba7c565374 | ||
|
|
31b4294ed6 | ||
|
|
55a1c6933c | ||
|
|
125960a3a3 | ||
|
|
9feecf98b8 | ||
|
|
4b88f02f97 | ||
|
|
eccecd6875 | ||
|
|
0862e54f42 | ||
|
|
1c578fec91 | ||
|
|
29c33fec60 | ||
|
|
6c71cf439a | ||
|
|
2d7f6bf174 | ||
|
|
1e4a3db0a2 | ||
|
|
b0fc03f38c | ||
|
|
a2658f9af9 | ||
|
|
48a49a67ec | ||
|
|
93b69a511f | ||
|
|
ef97e7f950 | ||
|
|
fbd8207ff4 | ||
|
|
ff4e5612af | ||
|
|
6bace8a582 | ||
|
|
a6b0d0cb83 | ||
|
|
91176e9174 | ||
|
|
494c8afff0 | ||
|
|
d14694a6d6 | ||
|
|
aa64fa131c | ||
|
|
fe0eab1c90 | ||
|
|
14d7c29808 | ||
|
|
1bf758480f | ||
|
|
12ea21c00b | ||
|
|
6411ba6b81 | ||
|
|
302eb9c66f | ||
|
|
4bd88a3fcb | ||
|
|
61b026a60c | ||
|
|
72f993fab5 | ||
|
|
0a7c4886ec | ||
|
|
b902897a22 | ||
|
|
0df2687b93 | ||
|
|
60ddebbe1a | ||
|
|
e91b8cc535 | ||
|
|
f718a82af1 | ||
|
|
606f193ff6 | ||
|
|
5df78f22d1 | ||
|
|
b0f264a928 | ||
|
|
ea4a604bcb | ||
|
|
1ec72afe32 | ||
|
|
127ffee93f | ||
|
|
6a732ceb99 | ||
|
|
0140986091 | ||
|
|
312fe3d45a | ||
|
|
be2340ddcb | ||
|
|
f29061e75a | ||
|
|
de531262c8 | ||
|
|
35d520d251 | ||
|
|
1589df3959 | ||
|
|
a0779a5811 | ||
|
|
c611e907e0 | ||
|
|
42c94c4dd2 | ||
|
|
16f01dbda1 | ||
|
|
f285176e25 | ||
|
|
ca1ae124af | ||
|
|
672c89dcc8 | ||
|
|
5a5de9ee4a | ||
|
|
7e21aacecc | ||
|
|
a9f50cd82e | ||
|
|
0b0a762a80 | ||
|
|
0fae7e0f9e | ||
|
|
953d2813fb | ||
|
|
abd7175eef | ||
|
|
8fab94702f | ||
|
|
ef332dd02b | ||
|
|
83ae430dd8 | ||
|
|
8c0974200c | ||
|
|
28e3ed2500 | ||
|
|
1bf5644a72 | ||
|
|
bc37d0277b | ||
|
|
c4846b7ef9 | ||
|
|
d09dad30f4 | ||
|
|
31e98fbc41 | ||
|
|
82dd0b3cce | ||
|
|
1ae86e3cb2 | ||
|
|
b3eea83ae1 | ||
|
|
7e4d546f60 | ||
|
|
be62b92fa9 | ||
|
|
0b6d751388 | ||
|
|
410921f673 | ||
|
|
8b49b5ac0c | ||
|
|
d7b5d77bbf | ||
|
|
ddf2624bf9 | ||
|
|
80b40d1b36 | ||
|
|
e8e4628261 | ||
|
|
4261c3494e | ||
|
|
d138644925 | ||
|
|
0301dcb672 | ||
|
|
73d4415e14 | ||
|
|
ed179ed7be | ||
|
|
0930cfdd88 | ||
|
|
c140349a73 | ||
|
|
8c35215697 | ||
|
|
840b6666e0 | ||
|
|
7b7c6fc793 | ||
|
|
2357875c13 | ||
|
|
cac840c57d | ||
|
|
9acca33bc2 | ||
|
|
bfae7b9a45 | ||
|
|
4202b95076 | ||
|
|
b6efcfced8 | ||
|
|
63e91d8e72 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -0,0 +1 @@
|
|||||||
|
coverage/
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
cache: bundler
|
|
||||||
language: ruby
|
language: ruby
|
||||||
|
before_install:
|
||||||
|
- gem update --system
|
||||||
|
- gem install bundler
|
||||||
rvm:
|
rvm:
|
||||||
- 2.1.0
|
- 2.1.0
|
||||||
script:
|
script:
|
||||||
|
|||||||
102
CHANGELOG.md
102
CHANGELOG.md
@@ -1,5 +1,92 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [Unreleased](https://github.com/skywinder/github-changelog-generator/tree/HEAD)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.9.0...HEAD)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Rubocop: less complex methods in parser.rb [\#297](https://github.com/skywinder/github-changelog-generator/pull/297) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- Introduce ParserError exception class [\#296](https://github.com/skywinder/github-changelog-generator/pull/296) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- ParserFile: support values with equals signs [\#285](https://github.com/skywinder/github-changelog-generator/pull/285) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update bundler [\#306](https://github.com/skywinder/github-changelog-generator/pull/306) ([SteveGilvarry](https://github.com/SteveGilvarry))
|
||||||
|
- Add options to def self.user\_and\_project\_from\_git to fix parser.rb:19… [\#303](https://github.com/skywinder/github-changelog-generator/pull/303) ([SteveGilvarry](https://github.com/SteveGilvarry))
|
||||||
|
- Git ignore coverage/ [\#300](https://github.com/skywinder/github-changelog-generator/pull/300) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- \[refactor\] Fix docblock datatype, use \#map [\#299](https://github.com/skywinder/github-changelog-generator/pull/299) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- \[refactor\] Reader: positive Boolean; unused \#map [\#298](https://github.com/skywinder/github-changelog-generator/pull/298) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- Add base option to RakeTask [\#287](https://github.com/skywinder/github-changelog-generator/pull/287) ([jkeiser](https://github.com/jkeiser))
|
||||||
|
|
||||||
|
## [1.9.0](https://github.com/skywinder/github-changelog-generator/tree/1.9.0) (2015-09-17)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.5...1.9.0)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Feature: exclude\_tags using regular expression [\#281](https://github.com/skywinder/github-changelog-generator/pull/281) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- Auto parse options from file .github\_changelog\_generator [\#278](https://github.com/skywinder/github-changelog-generator/pull/278) ([dlanileonardo](https://github.com/dlanileonardo))
|
||||||
|
|
||||||
|
## [1.8.5](https://github.com/skywinder/github-changelog-generator/tree/1.8.5) (2015-09-15)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.4...1.8.5)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Rake task: Be able to set false value in config [\#279](https://github.com/skywinder/github-changelog-generator/pull/279) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
## [1.8.4](https://github.com/skywinder/github-changelog-generator/tree/1.8.4) (2015-09-01)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.3...1.8.4)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Sending OATH through -t fails [\#274](https://github.com/skywinder/github-changelog-generator/issues/274)
|
||||||
|
|
||||||
|
## [1.8.3](https://github.com/skywinder/github-changelog-generator/tree/1.8.3) (2015-08-31)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.2...1.8.3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Do not alter pull\_requests while iterating on it [\#271](https://github.com/skywinder/github-changelog-generator/pull/271) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
|
## [1.8.2](https://github.com/skywinder/github-changelog-generator/tree/1.8.2) (2015-08-26)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.1...1.8.2)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Output should not include security information [\#270](https://github.com/skywinder/github-changelog-generator/issues/270)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- This PRi will fix \#274. [\#275](https://github.com/skywinder/github-changelog-generator/pull/275) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
|
## [1.8.1](https://github.com/skywinder/github-changelog-generator/tree/1.8.1) (2015-08-25)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.0...1.8.1)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Honor labels for Pull Requests [\#266](https://github.com/skywinder/github-changelog-generator/pull/266) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fix issue with missing events \(in case of events for issue \>30\) [\#268](https://github.com/skywinder/github-changelog-generator/pull/268) ([skywinder](https://github.com/skywinder))
|
||||||
|
- Use since\_tag as default for older\_tag [\#267](https://github.com/skywinder/github-changelog-generator/pull/267) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
|
## [1.8.0](https://github.com/skywinder/github-changelog-generator/tree/1.8.0) (2015-08-24)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.7.0...1.8.0)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Generate change log since/due specific tag [\#254](https://github.com/skywinder/github-changelog-generator/issues/254)
|
||||||
|
- Add --base option [\#258](https://github.com/skywinder/github-changelog-generator/pull/258) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Add `--due-tag` option [\#265](https://github.com/skywinder/github-changelog-generator/pull/265) ([skywinder](https://github.com/skywinder))
|
||||||
|
- Add release\_url to rake task options [\#264](https://github.com/skywinder/github-changelog-generator/pull/264) ([raphink](https://github.com/raphink))
|
||||||
|
- Add a rake task [\#260](https://github.com/skywinder/github-changelog-generator/pull/260) ([raphink](https://github.com/raphink))
|
||||||
|
- Add release\_url option [\#259](https://github.com/skywinder/github-changelog-generator/pull/259) ([raphink](https://github.com/raphink))
|
||||||
|
- Add --since-tag [\#257](https://github.com/skywinder/github-changelog-generator/pull/257) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
## [1.7.0](https://github.com/skywinder/github-changelog-generator/tree/1.7.0) (2015-07-16)
|
## [1.7.0](https://github.com/skywinder/github-changelog-generator/tree/1.7.0) (2015-07-16)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.6.2...1.7.0)
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.6.2...1.7.0)
|
||||||
|
|
||||||
@@ -79,6 +166,7 @@
|
|||||||
|
|
||||||
- Parsing of existing Change Log file [\#212](https://github.com/skywinder/github-changelog-generator/issues/212)
|
- Parsing of existing Change Log file [\#212](https://github.com/skywinder/github-changelog-generator/issues/212)
|
||||||
- Warn users about 0 tags in repo. [\#208](https://github.com/skywinder/github-changelog-generator/issues/208)
|
- Warn users about 0 tags in repo. [\#208](https://github.com/skywinder/github-changelog-generator/issues/208)
|
||||||
|
- Cleanup [\#220](https://github.com/skywinder/github-changelog-generator/pull/220) ([tuexss](https://github.com/tuexss))
|
||||||
|
|
||||||
**Closed issues:**
|
**Closed issues:**
|
||||||
|
|
||||||
@@ -88,7 +176,6 @@
|
|||||||
|
|
||||||
- Implement fetcher class [\#227](https://github.com/skywinder/github-changelog-generator/pull/227) ([skywinder](https://github.com/skywinder))
|
- Implement fetcher class [\#227](https://github.com/skywinder/github-changelog-generator/pull/227) ([skywinder](https://github.com/skywinder))
|
||||||
- Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder))
|
- Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder))
|
||||||
- Cleanup [\#220](https://github.com/skywinder/github-changelog-generator/pull/220) ([tuexss](https://github.com/tuexss))
|
|
||||||
- Rspec & rubocop integration [\#217](https://github.com/skywinder/github-changelog-generator/pull/217) ([skywinder](https://github.com/skywinder))
|
- Rspec & rubocop integration [\#217](https://github.com/skywinder/github-changelog-generator/pull/217) ([skywinder](https://github.com/skywinder))
|
||||||
- Implement Reader class to parse ChangeLog.md [\#216](https://github.com/skywinder/github-changelog-generator/pull/216) ([estahn](https://github.com/estahn))
|
- Implement Reader class to parse ChangeLog.md [\#216](https://github.com/skywinder/github-changelog-generator/pull/216) ([estahn](https://github.com/estahn))
|
||||||
- Relatively require github\_changelog\_generator library [\#207](https://github.com/skywinder/github-changelog-generator/pull/207) ([sneal](https://github.com/sneal))
|
- Relatively require github\_changelog\_generator library [\#207](https://github.com/skywinder/github-changelog-generator/pull/207) ([sneal](https://github.com/sneal))
|
||||||
@@ -104,7 +191,7 @@
|
|||||||
## [1.3.10](https://github.com/skywinder/github-changelog-generator/tree/1.3.10) (2015-03-18)
|
## [1.3.10](https://github.com/skywinder/github-changelog-generator/tree/1.3.10) (2015-03-18)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.3.9...1.3.10)
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.3.9...1.3.10)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
- Fix termination in case of empty unreleased section with `--unreleased-only` option. [\#70](https://github.com/skywinder/github-changelog-generator/pull/70) ([skywinder](https://github.com/skywinder))
|
- Fix termination in case of empty unreleased section with `--unreleased-only` option. [\#70](https://github.com/skywinder/github-changelog-generator/pull/70) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
@@ -115,7 +202,7 @@
|
|||||||
|
|
||||||
- Improve method of detecting owner and repository [\#63](https://github.com/skywinder/github-changelog-generator/issues/63)
|
- Improve method of detecting owner and repository [\#63](https://github.com/skywinder/github-changelog-generator/issues/63)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
- Resolved concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/github-changelog-generator/pull/65) ([skywinder](https://github.com/skywinder))
|
- Resolved concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/github-changelog-generator/pull/65) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
@@ -189,7 +276,7 @@
|
|||||||
## [1.2.7](https://github.com/skywinder/github-changelog-generator/tree/1.2.7) (2015-01-26)
|
## [1.2.7](https://github.com/skywinder/github-changelog-generator/tree/1.2.7) (2015-01-26)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.2.6...1.2.7)
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.2.6...1.2.7)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
- Add compare link between older version and newer version [\#46](https://github.com/skywinder/github-changelog-generator/pull/46) ([sue445](https://github.com/sue445))
|
- Add compare link between older version and newer version [\#46](https://github.com/skywinder/github-changelog-generator/pull/46) ([sue445](https://github.com/sue445))
|
||||||
|
|
||||||
@@ -206,15 +293,12 @@
|
|||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
- Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/github-changelog-generator/issues/22)
|
- Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/github-changelog-generator/issues/22)
|
||||||
|
- support enterprise github via command line options [\#42](https://github.com/skywinder/github-changelog-generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
- Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/github-changelog-generator/issues/32)
|
- Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/github-changelog-generator/issues/32)
|
||||||
|
|
||||||
**Merged pull requests:**
|
|
||||||
|
|
||||||
- PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/github-changelog-generator/pull/43) ([schwing](https://github.com/schwing))
|
- PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/github-changelog-generator/pull/43) ([schwing](https://github.com/schwing))
|
||||||
- support enterprise github via command line options [\#42](https://github.com/skywinder/github-changelog-generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
|
||||||
|
|
||||||
## [1.2.4](https://github.com/skywinder/github-changelog-generator/tree/1.2.4) (2014-12-16)
|
## [1.2.4](https://github.com/skywinder/github-changelog-generator/tree/1.2.4) (2014-12-16)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.2.3...1.2.4)
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.2.3...1.2.4)
|
||||||
@@ -323,6 +407,7 @@
|
|||||||
|
|
||||||
- Add support for fixed issues and implemented enchanments. [\#6](https://github.com/skywinder/github-changelog-generator/issues/6)
|
- Add support for fixed issues and implemented enchanments. [\#6](https://github.com/skywinder/github-changelog-generator/issues/6)
|
||||||
- Implement option to specify output filename [\#4](https://github.com/skywinder/github-changelog-generator/issues/4)
|
- Implement option to specify output filename [\#4](https://github.com/skywinder/github-changelog-generator/issues/4)
|
||||||
|
- Implement support of different tags. [\#8](https://github.com/skywinder/github-changelog-generator/pull/8) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -330,7 +415,6 @@
|
|||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Implement support of different tags. [\#8](https://github.com/skywinder/github-changelog-generator/pull/8) ([skywinder](https://github.com/skywinder))
|
|
||||||
- Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/github-changelog-generator/pull/7) ([skywinder](https://github.com/skywinder))
|
- Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/github-changelog-generator/pull/7) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
## [0.1.0](https://github.com/skywinder/github-changelog-generator/tree/0.1.0) (2014-11-07)
|
## [0.1.0](https://github.com/skywinder/github-changelog-generator/tree/0.1.0) (2014-11-07)
|
||||||
|
|||||||
11
Gemfile.lock
11
Gemfile.lock
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
github_changelog_generator (1.7.0)
|
github_changelog_generator (1.9.0)
|
||||||
colorize (~> 0.7)
|
colorize (~> 0.7)
|
||||||
github_api (~> 0.12)
|
github_api (~> 0.12)
|
||||||
|
|
||||||
@@ -29,13 +29,13 @@ GEM
|
|||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
faraday (0.9.1)
|
faraday (0.9.1)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
github_api (0.12.3)
|
github_api (0.12.4)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
descendants_tracker (~> 0.0.4)
|
descendants_tracker (~> 0.0.4)
|
||||||
faraday (~> 0.8, < 0.10)
|
faraday (~> 0.8, < 0.10)
|
||||||
hashie (>= 3.3)
|
hashie (>= 3.4)
|
||||||
multi_json (>= 1.7.5, < 2.0)
|
multi_json (>= 1.7.5, < 2.0)
|
||||||
nokogiri (~> 1.6.3)
|
nokogiri (~> 1.6.6)
|
||||||
oauth2
|
oauth2
|
||||||
hashie (3.4.2)
|
hashie (3.4.2)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.2)
|
||||||
@@ -112,3 +112,6 @@ DEPENDENCIES
|
|||||||
rspec (~> 3.2)
|
rspec (~> 3.2)
|
||||||
rubocop (~> 0.31)
|
rubocop (~> 0.31)
|
||||||
simplecov (~> 0.10)
|
simplecov (~> 0.10)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.10.6
|
||||||
|
|||||||
434
README.md
434
README.md
@@ -1,208 +1,228 @@
|
|||||||
[](http://badge.fury.io/rb/github_changelog_generator)
|
[](http://badge.fury.io/rb/github_changelog_generator)
|
||||||
[](https://gemnasium.com/skywinder/github-changelog-generator)
|
[](https://gemnasium.com/skywinder/github-changelog-generator)
|
||||||
[](https://travis-ci.org/skywinder/github-changelog-generator)
|
[](https://travis-ci.org/skywinder/github-changelog-generator)
|
||||||
[](http://inch-ci.org/github/skywinder/github-changelog-generator)
|
[](http://inch-ci.org/github/skywinder/github-changelog-generator)
|
||||||
[](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
[](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
||||||
[](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
[](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
||||||
|
|
||||||
GitHub Changelog Generator 
|
GitHub Changelog Generator 
|
||||||
==================
|
==================
|
||||||
|
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Output example](#output-example)
|
- [Output example](#output-example)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
- [Params](#params)
|
- [Params](#params)
|
||||||
- [GitHub token](#github-token)
|
- [GitHub token](#github-token)
|
||||||
- [Features and advantages of this project](#features-and-advantages-of-this-project)
|
- [Features and advantages of this project](#features-and-advantages-of-this-project)
|
||||||
- [Alternatives](#alternatives)
|
- [Alternatives](#alternatives)
|
||||||
- [Projects using this library](#projects-using-this-library)
|
- [Projects using this library](#projects-using-this-library)
|
||||||
- [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
|
- [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
|
|
||||||
### Changelog generation has never been so easy:
|
### Changelog generation has never been so easy:
|
||||||
|
|
||||||
**Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according labels) from :octocat: GitHub Issue Tracker.
|
**Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according labels) from :octocat: GitHub Issue Tracker.
|
||||||
|
|
||||||
Since now you don't have to fill your `CHANGELOG.md` manually: just run the script, relax and take a cup of :coffee: before your next release! :tada:
|
Since now you don't have to fill your `CHANGELOG.md` manually: just run the script, relax and take a cup of :coffee: before your next release! :tada:
|
||||||
|
|
||||||
>### *What’s the point of a change log?*
|
>### *What’s the point of a change log?*
|
||||||
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.
|
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.
|
||||||
### *Why should I care?*
|
### *Why should I care?*
|
||||||
Because software tools are for people. If you don’t care, why are you contributing to open source? Surely, there must be a kernel (ha!) of care somewhere in that lovely little brain of yours.
|
Because software tools are for people. If you don’t care, why are you contributing to open source? Surely, there must be a kernel (ha!) of care somewhere in that lovely little brain of yours.
|
||||||
|
|
||||||
> :copyright: *[http://keepachangelog.com](http://keepachangelog.com/)*
|
> :arrow_right: *[http://keepachangelog.com](http://keepachangelog.com/)*
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[sudo] gem install github_changelog_generator
|
[sudo] gem install github_changelog_generator
|
||||||
|
|
||||||
## Output example
|
## Output example
|
||||||
|
|
||||||
- Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
|
- Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
|
||||||
- [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
|
- [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
|
||||||
|
|
||||||
github_changelog_generator -u skywinder -p ActionSheetPicker-3.0
|
github_changelog_generator -u skywinder -p ActionSheetPicker-3.0
|
||||||
|
|
||||||
- In general it looks like this:
|
- In general it looks like this:
|
||||||
|
|
||||||
> ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
|
> ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
|
||||||
>
|
>
|
||||||
> [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
> [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
||||||
>
|
>
|
||||||
> **Implemented enhancements:**
|
> **Implemented enhancements:**
|
||||||
>
|
>
|
||||||
> - Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
> - Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
||||||
>
|
>
|
||||||
> **Fixed bugs:**
|
> **Fixed bugs:**
|
||||||
>
|
>
|
||||||
> - Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
> - Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
||||||
>
|
>
|
||||||
> **Merged pull requests:**
|
> **Merged pull requests:**
|
||||||
>
|
>
|
||||||
> - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
> - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
||||||
>
|
>
|
||||||
> - support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
> - support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
**It's really simple**:
|
**It's really simple**:
|
||||||
|
|
||||||
- If your **git remote** `origin` refers to your GitHub repo, then just go to your project folder and run:
|
- If your **git remote** `origin` refers to your GitHub repo, then just go to your project folder and run:
|
||||||
|
|
||||||
github_changelog_generator
|
github_changelog_generator
|
||||||
|
|
||||||
- or from anywhere:
|
- or from anywhere:
|
||||||
- `github_changelog_generator -u github_username -p github_project`
|
- `github_changelog_generator -u github_username -p github_project`
|
||||||
- `github_changelog_generator github_username/github_project`
|
- `github_changelog_generator github_username/github_project`
|
||||||
|
|
||||||
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
||||||
|
|
||||||
### Params
|
### Params
|
||||||
Type `github_changelog_generator --help` for details.
|
Type `github_changelog_generator --help` for details.
|
||||||
|
|
||||||
More detailed info about params you can find in Wiki page: [**Advanced change log generation examples**](https://github.com/skywinder/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
|
More detailed info about params you can find in Wiki page: [**Advanced change log generation examples**](https://github.com/skywinder/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
|
||||||
|
|
||||||
### GitHub token
|
### Params File
|
||||||
|
You can put Params in a .github_changelog_generator file in Project Root to override default params:
|
||||||
Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
|
|
||||||
|
Example:
|
||||||
**You can easily [generate it here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token)**.
|
```
|
||||||
|
unreleased=false
|
||||||
And:
|
future-release=5.0.0
|
||||||
|
since-tag=1.0.0
|
||||||
- Run with key `-t [your-16-digit-token]`
|
```
|
||||||
- Or set environment variable `CHANGELOG_GITHUB_TOKEN` and specify there your token.
|
|
||||||
|
### GitHub token
|
||||||
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string :
|
|
||||||
|
Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
|
||||||
export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"
|
|
||||||
|
**You can easily [generate it here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token)**.
|
||||||
So, if you got error like this:
|
|
||||||
>! /Library/Ruby/Gems/2.0.0/gems/github_api-0.12.2/lib/github_api/response/raise_error.rb:14:in `on_complete'
|
And:
|
||||||
|
|
||||||
It's time to create this token or wait for 1 hour before GitHub reset the counter for your IP.
|
- Run with key `-t [your-40-digit-token]`
|
||||||
|
- Or set environment variable `CHANGELOG_GITHUB_TOKEN` and specify there your token.
|
||||||
|
|
||||||
### Rake task
|
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string :
|
||||||
|
|
||||||
You love Rake? So do we! And so we've made it easier for you by providing a Rake task library for your Change log generation. In your Rakefile, use:
|
export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"
|
||||||
|
|
||||||
```ruby
|
So, if you got error like this:
|
||||||
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
>! /Library/Ruby/Gems/2.0.0/gems/github_api-0.12.2/lib/github_api/response/raise_error.rb:14:in `on_complete'
|
||||||
config.since_tag = '0.1.14'
|
|
||||||
config.future_release = '0.2.0'
|
It's time to create this token or wait for 1 hour before GitHub reset the counter for your IP.
|
||||||
end
|
|
||||||
```
|
## Migrating from a manual changelog
|
||||||
|
|
||||||
All command line options can be passed to the Rake task as `config` parameters. Since you're naming the Rake task yourself, you can create as many as you want, too.
|
Knowing how dedicated you are to your project, you probably haven't been waiting for github-changelog-generator to keep a changelog,
|
||||||
|
but you most likely wouldn't like to have to open issues and PRs for all past features listed in your historic changelog.
|
||||||
##Features and advantages of this project
|
|
||||||
- Generate canonical, neat change log file, followed by [basic change log guidelines](http://keepachangelog.com/) :gem:
|
That's where `--base` comes handy. This option lets you pass a static changelog to be appended at the end of the generated entries.
|
||||||
- Possible to generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
|
|
||||||
- **GitHub Enterprise support** via command line options! :factory:
|
If you have a `HISTORY.md` file in your project, it will automatically be picked as the static historical changelog and appended.
|
||||||
- Flexible format **customisation**:
|
|
||||||
- **Customize** issues, that **should be added** to changelog :eight_spoked_asterisk:
|
### Rake task
|
||||||
- **Custom date format** supported (but get in mind [ISO 8601](http://xkcd.com/1179/) ) :date:
|
|
||||||
- Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version :pushpin:
|
You love Rake? So do we! And so we've made it easier for you by providing a Rake task library for your Change log generation. In your Rakefile, use:
|
||||||
- Automatically **exclude specific issues**, not-related to change log (any issue, that has label `question` `duplicate` `invalid` `wontfix`by default) :scissors:
|
|
||||||
- **Distinguish** issues **according labels**. :mag_right:
|
```ruby
|
||||||
- Merged pull requests (all `merged` pull-requests) :twisted_rightwards_arrows:
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
||||||
- Bug fixes (by label `bug` in issue) :beetle:
|
config.since_tag = '0.1.14'
|
||||||
- Enhancements (by label `enhancement` in issue) :star2:
|
config.future_release = '0.2.0'
|
||||||
- Issues (closed issues `w/o any labels`) :non-potable_water:
|
end
|
||||||
|
```
|
||||||
- You can manually set which labels should be included/excluded. :wrench:
|
|
||||||
- Apply a lot of other customisations, to fit changelog for your personal style :tophat:
|
All command line options can be passed to the Rake task as `config` parameters. Since you're naming the Rake task yourself, you can create as many as you want, too.
|
||||||
(*look `github_changelog_generator --help` for details)*
|
|
||||||
|
##Features and advantages of this project
|
||||||
|
- Generate canonical, neat change log file, followed by [basic change log guidelines](http://keepachangelog.com/) :gem:
|
||||||
###Alternatives
|
- Possible to generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
|
||||||
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But none satisfied my requirements.
|
- **GitHub Enterprise support** via command line options! :factory:
|
||||||
|
- Flexible format **customisation**:
|
||||||
*If you know other projects - feel free to edit this Wiki page!*
|
- **Customize** issues, that **should be added** to changelog :eight_spoked_asterisk:
|
||||||
|
- **Custom date format** supported (but get in mind [ISO 8601](http://xkcd.com/1179/) ) :date:
|
||||||
|
- Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version :pushpin:
|
||||||
### Projects using this library
|
- Automatically **exclude specific issues**, not-related to change log (any issue, that has label `question` `duplicate` `invalid` `wontfix`by default) :scissors:
|
||||||
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
|
- **Distinguish** issues **according labels**. :mag_right:
|
||||||
|
- Merged pull requests (all `merged` pull-requests) :twisted_rightwards_arrows:
|
||||||
|
- Bug fixes (by label `bug` in issue) :beetle:
|
||||||
|
- Enhancements (by label `enhancement` in issue) :star2:
|
||||||
|
- Issues (closed issues `w/o any labels`) :non-potable_water:
|
||||||
|
|
||||||
|
- You can manually set which labels should be included/excluded. :wrench:
|
||||||
|
- Apply a lot of other customisations, to fit changelog for your personal style :tophat:
|
||||||
|
(*look `github_changelog_generator --help` for details)*
|
||||||
|
|
||||||
|
|
||||||
|
###Alternatives
|
||||||
|
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But none satisfied my requirements.
|
||||||
|
|
||||||
|
*If you know other projects - feel free to edit this Wiki page!*
|
||||||
|
|
||||||
|
|
||||||
|
### Projects using this library
|
||||||
|
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
|
*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
|
||||||
|
|
||||||
## Am I missing some essential feature?
|
## Am I missing some essential feature?
|
||||||
|
|
||||||
- **Nothing is impossible!**
|
- **Nothing is impossible!**
|
||||||
|
|
||||||
- Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
|
- Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
|
||||||
|
|
||||||
- *Bug reports, feature requests, patches, well-wishes are always welcome* :heavy_exclamation_mark:
|
- *Bug reports, feature requests, patches, well-wishes are always welcome* :heavy_exclamation_mark:
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
- ***I already use GitHub Releases. Why do I need this?***
|
- ***I already use GitHub Releases. Why do I need this?***
|
||||||
|
|
||||||
GitHub Releases is a very good thing. And it's very good practice to maintain it (not so much people using it yet)! :congratulations:
|
GitHub Releases is a very good thing. And it's very good practice to maintain it (not so much people using it yet)! :congratulations:
|
||||||
|
|
||||||
*BDW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
|
*BDW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
|
||||||
|
|
||||||
I'm not try to compare quality of auto-generated and manually generated logs.. but:
|
I'm not try to compare quality of auto-generated and manually generated logs.. but:
|
||||||
|
|
||||||
The auto generated Changelog really helps even if you manually fill Releases notes!
|
The auto generated Changelog really helps even if you manually fill Releases notes!
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
When I found a closed bug - it's very useful to understand, in which release it was fixed. In that case you can easily find this issue by \# in `CHANGELOG.md`.
|
When I found a closed bug - it's very useful to understand, in which release it was fixed. In that case you can easily find this issue by \# in `CHANGELOG.md`.
|
||||||
|
|
||||||
- it's not so quite easy to find it in manually filled Releases notes.
|
- it's not so quite easy to find it in manually filled Releases notes.
|
||||||
- this file can also help you to build your Release note and not miss features in manually-filled list.
|
- this file can also help you to build your Release note and not miss features in manually-filled list.
|
||||||
|
|
||||||
In the end:
|
In the end:
|
||||||
|
|
||||||
I think, that GitHub Releases is more for end-users.
|
I think, that GitHub Releases is more for end-users.
|
||||||
But `CHANGELOG.md` could stay in the repo for developers with detailed list of changes.
|
But `CHANGELOG.md` could stay in the repo for developers with detailed list of changes.
|
||||||
And it's nothing bad to combine GitHub Releases and `CHANGELOG.md` file together in that manner.
|
And it's nothing bad to combine GitHub Releases and `CHANGELOG.md` file together in that manner.
|
||||||
|
|
||||||
- ***I received a warning: GitHub API rate limit exceed, what does this mean?***
|
- ***I received a warning: GitHub API rate limit exceed, what does this mean?***
|
||||||
|
|
||||||
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 allows you to make up to 60 requests per hour. Unauthenticated requests are associated with your IP address, and not the user making requests.
|
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 allows you to make up to 60 requests per hour. Unauthenticated requests are associated with your IP address, and not the user making requests.
|
||||||
|
|
||||||
If you're seeing this warning:
|
If you're seeing this warning:
|
||||||
|
|
||||||
1. Make sure you're providing an OAuth token so you're not anonymously making requests. This will increase the number of requests from 60 to 5000 per hour.
|
1. Make sure you're providing an OAuth token so you're not anonymously making requests. This will increase the number of requests from 60 to 5000 per hour.
|
||||||
2. You probably have a large repo with lots of issues/PRs. You can use the `--max-issues NUM` argument to limit the number of issues that are pulled back. For example: `--max-issues 1000`
|
2. You probably have a large repo with lots of issues/PRs. You can use the `--max-issues NUM` argument to limit the number of issues that are pulled back. For example: `--max-issues 1000`
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
1. Create an issue to discuss about your idea
|
1. Create an issue to discuss about your idea
|
||||||
2. [Fork it] (https://github.com/skywinder/Github-Changelog-Generator/fork)
|
2. [Fork it] (https://github.com/skywinder/Github-Changelog-Generator/fork)
|
||||||
3. Create your feature branch (`git checkout -b my-new-feature`)
|
3. Create your feature branch (`git checkout -b my-new-feature`)
|
||||||
4. Commit your changes (`git commit -am 'Add some feature'`)
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
||||||
5. Push to the branch (`git push origin my-new-feature`)
|
5. Push to the branch (`git push origin my-new-feature`)
|
||||||
6. Create a new Pull Request
|
6. Create a new Pull Request
|
||||||
7. Profit! :white_check_mark:
|
7. Profit! :white_check_mark:
|
||||||
|
|
||||||
## License
|
*To test change log workflow you can use [test repo](https://github.com/skywinder/changelog_test/)*
|
||||||
|
|
||||||
Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
## License
|
||||||
|
|
||||||
|
Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
- Enchancment [\#9](https://github.com/skywinder/changelog_test/issues/9)
|
- Enchancment [\#9](https://github.com/skywinder/changelog_test/issues/9)
|
||||||
|
- PR with enhancement label [\#16](https://github.com/skywinder/changelog_test/pull/16) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -21,6 +22,8 @@
|
|||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Merged br \(should appear in change log also\) [\#21](https://github.com/skywinder/changelog_test/pull/21) ([skywinder](https://github.com/skywinder))
|
||||||
|
- This a PR with a lot of comments and events [\#17](https://github.com/skywinder/changelog_test/pull/17) ([skywinder](https://github.com/skywinder))
|
||||||
- This PR closes 14 from commit [\#15](https://github.com/skywinder/changelog_test/pull/15) ([skywinder](https://github.com/skywinder))
|
- This PR closes 14 from commit [\#15](https://github.com/skywinder/changelog_test/pull/15) ([skywinder](https://github.com/skywinder))
|
||||||
- This PR to close \#12 from body [\#13](https://github.com/skywinder/changelog_test/pull/13) ([skywinder](https://github.com/skywinder))
|
- This PR to close \#12 from body [\#13](https://github.com/skywinder/changelog_test/pull/13) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ require "benchmark"
|
|||||||
|
|
||||||
require_relative "github_changelog_generator/helper"
|
require_relative "github_changelog_generator/helper"
|
||||||
require_relative "github_changelog_generator/parser"
|
require_relative "github_changelog_generator/parser"
|
||||||
|
require_relative "github_changelog_generator/parser_file"
|
||||||
require_relative "github_changelog_generator/generator/generator"
|
require_relative "github_changelog_generator/generator/generator"
|
||||||
require_relative "github_changelog_generator/version"
|
require_relative "github_changelog_generator/version"
|
||||||
require_relative "github_changelog_generator/reader"
|
require_relative "github_changelog_generator/reader"
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ module GitHubChangelogGenerator
|
|||||||
@user = @options[:user]
|
@user = @options[:user]
|
||||||
@project = @options[:project]
|
@project = @options[:project]
|
||||||
@github_token = fetch_github_token
|
@github_token = fetch_github_token
|
||||||
github_options = { per_page: PER_PAGE_NUMBER }
|
@github_options = { per_page: PER_PAGE_NUMBER }
|
||||||
github_options[:oauth_token] = @github_token unless @github_token.nil?
|
@github_options[:oauth_token] = @github_token unless @github_token.nil?
|
||||||
github_options[:endpoint] = @options[:github_endpoint] unless @options[:github_endpoint].nil?
|
@github_options[:endpoint] = @options[:github_endpoint] unless @options[:github_endpoint].nil?
|
||||||
github_options[:site] = @options[:github_endpoint] unless @options[:github_site].nil?
|
@github_options[:site] = @options[:github_endpoint] unless @options[:github_site].nil?
|
||||||
|
|
||||||
@github = check_github_response { Github.new github_options }
|
@github = check_github_response { Github.new @github_options }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns GitHub token. First try to use variable, provided by --token option,
|
# Returns GitHub token. First try to use variable, provided by --token option,
|
||||||
@@ -123,7 +123,16 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|||||||
def fetch_closed_pull_requests
|
def fetch_closed_pull_requests
|
||||||
pull_requests = []
|
pull_requests = []
|
||||||
begin
|
begin
|
||||||
response = @github.pull_requests.list @options[:user], @options[:project], state: "closed"
|
if @options[:release_branch].nil?
|
||||||
|
response = @github.pull_requests.list @options[:user],
|
||||||
|
@options[:project],
|
||||||
|
state: "closed"
|
||||||
|
else
|
||||||
|
response = @github.pull_requests.list @options[:user],
|
||||||
|
@options[:project],
|
||||||
|
state: "closed",
|
||||||
|
base: @options[:release_branch]
|
||||||
|
end
|
||||||
page_i = 0
|
page_i = 0
|
||||||
count_pages = response.count_pages
|
count_pages = response.count_pages
|
||||||
response.each_page do |page|
|
response.each_page do |page|
|
||||||
@@ -163,10 +172,13 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|||||||
issues_slice.each do |issue|
|
issues_slice.each do |issue|
|
||||||
threads << Thread.new do
|
threads << Thread.new do
|
||||||
begin
|
begin
|
||||||
obj = @github.issues.events.list user: @options[:user],
|
response = @github.issues.events.list user: @options[:user],
|
||||||
repo: @options[:project],
|
repo: @options[:project],
|
||||||
issue_number: issue["number"]
|
issue_number: issue["number"]
|
||||||
issue[:events] = obj.body
|
issue[:events] = []
|
||||||
|
response.each_page do |page|
|
||||||
|
issue[:events].concat(page)
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
if @options[:issues]
|
if @options[:issues]
|
||||||
# Generate issues:
|
# Generate issues:
|
||||||
log += issues_to_log(issues)
|
log += issues_to_log(issues, pull_requests)
|
||||||
end
|
end
|
||||||
|
|
||||||
if @options[:pulls]
|
if @options[:pulls]
|
||||||
@@ -77,13 +77,14 @@ module GitHubChangelogGenerator
|
|||||||
log
|
log
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate ready-to-paste log from list of issues.
|
# Generate ready-to-paste log from list of issues and pull requests.
|
||||||
#
|
#
|
||||||
# @param [Array] issues
|
# @param [Array] issues
|
||||||
|
# @param [Array] pull_requests
|
||||||
# @return [String] generated log for issues
|
# @return [String] generated log for issues
|
||||||
def issues_to_log(issues)
|
def issues_to_log(issues, pull_requests)
|
||||||
log = ""
|
log = ""
|
||||||
bugs_a, enhancement_a, issues_a = parse_by_sections(issues)
|
bugs_a, enhancement_a, issues_a = parse_by_sections(issues, pull_requests)
|
||||||
|
|
||||||
log += generate_sub_section(enhancement_a, @options[:enhancement_prefix])
|
log += generate_sub_section(enhancement_a, @options[:enhancement_prefix])
|
||||||
log += generate_sub_section(bugs_a, @options[:bug_prefix])
|
log += generate_sub_section(bugs_a, @options[:bug_prefix])
|
||||||
@@ -95,8 +96,9 @@ module GitHubChangelogGenerator
|
|||||||
# (bugs, features, or just closed issues) by labels
|
# (bugs, features, or just closed issues) by labels
|
||||||
#
|
#
|
||||||
# @param [Array] issues
|
# @param [Array] issues
|
||||||
|
# @param [Array] pull_requests
|
||||||
# @return [Array] tuple of filtered arrays: (Bugs, Enhancements Issues)
|
# @return [Array] tuple of filtered arrays: (Bugs, Enhancements Issues)
|
||||||
def parse_by_sections(issues)
|
def parse_by_sections(issues, pull_requests)
|
||||||
issues_a = []
|
issues_a = []
|
||||||
enhancement_a = []
|
enhancement_a = []
|
||||||
bugs_a = []
|
bugs_a = []
|
||||||
@@ -117,6 +119,24 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
issues_a.push dict unless added
|
issues_a.push dict unless added
|
||||||
end
|
end
|
||||||
|
|
||||||
|
added_pull_requests = []
|
||||||
|
pull_requests.each do |dict|
|
||||||
|
dict.labels.each do |label|
|
||||||
|
if @options[:bug_labels].include? label.name
|
||||||
|
bugs_a.push dict
|
||||||
|
added_pull_requests.push dict
|
||||||
|
next
|
||||||
|
end
|
||||||
|
if @options[:enhancement_labels].include? label.name
|
||||||
|
enhancement_a.push dict
|
||||||
|
added_pull_requests.push dict
|
||||||
|
next
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
added_pull_requests.each { |p| pull_requests.delete(p) }
|
||||||
|
|
||||||
[bugs_a, enhancement_a, issues_a]
|
[bugs_a, enhancement_a, issues_a]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ module GitHubChangelogGenerator
|
|||||||
# Fill :actual_date parameter of specified issue by closed date of the commit, if it was closed by commit.
|
# Fill :actual_date parameter of specified issue by closed date of the commit, if it was closed by commit.
|
||||||
# @param [Hash] issue
|
# @param [Hash] issue
|
||||||
def find_closed_date_by_commit(issue)
|
def find_closed_date_by_commit(issue)
|
||||||
unless issue["events"].nil?
|
unless issue[:events].nil?
|
||||||
# if it's PR -> then find "merged event", in case of usual issue -> fond closed date
|
# if it's PR -> then find "merged event", in case of usual issue -> fond closed date
|
||||||
compare_string = issue[:merged_at].nil? ? "closed" : "merged"
|
compare_string = issue[:merged_at].nil? ? "closed" : "merged"
|
||||||
# reverse! - to find latest closed event. (event goes in date order)
|
# reverse! - to find latest closed event. (event goes in date order)
|
||||||
issue["events"].reverse!.each do |event|
|
issue[:events].reverse!.each do |event|
|
||||||
if event[:event].eql? compare_string
|
if event[:event].eql? compare_string
|
||||||
set_date_from_event(event, issue)
|
set_date_from_event(event, issue)
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ module GitHubChangelogGenerator
|
|||||||
log += generate_log_for_all_tags
|
log += generate_log_for_all_tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
log += File.read(@options[:base]) if File.file?(@options[:base])
|
||||||
|
|
||||||
log += "\n\n\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
|
log += "\n\n\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
|
||||||
@log = log
|
@log = log
|
||||||
end
|
end
|
||||||
@@ -49,9 +51,8 @@ module GitHubChangelogGenerator
|
|||||||
def generate_sub_section(issues, prefix)
|
def generate_sub_section(issues, prefix)
|
||||||
log = ""
|
log = ""
|
||||||
|
|
||||||
log += "#{prefix}\n\n" if options[:simple_list] != true && issues.any?
|
|
||||||
|
|
||||||
if issues.any?
|
if issues.any?
|
||||||
|
log += "#{prefix}\n\n" unless options[:simple_list]
|
||||||
issues.each do |issue|
|
issues.each do |issue|
|
||||||
merge_string = get_string_for_issue(issue)
|
merge_string = get_string_for_issue(issue)
|
||||||
log += "- #{merge_string}\n"
|
log += "- #{merge_string}\n"
|
||||||
@@ -101,7 +102,7 @@ module GitHubChangelogGenerator
|
|||||||
def generate_log_between_tags(older_tag, newer_tag)
|
def generate_log_between_tags(older_tag, newer_tag)
|
||||||
filtered_issues, filtered_pull_requests = filter_issues_for_tags(newer_tag, older_tag)
|
filtered_issues, filtered_pull_requests = filter_issues_for_tags(newer_tag, older_tag)
|
||||||
|
|
||||||
older_tag_name = older_tag.nil? ? nil : older_tag["name"]
|
older_tag_name = older_tag.nil? ? detect_since_tag : older_tag["name"]
|
||||||
|
|
||||||
if newer_tag.nil? && filtered_issues.empty? && filtered_pull_requests.empty?
|
if newer_tag.nil? && filtered_issues.empty? && filtered_pull_requests.empty?
|
||||||
# do not generate empty unreleased section
|
# do not generate empty unreleased section
|
||||||
|
|||||||
@@ -63,21 +63,21 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Method filter issues, that belong only specified tag range
|
# Method filter issues, that belong only specified tag range
|
||||||
# @param [Array] array of issues to filter
|
# @param [Array] issues issues to filter
|
||||||
# @param [Symbol] hash_key key of date value default is :actual_date
|
# @param [Symbol] hash_key key of date value default is :actual_date
|
||||||
# @param [String] older_tag all issues before this tag date will be excluded. May be nil, if it's first tag
|
# @param [String] older_tag all issues before this tag date will be excluded. May be nil, if it's first tag
|
||||||
# @param [String] newer_tag all issue after this tag will be excluded. May be nil for unreleased section
|
# @param [String] newer_tag all issue after this tag will be excluded. May be nil for unreleased section
|
||||||
# @return [Array] filtered issues
|
# @return [Array] filtered issues
|
||||||
def delete_by_time(array, hash_key = :actual_date, older_tag = nil, newer_tag = nil)
|
def delete_by_time(issues, hash_key = :actual_date, older_tag = nil, newer_tag = nil)
|
||||||
# in case if not tags specified - return unchanged array
|
# in case if not tags specified - return unchanged array
|
||||||
return array if older_tag.nil? && newer_tag.nil?
|
return issues if older_tag.nil? && newer_tag.nil?
|
||||||
|
|
||||||
newer_tag_time = newer_tag && get_time_of_tag(newer_tag)
|
newer_tag_time = newer_tag && get_time_of_tag(newer_tag)
|
||||||
older_tag_time = older_tag && get_time_of_tag(older_tag)
|
older_tag_time = older_tag && get_time_of_tag(older_tag)
|
||||||
|
|
||||||
array.select do |req|
|
issues.select do |issue|
|
||||||
if req[hash_key]
|
if issue[hash_key]
|
||||||
time = Time.parse(req[hash_key]).utc
|
time = Time.parse(issue[hash_key]).utc
|
||||||
|
|
||||||
tag_in_range_old = tag_newer_old_tag?(older_tag_time, time)
|
tag_in_range_old = tag_newer_old_tag?(older_tag_time, time)
|
||||||
|
|
||||||
@@ -178,8 +178,10 @@ module GitHubChangelogGenerator
|
|||||||
fetched_pr = closed_pull_requests.find do |fpr|
|
fetched_pr = closed_pull_requests.find do |fpr|
|
||||||
fpr.number == pr.number
|
fpr.number == pr.number
|
||||||
end
|
end
|
||||||
pr[:merged_at] = fetched_pr[:merged_at]
|
if fetched_pr
|
||||||
closed_pull_requests.delete(fetched_pr)
|
pr[:merged_at] = fetched_pr[:merged_at]
|
||||||
|
closed_pull_requests.delete(fetched_pr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pull_requests.select! do |pr|
|
pull_requests.select! do |pr|
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ module GitHubChangelogGenerator
|
|||||||
[newer_tag_link, newer_tag_name, newer_tag_time]
|
[newer_tag_link, newer_tag_name, newer_tag_time]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [Object] try to find newest tag using #Reader and :base option if specified otherwise returns nil
|
||||||
|
def detect_since_tag
|
||||||
|
@since_tag ||= @options[:since_tag]
|
||||||
|
if @since_tag.nil? && @options[:base] && File.file?(@options[:base])
|
||||||
|
reader = GitHubChangelogGenerator::Reader.new
|
||||||
|
content = reader.read(@options[:base])
|
||||||
|
@since_tag = content[0]["version"] if content
|
||||||
|
end
|
||||||
|
@since_tag
|
||||||
|
end
|
||||||
|
|
||||||
# Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags
|
# Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags
|
||||||
#
|
#
|
||||||
# @return [Array]
|
# @return [Array]
|
||||||
@@ -61,9 +72,11 @@ module GitHubChangelogGenerator
|
|||||||
filter_excluded_tags(filtered_tags)
|
filter_excluded_tags(filtered_tags)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @param [Array] all_tags all tags
|
||||||
|
# @return [Array] filtered tags according :since_tag option
|
||||||
def filter_since_tag(all_tags)
|
def filter_since_tag(all_tags)
|
||||||
filtered_tags = all_tags
|
filtered_tags = all_tags
|
||||||
tag = @options[:since_tag]
|
tag = detect_since_tag
|
||||||
if tag
|
if tag
|
||||||
if all_tags.map(&:name).include? tag
|
if all_tags.map(&:name).include? tag
|
||||||
idx = all_tags.index { |t| t.name == tag }
|
idx = all_tags.index { |t| t.name == tag }
|
||||||
@@ -79,6 +92,29 @@ module GitHubChangelogGenerator
|
|||||||
filtered_tags
|
filtered_tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @param [Array] all_tags all tags
|
||||||
|
# @return [Array] filtered tags according :due_tag option
|
||||||
|
def filter_due_tag(all_tags)
|
||||||
|
filtered_tags = all_tags
|
||||||
|
tag = @options[:due_tag]
|
||||||
|
if tag
|
||||||
|
if (all_tags.count > 0) && (all_tags.map(&:name).include? tag)
|
||||||
|
idx = all_tags.index { |t| t.name == tag }
|
||||||
|
last_index = all_tags.count - 1
|
||||||
|
if idx > 0 && idx < last_index
|
||||||
|
filtered_tags = all_tags[idx + 1..last_index]
|
||||||
|
else
|
||||||
|
filtered_tags = []
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Helper.log.warn "Warning: can't find tag #{tag}, specified with --due-tag option."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
filtered_tags
|
||||||
|
end
|
||||||
|
|
||||||
|
# @param [Array] all_tags all tags
|
||||||
|
# @return [Array] filtered tags according :between_tags option
|
||||||
def filter_between_tags(all_tags)
|
def filter_between_tags(all_tags)
|
||||||
filtered_tags = all_tags
|
filtered_tags = all_tags
|
||||||
if @options[:between_tags]
|
if @options[:between_tags]
|
||||||
@@ -92,17 +128,48 @@ module GitHubChangelogGenerator
|
|||||||
filtered_tags
|
filtered_tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @param [Array] all_tags all tags
|
||||||
|
# @return [Array] filtered tags according :exclude_tags option
|
||||||
def filter_excluded_tags(all_tags)
|
def filter_excluded_tags(all_tags)
|
||||||
filtered_tags = all_tags
|
return all_tags unless @options[:exclude_tags]
|
||||||
if @options[:exclude_tags]
|
|
||||||
@options[:exclude_tags].each do |tag|
|
apply_exclude_tags(all_tags)
|
||||||
unless all_tags.map(&:name).include? tag
|
end
|
||||||
Helper.log.warn "Warning: can't find tag #{tag}, specified with --exclude-tags option."
|
|
||||||
end
|
private
|
||||||
end
|
|
||||||
filtered_tags = all_tags.reject { |tag| @options[:exclude_tags].include? tag.name }
|
def apply_exclude_tags(all_tags)
|
||||||
|
if @options[:exclude_tags].is_a?(Regexp)
|
||||||
|
filter_tags_with_regex(all_tags)
|
||||||
|
else
|
||||||
|
filter_exact_tags(all_tags)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def filter_tags_with_regex(all_tags)
|
||||||
|
warn_if_nonmatching_regex(all_tags)
|
||||||
|
all_tags.reject { |tag| @options[:exclude_tags] =~ tag.name }
|
||||||
|
end
|
||||||
|
|
||||||
|
def filter_exact_tags(all_tags)
|
||||||
|
@options[:exclude_tags].each do |tag|
|
||||||
|
warn_if_tag_not_found(all_tags, tag)
|
||||||
|
end
|
||||||
|
all_tags.reject { |tag| @options[:exclude_tags].include? tag.name }
|
||||||
|
end
|
||||||
|
|
||||||
|
def warn_if_nonmatching_regex(all_tags)
|
||||||
|
unless all_tags.map(&:name).any? { |t| @options[:exclude_tags] =~ t }
|
||||||
|
Helper.log.warn "Warning: unable to reject any tag, using regex "\
|
||||||
|
"#{@options[:exclude_tags].inspect} in --exclude-tags "\
|
||||||
|
"option."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def warn_if_tag_not_found(all_tags, tag)
|
||||||
|
unless all_tags.map(&:name).include? tag
|
||||||
|
Helper.log.warn "Warning: can't find tag #{tag}, specified with --exclude-tags option."
|
||||||
end
|
end
|
||||||
filtered_tags
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,30 +7,33 @@ module GitHubChangelogGenerator
|
|||||||
class Parser
|
class Parser
|
||||||
# parse options with optparse
|
# parse options with optparse
|
||||||
def self.parse_options
|
def self.parse_options
|
||||||
options = get_default_options
|
options = default_options
|
||||||
|
|
||||||
|
ParserFile.new(options).parse!
|
||||||
|
|
||||||
parser = setup_parser(options)
|
parser = setup_parser(options)
|
||||||
|
|
||||||
parser.parse!
|
parser.parse!
|
||||||
|
|
||||||
if options[:user].nil? || options[:project].nil?
|
user_and_project_from_git(options)
|
||||||
detect_user_and_project(options, ARGV[0], ARGV[1])
|
|
||||||
end
|
|
||||||
|
|
||||||
if !options[:user] || !options[:project]
|
abort(parser.banner) unless options[:user] && options[:project]
|
||||||
puts parser.banner
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
if options[:verbose]
|
print_options(options)
|
||||||
Helper.log.info "Performing task with options:"
|
|
||||||
pp options
|
|
||||||
puts ""
|
|
||||||
end
|
|
||||||
|
|
||||||
options
|
options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @param [Hash] options to display
|
||||||
|
def self.print_options(options)
|
||||||
|
if options[:verbose]
|
||||||
|
Helper.log.info "Performing task with options:"
|
||||||
|
options_to_display = options.clone
|
||||||
|
options_to_display[:token] = options_to_display[:token].nil? ? nil : "hidden value"
|
||||||
|
pp options_to_display
|
||||||
|
puts ""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# setup parsing options
|
# setup parsing options
|
||||||
def self.setup_parser(options)
|
def self.setup_parser(options)
|
||||||
parser = OptionParser.new do |opts|
|
parser = OptionParser.new do |opts|
|
||||||
@@ -50,6 +53,9 @@ module GitHubChangelogGenerator
|
|||||||
opts.on("-o", "--output [NAME]", "Output file. Default is CHANGELOG.md") do |last|
|
opts.on("-o", "--output [NAME]", "Output file. Default is CHANGELOG.md") do |last|
|
||||||
options[:output] = last
|
options[:output] = last
|
||||||
end
|
end
|
||||||
|
opts.on("-b", "--base [NAME]", "Optional base file to append generated changes to.") do |last|
|
||||||
|
options[:base] = last
|
||||||
|
end
|
||||||
opts.on("--bugs-label [LABEL]", "Setup custom label for bug-fixes section. Default is \"**Fixed bugs:**""") do |v|
|
opts.on("--bugs-label [LABEL]", "Setup custom label for bug-fixes section. Default is \"**Fixed bugs:**""") do |v|
|
||||||
options[:bug_prefix] = v
|
options[:bug_prefix] = v
|
||||||
end
|
end
|
||||||
@@ -116,6 +122,9 @@ module GitHubChangelogGenerator
|
|||||||
opts.on("--since-tag x", "Change log will start after specified tag") do |v|
|
opts.on("--since-tag x", "Change log will start after specified tag") do |v|
|
||||||
options[:since_tag] = v
|
options[:since_tag] = v
|
||||||
end
|
end
|
||||||
|
opts.on("--due-tag x", "Change log will end before specified tag") do |v|
|
||||||
|
options[:due_tag] = v
|
||||||
|
end
|
||||||
opts.on("--max-issues [NUMBER]", Integer, "Max number of issues to fetch from GitHub. Default is unlimited") do |max|
|
opts.on("--max-issues [NUMBER]", Integer, "Max number of issues to fetch from GitHub. Default is unlimited") do |max|
|
||||||
options[:max_issues] = max
|
options[:max_issues] = max
|
||||||
end
|
end
|
||||||
@@ -134,6 +143,9 @@ module GitHubChangelogGenerator
|
|||||||
opts.on("--future-release [RELEASE-VERSION]", "Put the unreleased changes in the specified release number.") do |future_release|
|
opts.on("--future-release [RELEASE-VERSION]", "Put the unreleased changes in the specified release number.") do |future_release|
|
||||||
options[:future_release] = future_release
|
options[:future_release] = future_release
|
||||||
end
|
end
|
||||||
|
opts.on("--release-branch [RELEASE-BRANCH]", "Limit pull requests to the release branch, such as master or release") do |release_branch|
|
||||||
|
options[:release_branch] = release_branch
|
||||||
|
end
|
||||||
opts.on("--[no-]verbose", "Run verbosely. Default is true") do |v|
|
opts.on("--[no-]verbose", "Run verbosely. Default is true") do |v|
|
||||||
options[:verbose] = v
|
options[:verbose] = v
|
||||||
end
|
end
|
||||||
@@ -150,12 +162,13 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
# just get default options
|
# just get default options
|
||||||
def self.get_default_options
|
def self.default_options
|
||||||
options = {
|
{
|
||||||
tag1: nil,
|
tag1: nil,
|
||||||
tag2: nil,
|
tag2: nil,
|
||||||
date_format: "%Y-%m-%d",
|
date_format: "%Y-%m-%d",
|
||||||
output: "CHANGELOG.md",
|
output: "CHANGELOG.md",
|
||||||
|
base: "HISTORY.md",
|
||||||
issues: true,
|
issues: true,
|
||||||
add_issues_wo_labels: true,
|
add_issues_wo_labels: true,
|
||||||
add_pr_wo_labels: true,
|
add_pr_wo_labels: true,
|
||||||
@@ -178,21 +191,25 @@ module GitHubChangelogGenerator
|
|||||||
enhancement_prefix: "**Implemented enhancements:**",
|
enhancement_prefix: "**Implemented enhancements:**",
|
||||||
git_remote: "origin"
|
git_remote: "origin"
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
|
||||||
options
|
def self.user_and_project_from_git(options)
|
||||||
|
if options[:user].nil? || options[:project].nil?
|
||||||
|
detect_user_and_project(options, ARGV[0], ARGV[1])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Detects user and project from git
|
# Detects user and project from git
|
||||||
def self.detect_user_and_project(options, arg0 = nil, arg1 = nil)
|
def self.detect_user_and_project(options, arg0 = nil, arg1 = nil)
|
||||||
options[:user], options[:project] = user_project_from_option(arg0, arg1, options[:github_site])
|
options[:user], options[:project] = user_project_from_option(arg0, arg1, options[:github_site])
|
||||||
if !options[:user] || !options[:project]
|
return if options[:user] && options[:project]
|
||||||
if ENV["RUBYLIB"] =~ /ruby-debug-ide/
|
|
||||||
options[:user] = "skywinder"
|
if ENV["RUBYLIB"] =~ /ruby-debug-ide/
|
||||||
options[:project] = "changelog_test"
|
options[:user] = "skywinder"
|
||||||
else
|
options[:project] = "changelog_test"
|
||||||
remote = `git config --get remote.#{options[:git_remote]}.url`
|
else
|
||||||
options[:user], options[:project] = user_project_from_remote(remote)
|
remote = `git config --get remote.#{options[:git_remote]}.url`
|
||||||
end
|
options[:user], options[:project] = user_project_from_remote(remote)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
39
lib/github_changelog_generator/parser_file.rb
Normal file
39
lib/github_changelog_generator/parser_file.rb
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
module GitHubChangelogGenerator
|
||||||
|
ParserError = Class.new(StandardError)
|
||||||
|
|
||||||
|
class ParserFile
|
||||||
|
def initialize(options)
|
||||||
|
@options = options
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse!
|
||||||
|
return unless File.exist?(file)
|
||||||
|
|
||||||
|
File.readlines(file).each { |line| parse_line!(line) }
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def file
|
||||||
|
@file ||= File.expand_path(@options[:params_file] || ".github_changelog_generator")
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_line!(line)
|
||||||
|
key_sym, value = extract_pair(line)
|
||||||
|
value = true if value =~ (/^(true|t|yes|y|1)$/i)
|
||||||
|
value = false if value =~ (/^(false|f|no|n|0)$/i)
|
||||||
|
@options[key_sym] = value
|
||||||
|
rescue
|
||||||
|
raise ParserError, "Config file #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns a the setting as a symbol and its string value sans newlines.
|
||||||
|
#
|
||||||
|
# @param line [String] unparsed line from config file
|
||||||
|
# @return [Array<Symbol, String>]
|
||||||
|
def extract_pair(line)
|
||||||
|
key, value = line.split("=", 2)
|
||||||
|
[key.sub("-", "_").to_sym, value.gsub(/[\n\r]+/, "")]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -53,31 +53,28 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
@heading_structures.each do |regexp|
|
@heading_structures.each do |regexp|
|
||||||
matches = Regexp.new(regexp).match(heading)
|
matches = Regexp.new(regexp).match(heading)
|
||||||
captures.merge!(Hash[matches.names.map.zip(matches.captures)]) unless matches.nil?
|
if matches
|
||||||
|
captures.merge!(Hash[matches.names.zip(matches.captures)])
|
||||||
# Try Regular Expressions until you find one that delivers results
|
break
|
||||||
break unless matches.nil?
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
captures
|
captures
|
||||||
end
|
end
|
||||||
|
|
||||||
# Parse the given ChangeLog data into a Hash
|
# Parse the given ChangeLog data into a list of Hashes
|
||||||
#
|
#
|
||||||
# @param [String] data File data from the ChangeLog.md
|
# @param [String] data File data from the ChangeLog.md
|
||||||
# @return [Hash] Parsed data, e.g. [{ 'version' => ..., 'url' => ..., 'date' => ..., 'content' => ...}, ...]
|
# @return [Array<Hash>] Parsed data, e.g. [{ 'version' => ..., 'url' => ..., 'date' => ..., 'content' => ...}, ...]
|
||||||
def parse(data)
|
def parse(data)
|
||||||
sections = data.split(/^## .+?$/)
|
sections = data.split(/^## .+?$/)
|
||||||
headings = data.scan(/^## .+?$/)
|
headings = data.scan(/^## .+?$/)
|
||||||
changelog = []
|
|
||||||
|
|
||||||
headings.each_with_index do |heading, index|
|
headings.each_with_index.map do |heading, index|
|
||||||
captures = parse_heading(heading)
|
section = parse_heading(heading)
|
||||||
captures["content"] = sections.at(index + 1)
|
section["content"] = sections.at(index + 1)
|
||||||
changelog.push captures
|
section
|
||||||
end
|
end
|
||||||
|
|
||||||
changelog
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(file_path)
|
def read(file_path)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ module GitHubChangelogGenerator
|
|||||||
bug_labels enhancement_labels
|
bug_labels enhancement_labels
|
||||||
between_tags exclude_tags since_tag max_issues
|
between_tags exclude_tags since_tag max_issues
|
||||||
github_site github_endpoint simple_list
|
github_site github_endpoint simple_list
|
||||||
future_release verbose )
|
future_release release_branch verbose release_url
|
||||||
|
base )
|
||||||
|
|
||||||
OPTIONS.each do |o|
|
OPTIONS.each do |o|
|
||||||
attr_accessor o.to_sym
|
attr_accessor o.to_sym
|
||||||
@@ -43,15 +44,13 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
task @name do
|
task @name do
|
||||||
# mimick parse_options
|
# mimick parse_options
|
||||||
options = Parser.get_default_options
|
options = Parser.default_options
|
||||||
|
|
||||||
if options[:user].nil? || options[:project].nil?
|
Parser.user_and_project_from_git(options)
|
||||||
Parser.detect_user_and_project(options)
|
|
||||||
end
|
|
||||||
|
|
||||||
OPTIONS.each do |o|
|
OPTIONS.each do |o|
|
||||||
v = instance_variable_get("@#{o}")
|
v = instance_variable_get("@#{o}")
|
||||||
options[o.to_sym] = v if v
|
options[o.to_sym] = v unless v.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
generator = Generator.new options
|
generator = Generator.new options
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
VERSION = "1.7.0"
|
VERSION = "1.10.0"
|
||||||
end
|
end
|
||||||
|
|||||||
0
spec/files/github_changelog_params_empty
Normal file
0
spec/files/github_changelog_params_empty
Normal file
2
spec/files/github_changelog_params_incorrect
Normal file
2
spec/files/github_changelog_params_incorrect
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
unreleased_label: staging
|
||||||
|
unreleased: false
|
||||||
3
spec/files/github_changelog_params_override
Normal file
3
spec/files/github_changelog_params_override
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
unreleased_label=staging
|
||||||
|
unreleased=false
|
||||||
|
header==== Changelog ===
|
||||||
@@ -31,91 +31,25 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|||||||
SimpleCov.start
|
SimpleCov.start
|
||||||
|
|
||||||
require "github_changelog_generator"
|
require "github_changelog_generator"
|
||||||
|
require "github_changelog_generator/task"
|
||||||
|
|
||||||
# This file was generated by the `rspec --init` command. Conventionally, all
|
|
||||||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
||||||
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
||||||
# this file to always be loaded, without a need to explicitly require it in any
|
|
||||||
# files.
|
|
||||||
#
|
|
||||||
# Given that it is always loaded, you are encouraged to keep this file as
|
|
||||||
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
||||||
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
||||||
# individual file that may not need all of that loaded. Instead, consider making
|
|
||||||
# a separate helper file that requires the additional dependencies and performs
|
|
||||||
# the additional setup, and require it from the spec files that actually need
|
|
||||||
# it.
|
|
||||||
#
|
|
||||||
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
||||||
# users commonly want.
|
|
||||||
#
|
|
||||||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
# rspec-expectations config goes here. You can use an alternate
|
|
||||||
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
||||||
# assertions if you prefer.
|
|
||||||
config.expect_with :rspec do |expectations|
|
config.expect_with :rspec do |expectations|
|
||||||
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
||||||
# and `failure_message` of custom matchers include text for helper methods
|
|
||||||
# defined using `chain`, e.g.:
|
|
||||||
# be_bigger_than(2).and_smaller_than(4).description
|
|
||||||
# # => "be bigger than 2 and smaller than 4"
|
|
||||||
# ...rather than:
|
|
||||||
# # => "be bigger than 2"
|
|
||||||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
||||||
end
|
end
|
||||||
|
|
||||||
# rspec-mocks config goes here. You can use an alternate test double
|
|
||||||
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
||||||
config.mock_with :rspec do |mocks|
|
config.mock_with :rspec do |mocks|
|
||||||
# Prevents you from mocking or stubbing a method that does not exist on
|
|
||||||
# a real object. This is generally recommended, and will default to
|
|
||||||
# `true` in RSpec 4.
|
|
||||||
mocks.verify_partial_doubles = true
|
mocks.verify_partial_doubles = true
|
||||||
end
|
end
|
||||||
|
|
||||||
# These two settings work together to allow you to limit a spec run
|
|
||||||
# to individual examples or groups you care about by tagging them with
|
|
||||||
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
||||||
# get run.
|
|
||||||
config.filter_run :focus
|
config.filter_run :focus
|
||||||
config.run_all_when_everything_filtered = true
|
config.run_all_when_everything_filtered = true
|
||||||
|
|
||||||
# Limits the available syntax to the non-monkey patched syntax that is
|
|
||||||
# recommended. For more details, see:
|
|
||||||
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
|
||||||
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
||||||
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
|
||||||
# config.disable_monkey_patching!
|
|
||||||
|
|
||||||
# This setting enables warnings. It's recommended, but in some cases may
|
|
||||||
# be too noisy due to issues in dependencies.
|
|
||||||
config.warnings = true
|
config.warnings = true
|
||||||
|
|
||||||
# Many RSpec users commonly either run the entire suite or an individual
|
config.default_formatter = "doc" if config.files_to_run.one?
|
||||||
# file, and it's useful to allow more verbose output when running an
|
|
||||||
# individual spec file.
|
|
||||||
if config.files_to_run.one?
|
|
||||||
# Use the documentation formatter for detailed output,
|
|
||||||
# unless a formatter has already been configured
|
|
||||||
# (e.g. via a command-line flag).
|
|
||||||
config.default_formatter = "doc"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Print the 10 slowest examples and example groups at the
|
|
||||||
# end of the spec run, to help surface which specs are running
|
|
||||||
# particularly slow.
|
|
||||||
# config.profile_examples = 10
|
|
||||||
|
|
||||||
# Run specs in random order to surface order dependencies. If you find an
|
|
||||||
# order dependency and want to debug it, you can fix the order by providing
|
|
||||||
# the seed, which is printed after each run.
|
|
||||||
# --seed 1234
|
|
||||||
config.order = :random
|
config.order = :random
|
||||||
|
|
||||||
# Seed global randomization in this process using the `--seed` CLI option.
|
|
||||||
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
||||||
# test failures related to randomization by passing the same `--seed` value
|
|
||||||
# as the one that triggered the failure.
|
|
||||||
Kernel.srand config.seed
|
Kernel.srand config.seed
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -87,24 +87,88 @@ describe GitHubChangelogGenerator::Generator do
|
|||||||
it { is_expected.to be_a Array }
|
it { is_expected.to be_a Array }
|
||||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
describe "#filter_since_tag" do
|
context "with regex exclude_tags" do
|
||||||
subject { generator.filter_since_tag(tags_mash_from_strings(%w(1 2 3))) }
|
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[23]/) }
|
||||||
|
|
||||||
context "with valid since tag" do
|
|
||||||
let(:generator) { GitHubChangelogGenerator::Generator.new(since_tag: "2") }
|
|
||||||
it { is_expected.to be_a Array }
|
it { is_expected.to be_a Array }
|
||||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with invalid since tag" do
|
context "with non-matching regex in exclude_tags" do
|
||||||
let(:generator) { GitHubChangelogGenerator::Generator.new(since_tag: %w(invalid tags)) }
|
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[abc]/) }
|
||||||
it { is_expected.to be_a Array }
|
it { is_expected.to be_a Array }
|
||||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#filter_since_tag" do
|
||||||
|
context "with filled array" do
|
||||||
|
subject { generator.filter_since_tag(tags_mash_from_strings(%w(1 2 3))) }
|
||||||
|
|
||||||
|
context "with valid since tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(since_tag: "2") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with invalid since tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(since_tag: "Invalid tag") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with empty array" do
|
||||||
|
subject { generator.filter_since_tag(tags_mash_from_strings(%w())) }
|
||||||
|
|
||||||
|
context "with valid since tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(since_tag: "2") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w())) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with invalid since tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(since_tag: "Invalid tag") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w())) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#filter_due_tag" do
|
||||||
|
context "with filled array" do
|
||||||
|
subject { generator.filter_due_tag(tags_mash_from_strings(%w(1 2 3))) }
|
||||||
|
|
||||||
|
context "with valid due tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(due_tag: "2") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w(3))) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with invalid due tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(due_tag: "Invalid tag") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with empty array" do
|
||||||
|
subject { generator.filter_due_tag(tags_mash_from_strings(%w())) }
|
||||||
|
|
||||||
|
context "with valid due tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(due_tag: "2") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w())) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with invalid due tag" do
|
||||||
|
let(:generator) { GitHubChangelogGenerator::Generator.new(due_tag: "Invalid tag") }
|
||||||
|
it { is_expected.to be_a Array }
|
||||||
|
it { is_expected.to match_array(tags_mash_from_strings(%w())) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#get_time_of_tag" do
|
describe "#get_time_of_tag" do
|
||||||
current_time = Time.now
|
current_time = Time.now
|
||||||
before(:all) { @generator = GitHubChangelogGenerator::Generator.new }
|
before(:all) { @generator = GitHubChangelogGenerator::Generator.new }
|
||||||
|
|||||||
41
spec/unit/parse_file_spec.rb
Normal file
41
spec/unit/parse_file_spec.rb
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
describe GitHubChangelogGenerator::ParserFile do
|
||||||
|
describe ".github_changelog_generator" do
|
||||||
|
context "when no has file" do
|
||||||
|
let(:options) { {} }
|
||||||
|
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||||
|
subject { parse.parse! }
|
||||||
|
it { is_expected.to be_nil }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "when file is empty" do
|
||||||
|
let(:options) { { params_file: "spec/files/github_changelog_params_empty" } }
|
||||||
|
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||||
|
|
||||||
|
it "does not change the options" do
|
||||||
|
expect { parse.parse! }.to_not change { options }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "when file is incorrect" do
|
||||||
|
let(:options) { { params_file: "spec/files/github_changelog_params_incorrect" } }
|
||||||
|
let(:options_before_change) { options.dup }
|
||||||
|
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||||
|
it { expect { parse.parse! }.to raise_error(GitHubChangelogGenerator::ParserError) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "when override default values" do
|
||||||
|
let(:default_options) { GitHubChangelogGenerator::Parser.default_options }
|
||||||
|
let(:options) { { params_file: "spec/files/github_changelog_params_override" }.merge(default_options) }
|
||||||
|
let(:options_before_change) { options.dup }
|
||||||
|
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||||
|
|
||||||
|
it "changes the options" do
|
||||||
|
expect { parse.parse! }.to change { options }
|
||||||
|
.from(options_before_change)
|
||||||
|
.to(options_before_change.merge(unreleased_label: "staging",
|
||||||
|
unreleased: false,
|
||||||
|
header: "=== Changelog ==="))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user