Skip to content

Commit f169ea6

Browse files
committed
Merge branch 'hotfix/update-changelog' into develop
2 parents d13d22e + 55fba0f commit f169ea6

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

CHANGELOG.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Change Log
22

3+
## [1.13.0](https://github.com/skywinder/github-changelog-generator/tree/1.13.0) (2016-07-04)
4+
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.12.1...1.13.0)
5+
6+
**Merged pull requests:**
7+
8+
- Carry PR \#301: usernames\_as\_github\_logins [\#392](https://github.com/skywinder/github-changelog-generator/pull/392) ([olleolleolle](https://github.com/olleolleolle))
9+
310
## [1.12.1](https://github.com/skywinder/github-changelog-generator/tree/1.12.1) (2016-05-09)
411
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.12.0...1.12.1)
512

13+
**Fixed bugs:**
14+
15+
- github\_changelog\_generator/generator/generator\_tags.rb:61:in `detect\_since\_tag': undefined method `\[\]' for nil:NilClass \(NoMethodError\) [\#351](https://github.com/skywinder/github-changelog-generator/issues/351)
16+
617
**Closed issues:**
718

819
- Add a LICENSE file [\#369](https://github.com/skywinder/github-changelog-generator/issues/369)
@@ -505,10 +516,6 @@
505516

506517
- Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/github-changelog-generator/issues/34)
507518

508-
**Merged pull requests:**
509-
510-
- Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/github-changelog-generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef))
511-
512519
## [1.2.1](https://github.com/skywinder/github-changelog-generator/tree/1.2.1) (2014-11-22)
513520
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.2.0...1.2.1)
514521

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
github_changelog_generator (1.12.1)
4+
github_changelog_generator (1.13.0)
55
colorize (~> 0.7)
66
github_api (~> 0.12)
77
rake (>= 10.0)
@@ -105,4 +105,4 @@ DEPENDENCIES
105105
simplecov (~> 0.10)
106106

107107
BUNDLED WITH
108-
1.12.0.rc.2
108+
1.12.5

lib/github_changelog_generator/fetcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def github_fetch_tags
7171
response.each_page do |page|
7272
page_i += PER_PAGE_NUMBER
7373
print_in_same_line("Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}")
74-
tags.concat(page)
74+
tags.concat(page) unless page.nil?
7575
end
7676
print_empty_line
7777

lib/github_changelog_generator/generator/generator_generation.rb

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,30 @@ def generate_unreleased_section
160160
# Parse issue and generate single line formatted issue line.
161161
#
162162
# Example output:
163-
# - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder))
163+
# - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) (@skywinder)
164164
#
165165
# @param [Hash] issue Fetched issue from GitHub
166166
# @return [String] Markdown-formatted single issue
167167
def get_string_for_issue(issue)
168168
encapsulated_title = encapsulate_string issue[:title]
169169

170170
title_with_number = "#{encapsulated_title} [\\##{issue[:number]}](#{issue.html_url})"
171+
issue_line_with_user(title_with_number, issue)
172+
end
171173

172-
unless issue.pull_request.nil?
173-
if @options[:author]
174-
title_with_number += if issue.user.nil?
175-
" ({Null user})"
176-
else
177-
" ([#{issue.user.login}](#{issue.user.html_url}))"
178-
end
179-
end
174+
private
175+
176+
def issue_line_with_user(line, issue)
177+
return line if !@options[:author] || issue.pull_request.nil?
178+
179+
user = issue.user
180+
return "#{line} ({Null user})" unless user
181+
182+
if @options[:usernames_as_github_logins]
183+
"#{line} (@#{user.login})"
184+
else
185+
"#{line} ([#{user.login}](#{user.html_url}))"
180186
end
181-
title_with_number
182187
end
183188
end
184189
end

lib/github_changelog_generator/parser.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def self.setup_parser(options)
9292
opts.on("--[no-]author", "Add author of pull-request in the end. Default is true") do |author|
9393
options[:author] = author
9494
end
95+
opts.on("--usernames-as-github-logins", "Use GitHub tags instead of Markdown links for the author of an issue or pull-request.") do |v|
96+
options[:usernames_as_github_logins] = v
97+
end
9598
opts.on("--unreleased-only", "Generate log from unreleased closed issues only.") do |v|
9699
options[:unreleased_only] = v
97100
end

0 commit comments

Comments
 (0)