milestoner 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +9 -3
- data/lib/milestoner/cli.rb +8 -0
- data/lib/milestoner/identity.rb +1 -1
- data/lib/milestoner/tagger.rb +28 -10
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a383b5ca439d263af13d3a99df04900c5cf9af6d
|
4
|
+
data.tar.gz: 7bbeabe417fa74b1ea2de76f98ca4ad5cbc02468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 203b4857ce7f978e63560a760ed56369853cad84405bfadb8b83e0b1f459023f495a44a0bd7b196ae4a17c14da44ab17cd6f6fe0b156b7d72047e442a28db62e
|
7
|
+
data.tar.gz: 87add04071261e77f5964cf8202a914891228af308b3f90bf65c66ea94f585c3671b903a2a488dd6c1d6e92eb63e9003ec303dcaeb05c177625ac75637ac42b9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -28,10 +28,15 @@ A tool for automating and releasing Git repository milestones.
|
|
28
28
|
|
29
29
|
# Features
|
30
30
|
|
31
|
-
- Provides [Semantic Versioning](http://semver.org) for Git repositories in the form of
|
32
|
-
Example: `v0.1.0`.
|
33
|
-
- Provides optional
|
31
|
+
- Provides [Semantic Versioning](http://semver.org) for Git repositories in the form of
|
32
|
+
`v<major>.<minor>.</maintenance>` tags. Example: `v0.1.0`.
|
33
|
+
- Provides optional security for signing tags using GPG signing key.
|
34
34
|
- Automatically includes commits since last tag (or HEAD if no tags exist) within each tag message.
|
35
|
+
- Groups commit messages by consistent prefixes in order defined: "Fixed", "Added", "Updated", "Removed", "Refactored".
|
36
|
+
Otherwise, they are alphabetically sorted.
|
37
|
+
- Alphabetically sorts commit messages within each prefix group.
|
38
|
+
- Ensures duplicate commit messages are removed (if any).
|
39
|
+
- Sanitizes commit messages by removing extra spaces and `[ci skip]` text.
|
35
40
|
|
36
41
|
# Requirements
|
37
42
|
|
@@ -58,6 +63,7 @@ For an insecure install, type the following (not recommended):
|
|
58
63
|
From the command line, type: milestoner help
|
59
64
|
|
60
65
|
milestoner -P, [--publish=PUBLISH] # Tag and push to remote repository.
|
66
|
+
milestoner -c, [--commits] # Show tag message commits for next milestone.
|
61
67
|
milestoner -h, [--help=HELP] # Show this message or get help for a command.
|
62
68
|
milestoner -p, [--push] # Push tags to remote repository.
|
63
69
|
milestoner -t, [--tag=TAG] # Tag local repository with new version.
|
data/lib/milestoner/cli.rb
CHANGED
@@ -15,6 +15,14 @@ module Milestoner
|
|
15
15
|
super args, options, config
|
16
16
|
end
|
17
17
|
|
18
|
+
desc "-c, [--commits]", "Show tag message commits for next milestone."
|
19
|
+
map %w(-c --commits) => :commits
|
20
|
+
def commits version
|
21
|
+
tagger = Milestoner::Tagger.new version
|
22
|
+
say "Milestone #{version} Commits:"
|
23
|
+
tagger.commit_list.each { |commit| say commit }
|
24
|
+
end
|
25
|
+
|
18
26
|
desc "-t, [--tag=TAG]", "Tag local repository with new version."
|
19
27
|
map %w(-t --tag) => :tag
|
20
28
|
method_option :sign, aliases: "-s", desc: "Sign tag with GPG key.", type: :boolean, default: false
|
data/lib/milestoner/identity.rb
CHANGED
data/lib/milestoner/tagger.rb
CHANGED
@@ -39,12 +39,25 @@ module Milestoner
|
|
39
39
|
def commits
|
40
40
|
groups = build_commit_prefix_groups
|
41
41
|
group_by_commit_prefix! groups
|
42
|
-
groups
|
42
|
+
sort_by_commit_prefix! groups
|
43
|
+
groups.values.flatten.uniq
|
44
|
+
end
|
45
|
+
|
46
|
+
def commit_list
|
47
|
+
commits.map { |commit| "- #{commit}" }
|
43
48
|
end
|
44
49
|
|
45
50
|
def create sign: false
|
46
51
|
fail(DuplicateTagError, "Duplicate tag exists: #{version_label}.") if duplicate?
|
47
|
-
|
52
|
+
|
53
|
+
begin
|
54
|
+
message_file = Tempfile.new Milestoner::Identity.name
|
55
|
+
File.open(message_file, "w") { |file| file.write tag_message }
|
56
|
+
`git tag #{tag_options message_file, sign: sign}`
|
57
|
+
ensure
|
58
|
+
message_file.close
|
59
|
+
message_file.unlink
|
60
|
+
end
|
48
61
|
end
|
49
62
|
|
50
63
|
def destroy
|
@@ -68,27 +81,32 @@ module Milestoner
|
|
68
81
|
end
|
69
82
|
|
70
83
|
def build_commit_prefix_groups
|
71
|
-
groups = self.class.commit_prefixes.map.with_object({})
|
72
|
-
group.merge! prefix => []
|
73
|
-
end
|
84
|
+
groups = self.class.commit_prefixes.map.with_object({}) { |prefix, group| group.merge! prefix => [] }
|
74
85
|
groups.merge! "Other" => []
|
75
86
|
end
|
76
87
|
|
88
|
+
def sanitize_commit commit
|
89
|
+
commit.gsub(/\[ci\sskip\]/, "").squeeze(" ").strip
|
90
|
+
end
|
91
|
+
|
77
92
|
def group_by_commit_prefix! groups = {}
|
78
93
|
raw_commits.each do |commit|
|
79
94
|
prefix = commit[self.class.commit_prefix_regex]
|
80
95
|
key = groups.key?(prefix) ? prefix : "Other"
|
81
|
-
groups[key] << commit
|
96
|
+
groups[key] << sanitize_commit(commit)
|
82
97
|
end
|
83
98
|
end
|
84
99
|
|
100
|
+
def sort_by_commit_prefix! groups = {}
|
101
|
+
groups.each { |_, values| values.sort! }
|
102
|
+
end
|
103
|
+
|
85
104
|
def tag_message
|
86
|
-
commit_list
|
87
|
-
%(#{version_message}\n\n#{commit_list.join})
|
105
|
+
%(#{version_message}\n\n#{commit_list.join "\n"})
|
88
106
|
end
|
89
107
|
|
90
|
-
def tag_options sign: false
|
91
|
-
options = %(--sign --annotate "#{version_label}" --
|
108
|
+
def tag_options message_file, sign: false
|
109
|
+
options = %(--sign --annotate "#{version_label}" --file "#{message_file.path}")
|
92
110
|
return options.gsub("--sign ", "") unless sign
|
93
111
|
options
|
94
112
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: milestoner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
|
31
31
|
xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-09-
|
33
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: thor
|
metadata.gz.sig
CHANGED
Binary file
|