structured_changelog 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +20 -11
- data/lib/structured_changelog/tasks/commit.rb +29 -0
- data/lib/structured_changelog/tasks/release.rb +15 -0
- data/lib/structured_changelog/tasks/sync.rb +15 -0
- data/lib/structured_changelog/version.rb +3 -3
- data/lib/structured_changelog/version_pattern.rb +1 -1
- data/structured_changelog.gemspec +2 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 664aee7c11b7b9ca26529a0a8b2e008598684c74
|
4
|
+
data.tar.gz: e5178e0f57a8b66084b0ddf231f78b6d32867c09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ca2f2a8cbf4b9f17f62fc49a552e6f861ed338d08017e73291d95cb0196c671f28be902a3b0848468237df5a777f1cf9be6927c8a8bf8c197aa684000fa1651
|
7
|
+
data.tar.gz: 01f883a91e896e01e5d4306f0c1d0e7f5f71daa418bd027c689beda1d43c422a66b7eb2e5d6cea7d95976edd204c912358f5f00fb8fe8482a931529ea99dc13e
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,11 @@
|
|
11
11
|
* require release block lines to be ordered in descending severity
|
12
12
|
* disable strict semver version validation before 1.0.0
|
13
13
|
|
14
|
+
## RELEASE 0.8.0
|
15
|
+
|
16
|
+
* FEATURE: `rake changelog:sync` will update your gem's VERSION constant to your changelog's latest release version. This will let devs stop requiring `structured_changelog` to be installed before they can bundle their projects.
|
17
|
+
* FEATURE: `rake changelog:release` will validate the Changelog, sync the Changelog release to `VERSION`, commit the version bump, then proceed with the default `rake release` task.
|
18
|
+
|
14
19
|
## RELEASE 0.7.2
|
15
20
|
|
16
21
|
* FIX: fixed version comparison
|
data/README.md
CHANGED
@@ -1,30 +1,39 @@
|
|
1
1
|
# StructuredChangelog
|
2
2
|
|
3
|
-
You have a changelog in your repo, right? Great! Then
|
3
|
+
You have a changelog in your repo, right? Great! Then you'll never need to manually update your `VERSION` constant again!
|
4
4
|
|
5
|
-
|
5
|
+
Add this to your Rakefile:
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
require 'structured_changelog'
|
9
|
-
|
10
|
-
MyProject::VERSION = StructuredChangeog.new("path/to/CHANGELOG.md").version
|
8
|
+
require 'structured_changelog/tasks'
|
11
9
|
```
|
12
10
|
|
13
|
-
|
11
|
+
This will create a `rake changelog:release` task that:
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
1. validates your `CHANGELOG.md`
|
14
|
+
2. sets your gem's `VERSION` constant to the latest release version specified by your `CHANGELOG.md`
|
15
|
+
3. commits that version bump
|
16
|
+
4. runs `rake release`
|
18
17
|
|
19
|
-
|
18
|
+
Turns out modifying `rake release` was _way_ more trouble than it was worth, so we had to make a separate task. Sorry folks.
|
19
|
+
|
20
|
+
You'll also get these wonderful rake tasks:
|
20
21
|
|
21
22
|
## Wonderful Rake Tasks
|
22
23
|
|
23
24
|
To validate your changelog:
|
24
25
|
|
25
26
|
$ rake changelog:validate
|
27
|
+
|
28
|
+
To update your gem's `VERSION` constant to the latest release in your Changelog:
|
29
|
+
|
30
|
+
$ rake changelog:sync
|
31
|
+
|
32
|
+
To commit your version bump--and only your version bump:
|
33
|
+
|
34
|
+
$ rake changelog:commit
|
26
35
|
|
27
|
-
To determine
|
36
|
+
To determine the version of the latest release *according to the Changelog*:
|
28
37
|
|
29
38
|
$ rake changelog:version
|
30
39
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'structured_changelog'
|
2
|
+
require 'git'
|
3
|
+
|
4
|
+
desc 'Commit changes to the Changelog & version files as necessary'
|
5
|
+
task 'changelog:commit', [:repo_path, :changelog_path, :version_path] do |_task, arguments|
|
6
|
+
repo_path = arguments.to_h.fetch(:repo_path) { Pathname.pwd }
|
7
|
+
changelog_path = arguments.to_h.fetch(:changelog_path) { "CHANGELOG.md" }
|
8
|
+
version_path = arguments.to_h.fetch(:version_path) { "lib/#{Pathname.pwd.basename}/version.rb"}
|
9
|
+
|
10
|
+
changelog = StructuredChangelog.new(changelog_path)
|
11
|
+
repo = Git.open(repo_path)
|
12
|
+
|
13
|
+
if repo.status.deleted.any?
|
14
|
+
abort "Please commit all file deletions before bumping the version."
|
15
|
+
end
|
16
|
+
|
17
|
+
if repo.status.added.any?
|
18
|
+
abort "Please commit all new files before bumping the version."
|
19
|
+
end
|
20
|
+
|
21
|
+
if repo.status.changed.keys.sort != [changelog_path, version_path].sort
|
22
|
+
abort "Please commit all files that aren't #{changelog_path} or #{version_path} before bumping the version."
|
23
|
+
end
|
24
|
+
|
25
|
+
repo.add([changelog_path, version_path])
|
26
|
+
repo.commit("Version bump to #{changelog.version}")
|
27
|
+
|
28
|
+
puts "Commited 'Version bumped to #{changelog.version}'"
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
desc "Validates your Changelog, updates your VERSION constant, commits that, then releases your gem."
|
2
|
+
task 'changelog:release', [:repo_path, :changelog_path, :version_path] do |_task, arguments|
|
3
|
+
Rake::Task['changelog:validate'].execute(arguments)
|
4
|
+
Rake::Task['changelog:sync'].execute(arguments)
|
5
|
+
Rake::Task['changelog:commit'].execute(arguments)
|
6
|
+
|
7
|
+
# Merely requiring `bundler/gem_tasks` instantiates & caches a gemspec. At this point in this code,
|
8
|
+
# it's already set and attached to the `Bundler::GemHelper` module. In fact, it's there before this
|
9
|
+
# file is laoded at all. This means that our changes to the filesystem won't change the version bundler
|
10
|
+
# thinks our gem is. We could instantiate another gemspec and attach it, or we could try modifying the
|
11
|
+
# gemspec in situ, but both would be extremely brittle. What we do instead, is start another process,
|
12
|
+
# and because that process doesn't have the state ours does already, our changes to the filesystem will
|
13
|
+
# be picked up, and we'll actually cut a release of the new version.
|
14
|
+
exec('rake release')
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'structured_changelog'
|
2
|
+
require 'structured_changelog/version_pattern'
|
3
|
+
|
4
|
+
desc "Set the gem's VERSION constant to be the changelog's version"
|
5
|
+
task 'changelog:sync', [:changelog_path, :version_path] do |_task, arguments|
|
6
|
+
changelog_path = arguments.to_h.fetch(:changelog_path) { "CHANGELOG.md" }
|
7
|
+
version_path = arguments.to_h.fetch(:version_path) { "lib/#{Pathname.pwd.basename}/version.rb"}
|
8
|
+
|
9
|
+
changelog = StructuredChangelog.new(changelog_path)
|
10
|
+
version_file = Pathname.new(version_path)
|
11
|
+
|
12
|
+
version_file.write(version_file.read.gsub(StructuredChangelog::VersionPattern, changelog.version.to_s))
|
13
|
+
|
14
|
+
puts "Updated gem version to #{changelog.version}"
|
15
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
class StructuredChangelog
|
2
|
+
VERSION = "0.8.0"
|
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.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Hoffman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: git
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Version your gem through your changelog, not a VERSION constant.
|
98
112
|
email:
|
99
113
|
- yarmiganosca@gmail.com
|
@@ -123,8 +137,11 @@ files:
|
|
123
137
|
- lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
|
124
138
|
- lib/structured_changelog/roadmap.rb
|
125
139
|
- lib/structured_changelog/tasks.rb
|
140
|
+
- lib/structured_changelog/tasks/commit.rb
|
126
141
|
- lib/structured_changelog/tasks/notes.rb
|
127
142
|
- lib/structured_changelog/tasks/recent.rb
|
143
|
+
- lib/structured_changelog/tasks/release.rb
|
144
|
+
- lib/structured_changelog/tasks/sync.rb
|
128
145
|
- lib/structured_changelog/tasks/validate.rb
|
129
146
|
- lib/structured_changelog/tasks/version.rb
|
130
147
|
- lib/structured_changelog/version.rb
|