Compare commits
157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61bfba69c5 | ||
|
|
11d85bff41 | ||
|
|
944ad69092 | ||
|
|
c798266695 | ||
|
|
170eb40f33 | ||
|
|
6d9fcf202e | ||
|
|
0fccc4396f | ||
|
|
068af037f5 | ||
|
|
4569fad479 | ||
|
|
c5a92b71b2 | ||
|
|
7c2b95d24b | ||
|
|
1a289c872d | ||
|
|
6b64d4e4a2 | ||
|
|
0b32484184 | ||
|
|
a997d2417d | ||
|
|
29b5ef3d53 | ||
|
|
2e8e2a62e1 | ||
|
|
15d92cea45 | ||
|
|
93df2d5646 | ||
|
|
deba7efa49 | ||
|
|
f9ad19285e | ||
|
|
5071b596d2 | ||
|
|
9150cdc09e | ||
|
|
669ac73466 | ||
|
|
c6b12454d9 | ||
|
|
1519d16cef | ||
|
|
655aa965a7 | ||
|
|
d0bd44e0c8 | ||
|
|
44bbd9ca01 | ||
|
|
a7ee304f20 | ||
|
|
42b3955c06 | ||
|
|
9cb03fa745 | ||
|
|
1391eefcd8 | ||
|
|
8e659072e8 | ||
|
|
ce68ab3685 | ||
|
|
d53bba3939 | ||
|
|
18aea22cd6 | ||
|
|
ce97e212c2 | ||
|
|
cd53e1cd9a | ||
|
|
677b0d8c50 | ||
|
|
8df1bbad13 | ||
|
|
86386ff7e6 | ||
|
|
197a438c09 | ||
|
|
8caa577686 | ||
|
|
d188facd92 | ||
|
|
f5bdd30d47 | ||
|
|
edb1fade20 | ||
|
|
542a0948fc | ||
|
|
aaa71d1ed0 | ||
|
|
11ea9eccb1 | ||
|
|
7ab1ee1c21 | ||
|
|
6fa2f2701e | ||
|
|
2bdaf31da7 | ||
|
|
6e8a9cb6ce | ||
|
|
867337b58e | ||
|
|
4687b0b025 | ||
|
|
eca1ffa418 | ||
|
|
7d92087f4a | ||
|
|
f1a6a79865 | ||
|
|
5b46a24f0b | ||
|
|
2a1e7daa1d | ||
|
|
c76cfd1920 | ||
|
|
d3ea8a1b0c | ||
|
|
7ea80547c5 | ||
|
|
b4dcd8a0d9 | ||
|
|
3d13f9c4b3 | ||
|
|
76df82fe0b | ||
|
|
12734dbbe1 | ||
|
|
d33dcced8f | ||
|
|
4a9f6fdd43 | ||
|
|
32f14e685b | ||
|
|
85d5352e6e | ||
|
|
637de14699 | ||
|
|
925f6fd3f0 | ||
|
|
568db9e519 | ||
|
|
9b7273f009 | ||
|
|
08cacdc5ec | ||
|
|
159173d86a | ||
|
|
c111488376 | ||
|
|
5bc90a32ae | ||
|
|
772e403e40 | ||
|
|
fe2162030b | ||
|
|
ee86b35068 | ||
|
|
93e29e8e81 | ||
|
|
5bff64de19 | ||
|
|
780ebdf0eb | ||
|
|
c5837ad9f0 | ||
|
|
17a1b23059 | ||
|
|
7205a060b3 | ||
|
|
471fe6f312 | ||
|
|
40df2c7dac | ||
|
|
aa87c803ca | ||
|
|
6962b5e7b2 | ||
|
|
407bf86e57 | ||
|
|
cff1e8c5ed | ||
|
|
8e9ff4cb8a | ||
|
|
3e045e3b42 | ||
|
|
0bfd702d21 | ||
|
|
c762f82917 | ||
|
|
b510b2c3fb | ||
|
|
f45dc26aba | ||
|
|
78361faaa9 | ||
|
|
5898dd4eb9 | ||
|
|
6706b10311 | ||
|
|
827afcda02 | ||
|
|
94c52a17e2 | ||
|
|
4af3d1cb06 | ||
|
|
b5df8e1e76 | ||
|
|
2f179649b9 | ||
|
|
9a217e3468 | ||
|
|
035e160f5e | ||
|
|
60517bffe9 | ||
|
|
402e70f677 | ||
|
|
5b192f9e43 | ||
|
|
1167706335 | ||
|
|
63c70edb25 | ||
|
|
0b3e8429c4 | ||
|
|
20c22defc2 | ||
|
|
bc6bfac2a3 | ||
|
|
fb502c0ac7 | ||
|
|
575f42f652 | ||
|
|
92fbf47960 | ||
|
|
32ab582797 | ||
|
|
4e6906dccf | ||
|
|
179f110b8a | ||
|
|
06585b1c69 | ||
|
|
89d1b5393d | ||
|
|
87b9962a8d | ||
|
|
4ceb065cae | ||
|
|
cf55352620 | ||
|
|
540251ab60 | ||
|
|
74f93460bc | ||
|
|
b8f7dbaa2e | ||
|
|
74655cce06 | ||
|
|
bc13534d88 | ||
|
|
e27a471fc8 | ||
|
|
af90816a96 | ||
|
|
1f330a3c18 | ||
|
|
0627b6c701 | ||
|
|
bfdb5debec | ||
|
|
e871613d62 | ||
|
|
589dc13938 | ||
|
|
9a842dae26 | ||
|
|
bf84a6b479 | ||
|
|
843470273c | ||
|
|
1e405b48ff | ||
|
|
3a7dbf8138 | ||
|
|
857b9e6f53 | ||
|
|
2691a3ef96 | ||
|
|
62623ff2dd | ||
|
|
a0f28d3393 | ||
|
|
88e9a3ec88 | ||
|
|
4fcde1eb28 | ||
|
|
b3cfe76702 | ||
|
|
6edf473e25 | ||
|
|
13315f4c9d | ||
|
|
70035737cf |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1 +1,7 @@
|
|||||||
|
bin/
|
||||||
|
!bin/git-generate-changelog
|
||||||
|
!bin/github_changelog_generator
|
||||||
|
pkg/
|
||||||
coverage/
|
coverage/
|
||||||
|
.bundle
|
||||||
|
spec/*.lock
|
||||||
|
|||||||
36
.rubocop.yml
36
.rubocop.yml
@@ -18,3 +18,39 @@ Metrics/MethodLength:
|
|||||||
Style/FileName:
|
Style/FileName:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'bin/git-generate-changelog'
|
- 'bin/git-generate-changelog'
|
||||||
|
|
||||||
|
#TODOS
|
||||||
|
# Offense count: 14
|
||||||
|
Metrics/AbcSize:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Offense count: 1
|
||||||
|
Style/AccessorMethodName:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Offense count: 10
|
||||||
|
Style/Documentation:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Offense count: 1
|
||||||
|
# Configuration parameters: MinBodyLength.
|
||||||
|
Style/GuardClause:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Offense count: 2
|
||||||
|
# Cop supports --auto-correct.
|
||||||
|
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
|
||||||
|
# SupportedStyles: skip_modifier_ifs, always
|
||||||
|
Style/Next:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# Offense count: 3
|
||||||
|
# Cop supports --auto-correct.
|
||||||
|
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
|
||||||
|
# SupportedStyles: slashes, percent_r, mixed
|
||||||
|
Style/RegexpLiteral:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/MutableConstant:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This configuration was generated by
|
# This configuration was generated by
|
||||||
# `rubocop --auto-gen-config`
|
# `rubocop --auto-gen-config`
|
||||||
# on 2016-02-23 12:36:44 +0200 using RuboCop version 0.37.2.
|
# on 2016-02-23 17:18:27 +0200 using RuboCop version 0.37.2.
|
||||||
# The point is for the user to remove these configuration records
|
# The point is for the user to remove these configuration records
|
||||||
# one by one as the offenses are removed from the code base.
|
# one by one as the offenses are removed from the code base.
|
||||||
# Note that changes in the inspected code, or installation of new
|
# Note that changes in the inspected code, or installation of new
|
||||||
|
|||||||
25
.travis.yml
25
.travis.yml
@@ -1,16 +1,27 @@
|
|||||||
sudo: false
|
cache:
|
||||||
|
- bundler
|
||||||
language: ruby
|
language: ruby
|
||||||
before_install:
|
before_install:
|
||||||
- gem update --system
|
- gem update --system
|
||||||
- gem install bundler
|
- gem install bundler
|
||||||
rvm:
|
rvm:
|
||||||
- 2.1.0
|
- 2.1
|
||||||
script:
|
script: bundle exec rake checks
|
||||||
- bundle exec rake checks
|
matrix:
|
||||||
|
include:
|
||||||
|
# Test install on clean system
|
||||||
|
- install: true
|
||||||
|
script:
|
||||||
|
- gem build github_changelog_generator
|
||||||
|
- gem install *.gem
|
||||||
|
- install: true
|
||||||
|
script:
|
||||||
|
- gem build github_changelog_generator
|
||||||
|
- bundle install --gemfile spec/install-gem-in-bundler.gemfile
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
recipients:
|
recipients:
|
||||||
- sky4winder+githubchangeloggenerator@gmail.com
|
- sky4winder+githubchangeloggenerator@gmail.com
|
||||||
on_success: never
|
on_success: never
|
||||||
on_failure: change
|
on_failure: change
|
||||||
addons:
|
addons:
|
||||||
|
|||||||
105
CHANGELOG.md
105
CHANGELOG.md
@@ -1,5 +1,110 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.11.7](https://github.com/skywinder/github-changelog-generator/tree/1.11.7) (2016-03-04)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.6...1.11.7)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Add Olle Jonsson as co-author [\#347](https://github.com/skywinder/github-changelog-generator/pull/347) ([skywinder](https://github.com/skywinder))
|
||||||
|
- Gemspec, default date [\#346](https://github.com/skywinder/github-changelog-generator/pull/346) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
## [1.11.6](https://github.com/skywinder/github-changelog-generator/tree/1.11.6) (2016-03-01)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.5...1.11.6)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Can't build on Windows [\#340](https://github.com/skywinder/github-changelog-generator/issues/340)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- install error "Not a git repository" [\#339](https://github.com/skywinder/github-changelog-generator/issues/339)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Gemspec: Calculate date using Date stdlib [\#343](https://github.com/skywinder/github-changelog-generator/pull/343) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
## [1.11.5](https://github.com/skywinder/github-changelog-generator/tree/1.11.5) (2016-03-01)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.4...1.11.5)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Test clean install in Travis [\#344](https://github.com/skywinder/github-changelog-generator/pull/344) ([jkeiser](https://github.com/jkeiser))
|
||||||
|
- Update Rakefile to avoid install-breaking bug [\#341](https://github.com/skywinder/github-changelog-generator/pull/341) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
## [1.11.4](https://github.com/skywinder/github-changelog-generator/tree/1.11.4) (2016-02-26)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.3...1.11.4)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Man page copying: only copy .1 [\#338](https://github.com/skywinder/github-changelog-generator/pull/338) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
## [1.11.3](https://github.com/skywinder/github-changelog-generator/tree/1.11.3) (2016-02-25)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.2...1.11.3)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Cannot install gem [\#335](https://github.com/skywinder/github-changelog-generator/issues/335)
|
||||||
|
|
||||||
|
## [1.11.2](https://github.com/skywinder/github-changelog-generator/tree/1.11.2) (2016-02-25)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.1...1.11.2)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Getting an error on install [\#329](https://github.com/skywinder/github-changelog-generator/issues/329)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fix installation by not running the specs - which have dependencies [\#337](https://github.com/skywinder/github-changelog-generator/pull/337) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
|
## [1.11.1](https://github.com/skywinder/github-changelog-generator/tree/1.11.1) (2016-02-25)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.11.0...1.11.1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Add rubocop and rspec as runtime dependencies [\#336](https://github.com/skywinder/github-changelog-generator/pull/336) ([jkeiser](https://github.com/jkeiser))
|
||||||
|
- \[Refactor\] ParserFile class use Pathname [\#334](https://github.com/skywinder/github-changelog-generator/pull/334) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- \[Refactor\] Generator\#exclude\_issues\_by\_labels simpler, tested [\#332](https://github.com/skywinder/github-changelog-generator/pull/332) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
## [1.11.0](https://github.com/skywinder/github-changelog-generator/tree/1.11.0) (2016-02-24)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.5...1.11.0)
|
||||||
|
|
||||||
|
## [1.10.5](https://github.com/skywinder/github-changelog-generator/tree/1.10.5) (2016-02-24)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.4...1.10.5)
|
||||||
|
|
||||||
|
## [1.10.4](https://github.com/skywinder/github-changelog-generator/tree/1.10.4) (2016-02-24)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.3...1.10.4)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Rake and Bundler as runtime deps [\#333](https://github.com/skywinder/github-changelog-generator/pull/333) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Test case for \#327 [\#331](https://github.com/skywinder/github-changelog-generator/pull/331) ([olleolleolle](https://github.com/olleolleolle))
|
||||||
|
- Fix crash installing on systems without overcommit [\#330](https://github.com/skywinder/github-changelog-generator/pull/330) ([jkeiser](https://github.com/jkeiser))
|
||||||
|
|
||||||
|
## [1.10.3](https://github.com/skywinder/github-changelog-generator/tree/1.10.3) (2016-02-23)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.2...1.10.3)
|
||||||
|
|
||||||
|
## [1.10.2](https://github.com/skywinder/github-changelog-generator/tree/1.10.2) (2016-02-23)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/v1.11.0...1.10.2)
|
||||||
|
|
||||||
|
## [v1.11.0](https://github.com/skywinder/github-changelog-generator/tree/v1.11.0) (2016-02-23)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.1...v1.11.0)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- YAML front matter [\#322](https://github.com/skywinder/github-changelog-generator/pull/322) ([retorquere](https://github.com/retorquere))
|
||||||
|
- Git Subcommand [\#288](https://github.com/skywinder/github-changelog-generator/pull/288) ([dlanileonardo](https://github.com/dlanileonardo))
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- detect\_since\_tag undefined [\#328](https://github.com/skywinder/github-changelog-generator/issues/328)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update README.md [\#324](https://github.com/skywinder/github-changelog-generator/pull/324) ([Zearin](https://github.com/Zearin))
|
||||||
|
|
||||||
## [1.10.1](https://github.com/skywinder/github-changelog-generator/tree/1.10.1) (2016-01-06)
|
## [1.10.1](https://github.com/skywinder/github-changelog-generator/tree/1.10.1) (2016-01-06)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.0...1.10.1)
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.10.0...1.10.1)
|
||||||
|
|
||||||
|
|||||||
7
Gemfile
7
Gemfile
@@ -3,10 +3,11 @@ source "https://rubygems.org"
|
|||||||
gemspec
|
gemspec
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem "rspec", "~>3.2"
|
gem "rake"
|
||||||
gem "rubocop", "~>0.31"
|
gem "bundler"
|
||||||
|
gem "rubocop"
|
||||||
|
gem "overcommit"
|
||||||
gem "coveralls", "~>0.8", require: false
|
gem "coveralls", "~>0.8", require: false
|
||||||
gem "simplecov", "~>0.10", require: false
|
gem "simplecov", "~>0.10", require: false
|
||||||
gem "codeclimate-test-reporter", "~>0.4"
|
gem "codeclimate-test-reporter", "~>0.4"
|
||||||
gem "overcommit", "~>0.31"
|
|
||||||
end
|
end
|
||||||
|
|||||||
32
Gemfile.lock
32
Gemfile.lock
@@ -1,9 +1,14 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
github_changelog_generator (1.11.0)
|
github_changelog_generator (1.11.7)
|
||||||
|
bundler (>= 1.7)
|
||||||
colorize (~> 0.7)
|
colorize (~> 0.7)
|
||||||
github_api (~> 0.12)
|
github_api (~> 0.12)
|
||||||
|
overcommit (>= 0.31)
|
||||||
|
rake (>= 10.0)
|
||||||
|
rspec (>= 3.2)
|
||||||
|
rubocop (>= 0.31)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
@@ -12,10 +17,10 @@ GEM
|
|||||||
ast (2.2.0)
|
ast (2.2.0)
|
||||||
childprocess (0.5.9)
|
childprocess (0.5.9)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
codeclimate-test-reporter (0.4.8)
|
codeclimate-test-reporter (0.5.0)
|
||||||
simplecov (>= 0.7.1, < 1.0.0)
|
simplecov (>= 0.7.1, < 1.0.0)
|
||||||
colorize (0.7.7)
|
colorize (0.7.7)
|
||||||
coveralls (0.8.11)
|
coveralls (0.8.13)
|
||||||
json (~> 1.8)
|
json (~> 1.8)
|
||||||
simplecov (~> 0.11.0)
|
simplecov (~> 0.11.0)
|
||||||
term-ansicolor (~> 1.3)
|
term-ansicolor (~> 1.3)
|
||||||
@@ -56,12 +61,12 @@ GEM
|
|||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
rack (1.6.4)
|
rack (1.6.4)
|
||||||
rainbow (2.1.0)
|
rainbow (2.1.0)
|
||||||
rake (10.5.0)
|
rake (11.0.1)
|
||||||
rspec (3.4.0)
|
rspec (3.4.0)
|
||||||
rspec-core (~> 3.4.0)
|
rspec-core (~> 3.4.0)
|
||||||
rspec-expectations (~> 3.4.0)
|
rspec-expectations (~> 3.4.0)
|
||||||
rspec-mocks (~> 3.4.0)
|
rspec-mocks (~> 3.4.0)
|
||||||
rspec-core (3.4.3)
|
rspec-core (3.4.4)
|
||||||
rspec-support (~> 3.4.0)
|
rspec-support (~> 3.4.0)
|
||||||
rspec-expectations (3.4.0)
|
rspec-expectations (3.4.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
@@ -70,12 +75,12 @@ GEM
|
|||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.4.0)
|
rspec-support (~> 3.4.0)
|
||||||
rspec-support (3.4.1)
|
rspec-support (3.4.1)
|
||||||
rubocop (0.37.2)
|
rubocop (0.38.0)
|
||||||
parser (>= 2.3.0.4, < 3.0)
|
parser (>= 2.3.0.6, < 3.0)
|
||||||
powerpack (~> 0.1)
|
powerpack (~> 0.1)
|
||||||
rainbow (>= 1.99.1, < 3.0)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (~> 0.3)
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||||
ruby-progressbar (1.7.5)
|
ruby-progressbar (1.7.5)
|
||||||
simplecov (0.11.2)
|
simplecov (0.11.2)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
@@ -87,20 +92,19 @@ GEM
|
|||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.5)
|
||||||
tins (1.6.0)
|
tins (1.6.0)
|
||||||
unicode-display_width (0.3.1)
|
unicode-display_width (1.0.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bundler (~> 1.7)
|
bundler
|
||||||
codeclimate-test-reporter (~> 0.4)
|
codeclimate-test-reporter (~> 0.4)
|
||||||
coveralls (~> 0.8)
|
coveralls (~> 0.8)
|
||||||
github_changelog_generator!
|
github_changelog_generator!
|
||||||
overcommit (~> 0.31)
|
overcommit
|
||||||
rake (~> 10.0)
|
rake
|
||||||
rspec (~> 3.2)
|
rubocop
|
||||||
rubocop (~> 0.31)
|
|
||||||
simplecov (~> 0.10)
|
simplecov (~> 0.10)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ Therefore, it's recommended to run this script with authentication by using a **
|
|||||||
|
|
||||||
Here's how:
|
Here's how:
|
||||||
|
|
||||||
- [Generate a token here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token)
|
- [Generate a token here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token) - you only need "repo" scope for private repositories
|
||||||
- Either:
|
- Either:
|
||||||
- Run the script with `--token <your-40-digit-token>`; **OR**
|
- Run the script with `--token <your-40-digit-token>`; **OR**
|
||||||
- Set the `CHANGELOG_GITHUB_TOKEN` environment variable to your 40 digit token
|
- Set the `CHANGELOG_GITHUB_TOKEN` environment variable to your 40 digit token
|
||||||
|
|||||||
29
Rakefile
29
Rakefile
@@ -1,3 +1,4 @@
|
|||||||
|
require "bundler"
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
require "rubocop/rake_task"
|
require "rubocop/rake_task"
|
||||||
require "rspec/core/rake_task"
|
require "rspec/core/rake_task"
|
||||||
@@ -8,15 +9,31 @@ require "overcommit"
|
|||||||
RuboCop::RakeTask.new
|
RuboCop::RakeTask.new
|
||||||
RSpec::Core::RakeTask.new(:rspec)
|
RSpec::Core::RakeTask.new(:rspec)
|
||||||
|
|
||||||
task :create_man do |_t|
|
task :copy_man_page_to_manpath do |_t|
|
||||||
os_prefix = "/usr/local"
|
known_manpath_paths = %w(/etc/manpath.config /etc/manpaths)
|
||||||
man_prefix = Pathname("#{os_prefix}/share/man/man1")
|
manpath = known_manpath_paths.find do |f|
|
||||||
man_pages = "man/git-*"
|
path = Pathname(f)
|
||||||
|
path.file? && path.readable?
|
||||||
|
end
|
||||||
|
|
||||||
|
next unless manpath
|
||||||
|
|
||||||
|
writable_man_path = Pathname(manpath).each_line.find do |line|
|
||||||
|
path = Pathname(line.chomp)
|
||||||
|
path.directory? && path.writable?
|
||||||
|
end
|
||||||
|
|
||||||
|
next unless writable_man_path
|
||||||
|
|
||||||
|
man_prefix = Pathname("#{writable_man_path.chomp}/man1")
|
||||||
|
man_pages = "man/git-*.1"
|
||||||
|
|
||||||
Pathname.glob(man_pages) do |path|
|
Pathname.glob(man_pages) do |path|
|
||||||
FileUtils.cp(path, man_prefix + path.basename)
|
if path.exist? && man_prefix.exist? && man_prefix.writable?
|
||||||
|
FileUtils.cp(path, man_prefix + path.basename)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
task checks: [:rubocop, :rspec]
|
task checks: [:rubocop, :rspec]
|
||||||
task default: [:checks, :create_man]
|
task default: [:copy_man_page_to_manpath]
|
||||||
|
|||||||
50
appveyor.yml
Normal file
50
appveyor.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
version: "{build}"
|
||||||
|
|
||||||
|
platform: x64
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
clone_depth: 10
|
||||||
|
|
||||||
|
skip_tags: true
|
||||||
|
|
||||||
|
# See here for Ruby versions pre-installed:
|
||||||
|
# http://www.appveyor.com/docs/installed-software#ruby
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- ruby_version: "21" # Older version, but matches Travis-CI
|
||||||
|
- ruby_version: "21-x64"
|
||||||
|
|
||||||
|
install:
|
||||||
|
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
||||||
|
|
||||||
|
# Print version and location for pre-installed ruby
|
||||||
|
- ruby --version
|
||||||
|
- where ruby
|
||||||
|
|
||||||
|
# Install latest version of RubyGems
|
||||||
|
- gem update --system --no-document --no-post-install-message
|
||||||
|
- gem --version
|
||||||
|
- where gem
|
||||||
|
|
||||||
|
# Print version and location for pre-installed bundler
|
||||||
|
- bundler --version
|
||||||
|
- where bundler
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
# Install ruby dependencies
|
||||||
|
- bundle install --retry 3
|
||||||
|
- bundle exec rake checks
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- gem build github_changelog_generator
|
||||||
|
- gem install *.gem
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
- provider: Email
|
||||||
|
to:
|
||||||
|
- sky4winder+githubchangeloggenerator@gmail.com
|
||||||
|
on_build_success: false
|
||||||
|
on_build_status_changed: true
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
lib = File.expand_path("../lib", __FILE__)
|
lib = File.expand_path("../lib", __FILE__)
|
||||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||||
require "github_changelog_generator/version"
|
require "github_changelog_generator/version"
|
||||||
@@ -10,24 +9,25 @@ Gem::Specification.new do |spec|
|
|||||||
spec.default_executable = "github_changelog_generator"
|
spec.default_executable = "github_changelog_generator"
|
||||||
|
|
||||||
spec.required_ruby_version = ">= 1.9.3"
|
spec.required_ruby_version = ">= 1.9.3"
|
||||||
spec.authors = ["Petr Korolev"]
|
spec.authors = ["Petr Korolev", "Olle Jonsson"]
|
||||||
spec.email = "sky4winder+github_changelog_generator@gmail.com"
|
spec.email = "sky4winder+github_changelog_generator@gmail.com"
|
||||||
spec.date = `date +"%Y-%m-%d"`.strip!
|
|
||||||
spec.summary = "Script, that automatically generate changelog from your tags, issues, labels and pull requests."
|
spec.summary = "Script, that automatically generate changelog from your tags, issues, labels and pull requests."
|
||||||
spec.description = "Changelog generation has never been so easy. Fully automate changelog generation - this gem generate change log file based on tags, issues and merged pull requests from Github issue tracker."
|
spec.description = "Changelog generation has never been so easy. Fully automate changelog generation - this gem generate change log file based on tags, issues and merged pull requests from Github issue tracker."
|
||||||
spec.homepage = "https://github.com/skywinder/Github-Changelog-Generator"
|
spec.homepage = "https://github.com/skywinder/Github-Changelog-Generator"
|
||||||
spec.license = "MIT"
|
spec.license = "MIT"
|
||||||
spec.extensions = ["Rakefile"]
|
|
||||||
|
|
||||||
spec.files = `git ls-files -z`.split("\x0")
|
spec.files = Dir['{bin,lib,man,spec}/**/*', 'Rakefile', 'README.md']
|
||||||
|
|
||||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||||
spec.require_paths = ["lib"]
|
spec.require_paths = ["lib"]
|
||||||
|
|
||||||
|
spec.add_runtime_dependency "rake", ">= 10.0"
|
||||||
|
spec.add_runtime_dependency "bundler", ">= 1.7"
|
||||||
spec.add_runtime_dependency("github_api", ["~> 0.12"])
|
spec.add_runtime_dependency("github_api", ["~> 0.12"])
|
||||||
spec.add_runtime_dependency("colorize", ["~> 0.7"])
|
spec.add_runtime_dependency("colorize", ["~> 0.7"])
|
||||||
|
spec.add_runtime_dependency("overcommit", ">= 0.31")
|
||||||
# Development only
|
spec.add_runtime_dependency("rubocop", ">= 0.31")
|
||||||
spec.add_development_dependency "bundler", "~> 1.7"
|
spec.add_runtime_dependency("rspec", ">= 3.2")
|
||||||
spec.add_development_dependency "rake", "~> 10.0"
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
class Fetcher
|
class Fetcher
|
||||||
PER_PAGE_NUMBER = 30
|
PER_PAGE_NUMBER = 30
|
||||||
CHANGELOG_GITHUB_TOKEN = "CHANGELOG_GITHUB_TOKEN".freeze
|
CHANGELOG_GITHUB_TOKEN = "CHANGELOG_GITHUB_TOKEN"
|
||||||
GH_RATE_LIMIT_EXCEEDED_MSG = "Warning: Can't finish operation: GitHub API rate limit exceeded, change log may be " \
|
GH_RATE_LIMIT_EXCEEDED_MSG = "Warning: Can't finish operation: GitHub API rate limit exceeded, change log may be " \
|
||||||
"missing some issues. You can limit the number of issues fetched using the `--max-issues NUM` argument.".freeze
|
"missing some issues. You can limit the number of issues fetched using the `--max-issues NUM` argument."
|
||||||
NO_TOKEN_PROVIDED = "Warning: No token provided (-t option) and variable $CHANGELOG_GITHUB_TOKEN was not found. " \
|
NO_TOKEN_PROVIDED = "Warning: No token provided (-t option) and variable $CHANGELOG_GITHUB_TOKEN was not found. " \
|
||||||
"This script can make only 50 requests to GitHub API per hour without token!".freeze
|
"This script can make only 50 requests to GitHub API per hour without token!"
|
||||||
|
|
||||||
def initialize(options = {})
|
def initialize(options = {})
|
||||||
@options = options || {}
|
@options = options || {}
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ module GitHubChangelogGenerator
|
|||||||
# @param [Array] issues
|
# @param [Array] issues
|
||||||
# @return [Array] filtered array
|
# @return [Array] filtered array
|
||||||
def exclude_issues_by_labels(issues)
|
def exclude_issues_by_labels(issues)
|
||||||
unless @options[:exclude_labels].nil?
|
return issues if !@options[:exclude_labels] || @options[:exclude_labels].empty?
|
||||||
issues = issues.select do |issue|
|
|
||||||
var = issue.labels.map(&:name) & @options[:exclude_labels]
|
issues.reject do |issue|
|
||||||
!var.any?
|
labels = issue.labels.map(&:name)
|
||||||
end
|
(labels & @options[:exclude_labels]).any?
|
||||||
end
|
end
|
||||||
issues
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Array] filtered issues accourding milestone
|
# @return [Array] filtered issues accourding milestone
|
||||||
|
|||||||
@@ -1,33 +1,61 @@
|
|||||||
|
require "pathname"
|
||||||
|
|
||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
ParserError = Class.new(StandardError)
|
ParserError = Class.new(StandardError)
|
||||||
|
|
||||||
|
# ParserFile is a configuration file reader which sets options in the
|
||||||
|
# given Hash.
|
||||||
|
#
|
||||||
|
# In your project's root, you can put a file named
|
||||||
|
# <tt>.github_changelog_generator</tt> to override defaults.
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# header_label=# My Super Changelog
|
||||||
|
# ; Comments are allowed
|
||||||
|
# future-release=5.0.0
|
||||||
|
# # Ruby-style comments, too
|
||||||
|
# since-tag=1.0.0
|
||||||
|
#
|
||||||
|
# The configuration format is <tt>some-key=value</tt> or <tt>some_key=value</tt>.
|
||||||
|
#
|
||||||
class ParserFile
|
class ParserFile
|
||||||
def initialize(options)
|
# @param options [Hash] options to be configured from file contents
|
||||||
|
# @param file [nil,IO] configuration file handle, defaults to opening `.github_changelog_generator`
|
||||||
|
def initialize(options, file = open_settings_file)
|
||||||
@options = options
|
@options = options
|
||||||
|
@file = file
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Sets options using configuration file content
|
||||||
def parse!
|
def parse!
|
||||||
return unless File.exist?(file)
|
return unless @file
|
||||||
|
@file.each_with_index { |line, i| parse_line!(line, i + 1) }
|
||||||
File.readlines(file).each { |line| parse_line!(line) }
|
@file.close
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def file
|
FILENAME = ".github_changelog_generator"
|
||||||
@file ||= File.expand_path(@options[:params_file] || ".github_changelog_generator")
|
|
||||||
|
def open_settings_file
|
||||||
|
path = Pathname(File.expand_path(FILENAME))
|
||||||
|
File.open(path) if path.exist?
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_line!(line)
|
def parse_line!(line, line_number)
|
||||||
key_sym, value = extract_pair(line)
|
return if non_configuration_line?(line)
|
||||||
value = true if value =~ /^(true|t|yes|y|1)$/i
|
option_name, value = extract_pair(line)
|
||||||
value = false if value =~ /^(false|f|no|n|0)$/i
|
@options[option_key_for(option_name)] = convert_value(value, option_name)
|
||||||
@options[key_sym] = value
|
|
||||||
rescue
|
rescue
|
||||||
raise ParserError, "Config file #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
|
raise ParserError, "Failed on line ##{line_number}: \"#{line.gsub(/[\n\r]+/, '')}\""
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a the setting as a symbol and its string value sans newlines.
|
# Returns true if the line starts with a pound sign or a semi-colon.
|
||||||
|
def non_configuration_line?(line)
|
||||||
|
line =~ /^[\#;]/ || line =~ /^[\s]+$/
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns a the option name as a symbol and its string value sans newlines.
|
||||||
#
|
#
|
||||||
# @param line [String] unparsed line from config file
|
# @param line [String] unparsed line from config file
|
||||||
# @return [Array<Symbol, String>]
|
# @return [Array<Symbol, String>]
|
||||||
@@ -35,5 +63,41 @@ module GitHubChangelogGenerator
|
|||||||
key, value = line.split("=", 2)
|
key, value = line.split("=", 2)
|
||||||
[key.sub("-", "_").to_sym, value.gsub(/[\n\r]+/, "")]
|
[key.sub("-", "_").to_sym, value.gsub(/[\n\r]+/, "")]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
KNOWN_ARRAY_KEYS = [:exclude_labels, :include_labels, :bug_labels,
|
||||||
|
:enhancement_labels, :between_tags, :exclude_tags]
|
||||||
|
KNOWN_INTEGER_KEYS = [:max_issues]
|
||||||
|
|
||||||
|
def convert_value(value, option_name)
|
||||||
|
if KNOWN_ARRAY_KEYS.include?(option_name)
|
||||||
|
value.split(",")
|
||||||
|
elsif KNOWN_INTEGER_KEYS.include?(option_name)
|
||||||
|
value.to_i
|
||||||
|
elsif value =~ /^(true|t|yes|y|1)$/i
|
||||||
|
true
|
||||||
|
elsif value =~ /^(false|f|no|n|0)$/i
|
||||||
|
false
|
||||||
|
else
|
||||||
|
value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
IRREGULAR_OPTIONS = {
|
||||||
|
bugs_label: :bug_prefix,
|
||||||
|
enhancement_label: :enhancement_prefix,
|
||||||
|
issues_label: :issue_prefix,
|
||||||
|
header_label: :header,
|
||||||
|
front_matter: :frontmatter,
|
||||||
|
pr_label: :merge_prefix,
|
||||||
|
issues_wo_labels: :add_issues_wo_labels,
|
||||||
|
pr_wo_labels: :add_pr_wo_labels,
|
||||||
|
pull_requests: :pulls,
|
||||||
|
filter_by_milestone: :filter_issues_by_milestone,
|
||||||
|
github_api: :github_endpoint
|
||||||
|
}
|
||||||
|
|
||||||
|
def option_key_for(option_name)
|
||||||
|
IRREGULAR_OPTIONS.fetch(option_name) { option_name }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module GitHubChangelogGenerator
|
|||||||
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 release_branch verbose release_url
|
future_release release_branch verbose release_url
|
||||||
base ).freeze
|
base )
|
||||||
|
|
||||||
OPTIONS.each do |o|
|
OPTIONS.each do |o|
|
||||||
attr_accessor o.to_sym
|
attr_accessor o.to_sym
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
VERSION = "1.11.0".freeze
|
VERSION = "1.11.8"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
unreleased_label: staging
|
|
||||||
unreleased: false
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
unreleased_label=staging
|
|
||||||
unreleased=false
|
|
||||||
header==== Changelog ===
|
|
||||||
3
spec/install-gem-in-bundler.gemfile
Normal file
3
spec/install-gem-in-bundler.gemfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
|
gem "github_changelog_generator", path: Dir.glob("../pkg/github_changelog_generator-*.gem")[0]
|
||||||
@@ -23,11 +23,11 @@ require "coveralls"
|
|||||||
module SpecHelper
|
module SpecHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
||||||
Coveralls::SimpleCov::Formatter,
|
Coveralls::SimpleCov::Formatter,
|
||||||
SimpleCov::Formatter::HTMLFormatter,
|
SimpleCov::Formatter::HTMLFormatter,
|
||||||
CodeClimate::TestReporter::Formatter
|
CodeClimate::TestReporter::Formatter
|
||||||
]
|
])
|
||||||
SimpleCov.start
|
SimpleCov.start
|
||||||
|
|
||||||
require "github_changelog_generator"
|
require "github_changelog_generator"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
VALID_TOKEN = "0123456789abcdef".freeze
|
VALID_TOKEN = "0123456789abcdef"
|
||||||
INVALID_TOKEN = "0000000000000000".freeze
|
INVALID_TOKEN = "0000000000000000"
|
||||||
|
|
||||||
DEFAULT_OPTIONS = { user: "skywinder",
|
DEFAULT_OPTIONS = { user: "skywinder",
|
||||||
project: "changelog_test" }.freeze
|
project: "changelog_test" }
|
||||||
|
|
||||||
def options_with_invalid_token
|
def options_with_invalid_token
|
||||||
options = DEFAULT_OPTIONS
|
options = DEFAULT_OPTIONS
|
||||||
|
|||||||
28
spec/unit/generator/generator_processor_spec.rb
Normal file
28
spec/unit/generator/generator_processor_spec.rb
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
module GitHubChangelogGenerator
|
||||||
|
describe Generator do
|
||||||
|
context "#exclude_issues_by_labels" do
|
||||||
|
let(:label) { double("the-bad-label", name: "BAD") }
|
||||||
|
let(:issue) { double("the-issue-to-be-excluded", labels: [label]) }
|
||||||
|
let(:good_label) { double("a-good-label", name: "GOOD") }
|
||||||
|
let(:good_issue) { double("an-issue-to-be-kept", labels: [good_label]) }
|
||||||
|
let(:issues) { [issue, good_issue] }
|
||||||
|
subject(:generator) { described_class.new(exclude_labels: %w(BAD BOO)) }
|
||||||
|
|
||||||
|
it "removes issues with labels in the exclude_label list" do
|
||||||
|
result = generator.exclude_issues_by_labels(issues)
|
||||||
|
|
||||||
|
expect(result).to include(good_issue)
|
||||||
|
expect(result).not_to include(issue)
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with no option given" do
|
||||||
|
subject(:generator) { described_class.new }
|
||||||
|
it "passes everything through when no option given" do
|
||||||
|
result = generator.exclude_issues_by_labels(issues)
|
||||||
|
|
||||||
|
expect(result).to eq(issues)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,41 +1,73 @@
|
|||||||
describe GitHubChangelogGenerator::ParserFile do
|
describe GitHubChangelogGenerator::ParserFile do
|
||||||
describe ".github_changelog_generator" do
|
describe ".github_changelog_generator" do
|
||||||
context "when no has file" do
|
let(:options) { {} }
|
||||||
let(:options) { {} }
|
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
context "when the well-known default file does not exist" do
|
||||||
subject { parse.parse! }
|
let(:parser) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||||
|
subject { parser.parse! }
|
||||||
it { is_expected.to be_nil }
|
it { is_expected.to be_nil }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when file is empty" do
|
context "when file is empty" do
|
||||||
let(:options) { { params_file: "spec/files/github_changelog_params_empty" } }
|
let(:parser) { GitHubChangelogGenerator::ParserFile.new(options, StringIO.new("")) }
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
|
||||||
|
|
||||||
it "does not change the options" do
|
it "does not change the options" do
|
||||||
expect { parse.parse! }.to_not change { options }
|
expect { parser.parse! }.to_not change { options }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when file is incorrect" do
|
context "when file is incorrect" do
|
||||||
let(:options) { { params_file: "spec/files/github_changelog_params_incorrect" } }
|
|
||||||
let(:options_before_change) { options.dup }
|
let(:options_before_change) { options.dup }
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
let(:file) { StringIO.new("unreleased_label=staging\nunreleased: false") }
|
||||||
it { expect { parse.parse! }.to raise_error(GitHubChangelogGenerator::ParserError) }
|
let(:parser) do
|
||||||
|
GitHubChangelogGenerator::ParserFile.new(options, file)
|
||||||
|
end
|
||||||
|
it { expect { parser.parse! }.to raise_error(/line #2/) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "allows empty lines and comments with semi-colon or pound sign" do
|
||||||
|
let(:file) { StringIO.new("\n \n# Comment on first line\nunreleased_label=staging\n; Comment on third line\nunreleased=false") }
|
||||||
|
let(:parser) do
|
||||||
|
GitHubChangelogGenerator::ParserFile.new(options, file)
|
||||||
|
end
|
||||||
|
it { expect { parser.parse! }.not_to raise_error }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when override default values" do
|
context "when override default values" do
|
||||||
let(:default_options) { GitHubChangelogGenerator::Parser.default_options }
|
let(:default_options) { GitHubChangelogGenerator::Parser.default_options }
|
||||||
let(:options) { { params_file: "spec/files/github_changelog_params_override" }.merge(default_options) }
|
let(:options) { {}.merge(default_options) }
|
||||||
let(:options_before_change) { options.dup }
|
let(:options_before_change) { options.dup }
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
let(:file) { StringIO.new("unreleased_label=staging\nunreleased=false\nheader==== Changelog ===") }
|
||||||
|
let(:parser) { GitHubChangelogGenerator::ParserFile.new(options, file) }
|
||||||
|
|
||||||
it "changes the options" do
|
it "changes the options" do
|
||||||
expect { parse.parse! }.to change { options }
|
expect { parser.parse! }.to change { options }
|
||||||
.from(options_before_change)
|
.from(options_before_change)
|
||||||
.to(options_before_change.merge(unreleased_label: "staging",
|
.to(options_before_change.merge(unreleased_label: "staging",
|
||||||
unreleased: false,
|
unreleased: false,
|
||||||
header: "=== Changelog ==="))
|
header: "=== Changelog ==="))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "turns exclude-labels into an Array", bug: '#327' do
|
||||||
|
let(:file) do
|
||||||
|
StringIO.new(<<EOF
|
||||||
|
exclude-labels=73a91042-da6f-11e5-9335-1040f38d7f90,7adf83b4-da6f-11e5-ae18-1040f38d7f90
|
||||||
|
header_label=# My changelog
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
end
|
||||||
|
it "reads exclude_labels into an Array" do
|
||||||
|
expect { parser.parse! }.to change { options[:exclude_labels] }
|
||||||
|
.from(default_options[:exclude_labels])
|
||||||
|
.to(["73a91042-da6f-11e5-9335-1040f38d7f90", "7adf83b4-da6f-11e5-ae18-1040f38d7f90"])
|
||||||
|
end
|
||||||
|
|
||||||
|
it "translates given header_label into the :header option" do
|
||||||
|
expect { parser.parse! }.to change { options[:header] }
|
||||||
|
.from(default_options[:header])
|
||||||
|
.to("# My changelog")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user