File tree Expand file tree Collapse file tree 5 files changed +32
-17
lines changed
lib/github_changelog_generator Expand file tree Collapse file tree 5 files changed +32
-17
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
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
+
3
10
## [ 1.12.1] ( https://github.com/skywinder/github-changelog-generator/tree/1.12.1 ) (2016-05-09)
4
11
[ Full Changelog] ( https://github.com/skywinder/github-changelog-generator/compare/1.12.0...1.12.1 )
5
12
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
+
6
17
** Closed issues:**
7
18
8
19
- Add a LICENSE file [ \# 369] ( https://github.com/skywinder/github-changelog-generator/issues/369 )
505
516
506
517
- Encapsulate \[ \> \* \_ \ \] signs in issues names [ \# 34] ( https://github.com/skywinder/github-changelog-generator/issues/34 )
507
518
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
-
512
519
## [ 1.2.1] ( https://github.com/skywinder/github-changelog-generator/tree/1.2.1 ) (2014-11-22)
513
520
[ Full Changelog] ( https://github.com/skywinder/github-changelog-generator/compare/1.2.0...1.2.1 )
514
521
Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- github_changelog_generator (1.12.1 )
4
+ github_changelog_generator (1.13.0 )
5
5
colorize (~> 0.7 )
6
6
github_api (~> 0.12 )
7
7
rake (>= 10.0 )
@@ -105,4 +105,4 @@ DEPENDENCIES
105
105
simplecov (~> 0.10 )
106
106
107
107
BUNDLED WITH
108
- 1.12.0.rc.2
108
+ 1.12.5
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def github_fetch_tags
71
71
response . each_page do |page |
72
72
page_i += PER_PAGE_NUMBER
73
73
print_in_same_line ( "Fetching tags... #{ page_i } /#{ count_pages * PER_PAGE_NUMBER } " )
74
- tags . concat ( page )
74
+ tags . concat ( page ) unless page . nil?
75
75
end
76
76
print_empty_line
77
77
Original file line number Diff line number Diff line change @@ -160,25 +160,30 @@ def generate_unreleased_section
160
160
# Parse issue and generate single line formatted issue line.
161
161
#
162
162
# 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)
164
164
#
165
165
# @param [Hash] issue Fetched issue from GitHub
166
166
# @return [String] Markdown-formatted single issue
167
167
def get_string_for_issue ( issue )
168
168
encapsulated_title = encapsulate_string issue [ :title ]
169
169
170
170
title_with_number = "#{ encapsulated_title } [\\ ##{ issue [ :number ] } ](#{ issue . html_url } )"
171
+ issue_line_with_user ( title_with_number , issue )
172
+ end
171
173
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 } ))"
180
186
end
181
- title_with_number
182
187
end
183
188
end
184
189
end
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ def self.setup_parser(options)
92
92
opts . on ( "--[no-]author" , "Add author of pull-request in the end. Default is true" ) do |author |
93
93
options [ :author ] = author
94
94
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
95
98
opts . on ( "--unreleased-only" , "Generate log from unreleased closed issues only." ) do |v |
96
99
options [ :unreleased_only ] = v
97
100
end
You can’t perform that action at this time.
0 commit comments