structured_changelog 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/structured_changelog/tasks/commit.rb +23 -8
- data/lib/structured_changelog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac7ccb6be19c589aa19a3be4b9fff1a6638b0d43
|
4
|
+
data.tar.gz: aea678c0d73cc03e5062eeef2a3cada42a976596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09ad392a6b20c6f3394ee69cbbd073f98618b63ee3cb64efad0207520191cfd22f96c12fbfd0920c6d870427f70af00c68684cf92ebaed84c668d191417b0623
|
7
|
+
data.tar.gz: 6f8423680af8a11ec95674b8e001e5a765b17f80938e01ebf2ab29f4f303368b081288e0815e7e79cdacf21943d79f3da6698a9cb4ab8cdc624b038daabd95f0
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,10 @@
|
|
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.1
|
15
|
+
|
16
|
+
* FIX: `rake changelog:commit` wasn't allowing Gemfile.lock to change version.
|
17
|
+
|
14
18
|
## RELEASE 0.8.0
|
15
19
|
|
16
20
|
* 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.
|
@@ -5,25 +5,40 @@ desc 'Commit changes to the Changelog & version files as necessary'
|
|
5
5
|
task 'changelog:commit', [:repo_path, :changelog_path, :version_path] do |_task, arguments|
|
6
6
|
repo_path = arguments.to_h.fetch(:repo_path) { Pathname.pwd }
|
7
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"}
|
8
|
+
version_path = arguments.to_h.fetch(:version_path) { "lib/#{Pathname.pwd.basename}/version.rb" }
|
9
9
|
|
10
10
|
changelog = StructuredChangelog.new(changelog_path)
|
11
|
-
|
11
|
+
git = Git.open(repo_path)
|
12
12
|
|
13
|
-
if
|
13
|
+
if git.status.deleted.any?
|
14
14
|
abort "Please commit all file deletions before bumping the version."
|
15
15
|
end
|
16
16
|
|
17
|
-
if
|
17
|
+
if git.status.added.any?
|
18
18
|
abort "Please commit all new files before bumping the version."
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
diff = git.diff('HEAD').stats[:files]
|
22
|
+
acceptable_changes = [changelog_path, version_path, 'Gemfile.lock']
|
23
|
+
|
24
|
+
only_release_changes = (diff.keys - acceptable_changes).empty?
|
25
|
+
|
26
|
+
unless only_release_changes
|
27
|
+
abort "Please commit all files that aren't #{acceptable_changes.join(' or ')} before bumping the version."
|
28
|
+
end
|
29
|
+
|
30
|
+
if diff.key?('Gemfile.lock')
|
31
|
+
lockfile_only_changed_version = diff['Gemfile.lock'][:deletions] == 1 && diff['Gemfile.lock'][:insertions] == 1
|
32
|
+
|
33
|
+
unless lockfile_only_changed_version
|
34
|
+
abort "Please commit all Gemfile.lock changes not related to this version bump."
|
35
|
+
end
|
36
|
+
|
37
|
+
git.add(['Gemfile.lock'])
|
23
38
|
end
|
24
39
|
|
25
|
-
|
26
|
-
|
40
|
+
git.add([changelog_path, version_path])
|
41
|
+
git.commit("Version bump to #{changelog.version}")
|
27
42
|
|
28
43
|
puts "Commited 'Version bumped to #{changelog.version}'"
|
29
44
|
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.8.
|
4
|
+
version: 0.8.1
|
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-
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|