gem_comet 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.gem_comet.yml +8 -0
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +39 -19
- data/Gemfile.lock +5 -5
- data/gem_comet.gemspec +1 -1
- data/lib/gem_comet/changelog/generator.rb +27 -4
- data/lib/gem_comet/release/release_pr.rb +14 -1
- data/lib/gem_comet/release/update_pr.rb +12 -2
- data/lib/gem_comet/version.rb +1 -1
- data/lib/gem_comet/version_history.rb +2 -1
- data/lib/gem_comet.rb +0 -4
- data/renovate.json +5 -0
- data/template/release_pr.md.erb +5 -0
- data/template/update_pr.md.erb +6 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c1e8a6cd0cfce646e1f0e2308d6a29dea5c0f741763d7aa721b6d61f5c9c71
|
4
|
+
data.tar.gz: 6bcc4d93b64b5eabfb1e6b824a167a4b54a9dfeadcfacbdccdaa1d81568397ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0db304325a3cdf022c961ffbc24728e1cdd606974de62ed93a64676e95e3b99069e2c76d0ba67476a52f8c6a8614ed4e7be3bf67d08cf551b593fd39764a6fd
|
7
|
+
data.tar.gz: 36a24509001aed657bed2976b4134f6a8155e5bffa9e251b8af555fb742a26b28600642d02138cf7d047dff70c90586fcbbe347b91d703e4a79daa9f94f28255
|
data/.circleci/config.yml
CHANGED
data/.gem_comet.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-10-
|
3
|
+
# on 2019-10-30 23:40:24 +0000 using RuboCop version 0.76.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
data/CHANGELOG.md
CHANGED
@@ -1,57 +1,77 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## v0.5.0 (Nov 02, 2019)
|
4
|
+
|
5
|
+
### Feature
|
6
|
+
|
7
|
+
* [#48](https://github.com/ryz310/gem_comet/pull/48) Add TODO list for the release flow ([@ryz310](https://github.com/ryz310))
|
8
|
+
* [#49](https://github.com/ryz310/gem_comet/pull/49) Add pull request author names to the changelog generator feature ([@ryz310](https://github.com/ryz310))
|
9
|
+
* [#54](https://github.com/ryz310/gem_comet/pull/54) Add to todo list to check version numbering ([@ryz310](https://github.com/ryz310))
|
10
|
+
|
11
|
+
### Bugfix
|
12
|
+
|
13
|
+
* [#50](https://github.com/ryz310/gem_comet/pull/50) Fixed broken version number parsing including obsolete version numbers ([@ryz310](https://github.com/ryz310))
|
14
|
+
* [#51](https://github.com/ryz310/gem_comet/pull/51) Fix author name parsing ([@ryz310](https://github.com/ryz310))
|
15
|
+
|
16
|
+
### Misc
|
17
|
+
|
18
|
+
* [#44](https://github.com/ryz310/gem_comet/pull/44) Configure Renovate ([@ryz310](https://github.com/ryz310))
|
19
|
+
* [#46](https://github.com/ryz310/gem_comet/pull/46) Re-generate .rubocop_todo.yml with RuboCop v0.76.0 ([@ryz310](https://github.com/ryz310))
|
20
|
+
* [#47](https://github.com/ryz310/gem_comet/pull/47) Update ruby-orbs orb to v1.4.4 ([@ryz310](https://github.com/ryz310))
|
21
|
+
* [#53](https://github.com/ryz310/gem_comet/pull/53) Use pr comet stubbing ([@ryz310](https://github.com/ryz310))
|
22
|
+
|
3
23
|
## v0.4.0 (Oct 27, 2019)
|
4
24
|
|
5
25
|
### Feature
|
6
26
|
|
7
|
-
* Modify to display gem versions sorted by tagged date ([
|
8
|
-
* Add the legend to creating pull requests ([
|
9
|
-
* Open the GitHub pull request page at release ([
|
27
|
+
* [#32](https://github.com/ryz310/gem_comet/pull/32) Modify to display gem versions sorted by tagged date ([@ryz310](https://github.com/ryz310))
|
28
|
+
* [#33](https://github.com/ryz310/gem_comet/pull/33) Add the legend to creating pull requests ([@ryz310](https://github.com/ryz310))
|
29
|
+
* [#36](https://github.com/ryz310/gem_comet/pull/36) Open the GitHub pull request page at release ([@ryz310](https://github.com/ryz310))
|
10
30
|
|
11
31
|
### Bugfix
|
12
32
|
|
13
|
-
* Fix broken links included by the modified change log ([
|
33
|
+
* [#34](https://github.com/ryz310/gem_comet/pull/34) Fix broken links included by the modified change log ([@ryz310](https://github.com/ryz310))
|
14
34
|
|
15
35
|
### Breaking Change
|
16
36
|
|
17
|
-
*
|
37
|
+
* [#35](https://github.com/ryz310/gem_comet/pull/35) Changelog initializer ([@ryz310](https://github.com/ryz310))
|
18
38
|
* The `$ gem_comet changelog` command options has changed:
|
19
39
|
* Before:
|
20
40
|
* `$ gem_comet changelog --from=0.1.0 --to=0.1.1`
|
21
41
|
* After:
|
22
42
|
* `$ gem_comet changelog --version=v0.1.1`
|
23
43
|
|
24
|
-
##
|
44
|
+
## v0.3.0 (Oct 19, 2019)
|
25
45
|
|
26
46
|
### Feature
|
27
47
|
|
28
|
-
* Enhance the feature of changelog command ([
|
48
|
+
* [#27](https://github.com/ryz310/gem_comet/pull/27) Enhance the feature of changelog command ([@ryz310](https://github.com/ryz310))
|
29
49
|
|
30
50
|
### Misc
|
31
51
|
|
32
|
-
* Re-generate .rubocop_todo.yml with RuboCop v0.75.1 ([
|
52
|
+
* [#25](https://github.com/ryz310/gem_comet/pull/25) Re-generate .rubocop_todo.yml with RuboCop v0.75.1 ([@ryz310](https://github.com/ryz310))
|
33
53
|
|
34
|
-
##
|
54
|
+
## v0.2.0 (Oct 13, 2019)
|
35
55
|
|
36
56
|
### Feature
|
37
57
|
|
38
|
-
* Auto generate change log ([
|
58
|
+
* [#22](https://github.com/ryz310/gem_comet/pull/22) Auto generate change log ([@ryz310](https://github.com/ryz310))
|
39
59
|
|
40
|
-
##
|
60
|
+
## v0.1.1 (Oct 13, 2019)
|
41
61
|
|
42
62
|
### Bugfix
|
43
63
|
|
44
|
-
* Fix version number validation ([
|
64
|
+
* [#16](https://github.com/ryz310/gem_comet/pull/16) Fix version number validation ([@ryz310](https://github.com/ryz310))
|
45
65
|
|
46
66
|
### Misc
|
47
67
|
|
48
|
-
* Re-generate .rubocop_todo.yml with RuboCop v0.73.0 ([
|
49
|
-
* Re-generate .rubocop_todo.yml with RuboCop v0.74.0 ([
|
50
|
-
* Re-generate .rubocop_todo.yml with RuboCop v0.75.0 ([
|
51
|
-
* ryz310/dependabot/bundler/rake-tw-13.0 ([
|
52
|
-
* ryz310/dependabot/bundler/rubocop-performance-1.5.0 ([
|
53
|
-
* ryz310/dependabot/bundler/rspec-3.9.0 ([
|
68
|
+
* [#3](https://github.com/ryz310/gem_comet/pull/3) Re-generate .rubocop_todo.yml with RuboCop v0.73.0 ([@ryz310](https://github.com/ryz310))
|
69
|
+
* [#5](https://github.com/ryz310/gem_comet/pull/5) Re-generate .rubocop_todo.yml with RuboCop v0.74.0 ([@ryz310](https://github.com/ryz310))
|
70
|
+
* [#13](https://github.com/ryz310/gem_comet/pull/13) Re-generate .rubocop_todo.yml with RuboCop v0.75.0 ([@ryz310](https://github.com/ryz310))
|
71
|
+
* [#9](https://github.com/ryz310/gem_comet/pull/9) ryz310/dependabot/bundler/rake-tw-13.0 ([@ryz310](https://github.com/ryz310))
|
72
|
+
* [#14](https://github.com/ryz310/gem_comet/pull/14) ryz310/dependabot/bundler/rubocop-performance-1.5.0 ([@ryz310](https://github.com/ryz310))
|
73
|
+
* [#17](https://github.com/ryz310/gem_comet/pull/17) ryz310/dependabot/bundler/rspec-3.9.0 ([@ryz310](https://github.com/ryz310))
|
54
74
|
|
55
|
-
##
|
75
|
+
## v0.1.0 (Jul 15, 2019)
|
56
76
|
|
57
77
|
Initial release :rocket:
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gem_comet (0.
|
5
|
-
pr_comet (~> 0.3.
|
4
|
+
gem_comet (0.5.0)
|
5
|
+
pr_comet (~> 0.3.1)
|
6
6
|
thor
|
7
7
|
type_struct
|
8
8
|
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
docile (1.3.2)
|
19
19
|
faraday (0.17.0)
|
20
20
|
multipart-post (>= 1.2, < 3)
|
21
|
-
jaro_winkler (1.5.
|
21
|
+
jaro_winkler (1.5.4)
|
22
22
|
json (2.2.0)
|
23
23
|
method_source (0.9.2)
|
24
24
|
multipart-post (2.1.1)
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
parallel (1.18.0)
|
28
28
|
parser (2.6.5.0)
|
29
29
|
ast (~> 2.4.0)
|
30
|
-
pr_comet (0.3.
|
30
|
+
pr_comet (0.3.1)
|
31
31
|
octokit
|
32
32
|
rainbow
|
33
33
|
pry (0.12.2)
|
@@ -54,7 +54,7 @@ GEM
|
|
54
54
|
rspec-support (3.9.0)
|
55
55
|
rspec_junit_formatter (0.4.1)
|
56
56
|
rspec-core (>= 2, < 4, != 2.12.0)
|
57
|
-
rubocop (0.
|
57
|
+
rubocop (0.76.0)
|
58
58
|
jaro_winkler (~> 1.5.1)
|
59
59
|
parallel (~> 1.10)
|
60
60
|
parser (>= 2.6)
|
data/gem_comet.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.add_runtime_dependency 'pr_comet', '~> 0.3.
|
25
|
+
spec.add_runtime_dependency 'pr_comet', '~> 0.3.1'
|
26
26
|
spec.add_runtime_dependency 'thor'
|
27
27
|
spec.add_runtime_dependency 'type_struct'
|
28
28
|
|
@@ -50,14 +50,29 @@ module GemComet
|
|
50
50
|
merge_commits.map do |merge_commit|
|
51
51
|
next unless merge_commit.match?(MERGE_COMMIT_TITLE)
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
number = extract_pull_request_number(merge_commit)
|
54
|
+
title = extract_description(merge_commit) || extract_branch_name(merge_commit)
|
55
|
+
author = extract_author_name(merge_commit)
|
56
56
|
|
57
|
-
|
57
|
+
generate_changelog(number, title, author)
|
58
58
|
end.compact
|
59
59
|
end
|
60
60
|
|
61
|
+
# Generates changelog message as markdown list
|
62
|
+
#
|
63
|
+
# @param number [Integer] The pull request number
|
64
|
+
# @param title [String] The pull request title
|
65
|
+
# @param author [String] The author of the PR
|
66
|
+
# @return [String] Changelog message as markdown list
|
67
|
+
def generate_changelog(number, title, author)
|
68
|
+
[
|
69
|
+
'*',
|
70
|
+
"[##{number}](#{get_pull_request_url(number)})",
|
71
|
+
title,
|
72
|
+
"([@#{author}](https://github.com/#{author}))"
|
73
|
+
].join(' ')
|
74
|
+
end
|
75
|
+
|
61
76
|
# Extracts PR number from merge commit string.
|
62
77
|
#
|
63
78
|
# @param merge_commit [String] The target string
|
@@ -92,6 +107,14 @@ module GemComet
|
|
92
107
|
MERGE_COMMIT_TITLE.match(merge_commit).captures.last.chomp.strip
|
93
108
|
end
|
94
109
|
|
110
|
+
# Extracts the author of the PR from merge commit string.
|
111
|
+
#
|
112
|
+
# @param merge_commit [String] The target string
|
113
|
+
# @return [String] Author name
|
114
|
+
def extract_author_name(merge_commit)
|
115
|
+
extract_branch_name(merge_commit).split('/').first
|
116
|
+
end
|
117
|
+
|
95
118
|
# Parces the merge commit log, which to separate by each commit.
|
96
119
|
#
|
97
120
|
# @return [Array<String>] Array of git commit log
|
@@ -18,7 +18,20 @@ module GemComet
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_pull_request
|
21
|
-
pr_comet.create!(
|
21
|
+
pr_comet.create!(
|
22
|
+
title: "Release v#{version}",
|
23
|
+
body: pull_request_body,
|
24
|
+
validate: false
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def pull_request_body
|
29
|
+
template = File.read(template_file_path)
|
30
|
+
ERB.new(template, nil, '-').result(binding)
|
31
|
+
end
|
32
|
+
|
33
|
+
def template_file_path
|
34
|
+
File.expand_path('../../../template/release_pr.md.erb', __dir__)
|
22
35
|
end
|
23
36
|
end
|
24
37
|
end
|
@@ -8,12 +8,13 @@ module GemComet
|
|
8
8
|
@version = version
|
9
9
|
@pr_comet = PrComet.new(base: base_branch, branch: "update/v#{version}")
|
10
10
|
@version_editor = VersionEditor.new
|
11
|
+
@prev_version = version_editor.current_version
|
11
12
|
@changelog_editor = Changelog::Editor.new
|
12
13
|
end
|
13
14
|
|
14
15
|
private
|
15
16
|
|
16
|
-
attr_reader :version, :pr_comet, :version_editor, :changelog_editor
|
17
|
+
attr_reader :version, :prev_version, :pr_comet, :version_editor, :changelog_editor
|
17
18
|
|
18
19
|
def call
|
19
20
|
update_changelog
|
@@ -40,7 +41,16 @@ module GemComet
|
|
40
41
|
end
|
41
42
|
|
42
43
|
def create_pull_request
|
43
|
-
pr_comet.create!(title: "Update v#{version}", body:
|
44
|
+
pr_comet.create!(title: "Update v#{version}", body: pull_request_body)
|
45
|
+
end
|
46
|
+
|
47
|
+
def pull_request_body
|
48
|
+
template = File.read(template_file_path)
|
49
|
+
ERB.new(template, nil, '-').result(binding)
|
50
|
+
end
|
51
|
+
|
52
|
+
def template_file_path
|
53
|
+
File.expand_path('../../../template/update_pr.md.erb', __dir__)
|
44
54
|
end
|
45
55
|
end
|
46
56
|
end
|
data/lib/gem_comet/version.rb
CHANGED
@@ -41,7 +41,8 @@ module GemComet
|
|
41
41
|
# @return [Array<Array<String>>] An array of versions and date
|
42
42
|
# e.g. [['v0.1.0', '2019-07-15'], ['v0.2.0', '2019-10-14']]
|
43
43
|
def array_of_version_and_date
|
44
|
-
@array_of_version_and_date ||=
|
44
|
+
@array_of_version_and_date ||=
|
45
|
+
git_tag_list.lines.map(&:chomp).map(&:split).reject(&:empty?).sort_by(&:last)
|
45
46
|
end
|
46
47
|
|
47
48
|
# Finds an index of the specified version number
|
data/lib/gem_comet.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_comet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryz310
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pr_comet
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.
|
19
|
+
version: 0.3.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.3.
|
26
|
+
version: 0.3.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -235,8 +235,11 @@ files:
|
|
235
235
|
- lib/gem_comet/version.rb
|
236
236
|
- lib/gem_comet/version_editor.rb
|
237
237
|
- lib/gem_comet/version_history.rb
|
238
|
+
- renovate.json
|
238
239
|
- template/.gem_comet.yml.erb
|
239
240
|
- template/CHANGELOG.md.erb
|
241
|
+
- template/release_pr.md.erb
|
242
|
+
- template/update_pr.md.erb
|
240
243
|
homepage: https://github.com/ryz310/gem_comet
|
241
244
|
licenses:
|
242
245
|
- MIT
|