release_flow 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bff2b3e2d03cfe1491426834aaf6d6ea62744912f53fe5cb52d931735197cc7
4
- data.tar.gz: 1a5efe4c7d41d50665b1244d31857f2ac473d7f28afc2e4c90a4ce48ac0bd11d
3
+ metadata.gz: ed923d96287e3f32f00b20bb783cb6ebdaa46e60c78397af348d02744b65283a
4
+ data.tar.gz: a8021809a338794139ddf41b1fba7099d175418e63fa181f008cd26312a447ce
5
5
  SHA512:
6
- metadata.gz: 45e3553b0149460e15ceb63ddc8860e2b2f79ed99f750f269ade2580c613d1e9f4c85e3330d0781c2e8d3639d5de323cc149b92dc4dc6df5b99bebad62b395f6
7
- data.tar.gz: c08f06f5e0f0238cadf7012bdf635e8974a152b1e3c520af227a2693c5ca95779e3aa7fc6dac8d7c708c44b1532be33e34b1f22e0bfbadf898722b944e7c3cf5
6
+ metadata.gz: 9688d07473f50f93c1171a4d45d419825eb15b6583c85d06c147ca73cc897bf66786fa09bc7d340215448bf36a9f5006abaf6d1726c6749b3fc003802cbb1f42
7
+ data.tar.gz: 972f65d6e2222673a0d73043b68b6f9d01d4200f99f373b7de01311da891e414359c013fbfa048b27dbf4aa8785235489f17ae20d10d071d530b85a3f0252424
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.2.1
6
+
7
+ - `prepare` names a project's first release when `CHANGELOG.md` holds only an empty `## [Unreleased]`, instead of crashing with `undefined method 'each_line' for nil`, and the file it writes ends with a single newline.
8
+
5
9
  ## 0.2.0
6
10
 
7
11
  - A release PR merged on GitHub is shipped by the release workflow: it publishes `v<name>` and merges `main` back into `next`. `init` keeps a workflow already installed, so copy the template's `ship` job into yours, add the production branch to its `pull_request` branches, and add the `base.ref` line to `prepare`'s condition.
@@ -22,11 +22,12 @@ module ReleaseFlow
22
22
  raise Error, "CHANGELOG.md has no #{UNRELEASED.strip} section" if rest.nil?
23
23
 
24
24
  body, tail = rest.split(/^(?=## )/, 2)
25
- sections = fold([body, *fragments])
25
+ sections = fold([body.to_s, *fragments])
26
26
  raise Error, "no entries under #{UNRELEASED.strip} or in #{FRAGMENTS}/; there is nothing to release" if sections.empty?
27
27
 
28
28
  released = sections.map { |title, lines| "### #{title}\n\n#{lines.join("\n")}\n" }.join("\n")
29
- "#{head}#{UNRELEASED}\n## v#{name}\n\n#{released}\n#{tail}"
29
+ named = "#{head}#{UNRELEASED}\n## v#{name}\n\n#{released}"
30
+ tail.to_s.empty? ? named : "#{named}\n#{tail}"
30
31
  end
31
32
 
32
33
  def fragment?(path) = path.match?(%r{\A#{FRAGMENTS}/[^/]+\.md\z}o) && File.basename(path) != "README.md"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReleaseFlow
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: release_flow
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
  - Dave Chmura