From 5304e4faf85c87d1cf614ab3ef590cf511a4c95c Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 22 Dec 2014 15:31:49 +0200 Subject: [PATCH] fix #22 --- CHANGELOG.md | 10 ++++++---- lib/github_changelog_generator.rb | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab6a16..5270bc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,20 +12,24 @@ - *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30) +- *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) + ## [1.2.3] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) #### 16/12/14 -- *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) - ## [1.2.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) #### 10/12/14 - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef)) +- *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) + ## [1.2.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) #### 22/11/14 - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder)) +- *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20) + ## [1.2.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) #### 19/11/14 - *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) @@ -42,8 +46,6 @@ - *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19) -- *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20) - ## [1.1.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) #### 12/11/14 - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder)) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 718438c..27e8688 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -253,18 +253,30 @@ module GitHubChangelogGenerator milestone_is_tag = @all_tags.find{|tag| tag.name == issue.milestone.title } - - if milestone_is_tag.nil? - true - else - issue.milestone.title == newer_tag_name - end + milestone_is_tag.nil? end } #add missed issues (according milestones) + issues_to_add = @issues.select{|issue| + if issue.milestone.nil? + false + else + #check, that this milestone in tag list: + milestone_is_tag = @all_tags.find{|tag| + tag.name == issue.milestone.title + } + if milestone_is_tag.nil? + false + else + issue.milestone.title == newer_tag_name + end + end + } + + filtered_issues |= issues_to_add self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time)