github_changelog_generator 1.13.1 → 1.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -2
- data/Rakefile +2 -1
- data/bin/ghclgen +4 -0
- data/bin/git-generate-changelog +1 -0
- data/bin/github_changelog_generator +1 -0
- data/lib/github_changelog_generator.rb +1 -1
- data/lib/github_changelog_generator/fetcher.rb +21 -16
- data/lib/github_changelog_generator/generator/generator.rb +1 -0
- data/lib/github_changelog_generator/generator/generator_fetcher.rb +2 -1
- data/lib/github_changelog_generator/generator/generator_generation.rb +4 -3
- data/lib/github_changelog_generator/generator/generator_processor.rb +8 -4
- data/lib/github_changelog_generator/generator/generator_tags.rb +3 -2
- data/lib/github_changelog_generator/helper.rb +12 -13
- data/lib/github_changelog_generator/parser.rb +25 -15
- data/lib/github_changelog_generator/parser_file.rb +1 -0
- data/lib/github_changelog_generator/reader.rb +1 -0
- data/lib/github_changelog_generator/task.rb +2 -1
- data/lib/github_changelog_generator/version.rb +2 -1
- data/spec/spec_helper.rb +4 -1
- data/spec/unit/fetcher_spec.rb +1 -0
- data/spec/unit/generator/generator_processor_spec.rb +1 -0
- data/spec/unit/generator/generator_tags_spec.rb +1 -0
- data/spec/unit/parse_file_spec.rb +2 -1
- data/spec/unit/parser_spec.rb +22 -0
- data/spec/unit/reader_spec.rb +1 -0
- metadata +12 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 336a1ac8b95b7e15cb682b2f073fcad6c3de1eae
|
4
|
+
data.tar.gz: 2ab6a245bf80a345de5fd1cedeab7aa49779b53b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78bc7037133a625102719ed21ea878e1f065dd92252052142c973be0f7cfa3236e06916a88574c1ae9534cdde100b8b202dc7aa40445a891c14a980de9608953
|
7
|
+
data.tar.gz: 887ee7d59c311859c8bfe55488f6a3985551fd28e16f981b8de43244239e7660af5f54ab30b8fb1759d2d19eca72968ab3b04d7d31383953bea46cff0c593349
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[![Inline docs](http://inch-ci.org/github/skywinder/github-changelog-generator.svg)](http://inch-ci.org/github/skywinder/github-changelog-generator)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/skywinder/github-changelog-generator/badges/gpa.svg)](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
6
6
|
[![Test Coverage](https://codeclimate.com/github/skywinder/github-changelog-generator/badges/coverage.svg)](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
7
|
+
[![Join the chat at https://gitter.im/github-changelog-generator/chat](https://badges.gitter.im/github-changelog-generator/chat.svg)](https://gitter.im/github-changelog-generator/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
7
8
|
|
8
9
|
GitHub Changelog Generator ![GitHub Logo](../master/images/logo.jpg)
|
9
10
|
==================
|
@@ -23,7 +24,7 @@ GitHub Changelog Generator ![GitHub Logo](../master/images/logo.jpg)
|
|
23
24
|
|
24
25
|
### Changelog generation has never been so easy
|
25
26
|
|
26
|
-
**Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according labels) from :octocat: GitHub Issue Tracker.
|
27
|
+
**Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according to labels) from :octocat: GitHub Issue Tracker.
|
27
28
|
|
28
29
|
Since now you don't have to fill your `CHANGELOG.md` manually: just run the script, relax and take a cup of :coffee: before your next release! :tada:
|
29
30
|
|
@@ -36,7 +37,9 @@ Because software tools are for people. If you don’t care, why are you contribu
|
|
36
37
|
|
37
38
|
## Installation
|
38
39
|
|
39
|
-
|
40
|
+
gem install github_changelog_generator
|
41
|
+
|
42
|
+
See also Troubleshooting.
|
40
43
|
|
41
44
|
## Output example
|
42
45
|
|
@@ -223,6 +226,31 @@ If you're seeing this warning, please do the following:
|
|
223
226
|
1. Make sure you're providing an OAuth token, so you're not making requests anonymously. Using an OAuth token increases your hourly request maximum from 60 to 5000.
|
224
227
|
2. If you have a large repo with lots of issues/PRs, you can use `--max-issues NUM` to limit the number of issues that are pulled back. For example: `--max-issues 1000`
|
225
228
|
|
229
|
+
- ***My Ruby version is very old, can I use this?***
|
230
|
+
|
231
|
+
When your Ruby is old, and you don't want to upgrade, and your want to
|
232
|
+
control which libraries you use, you can use Bundler.
|
233
|
+
|
234
|
+
In a Gemfile, perhaps in a non-deployed `:development` group, add this
|
235
|
+
gem:
|
236
|
+
|
237
|
+
```ruby
|
238
|
+
group :development do
|
239
|
+
gem 'github_changelog_generator', require: false
|
240
|
+
end
|
241
|
+
```
|
242
|
+
|
243
|
+
Then you can keep back dependencies like rack, which currently is only
|
244
|
+
compatible with Ruby >= 2.2.2. So, use an older version for your app by
|
245
|
+
adding a line like this to the Gemfile:
|
246
|
+
|
247
|
+
```
|
248
|
+
gem 'rack', '~> 1.6'
|
249
|
+
```
|
250
|
+
|
251
|
+
This way, you can keep on using github_changelog_generator, even if you
|
252
|
+
can't get the latest version of Ruby installed.
|
253
|
+
|
226
254
|
## Contributing
|
227
255
|
|
228
256
|
1. Create an issue and describe your idea
|
data/Rakefile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "bundler"
|
2
3
|
require "bundler/gem_tasks"
|
3
4
|
require "rubocop/rake_task"
|
@@ -36,4 +37,4 @@ task :copy_man_page_to_manpath do |_t|
|
|
36
37
|
end
|
37
38
|
|
38
39
|
task checks: [:rubocop, :rspec]
|
39
|
-
task default: [:
|
40
|
+
task default: [:rubocop, :rspec]
|
data/bin/ghclgen
ADDED
data/bin/git-generate-changelog
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module GitHubChangelogGenerator
|
2
3
|
# A Fetcher responsible for all requests to GitHub and all basic manipulation with related data
|
3
4
|
# (such as filtering, validating, e.t.c)
|
@@ -7,6 +8,7 @@ module GitHubChangelogGenerator
|
|
7
8
|
|
8
9
|
class Fetcher
|
9
10
|
PER_PAGE_NUMBER = 30
|
11
|
+
MAX_SIMULTANEOUS_REQUESTS = 25
|
10
12
|
CHANGELOG_GITHUB_TOKEN = "CHANGELOG_GITHUB_TOKEN"
|
11
13
|
GH_RATE_LIMIT_EXCEEDED_MSG = "Warning: Can't finish operation: GitHub API rate limit exceeded, change log may be " \
|
12
14
|
"missing some issues. You can limit the number of issues fetched using the `--max-issues NUM` argument."
|
@@ -33,7 +35,7 @@ module GitHubChangelogGenerator
|
|
33
35
|
def fetch_github_token
|
34
36
|
env_var = @options[:token] ? @options[:token] : (ENV.fetch CHANGELOG_GITHUB_TOKEN, nil)
|
35
37
|
|
36
|
-
Helper.log.warn NO_TOKEN_PROVIDED
|
38
|
+
Helper.log.warn NO_TOKEN_PROVIDED unless env_var
|
37
39
|
|
38
40
|
env_var
|
39
41
|
end
|
@@ -52,11 +54,11 @@ module GitHubChangelogGenerator
|
|
52
54
|
begin
|
53
55
|
value = yield
|
54
56
|
rescue Github::Error::Unauthorized => e
|
55
|
-
Helper.log.error e.
|
57
|
+
Helper.log.error e.response_message
|
56
58
|
abort "Error: wrong GitHub token"
|
57
59
|
rescue Github::Error::Forbidden => e
|
58
|
-
Helper.log.warn e.
|
59
|
-
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG
|
60
|
+
Helper.log.warn e.response_message
|
61
|
+
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG
|
60
62
|
end
|
61
63
|
value
|
62
64
|
end
|
@@ -75,9 +77,9 @@ module GitHubChangelogGenerator
|
|
75
77
|
end
|
76
78
|
print_empty_line
|
77
79
|
|
78
|
-
if tags.
|
80
|
+
if tags.empty?
|
79
81
|
Helper.log.warn "Warning: Can't find any tags in repo.\
|
80
|
-
Make sure, that you push tags to remote repo via 'git push --tags'"
|
82
|
+
Make sure, that you push tags to remote repo via 'git push --tags'"
|
81
83
|
else
|
82
84
|
Helper.log.info "Found #{tags.count} tags"
|
83
85
|
end
|
@@ -108,8 +110,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|
108
110
|
print_empty_line
|
109
111
|
Helper.log.info "Received issues: #{issues.count}"
|
110
112
|
|
111
|
-
rescue
|
112
|
-
Helper.log.warn
|
113
|
+
rescue Github::Error::Forbidden => e
|
114
|
+
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ")
|
115
|
+
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG
|
113
116
|
end
|
114
117
|
|
115
118
|
# separate arrays of issues and pull requests:
|
@@ -142,8 +145,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|
142
145
|
pull_requests.concat(page)
|
143
146
|
end
|
144
147
|
print_empty_line
|
145
|
-
rescue
|
146
|
-
Helper.log.warn
|
148
|
+
rescue Github::Error::Forbidden => e
|
149
|
+
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ")
|
150
|
+
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG
|
147
151
|
end
|
148
152
|
|
149
153
|
Helper.log.info "Fetching merged dates: #{pull_requests.count}"
|
@@ -166,9 +170,8 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|
166
170
|
# @return [Void]
|
167
171
|
def fetch_events_async(issues)
|
168
172
|
i = 0
|
169
|
-
max_thread_number = 50
|
170
173
|
threads = []
|
171
|
-
issues.each_slice(
|
174
|
+
issues.each_slice(MAX_SIMULTANEOUS_REQUESTS) do |issues_slice|
|
172
175
|
issues_slice.each do |issue|
|
173
176
|
threads << Thread.new do
|
174
177
|
begin
|
@@ -179,8 +182,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|
179
182
|
response.each_page do |page|
|
180
183
|
issue[:events].concat(page)
|
181
184
|
end
|
182
|
-
rescue
|
183
|
-
Helper.log.warn
|
185
|
+
rescue Github::Error::Forbidden => e
|
186
|
+
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ")
|
187
|
+
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG
|
184
188
|
end
|
185
189
|
print_in_same_line("Fetching events for issues and PR: #{i + 1}/#{issues.count}")
|
186
190
|
i += 1
|
@@ -205,8 +209,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|
205
209
|
commit_data = @github.git_data.commits.get @options[:user],
|
206
210
|
@options[:project],
|
207
211
|
tag["commit"]["sha"]
|
208
|
-
rescue
|
209
|
-
Helper.log.warn
|
212
|
+
rescue Github::Error::Forbidden => e
|
213
|
+
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ")
|
214
|
+
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG
|
210
215
|
end
|
211
216
|
time_string = commit_data["committer"]["date"]
|
212
217
|
Time.parse(time_string)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module GitHubChangelogGenerator
|
2
3
|
class Generator
|
3
4
|
# Fetch event for issues and pull requests
|
@@ -74,7 +75,7 @@ module GitHubChangelogGenerator
|
|
74
75
|
commit = @fetcher.fetch_commit(event)
|
75
76
|
issue[:actual_date] = commit[:author][:date]
|
76
77
|
rescue
|
77
|
-
puts "Warning: Can't fetch commit #{event[:commit_id]}. It is probably referenced from another repo."
|
78
|
+
puts "Warning: Can't fetch commit #{event[:commit_id]}. It is probably referenced from another repo."
|
78
79
|
issue[:actual_date] = issue[:closed_at]
|
79
80
|
end
|
80
81
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module GitHubChangelogGenerator
|
2
3
|
class Generator
|
3
4
|
# Main function to start change log generation
|
@@ -39,10 +40,10 @@ module GitHubChangelogGenerator
|
|
39
40
|
index2 = hash[tag2]
|
40
41
|
log += generate_log_between_tags(all_tags[index1], all_tags[index2])
|
41
42
|
else
|
42
|
-
raise ChangelogGeneratorError, "Can't find tag #{tag2} -> exit"
|
43
|
+
raise ChangelogGeneratorError, "Can't find tag #{tag2} -> exit"
|
43
44
|
end
|
44
45
|
else
|
45
|
-
raise ChangelogGeneratorError, "Can't find tag #{tag1} -> exit"
|
46
|
+
raise ChangelogGeneratorError, "Can't find tag #{tag1} -> exit"
|
46
47
|
end
|
47
48
|
log
|
48
49
|
end
|
@@ -141,7 +142,7 @@ module GitHubChangelogGenerator
|
|
141
142
|
(1...filtered_tags.size).each do |index|
|
142
143
|
log += generate_log_between_tags(filtered_tags[index], filtered_tags[index - 1])
|
143
144
|
end
|
144
|
-
if
|
145
|
+
if filtered_tags.any?
|
145
146
|
log += generate_log_between_tags(nil, filtered_tags.last)
|
146
147
|
end
|
147
148
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module GitHubChangelogGenerator
|
2
3
|
class Generator
|
3
4
|
# delete all labels with labels from @options[:exclude_labels] array
|
@@ -130,11 +131,14 @@ module GitHubChangelogGenerator
|
|
130
131
|
end
|
131
132
|
|
132
133
|
def filter_by_include_labels(issues)
|
133
|
-
|
134
|
-
|
135
|
-
|
134
|
+
if @options[:include_labels].nil?
|
135
|
+
issues
|
136
|
+
else
|
137
|
+
issues.select do |issue|
|
138
|
+
labels = issue.labels.map(&:name) & @options[:include_labels]
|
139
|
+
labels.any?
|
140
|
+
end
|
136
141
|
end
|
137
|
-
filtered_issues
|
138
142
|
end
|
139
143
|
|
140
144
|
# General filtered function
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module GitHubChangelogGenerator
|
2
3
|
class Generator
|
3
4
|
# fetch, filter tags, fetch dates and sort them in time order
|
@@ -19,7 +20,7 @@ module GitHubChangelogGenerator
|
|
19
20
|
# @param [Hash] tag_name name of the tag
|
20
21
|
# @return [Time] time of specified tag
|
21
22
|
def get_time_of_tag(tag_name)
|
22
|
-
raise ChangelogGeneratorError, "tag_name is nil"
|
23
|
+
raise ChangelogGeneratorError, "tag_name is nil" if tag_name.nil?
|
23
24
|
|
24
25
|
name_of_tag = tag_name["name"]
|
25
26
|
time_for_name = @tag_times_hash[name_of_tag]
|
@@ -99,7 +100,7 @@ module GitHubChangelogGenerator
|
|
99
100
|
filtered_tags = all_tags
|
100
101
|
tag = @options[:due_tag]
|
101
102
|
if tag
|
102
|
-
if
|
103
|
+
if all_tags.any? && all_tags.map(&:name).include?(tag)
|
103
104
|
idx = all_tags.index { |t| t.name == tag }
|
104
105
|
last_index = all_tags.count - 1
|
105
106
|
filtered_tags = if idx > 0 && idx < last_index
|
@@ -1,4 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "logger"
|
3
|
+
require "rainbow"
|
4
|
+
|
2
5
|
module GitHubChangelogGenerator
|
3
6
|
module Helper
|
4
7
|
# @return true if the currently running program is a unit test
|
@@ -6,6 +9,7 @@ module GitHubChangelogGenerator
|
|
6
9
|
defined? SpecHelper
|
7
10
|
end
|
8
11
|
|
12
|
+
# :nocov:
|
9
13
|
@log ||= if test?
|
10
14
|
Logger.new(nil) # don't show any logs when running tests
|
11
15
|
else
|
@@ -13,21 +17,16 @@ module GitHubChangelogGenerator
|
|
13
17
|
end
|
14
18
|
@log.formatter = proc do |severity, _datetime, _progname, msg|
|
15
19
|
string = "#{msg}\n"
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
elsif severity == "ERROR"
|
24
|
-
string = string.red
|
25
|
-
elsif severity == "FATAL"
|
26
|
-
string = string.red.bold
|
20
|
+
case severity
|
21
|
+
when "DEBUG" then Rainbow(string).magenta
|
22
|
+
when "INFO" then Rainbow(string).white
|
23
|
+
when "WARN" then Rainbow(string).yellow
|
24
|
+
when "ERROR" then Rainbow(string).red
|
25
|
+
when "FATAL" then Rainbow(string).red.bright
|
26
|
+
else string
|
27
27
|
end
|
28
|
-
|
29
|
-
string
|
30
28
|
end
|
29
|
+
# :nocov:
|
31
30
|
|
32
31
|
# Logging happens using this method
|
33
32
|
class << self
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
require "optparse"
|
3
4
|
require "pp"
|
4
5
|
require_relative "version"
|
@@ -14,7 +15,7 @@ module GitHubChangelogGenerator
|
|
14
15
|
parser = setup_parser(options)
|
15
16
|
parser.parse!
|
16
17
|
|
17
|
-
|
18
|
+
fetch_user_and_project(options)
|
18
19
|
|
19
20
|
abort(parser.banner) unless options[:user] && options[:project]
|
20
21
|
|
@@ -61,7 +62,7 @@ module GitHubChangelogGenerator
|
|
61
62
|
opts.on("-b", "--base [NAME]", "Optional base file to append generated changes to.") do |last|
|
62
63
|
options[:base] = last
|
63
64
|
end
|
64
|
-
opts.on("--bugs-label [LABEL]", "Setup custom label for bug-fixes section. Default is \"**Fixed bugs
|
65
|
+
opts.on("--bugs-label [LABEL]", "Setup custom label for bug-fixes section. Default is \"**Fixed bugs:**\"") do |v|
|
65
66
|
options[:bug_prefix] = v
|
66
67
|
end
|
67
68
|
opts.on("--enhancement-label [LABEL]", "Setup custom label for enhancements section. Default is \"**Implemented enhancements:**\"") do |v|
|
@@ -208,24 +209,34 @@ module GitHubChangelogGenerator
|
|
208
209
|
end
|
209
210
|
|
210
211
|
# If `:user` or `:project` not set in options, try setting them
|
211
|
-
|
212
|
+
# Valid unnamed parameters:
|
213
|
+
# 1) in 1 param: repo_name/project
|
214
|
+
# 2) in 2 params: repo name project
|
215
|
+
def self.fetch_user_and_project(options)
|
212
216
|
if options[:user].nil? || options[:project].nil?
|
213
|
-
|
217
|
+
user, project = user_and_project_from_git(options, ARGV[0], ARGV[1])
|
218
|
+
options[:user] ||= user
|
219
|
+
options[:project] ||= project
|
214
220
|
end
|
215
221
|
end
|
216
222
|
|
217
223
|
# Sets `:user` and `:project` in `options` from CLI arguments or `git remote`
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
224
|
+
# @param [String] arg0 first argument in cli
|
225
|
+
# @param [String] arg1 second argument in cli
|
226
|
+
# @return [Array<String>] user and project, or nil if unsuccessful
|
227
|
+
def self.user_and_project_from_git(options, arg0 = nil, arg1 = nil)
|
228
|
+
user, project = user_project_from_option(arg0, arg1, options[:github_site])
|
229
|
+
unless user && project
|
230
|
+
if ENV["RUBYLIB"] =~ /ruby-debug-ide/
|
231
|
+
user = "skywinder"
|
232
|
+
project = "changelog_test"
|
233
|
+
else
|
234
|
+
remote = `git config --get remote.#{options[:git_remote]}.url`
|
235
|
+
user, project = user_project_from_remote(remote)
|
236
|
+
end
|
228
237
|
end
|
238
|
+
|
239
|
+
[user, project]
|
229
240
|
end
|
230
241
|
|
231
242
|
# Returns GitHub username and project from CLI arguments
|
@@ -245,7 +256,6 @@ module GitHubChangelogGenerator
|
|
245
256
|
if arg0 && !arg1
|
246
257
|
# this match should parse strings such "https://github.com/skywinder/Github-Changelog-Generator" or
|
247
258
|
# "skywinder/Github-Changelog-Generator" to user and name
|
248
|
-
puts arg0
|
249
259
|
match = /(?:.+#{Regexp.escape(github_site)}\/)?(.+)\/(.+)/.match(arg0)
|
250
260
|
|
251
261
|
begin
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "rake"
|
2
3
|
require "rake/tasklib"
|
3
4
|
require "github_changelog_generator"
|
@@ -46,7 +47,7 @@ module GitHubChangelogGenerator
|
|
46
47
|
# mimick parse_options
|
47
48
|
options = Parser.default_options
|
48
49
|
|
49
|
-
Parser.
|
50
|
+
Parser.fetch_user_and_project(options)
|
50
51
|
|
51
52
|
OPTIONS.each do |o|
|
52
53
|
v = instance_variable_get("@#{o}")
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Enrico Stahn <mail@enricostahn.com>
|
3
4
|
#
|
@@ -28,7 +29,9 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
|
28
29
|
SimpleCov::Formatter::HTMLFormatter,
|
29
30
|
CodeClimate::TestReporter::Formatter
|
30
31
|
])
|
31
|
-
SimpleCov.start
|
32
|
+
SimpleCov.start do
|
33
|
+
add_filter "gemfiles/"
|
34
|
+
end
|
32
35
|
|
33
36
|
require "github_changelog_generator"
|
34
37
|
require "github_changelog_generator/task"
|
data/spec/unit/fetcher_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
describe GitHubChangelogGenerator::ParserFile do
|
2
3
|
describe ".github_changelog_generator" do
|
3
4
|
let(:options) { {} }
|
@@ -48,7 +49,7 @@ describe GitHubChangelogGenerator::ParserFile do
|
|
48
49
|
header: "=== Changelog ==="))
|
49
50
|
end
|
50
51
|
|
51
|
-
context "turns exclude-labels into an Array", bug:
|
52
|
+
context "turns exclude-labels into an Array", bug: "#327" do
|
52
53
|
let(:file) do
|
53
54
|
StringIO.new(<<EOF
|
54
55
|
exclude-labels=73a91042-da6f-11e5-9335-1040f38d7f90,7adf83b4-da6f-11e5-ae18-1040f38d7f90
|
data/spec/unit/parser_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
describe GitHubChangelogGenerator::Parser do
|
2
3
|
describe ".user_project_from_remote" do
|
3
4
|
context "when remote is type 1" do
|
@@ -56,5 +57,26 @@ describe GitHubChangelogGenerator::Parser do
|
|
56
57
|
it { is_expected.to be_a(Array) }
|
57
58
|
it { is_expected.to match_array([nil, nil]) }
|
58
59
|
end
|
60
|
+
context "when all args is not nil" do
|
61
|
+
subject { GitHubChangelogGenerator::Parser.user_project_from_option("skywinder/ActionSheetPicker-3.0", "blah", "https://codeclimate.com") }
|
62
|
+
it { is_expected.to be_a(Array) }
|
63
|
+
it { is_expected.to match_array([nil, nil]) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
describe ".fetch_user_and_project" do
|
67
|
+
before do
|
68
|
+
stub_const("ARGV", ["https://github.com/skywinder/github-changelog-generator"])
|
69
|
+
end
|
70
|
+
|
71
|
+
context do
|
72
|
+
let(:valid_user) { "initialized_user" }
|
73
|
+
let(:options) { { user: valid_user } }
|
74
|
+
let(:options_before_change) { options.dup }
|
75
|
+
it "should leave user unchanged" do
|
76
|
+
expect { GitHubChangelogGenerator::Parser.fetch_user_and_project(options) }.to change { options }
|
77
|
+
.from(options_before_change)
|
78
|
+
.to(options_before_change.merge(project: "github-changelog-generator"))
|
79
|
+
end
|
80
|
+
end
|
59
81
|
end
|
60
82
|
end
|
data/spec/unit/reader_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_changelog_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Korolev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -27,93 +27,38 @@ dependencies:
|
|
27
27
|
version: '10.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: github_api
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '0.12'
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0.12'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: colorize
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0.7'
|
49
|
-
type: :runtime
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0.7'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: overcommit
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0.31'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0.31'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rspec
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '3.2'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '3.2'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: bundler
|
86
30
|
requirement: !ruby/object:Gem::Requirement
|
87
31
|
requirements:
|
88
32
|
- - ">="
|
89
33
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
91
|
-
type: :
|
34
|
+
version: '0.14'
|
35
|
+
type: :runtime
|
92
36
|
prerelease: false
|
93
37
|
version_requirements: !ruby/object:Gem::Requirement
|
94
38
|
requirements:
|
95
39
|
- - ">="
|
96
40
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
41
|
+
version: '0.14'
|
98
42
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
43
|
+
name: rainbow
|
100
44
|
requirement: !ruby/object:Gem::Requirement
|
101
45
|
requirements:
|
102
46
|
- - ">="
|
103
47
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
105
|
-
type: :
|
48
|
+
version: '2.1'
|
49
|
+
type: :runtime
|
106
50
|
prerelease: false
|
107
51
|
version_requirements: !ruby/object:Gem::Requirement
|
108
52
|
requirements:
|
109
53
|
- - ">="
|
110
54
|
- !ruby/object:Gem::Version
|
111
|
-
version: '
|
55
|
+
version: '2.1'
|
112
56
|
description: Changelog generation has never been so easy. Fully automate changelog
|
113
57
|
generation - this gem generate change log file based on tags, issues and merged
|
114
58
|
pull requests from Github issue tracker.
|
115
59
|
email: sky4winder+github_changelog_generator@gmail.com
|
116
60
|
executables:
|
61
|
+
- ghclgen
|
117
62
|
- git-generate-changelog
|
118
63
|
- github_changelog_generator
|
119
64
|
extensions: []
|
@@ -122,6 +67,7 @@ files:
|
|
122
67
|
- LICENSE
|
123
68
|
- README.md
|
124
69
|
- Rakefile
|
70
|
+
- bin/ghclgen
|
125
71
|
- bin/git-generate-changelog
|
126
72
|
- bin/github_changelog_generator
|
127
73
|
- lib/CHANGELOG.md
|
@@ -172,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
118
|
version: '0'
|
173
119
|
requirements: []
|
174
120
|
rubyforge_project:
|
175
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.6.7
|
176
122
|
signing_key:
|
177
123
|
specification_version: 4
|
178
124
|
summary: Script, that automatically generate changelog from your tags, issues, labels
|
@@ -189,4 +135,3 @@ test_files:
|
|
189
135
|
- spec/unit/parse_file_spec.rb
|
190
136
|
- spec/unit/parser_spec.rb
|
191
137
|
- spec/unit/reader_spec.rb
|
192
|
-
has_rdoc:
|