structured_changelog 0.10.1 → 0.10.2

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
  SHA1:
3
- metadata.gz: 396406c6fa0d6c318cd8955ce3f57a8cc1445b81
4
- data.tar.gz: 769f91111b88740ad53fd16629d289c2b4de0378
3
+ metadata.gz: b739ec968c42936d856aa3788cf0429a1381f1a4
4
+ data.tar.gz: 7723700057200b69557b1a8fcfbf6842b3b4d60f
5
5
  SHA512:
6
- metadata.gz: d9222a344007479162ef5471d07ad53ff8d2d229fc34e878e319c883d6c2e186e3d8ad5953aa17c0e5d164c635e6fdfcf127d86406db5947db0c65473bb90874
7
- data.tar.gz: 4c40823c93b709f02e1abc1657e4f59c214ed3fd593389d04cd5e56d6d83e0b574b552afec99c0c9bd0a0b3e62311ff57e34c06f01d798ac30947612e09df296
6
+ metadata.gz: f21e553a2ef385497c4319ac5e5f640c5cadb3e4287e8e21de82e1f71cea7d770ca9afecfc5ed28da237adb0bf79d612f1ae38e1a69fd5f3b3fe24227c385778
7
+ data.tar.gz: 9c53f76476323d2f51c6fea3eb2562d9109cdf802ebfdb79536b3006dc36e6f4552f4922ba0dbb4c277742d7b2b7533e1fce0b7a97a2325a467fbbf738c1f6b7
@@ -5,6 +5,10 @@
5
5
  * require release block lines to be ordered in descending severity
6
6
  * disable strict semver version validation before 1.0.0
7
7
 
8
+ ## RELEASE 0.10.2
9
+
10
+ * ENHANCEMENT: release lines can now be embedded in any commit message body
11
+
8
12
  ## RELEASE 0.10.1
9
13
 
10
14
  * FIX: Fixed an issue that resulted in `changelog:compile` pulling in release lines from previous releases
data/README.md CHANGED
@@ -41,22 +41,23 @@ This will:
41
41
 
42
42
  If you have multiple contributors, and you follow the single-contributor workflow, you'll end up with conflicts every time multiple people go to add a line to the changelog. We have a separate workflow for you.
43
43
 
44
- When you want to add changelog lines, instead of adding it directly to the changelog, write a git commit:
44
+ When you want to add release notes, instead of adding them directly to the changelog, add them to any git commit:
45
45
 
46
46
  ```
47
- [CHANGELOG]
47
+ Describe what I did this commit
48
+
49
+ More description goes here
48
50
 
49
- * FEATURE: we added a new thing
50
51
  * FIX: we fixed a thing that was broken
51
52
  ```
52
53
 
53
- The commit message needs to start with `[CHANGELOG]\n\n` and each line should start with `* BREAKING: `, `* FEATURE: `, `* FIX: `, `* ENHANCEMENT: `, or `* DEPRECATION: `.
54
+ Any line in a commit message that starts with `* BREAKING: `, `* FEATURE: `, `* FIX: `, `* ENHANCEMENT: `, or `* DEPRECATION: ` will be included in the release notes for the next version.
54
55
 
55
56
  Then, when you're ready to cut a release, run:
56
57
 
57
58
  $ rake changelog:compile
58
59
 
59
- This will pull all the `[CHANGELOG]` commit message bodies you've written since the last release from the commit log, and create a new release section in your changelog. It will have the minimum version possible given the change types (BREAKING is a major bump, FEATURE is a minor bump, and FIX, ENHANCEMENT, and DEPRECATION are all patch bumps). Once the rake task has written the new section to the changelog, it's often beneficial to give it a look and make sure it's free of typos and any other mistakes. Then, run
60
+ This will pull all the release lines you've written in git commit messages since the last release from the commit log, and create a new release section in your changelog. It will have the minimum version possible given the change types (BREAKING is a major bump, FEATURE is a minor bump, and FIX, ENHANCEMENT, and DEPRECATION are all patch bumps). Once the rake task has written the new section to the changelog, it's often beneficial to give it a look and make sure it's free of typos and any other mistakes. Then, run
60
61
 
61
62
  $ rake changelog:release
62
63
 
@@ -64,7 +65,7 @@ as usual to actually release your gem.
64
65
 
65
66
  ## Viewing Release Notes
66
67
 
67
- To view the release notes of the current release:
68
+ To view the release notes of the current release:`
68
69
 
69
70
  $ rake changelog:notes
70
71
  $ rake changelog:notes[current]
@@ -11,32 +11,31 @@ task "changelog:compile", [:repo_path, :changelog_path] do |_task, arguments|
11
11
 
12
12
  repo = Git.open(repo_path)
13
13
 
14
- commit_messages = repo.log.between("v#{current_version}").map(&:message).select do |message|
15
- message.match?(/^\[CHANGELOG\]\n\n\*\ /)
16
- end
14
+ release_notes = repo.log.between("v#{current_version}").
15
+ map(&:message).
16
+ flat_map { |message| message.split("\n") }.
17
+ grep(/^\*\ (BREAKING|FEATURE|ENHANCEMENT|FIX|DEPRECATION)\:/).
18
+ map(&:strip).
19
+ join("\n")
17
20
 
18
- abort("No [CHANGELOG] commits since the last release") if commit_messages.empty?
21
+ abort("No release notes since the last release") if release_notes.empty?
19
22
 
20
- message = commit_messages.flat_map do |message|
21
- message.sub(/^\[CHANGELOG\]\n\n/, "")
22
- end.join("\n")
23
-
24
- new_version = if message.match?(/^*\ BREAKING:/)
23
+ new_version = if release_notes.match?(/^*\ BREAKING:/)
25
24
  current_version.bump_major
26
- elsif message.match?(/^*\ FEATURE:/)
25
+ elsif release_notes.match?(/^*\ FEATURE:/)
27
26
  current_version.bump_minor
28
- elsif message.match?(/^*\ FIX:/)
27
+ elsif release_notes.match?(/^*\ FIX:/)
29
28
  current_version.bump_patch
30
- elsif message.match?(/^*\ ENHANCEMENT:/)
29
+ elsif release_notes.match?(/^*\ ENHANCEMENT:/)
31
30
  current_version.bump_patch
32
- elsif message.match?(/^*\ DEPRECATION:/)
31
+ elsif release_notes.match?(/^*\ DEPRECATION:/)
33
32
  current_version.bump_patch
34
33
  end
35
34
 
36
35
  changelog_path.write(
37
36
  changelog_path.read.sub(
38
37
  /^##\ RELEASE\ #{current_version}/,
39
- "## RELEASE #{new_version}\n\n#{message}\n\n## RELEASE #{current_version}"
38
+ "## RELEASE #{new_version}\n\n#{release_notes}\n\n## RELEASE #{current_version}"
40
39
  )
41
40
  )
42
41
  end
@@ -1,3 +1,3 @@
1
1
  class StructuredChangelog
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured_changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hoffman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler