Compare commits
1 Commits
1.9.0
...
raphink-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f60c19ef2 |
@@ -1,5 +1,6 @@
|
|||||||
|
sudo: false
|
||||||
|
cache: bundler
|
||||||
language: ruby
|
language: ruby
|
||||||
before_install: gem update --system
|
|
||||||
rvm:
|
rvm:
|
||||||
- 2.1.0
|
- 2.1.0
|
||||||
script:
|
script:
|
||||||
|
|||||||
56
CHANGELOG.md
56
CHANGELOG.md
@@ -1,43 +1,8 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
## [1.8.5](https://github.com/skywinder/github-changelog-generator/tree/1.8.5) (2015-09-15)
|
## [Unreleased](https://github.com/skywinder/github-changelog-generator/tree/HEAD)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.4...1.8.5)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.0...HEAD)
|
||||||
|
|
||||||
- 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:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -50,7 +15,6 @@
|
|||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
- Generate change log since/due specific tag [\#254](https://github.com/skywinder/github-changelog-generator/issues/254)
|
- 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:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -58,6 +22,7 @@
|
|||||||
- Add release\_url to rake task options [\#264](https://github.com/skywinder/github-changelog-generator/pull/264) ([raphink](https://github.com/raphink))
|
- 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 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 release\_url option [\#259](https://github.com/skywinder/github-changelog-generator/pull/259) ([raphink](https://github.com/raphink))
|
||||||
|
- Add --base option [\#258](https://github.com/skywinder/github-changelog-generator/pull/258) ([raphink](https://github.com/raphink))
|
||||||
- Add --since-tag [\#257](https://github.com/skywinder/github-changelog-generator/pull/257) ([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)
|
||||||
@@ -139,7 +104,6 @@
|
|||||||
|
|
||||||
- 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:**
|
||||||
|
|
||||||
@@ -149,6 +113,7 @@
|
|||||||
|
|
||||||
- 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))
|
||||||
@@ -164,7 +129,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)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- 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))
|
||||||
|
|
||||||
@@ -175,7 +140,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)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- 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))
|
||||||
|
|
||||||
@@ -249,7 +214,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)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- 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))
|
||||||
|
|
||||||
@@ -266,12 +231,15 @@
|
|||||||
**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)
|
||||||
@@ -380,7 +348,6 @@
|
|||||||
|
|
||||||
- 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:**
|
||||||
|
|
||||||
@@ -388,6 +355,7 @@
|
|||||||
|
|
||||||
**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)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
github_changelog_generator (1.8.5)
|
github_changelog_generator (1.8.0)
|
||||||
colorize (~> 0.7)
|
colorize (~> 0.7)
|
||||||
github_api (~> 0.12)
|
github_api (~> 0.12)
|
||||||
|
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -84,16 +84,6 @@ 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)
|
||||||
|
|
||||||
### Params File
|
|
||||||
You can put Params in a .github_changelog_generator file in Project Root to override default params:
|
|
||||||
|
|
||||||
Example:
|
|
||||||
```
|
|
||||||
unreleased=false
|
|
||||||
future-release=5.0.0
|
|
||||||
since-tag=1.0.0
|
|
||||||
```
|
|
||||||
|
|
||||||
### GitHub token
|
### GitHub token
|
||||||
|
|
||||||
Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
|
Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
|
||||||
@@ -221,8 +211,6 @@ If you're seeing this warning:
|
|||||||
6. Create a new Pull Request
|
6. Create a new Pull Request
|
||||||
7. Profit! :white_check_mark:
|
7. Profit! :white_check_mark:
|
||||||
|
|
||||||
*To test change log workflow you can use [test repo](https://github.com/skywinder/changelog_test/)*
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
**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:**
|
||||||
|
|
||||||
@@ -23,6 +22,7 @@
|
|||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- 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 a PR with a lot of comments and events [\#17](https://github.com/skywinder/changelog_test/pull/17) ([skywinder](https://github.com/skywinder))
|
||||||
|
- PR [\#16](https://github.com/skywinder/changelog_test/pull/16) ([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,7 +7,6 @@ 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"
|
||||||
|
|||||||
@@ -120,22 +120,22 @@ module GitHubChangelogGenerator
|
|||||||
issues_a.push dict unless added
|
issues_a.push dict unless added
|
||||||
end
|
end
|
||||||
|
|
||||||
added_pull_requests = []
|
|
||||||
pull_requests.each do |dict|
|
pull_requests.each do |dict|
|
||||||
|
added = false
|
||||||
dict.labels.each do |label|
|
dict.labels.each do |label|
|
||||||
if @options[:bug_labels].include? label.name
|
if @options[:bug_labels].include? label.name
|
||||||
bugs_a.push dict
|
bugs_a.push dict
|
||||||
added_pull_requests.push dict
|
added = true
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
if @options[:enhancement_labels].include? label.name
|
if @options[:enhancement_labels].include? label.name
|
||||||
enhancement_a.push dict
|
enhancement_a.push dict
|
||||||
added_pull_requests.push dict
|
added = true
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
pull_requests.delete(dict) if added
|
||||||
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
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ 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"
|
||||||
|
|||||||
@@ -131,45 +131,16 @@ module GitHubChangelogGenerator
|
|||||||
# @param [Array] all_tags all tags
|
# @param [Array] all_tags all tags
|
||||||
# @return [Array] filtered tags according :exclude_tags option
|
# @return [Array] filtered tags according :exclude_tags option
|
||||||
def filter_excluded_tags(all_tags)
|
def filter_excluded_tags(all_tags)
|
||||||
return all_tags unless @options[:exclude_tags]
|
filtered_tags = all_tags
|
||||||
|
if @options[:exclude_tags]
|
||||||
apply_exclude_tags(all_tags)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
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|
|
@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
|
unless all_tags.map(&:name).include? tag
|
||||||
Helper.log.warn "Warning: can't find tag #{tag}, specified with --exclude-tags option."
|
Helper.log.warn "Warning: can't find tag #{tag}, specified with --exclude-tags option."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
filtered_tags = all_tags.reject { |tag| @options[:exclude_tags].include? tag.name }
|
||||||
|
end
|
||||||
|
filtered_tags
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,10 +9,8 @@ module GitHubChangelogGenerator
|
|||||||
def self.parse_options
|
def self.parse_options
|
||||||
options = get_default_options
|
options = get_default_options
|
||||||
|
|
||||||
parser_file = ParserFile.new options
|
|
||||||
parser_file.parse!
|
|
||||||
|
|
||||||
parser = setup_parser(options)
|
parser = setup_parser(options)
|
||||||
|
|
||||||
parser.parse!
|
parser.parse!
|
||||||
|
|
||||||
if options[:user].nil? || options[:project].nil?
|
if options[:user].nil? || options[:project].nil?
|
||||||
@@ -24,20 +22,13 @@ module GitHubChangelogGenerator
|
|||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
print_options(options)
|
|
||||||
|
|
||||||
options
|
|
||||||
end
|
|
||||||
|
|
||||||
# @param [Hash] options to display
|
|
||||||
def self.print_options(options)
|
|
||||||
if options[:verbose]
|
if options[:verbose]
|
||||||
Helper.log.info "Performing task with options:"
|
Helper.log.info "Performing task with options:"
|
||||||
options_to_display = options.clone
|
pp options
|
||||||
options_to_display[:token] = options_to_display[:token].nil? ? nil : "hidden value"
|
|
||||||
pp options_to_display
|
|
||||||
puts ""
|
puts ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
options
|
||||||
end
|
end
|
||||||
|
|
||||||
# setup parsing options
|
# setup parsing options
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
module GitHubChangelogGenerator
|
|
||||||
class ParserFile
|
|
||||||
def initialize(options)
|
|
||||||
@options = options
|
|
||||||
end
|
|
||||||
|
|
||||||
def file
|
|
||||||
File.expand_path(@options[:params_file] || ".github_changelog_generator")
|
|
||||||
end
|
|
||||||
|
|
||||||
def file?
|
|
||||||
File.exist?(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
def file_open
|
|
||||||
File.open(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
def parse!
|
|
||||||
return unless file?
|
|
||||||
file_open.each do |line|
|
|
||||||
begin
|
|
||||||
key, value = line.split("=")
|
|
||||||
key_sym = key.sub("-", "_").to_sym
|
|
||||||
value = value.gsub(/[\n\r]+/, "")
|
|
||||||
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 "File #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@options
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -51,7 +51,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
OPTIONS.each do |o|
|
OPTIONS.each do |o|
|
||||||
v = instance_variable_get("@#{o}")
|
v = instance_variable_get("@#{o}")
|
||||||
options[o.to_sym] = v unless v.nil?
|
options[o.to_sym] = v if v
|
||||||
end
|
end
|
||||||
|
|
||||||
generator = Generator.new options
|
generator = Generator.new options
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
VERSION = "1.9.0"
|
VERSION = "1.8.0"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
unreleased_label: staging
|
|
||||||
unreleased: false
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
unreleased_label=staging
|
|
||||||
unreleased=false
|
|
||||||
@@ -31,25 +31,91 @@ 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
|
||||||
|
|
||||||
config.default_formatter = "doc" if config.files_to_run.one?
|
# Many RSpec users commonly either run the entire suite or an individual
|
||||||
|
# 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,18 +87,6 @@ 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
|
||||||
|
|
||||||
context "with regex exclude_tags" do
|
|
||||||
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[23]/) }
|
|
||||||
it { is_expected.to be_a Array }
|
|
||||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
|
||||||
end
|
|
||||||
|
|
||||||
context "with non-matching regex in exclude_tags" do
|
|
||||||
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[abc]/) }
|
|
||||||
it { is_expected.to be_a Array }
|
|
||||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#filter_since_tag" do
|
describe "#filter_since_tag" do
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
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) }
|
|
||||||
subject { parse.parse! }
|
|
||||||
it { is_expected.to be_a(Hash) }
|
|
||||||
it { is_expected.to eq(options) }
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when file is incorrect" do
|
|
||||||
let(:options) { { params_file: "spec/files/github_changelog_params_incorrect" } }
|
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
|
||||||
it { expect { fail.raise! }.to raise_error RuntimeError }
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when override default values" do
|
|
||||||
let(:options) { { params_file: "spec/files/github_changelog_params_override" }.merge(GitHubChangelogGenerator::Parser.get_default_options) }
|
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
|
||||||
subject { parse.parse! }
|
|
||||||
it { is_expected.to be_a(Hash) }
|
|
||||||
it { is_expected.to eq(options.merge(unreleased_label: "staging", unreleased: false)) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user