create_github_release 0.2.0 → 0.2.1

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: 1a06b294acfb6e5357f5fbba1f47b1c0baa64acb6f8b93f9ea5f3c262afb3ae1
4
- data.tar.gz: 56dc6312fafcc3ca2b3244a9ba453651f17d2dfed4225830d2e594df48d2546c
3
+ metadata.gz: f086029c9ddf7585de3b2872c59a6d6b4d5449038327cc26703a5dcf31fc5302
4
+ data.tar.gz: 5c3eba003d79b8c676b8040f1fd359eb1b9a0271c873d70d930cd283eda743bd
5
5
  SHA512:
6
- metadata.gz: 6119db8f31ca3a9e0d77d1fff5deb1b6fe66443d41024300469d6849542698de0e5af00163b12158ec480c22a330baeb321d765398c08adf30c52722367930ba
7
- data.tar.gz: 791cfe69208757b5eba420a190150575686aeb554f4acde1dd584c3c22e282c3083e52e5d2e221e31aca4de2811ba783c14a00a61170b72c5d3f70fc1e012477
6
+ metadata.gz: 101af2b61d0a4a78b9ad776bf265981152a11134170c67133910e7f7ab3081f169bc5361b490dda4c5a218c2b46e2a22812a30613582d879ffc7080d058225f5
7
+ data.tar.gz: 6cb1bbdcaa1bc974ef0a684648fb82df1be00ff67de2d50503130ce642bd3f0022935d77a2fdd2af7c4bbd992bde05167e48142d9a3b048ff5b779cd63f57a70
@@ -0,0 +1,7 @@
1
+ {
2
+ "cSpell.words": [
3
+ "codeclimate",
4
+ "lcov",
5
+ "paambaati"
6
+ ]
7
+ }
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## v0.2.1 (2022-11-16)
9
+
10
+ [Full Changelog](https://github.com/main-branch/create_github_release/compare/v0.2.0...v0.2.1)
11
+
12
+ * 14b04ec Normalize local release branch and local release tag assertions' (#25)
13
+ * 025fa29 Refactor LocalReleaseBranchDoesNotExist#assert (#24)
14
+ * 7880c89 Further reduce the complexity of Changelog@to_s (#21)
15
+ * 2aa335e Fix high cognitive complexity of Changelog#to_s (#20)
16
+ * 42c263a Add CodeClimate badges and test coverage reporting (#19)
17
+ * 904d6cb Release v0.2.0
18
+
8
19
  ## v0.2.0 (2022-11-15)
9
20
 
10
21
  [Full Changelog](https://github.com/main-branch/create_github_release/compare/v0.1.0...v0.2.0)
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # The create_github_release Gem
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/create_github_release.svg)](https://badge.fury.io/rb/create_github_release)
4
+ [![Build Status](https://github.com/main-branch/create_github_release/workflows/Ruby/badge.svg?branch=main)](https://github.com/main-branch/create_github_release/actions?query=workflow%3ARuby)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/b8c0af10b15a0ffeb1a1/maintainability)](https://codeclimate.com/github/main-branch/create_github_release/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/b8c0af10b15a0ffeb1a1/test_coverage)](https://codeclimate.com/github/main-branch/create_github_release/test_coverage)
7
+
3
8
  Create a GitHub release for a new gem version.
4
9
 
5
10
  To create a new GitHub release for a gem, run the following from the top level
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency 'rspec', '~> 3.10'
39
39
  spec.add_development_dependency 'rubocop', '~> 1.36'
40
40
  spec.add_development_dependency 'simplecov', '~> 0.21'
41
+ spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
41
42
  spec.add_development_dependency 'solargraph', '~> 0.47'
42
43
  spec.add_development_dependency 'yard', '~> 0.9'
43
44
  spec.add_development_dependency 'yardstick', '~> 0.9'
@@ -31,11 +31,13 @@ module CreateGithubRelease
31
31
  def assert
32
32
  print "Checking that local branch ' #{options.branch}' does not exist..."
33
33
 
34
- if `git branch --list '#{options.branch}' | wc -l`.to_i.zero? && $CHILD_STATUS.success?
34
+ branches = `git branch --list "#{options.branch}"`.chomp
35
+ error 'Could not list branches' unless $CHILD_STATUS.success?
36
+
37
+ if branches == ''
35
38
  puts 'OK'
36
39
  else
37
- error 'Could not list branches' unless $CHILD_STATUS.success?
38
- error "'#{options.branch}' already exists."
40
+ error "Local branch '#{options.branch}' already exists"
39
41
  end
40
42
  end
41
43
  end
@@ -34,7 +34,7 @@ module CreateGithubRelease
34
34
  tags = `git tag --list "#{options.tag}"`.chomp
35
35
  error 'Could not list tags' unless $CHILD_STATUS.success?
36
36
 
37
- if tags.split.empty?
37
+ if tags == ''
38
38
  puts 'OK'
39
39
  else
40
40
  error "Local tag '#{options.tag}' already exists"
@@ -291,16 +291,25 @@ module CreateGithubRelease
291
291
  # @return [String] The changelog with the new release details
292
292
  #
293
293
  def to_s
294
- String.new.tap do |changelog|
295
- changelog << "#{front_matter}\n\n" unless front_matter.empty?
296
- changelog << release_header
297
- changelog << release_description
298
- changelog << "\n#{body}\n" unless body.empty?
299
- end
294
+ formatted_front_matter + release_header + release_description + formatted_body
300
295
  end
301
296
 
302
297
  private
303
298
 
299
+ # The front matter formatted to insert into the changelog
300
+ # @return [String] The front matter formatted to insert into the changelog
301
+ # @api private
302
+ def formatted_front_matter
303
+ front_matter.empty? ? '' : "#{front_matter}\n\n"
304
+ end
305
+
306
+ # The body formatted to insert into the changelog
307
+ # @return [String] The body formatted to insert into the changelog
308
+ # @api private
309
+ def formatted_body
310
+ body.empty? ? '' : "\n#{body}\n"
311
+ end
312
+
304
313
  # The index of the line in @lines where the front matter begins
305
314
  # @return [Integer] The index of the line in @lines where the front matter begins
306
315
  # @api private
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CreateGithubRelease
4
4
  # The version of this gem
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_github_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-16 00:00:00.000000000 Z
11
+ date: 2022-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bump
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.21'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov-lcov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.8'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.8'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: solargraph
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +175,7 @@ files:
161
175
  - ".markdownlint.yml"
162
176
  - ".rspec"
163
177
  - ".rubocop.yml"
178
+ - ".vscode/settings.json"
164
179
  - ".yardopts"
165
180
  - CHANGELOG.md
166
181
  - Gemfile