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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b13645ee861e799d64559a1d4b41de38fe7e11061073387bece2f18c9f6d595f
4
- data.tar.gz: 7d83a76d83b2812cb74afbcc7dd406d0980a6ad000caa9901395e0f8e9671ad2
3
+ metadata.gz: 57c1e8a6cd0cfce646e1f0e2308d6a29dea5c0f741763d7aa721b6d61f5c9c71
4
+ data.tar.gz: 6bcc4d93b64b5eabfb1e6b824a167a4b54a9dfeadcfacbdccdaa1d81568397ea
5
5
  SHA512:
6
- metadata.gz: 57d0c128ffe107140aafb153bd8ec3e858bd7643fbd878348bb3f7e0531163e60da7884f1e56116f948523b85d8f4d530ebee3a4e079528db82e4f700ea5c8d9
7
- data.tar.gz: 59dd23a66be1ac4fec13fd6fb2d2c7f92edbeae79ce7d02ae4e31e465e10c92babfe25e2bff52380188fc4adf1cd8bba2a8c9bcac14a7eb5ba3eb9f56ab86520
6
+ metadata.gz: e0db304325a3cdf022c961ffbc24728e1cdd606974de62ed93a64676e95e3b99069e2c76d0ba67476a52f8c6a8614ed4e7be3bf67d08cf551b593fd39764a6fd
7
+ data.tar.gz: 36a24509001aed657bed2976b4134f6a8155e5bffa9e251b8af555fb742a26b28600642d02138cf7d047dff70c90586fcbbe347b91d703e4a79daa9f94f28255
data/.circleci/config.yml CHANGED
@@ -5,7 +5,7 @@
5
5
  version: 2.1
6
6
 
7
7
  orbs:
8
- ruby-orbs: sue445/ruby-orbs@1.4.3
8
+ ruby-orbs: sue445/ruby-orbs@1.4.4
9
9
  code-climate: rvla/code-climate@0.0.2
10
10
 
11
11
  references:
data/.gem_comet.yml CHANGED
@@ -1,3 +1,11 @@
1
+ # [Usage]
2
+ #
3
+ # $ gem install gem_comet
4
+ # $ gem_comet init
5
+ # $ gem_comet release {version number, like as "1.2.3"}
6
+ # $ gem_comet changelog
7
+ # $ gem_comet versions
8
+
1
9
  version: 1.1
2
10
 
3
11
  release:
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-14 23:40:22 +0000 using RuboCop version 0.75.1.
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 ([#32](https://github.com/ryz310/gem_comet/pull/32))
8
- * Add the legend to creating pull requests ([#33](https://github.com/ryz310/gem_comet/pull/33))
9
- * Open the GitHub pull request page at release ([#36](https://github.com/ryz310/gem_comet/pull/36))
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 ([#34](https://github.com/ryz310/gem_comet/pull/34))
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
- * Changelog initializer ([#35](https://github.com/ryz310/gem_comet/pull/35))
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
- ## 0.3.0 (Oct 19, 2019)
44
+ ## v0.3.0 (Oct 19, 2019)
25
45
 
26
46
  ### Feature
27
47
 
28
- * Enhance the feature of changelog command ([#27](https://github.com/ryz310/gem_comet/pull/27))
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 ([#25](https://github.com/ryz310/gem_comet/pull/25))
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
- ## 0.2.0 (Oct 14, 2019)
54
+ ## v0.2.0 (Oct 13, 2019)
35
55
 
36
56
  ### Feature
37
57
 
38
- * Auto generate change log ([#22](https://github.com/ryz310/gem_comet/pull/22))
58
+ * [#22](https://github.com/ryz310/gem_comet/pull/22) Auto generate change log ([@ryz310](https://github.com/ryz310))
39
59
 
40
- ## 0.1.1 (Oct 13, 2019)
60
+ ## v0.1.1 (Oct 13, 2019)
41
61
 
42
62
  ### Bugfix
43
63
 
44
- * Fix version number validation ([#16](https://github.com/ryz310/gem_comet/pull/16))
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 ([#3](https://github.com/ryz310/gem_comet/pull/3))
49
- * Re-generate .rubocop_todo.yml with RuboCop v0.74.0 ([#5](https://github.com/ryz310/gem_comet/pull/5))
50
- * Re-generate .rubocop_todo.yml with RuboCop v0.75.0 ([#13](https://github.com/ryz310/gem_comet/pull/13))
51
- * ryz310/dependabot/bundler/rake-tw-13.0 ([#9](https://github.com/ryz310/gem_comet/pull/9))
52
- * ryz310/dependabot/bundler/rubocop-performance-1.5.0 ([#14](https://github.com/ryz310/gem_comet/pull/14))
53
- * ryz310/dependabot/bundler/rspec-3.9.0 ([#17](https://github.com/ryz310/gem_comet/pull/17))
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
- ## 0.1.0 (Jul 16, 2019)
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.4.0)
5
- pr_comet (~> 0.3.0)
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.3)
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.0)
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.75.1)
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.0'
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
- pull_request_number = extract_pull_request_number(merge_commit)
54
- pull_request_url = get_pull_request_url(pull_request_number)
55
- description = extract_description(merge_commit) || extract_branch_name(merge_commit)
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
- "* #{description} ([##{pull_request_number}](#{pull_request_url}))"
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!(title: "Release v#{version}", body: LEGEND, validate: false)
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: LEGEND)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemComet
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -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 ||= git_tag_list.lines.map(&:chomp).map(&:split).sort_by(&:last)
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
@@ -21,7 +21,3 @@ require 'gem_comet/release'
21
21
  require 'gem_comet/release/update_pr'
22
22
  require 'gem_comet/release/release_pr'
23
23
  require 'gem_comet/cli'
24
-
25
- module GemComet
26
- LEGEND = 'Generated by [gem_comet](https://github.com/ryz310/gem_comet)'
27
- end
data/renovate.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "config:base"
4
+ ]
5
+ }
@@ -0,0 +1,5 @@
1
+ # TODO
2
+
3
+ - [ ] Merge "Update v<%= version %>" first
4
+
5
+ Generated by [gem_comet](https://github.com/ryz310/gem_comet)
@@ -0,0 +1,6 @@
1
+ # TODO
2
+
3
+ - [ ] Check version numbering: v<%= version %> (was v<%= prev_version %>)
4
+ - [ ] Edit the CHANGELOG.md
5
+
6
+ Generated by [gem_comet](https://github.com/ryz310/gem_comet)
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.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-10-27 00:00:00.000000000 Z
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.0
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.0
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