milestoner 13.3.1 → 14.0.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.adoc +33 -35
- data/lib/milestoner/cli/actions/config.rb +5 -7
- data/lib/milestoner/cli/actions/container.rb +22 -0
- data/lib/milestoner/cli/actions/import.rb +11 -0
- data/lib/milestoner/cli/actions/status.rb +5 -5
- data/lib/milestoner/cli/parser.rb +10 -6
- data/lib/milestoner/cli/parsers/core.rb +6 -6
- data/lib/milestoner/cli/shell.rb +8 -25
- data/lib/milestoner/commits/categorizer.rb +6 -6
- data/lib/milestoner/configuration/content.rb +0 -1
- data/lib/milestoner/configuration/defaults.yml +1 -2
- data/lib/milestoner/container.rb +3 -26
- data/lib/milestoner/import.rb +7 -0
- data/lib/milestoner/presenters/commit.rb +6 -4
- data/lib/milestoner/tags/creator.rb +11 -21
- data/lib/milestoner/tags/publisher.rb +6 -6
- data/lib/milestoner/tags/pusher.rb +3 -11
- data/milestoner.gemspec +3 -2
- data.tar.gz.sig +0 -0
- metadata +37 -21
- metadata.gz.sig +0 -0
- data/lib/milestoner/cli/parsers/security.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 414e626152e7e409b899f4ef27e1834eb14a016ea522da04bb9bcc14cc624944
|
4
|
+
data.tar.gz: 79e74c38a4693e8cf98dbee86bf4758184de28c2251e47c086a17135c12159dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0854ded23bde4df9d170e8456e4850800722f6306169061ec29ab1b053ee6026ef5f17625981ea34e4ec6eeee20b79ebcda785c6cee9ac20e3b43f32d9e8a5b6'
|
7
|
+
data.tar.gz: 76faa8376ec91c6cf70be5d286f38e5eb8a32081992294a93d0e9e0be13e363a9ab75f747e8fb93c71d174eb51907f43ed4ecb91d4994fea384d09f57a9d4936
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -4,13 +4,18 @@
|
|
4
4
|
|
5
5
|
= Milestoner
|
6
6
|
|
7
|
-
Milestoner is a command line interface for crafting Git repository tags (milestones) using
|
8
|
-
versions. Each milestone is a summary of all commits made since
|
9
|
-
Milestoner to inspect what is currently
|
10
|
-
having a tool, like Milestoner, you can
|
11
|
-
reliable fashion. Milestoner
|
12
|
-
|
13
|
-
|
7
|
+
Milestoner is a command line interface for crafting Git repository tags (milestones) using
|
8
|
+
link:https://semver.org[semantic versions]. Each milestone is a summary of all commits made since
|
9
|
+
the last milestone. You can use Milestoner to inspect what is currently pending or create a new
|
10
|
+
release via a single command. By having a tool, like Milestoner, you can automate releases in a
|
11
|
+
consistent and reliable fashion. Milestoner pairs well with the following gems:
|
12
|
+
|
13
|
+
- link:https://www.alchemists.io/projects/git-lint[Git Lint] - Ensures your commit messages are of
|
14
|
+
high quality which feed into the release notes built by Milestoner.
|
15
|
+
- link:https://www.alchemists.io/projects/rubysmith[Rubysmith] - Use Milestoner to automate the
|
16
|
+
publishing of new or existing Ruby project versions.
|
17
|
+
- link:https://www.alchemists.io/projects/gemsmith[Gemsmith] - Is built on top of Milestoner and is
|
18
|
+
used to publish new Ruby gem versions.
|
14
19
|
|
15
20
|
toc::[]
|
16
21
|
|
@@ -31,13 +36,12 @@ toc::[]
|
|
31
36
|
** Refactored
|
32
37
|
* Ensures Git commit messages are alphabetically sorted.
|
33
38
|
* Ensures duplicate Git commit messages are removed (if any).
|
34
|
-
* Provides optional security for signing Git tags with https://www.gnupg.org[GnuPG] signing key.
|
35
39
|
|
36
40
|
== Requirements
|
37
41
|
|
38
42
|
. A UNIX-based system.
|
39
43
|
. https://www.ruby-lang.org[Ruby].
|
40
|
-
. https://www.gnupg.org[GnuPG].
|
44
|
+
. https://www.gnupg.org[GnuPG] (optional).
|
41
45
|
|
42
46
|
== Setup
|
43
47
|
|
@@ -61,9 +65,6 @@ USAGE:
|
|
61
65
|
-P, --publish VERSION Tag and push milestone to remote repository.
|
62
66
|
-s, --status Show project status.
|
63
67
|
-v, --version Show gem version.
|
64
|
-
|
65
|
-
SECURITY OPTIONS:
|
66
|
-
--[no-]sign Sign with GPG key. Default: false.
|
67
68
|
....
|
68
69
|
|
69
70
|
Examples:
|
@@ -72,13 +73,8 @@ Examples:
|
|
72
73
|
----
|
73
74
|
milestoner --config edit
|
74
75
|
milestoner --config view
|
75
|
-
|
76
76
|
milestoner --help
|
77
|
-
|
78
77
|
milestoner --publish 0.1.0
|
79
|
-
milestoner --publish 0.1.0 --sign
|
80
|
-
milestoner --publish 0.1.0 --no-sign
|
81
|
-
|
82
78
|
milestoner --status
|
83
79
|
milestoner --version
|
84
80
|
----
|
@@ -98,14 +94,13 @@ The default configuration is as follows:
|
|
98
94
|
[source,yaml]
|
99
95
|
----
|
100
96
|
:documentation:
|
101
|
-
:format: "
|
97
|
+
:format: "adoc"
|
102
98
|
:prefixes:
|
103
99
|
- Fixed
|
104
100
|
- Added
|
105
101
|
- Updated
|
106
102
|
- Removed
|
107
103
|
- Refactored
|
108
|
-
:sign: false
|
109
104
|
----
|
110
105
|
|
111
106
|
Feel free to take this default configuration, modify, and save as your own custom
|
@@ -113,18 +108,16 @@ Feel free to take this default configuration, modify, and save as your own custo
|
|
113
108
|
|
114
109
|
The `+configuration.yml+` file can be configured as follows:
|
115
110
|
|
116
|
-
* *
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
the Git tag. This is useful for public milestones where the author of a milestone can be verified
|
127
|
-
to ensure milestone integrity/security.
|
111
|
+
* *Documentation Format* (i.e. `documentation`): Determines what format the release notes should be
|
112
|
+
rendered as. This effects both status information from the command line and the release notes
|
113
|
+
embedded within the body of a Git tag. Defaults to
|
114
|
+
link:https://asciidoctor.org/docs/what-is-asciidoc[ASCII Doc] (i.e. `adoc`) but
|
115
|
+
link:https://daringfireball.net/projects/markdown[Markdown] (i.e. `md`) is supported too.
|
116
|
+
* *Git Commit Prefixes* (i.e. `prefixes`): Should the default prefixes not be desired, you can
|
117
|
+
define Git commit prefixes that match your style. _NOTE: Prefix order is important with the first
|
118
|
+
prefix defined taking precedence over the second and so forth._ Special characters are allowed for
|
119
|
+
prefixes but should be enclosed in quotes. To disable prefix usage completely, use an empty array.
|
120
|
+
Example: `:prefixes: []`.
|
128
121
|
|
129
122
|
== Security
|
130
123
|
|
@@ -151,16 +144,21 @@ To obtain your key, run the following and take the part after the forward slash:
|
|
151
144
|
gpg --list-keys | grep pub
|
152
145
|
....
|
153
146
|
|
154
|
-
Add your key to your global Git configuration
|
147
|
+
Add your key to your global (or local) Git configuration and ensure GPG signing for your tag is
|
148
|
+
enabled. Example:
|
155
149
|
|
156
150
|
....
|
151
|
+
[tag]
|
152
|
+
gpgSign = true
|
157
153
|
[user]
|
158
154
|
signingkey = <your GPG key>
|
159
155
|
....
|
160
156
|
|
161
|
-
Now, when publishing a new milestone (i.e.
|
162
|
-
|
163
|
-
|
157
|
+
Now, when publishing a new milestone (i.e. `milestoner --publish <version>`), the signing of your
|
158
|
+
Git tag will happen automatically. You will be prompted for the GPG Passphrase each time unless you
|
159
|
+
are running the
|
160
|
+
link:https://gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html#Invoking-GPG_002dAGENT[GPG
|
161
|
+
Agent] in the background (highly recommend).
|
164
162
|
|
165
163
|
== Development
|
166
164
|
|
@@ -5,9 +5,11 @@ module Milestoner
|
|
5
5
|
module Actions
|
6
6
|
# Handles the gem configuration action.
|
7
7
|
class Config
|
8
|
-
|
8
|
+
include Milestoner::Import[:kernel, :logger]
|
9
|
+
|
10
|
+
def initialize configuration: Configuration::Loader::CLIENT, **dependencies
|
11
|
+
super(**dependencies)
|
9
12
|
@configuration = configuration
|
10
|
-
@container = container
|
11
13
|
end
|
12
14
|
|
13
15
|
def call action
|
@@ -20,15 +22,11 @@ module Milestoner
|
|
20
22
|
|
21
23
|
private
|
22
24
|
|
23
|
-
attr_reader :configuration
|
25
|
+
attr_reader :configuration
|
24
26
|
|
25
27
|
def edit = kernel.system("$EDITOR #{configuration.current}")
|
26
28
|
|
27
29
|
def view = kernel.system("cat #{configuration.current}")
|
28
|
-
|
29
|
-
def kernel = container[__method__]
|
30
|
-
|
31
|
-
def logger = container[__method__]
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/container"
|
4
|
+
|
5
|
+
module Milestoner
|
6
|
+
module CLI
|
7
|
+
module Actions
|
8
|
+
# Provides a single container with application and action specific dependencies.
|
9
|
+
module Container
|
10
|
+
extend Dry::Container::Mixin
|
11
|
+
|
12
|
+
config.registry = ->(container, key, value, _options) { container[key.to_s] = value }
|
13
|
+
|
14
|
+
merge Milestoner::Container
|
15
|
+
|
16
|
+
register(:config) { Config.new }
|
17
|
+
register(:publish) { Publish.new }
|
18
|
+
register(:status) { Status.new }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,12 +5,14 @@ module Milestoner
|
|
5
5
|
module Actions
|
6
6
|
# Handles listing project status of untagged commit history.
|
7
7
|
class Status
|
8
|
+
include Milestoner::Import[:logger]
|
9
|
+
|
8
10
|
def initialize presenter: Presenters::Commit,
|
9
11
|
categorizer: Commits::Categorizer.new,
|
10
|
-
|
12
|
+
**dependencies
|
13
|
+
super(**dependencies)
|
11
14
|
@presenter = presenter
|
12
15
|
@categorizer = categorizer
|
13
|
-
@container = container
|
14
16
|
end
|
15
17
|
|
16
18
|
def call
|
@@ -22,11 +24,9 @@ module Milestoner
|
|
22
24
|
|
23
25
|
private
|
24
26
|
|
25
|
-
attr_reader :presenter, :categorizer
|
27
|
+
attr_reader :presenter, :categorizer
|
26
28
|
|
27
29
|
def info(message) = logger.info { message }
|
28
|
-
|
29
|
-
def logger = container[__method__]
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -6,26 +6,30 @@ module Milestoner
|
|
6
6
|
module CLI
|
7
7
|
# Assembles and parses all Command Line Interface (CLI) options.
|
8
8
|
class Parser
|
9
|
+
include Import[:configuration]
|
10
|
+
|
9
11
|
CLIENT = OptionParser.new nil, 40, " "
|
10
|
-
SECTIONS = [Parsers::Core
|
12
|
+
SECTIONS = [Parsers::Core].freeze
|
13
|
+
|
14
|
+
def initialize sections: SECTIONS, client: CLIENT, **dependencies
|
15
|
+
super(**dependencies)
|
11
16
|
|
12
|
-
def initialize sections: SECTIONS, client: CLIENT, container: Container
|
13
17
|
@sections = sections
|
14
18
|
@client = client
|
15
|
-
@
|
19
|
+
@configuration_duplicate = configuration.dup
|
16
20
|
end
|
17
21
|
|
18
22
|
def call arguments = []
|
19
|
-
sections.each { |section| section.call
|
23
|
+
sections.each { |section| section.call configuration_duplicate, client: }
|
20
24
|
client.parse arguments
|
21
|
-
|
25
|
+
configuration_duplicate.freeze
|
22
26
|
end
|
23
27
|
|
24
28
|
def to_s = client.to_s
|
25
29
|
|
26
30
|
private
|
27
31
|
|
28
|
-
attr_reader :sections, :client, :
|
32
|
+
attr_reader :sections, :client, :configuration_duplicate
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
@@ -11,14 +11,16 @@ module Milestoner
|
|
11
11
|
|
12
12
|
# Handles parsing of Command Line Interface (CLI) core options.
|
13
13
|
class Core
|
14
|
+
include Import[:specification]
|
15
|
+
|
14
16
|
def self.call(...) = new(...).call
|
15
17
|
|
16
|
-
def initialize configuration =
|
18
|
+
def initialize configuration = Container[:configuration],
|
17
19
|
client: Parser::CLIENT,
|
18
|
-
|
20
|
+
**dependencies
|
21
|
+
super(**dependencies)
|
19
22
|
@configuration = configuration
|
20
23
|
@client = client
|
21
|
-
@container = container
|
22
24
|
end
|
23
25
|
|
24
26
|
def call arguments = []
|
@@ -31,7 +33,7 @@ module Milestoner
|
|
31
33
|
|
32
34
|
private
|
33
35
|
|
34
|
-
attr_reader :configuration, :client
|
36
|
+
attr_reader :configuration, :client
|
35
37
|
|
36
38
|
def collate = private_methods.sort.grep(/add_/).each { |method| __send__ method }
|
37
39
|
|
@@ -74,8 +76,6 @@ module Milestoner
|
|
74
76
|
configuration.merge! action_help: true
|
75
77
|
end
|
76
78
|
end
|
77
|
-
|
78
|
-
def specification = container[__method__]
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
data/lib/milestoner/cli/shell.rb
CHANGED
@@ -4,16 +4,11 @@ module Milestoner
|
|
4
4
|
module CLI
|
5
5
|
# The main Command Line Interface (CLI) object.
|
6
6
|
class Shell
|
7
|
-
|
8
|
-
config: Actions::Config.new,
|
9
|
-
publish: Actions::Publish.new,
|
10
|
-
status: Actions::Status.new
|
11
|
-
}.freeze
|
7
|
+
include Actions::Import[:config, :publish, :status, :specification, :logger]
|
12
8
|
|
13
|
-
def initialize parser: Parser.new,
|
9
|
+
def initialize parser: Parser.new, **dependencies
|
10
|
+
super(**dependencies)
|
14
11
|
@parser = parser
|
15
|
-
@actions = actions
|
16
|
-
@container = container
|
17
12
|
end
|
18
13
|
|
19
14
|
def call arguments = []
|
@@ -24,29 +19,17 @@ module Milestoner
|
|
24
19
|
|
25
20
|
private
|
26
21
|
|
27
|
-
attr_reader :parser
|
22
|
+
attr_reader :parser
|
28
23
|
|
29
24
|
def perform configuration
|
30
25
|
case configuration
|
31
|
-
in action_config: Symbol => action then config action
|
32
|
-
in action_publish: true then publish configuration
|
33
|
-
in action_status: true then status
|
26
|
+
in action_config: Symbol => action then config.call action
|
27
|
+
in action_publish: true then publish.call configuration
|
28
|
+
in action_status: true then status.call
|
34
29
|
in action_version: true then logger.info { specification.labeled_version }
|
35
|
-
else
|
30
|
+
else logger.any { parser.to_s }
|
36
31
|
end
|
37
32
|
end
|
38
|
-
|
39
|
-
def config(action) = actions.fetch(__method__).call(action)
|
40
|
-
|
41
|
-
def publish(configuration) = actions.fetch(__method__).call(configuration)
|
42
|
-
|
43
|
-
def status = actions.fetch(__method__).call
|
44
|
-
|
45
|
-
def usage = logger.unknown { parser.to_s }
|
46
|
-
|
47
|
-
def specification = container[__method__]
|
48
|
-
|
49
|
-
def logger = container[__method__]
|
50
33
|
end
|
51
34
|
end
|
52
35
|
end
|
@@ -6,12 +6,14 @@ module Milestoner
|
|
6
6
|
module Commits
|
7
7
|
# Retrieves and categorizes Git repository commit tagged or untagged history.
|
8
8
|
class Categorizer
|
9
|
-
|
9
|
+
include Import[:repository]
|
10
|
+
|
11
|
+
def initialize expression: Regexp, **dependencies
|
12
|
+
super(**dependencies)
|
10
13
|
@expression = expression
|
11
|
-
@container = container
|
12
14
|
end
|
13
15
|
|
14
|
-
def call configuration =
|
16
|
+
def call configuration = Container[:configuration]
|
15
17
|
prefixes = configuration.prefixes
|
16
18
|
|
17
19
|
prefixes.reduce({}) { |group, prefix| group.merge prefix => [] }
|
@@ -25,7 +27,7 @@ module Milestoner
|
|
25
27
|
|
26
28
|
private
|
27
29
|
|
28
|
-
attr_reader :expression
|
30
|
+
attr_reader :expression
|
29
31
|
|
30
32
|
def group_by_prefix prefixes, groups
|
31
33
|
computed_commits.each.with_object groups do |commit, collection|
|
@@ -44,8 +46,6 @@ module Milestoner
|
|
44
46
|
def tagged_commits = repository.commits("#{repository.tag_last}..HEAD")
|
45
47
|
|
46
48
|
def saved_commits = repository.commits
|
47
|
-
|
48
|
-
def repository = container[__method__]
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
data/lib/milestoner/container.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "cogger"
|
3
4
|
require "dry-container"
|
4
5
|
require "git_plus"
|
5
|
-
require "logger"
|
6
|
-
require "pastel"
|
7
6
|
require "spek"
|
8
7
|
|
9
8
|
module Milestoner
|
@@ -13,30 +12,8 @@ module Milestoner
|
|
13
12
|
|
14
13
|
register(:configuration) { Configuration::Loader.call }
|
15
14
|
register(:specification) { Spek::Loader.call "#{__dir__}/../../milestoner.gemspec" }
|
16
|
-
register(:colorizer) { Pastel.new enabled: $stdout.tty? }
|
17
|
-
register(:kernel) { Kernel }
|
18
|
-
|
19
|
-
register :log_colors do
|
20
|
-
{
|
21
|
-
"DEBUG" => self[:colorizer].white.detach,
|
22
|
-
"INFO" => self[:colorizer].green.detach,
|
23
|
-
"WARN" => self[:colorizer].yellow.detach,
|
24
|
-
"ERROR" => self[:colorizer].red.detach,
|
25
|
-
"FATAL" => self[:colorizer].white.bold.on_red.detach,
|
26
|
-
"ANY" => self[:colorizer].white.bold.detach
|
27
|
-
}
|
28
|
-
end
|
29
|
-
|
30
|
-
register :logger do
|
31
|
-
Logger.new $stdout,
|
32
|
-
level: Logger.const_get(ENV.fetch("LOG_LEVEL", "INFO")),
|
33
|
-
formatter: (
|
34
|
-
lambda do |severity, _at, _name, message|
|
35
|
-
self[:log_colors][severity].call "#{message}\n"
|
36
|
-
end
|
37
|
-
)
|
38
|
-
end
|
39
|
-
|
40
15
|
register(:repository) { GitPlus::Repository.new }
|
16
|
+
register(:kernel) { Kernel }
|
17
|
+
register(:logger) { Cogger::Client.new }
|
41
18
|
end
|
42
19
|
end
|
@@ -7,23 +7,25 @@ module Milestoner
|
|
7
7
|
module Presenters
|
8
8
|
# Wraps the Git Kit Commit for presentation purposes.
|
9
9
|
class Commit
|
10
|
+
include Import[:configuration]
|
11
|
+
|
10
12
|
extend Forwardable
|
11
13
|
|
12
14
|
delegate [*GitPlus::Commit.members, :fixup?, :squash?] => :record
|
13
15
|
|
14
|
-
def initialize record,
|
16
|
+
def initialize record, **dependencies
|
17
|
+
super(**dependencies)
|
15
18
|
@record = record
|
16
|
-
@container = container
|
17
19
|
end
|
18
20
|
|
19
21
|
def line_item(delimiter: " - ") = "#{bullet}#{subject}#{delimiter}#{author_name}"
|
20
22
|
|
21
23
|
private
|
22
24
|
|
23
|
-
attr_reader :record
|
25
|
+
attr_reader :record
|
24
26
|
|
25
27
|
def bullet
|
26
|
-
case
|
28
|
+
case configuration.documentation_format
|
27
29
|
when "md" then "- "
|
28
30
|
when "adoc" then "* "
|
29
31
|
else ""
|
@@ -7,52 +7,46 @@ module Milestoner
|
|
7
7
|
module Tags
|
8
8
|
# Handles the creation of project repository tags.
|
9
9
|
class Creator
|
10
|
+
include Import[:repository, :logger]
|
11
|
+
|
10
12
|
using Versionaire::Cast
|
11
13
|
|
12
14
|
def initialize categorizer: Commits::Categorizer.new,
|
13
15
|
presenter: Presenters::Commit,
|
14
|
-
|
15
|
-
|
16
|
+
**dependencies
|
17
|
+
super(**dependencies)
|
16
18
|
@categorizer = categorizer
|
17
19
|
@presenter = presenter
|
18
|
-
@container = container
|
19
20
|
end
|
20
21
|
|
21
|
-
def call configuration =
|
22
|
+
def call configuration = Container[:configuration]
|
22
23
|
return false if local? configuration
|
23
24
|
fail Error, "Unable to tag without commits." if categorizer.call.empty?
|
24
25
|
|
25
|
-
|
26
|
+
create configuration
|
26
27
|
rescue Versionaire::Error, GitPlus::Error => error
|
27
28
|
raise Error, error.message
|
28
29
|
end
|
29
30
|
|
30
31
|
private
|
31
32
|
|
32
|
-
attr_reader :categorizer, :presenter
|
33
|
+
attr_reader :categorizer, :presenter
|
33
34
|
|
34
35
|
def local? configuration
|
35
36
|
version = Version configuration.version
|
36
37
|
|
37
38
|
if repository.tag_local? version
|
38
|
-
logger.warn "Local tag exists: #{version}. Skipped."
|
39
|
+
logger.warn { "Local tag exists: #{version}. Skipped." }
|
39
40
|
true
|
40
41
|
else
|
41
42
|
false
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
45
|
-
def
|
46
|
+
def create configuration
|
46
47
|
version = configuration.version
|
47
|
-
|
48
|
-
|
49
|
-
if configuration.sign
|
50
|
-
repository.tag_sign version, content
|
51
|
-
else
|
52
|
-
repository.tag_unsign version, content
|
53
|
-
end
|
54
|
-
|
55
|
-
logger.debug "Local tag created: #{version}."
|
48
|
+
repository.tag_unsign version, message(configuration)
|
49
|
+
logger.debug { "Local tag created: #{version}." }
|
56
50
|
end
|
57
51
|
|
58
52
|
def message configuration
|
@@ -62,10 +56,6 @@ module Milestoner
|
|
62
56
|
%(Version #{configuration.version}\n\n#{line_items.join "\n"}\n\n)
|
63
57
|
end
|
64
58
|
end
|
65
|
-
|
66
|
-
def repository = container[__method__]
|
67
|
-
|
68
|
-
def logger = container[__method__]
|
69
59
|
end
|
70
60
|
end
|
71
61
|
end
|
@@ -4,13 +4,15 @@ module Milestoner
|
|
4
4
|
module Tags
|
5
5
|
# Handles the tagging and pushing of a tag to a remote repository.
|
6
6
|
class Publisher
|
7
|
-
|
7
|
+
include Import[:logger]
|
8
|
+
|
9
|
+
def initialize tagger: Tags::Creator.new, pusher: Tags::Pusher.new, **dependencies
|
10
|
+
super(**dependencies)
|
8
11
|
@tagger = tagger
|
9
12
|
@pusher = pusher
|
10
|
-
@container = container
|
11
13
|
end
|
12
14
|
|
13
|
-
def call configuration =
|
15
|
+
def call configuration = Container[:configuration]
|
14
16
|
tagger.call configuration
|
15
17
|
pusher.call configuration
|
16
18
|
logger.info { "Published: #{configuration.version}!" }
|
@@ -18,9 +20,7 @@ module Milestoner
|
|
18
20
|
|
19
21
|
private
|
20
22
|
|
21
|
-
attr_reader :tagger, :pusher
|
22
|
-
|
23
|
-
def logger = container[__method__]
|
23
|
+
attr_reader :tagger, :pusher
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -6,13 +6,11 @@ module Milestoner
|
|
6
6
|
module Tags
|
7
7
|
# Handles publishing of tags to a remote repository.
|
8
8
|
class Pusher
|
9
|
-
|
9
|
+
include Import[:repository, :logger]
|
10
10
|
|
11
|
-
|
12
|
-
@container = container
|
13
|
-
end
|
11
|
+
using Versionaire::Cast
|
14
12
|
|
15
|
-
def call configuration =
|
13
|
+
def call configuration = Container[:configuration]
|
16
14
|
version = Version configuration.version
|
17
15
|
|
18
16
|
fail Error, "Remote repository not configured." unless repository.config_origin?
|
@@ -24,17 +22,11 @@ module Milestoner
|
|
24
22
|
|
25
23
|
private
|
26
24
|
|
27
|
-
attr_reader :container
|
28
|
-
|
29
25
|
def push
|
30
26
|
repository.tag_push.then do |_stdout, stderr, status|
|
31
27
|
status.success? && stderr.match?(/[new tag]/)
|
32
28
|
end
|
33
29
|
end
|
34
|
-
|
35
|
-
def repository = container[__method__]
|
36
|
-
|
37
|
-
def logger = container[__method__]
|
38
30
|
end
|
39
31
|
end
|
40
32
|
end
|
data/milestoner.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "milestoner"
|
5
|
-
spec.version = "
|
5
|
+
spec.version = "14.0.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://www.alchemists.io/projects/milestoner"
|
@@ -22,9 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.cert_chain = [Gem.default_cert_path]
|
23
23
|
|
24
24
|
spec.required_ruby_version = "~> 3.1"
|
25
|
+
spec.add_dependency "auto_injector", "~> 0.4"
|
26
|
+
spec.add_dependency "cogger", "~> 0.0"
|
25
27
|
spec.add_dependency "dry-container", "~> 0.8"
|
26
28
|
spec.add_dependency "git_plus", "~> 1.1"
|
27
|
-
spec.add_dependency "pastel", "~> 0.8"
|
28
29
|
spec.add_dependency "refinements", "~> 9.2"
|
29
30
|
spec.add_dependency "runcom", "~> 8.2"
|
30
31
|
spec.add_dependency "spek", "~> 0.2"
|
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:
|
4
|
+
version: 14.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -10,9 +10,9 @@ bindir: exe
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIC/
|
14
|
-
|
15
|
-
|
13
|
+
MIIC/jCCAeagAwIBAgIBBTANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
|
14
|
+
a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMjAzMTkxNzI0MzJaFw0yMzAzMTkx
|
15
|
+
NzI0MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
|
16
16
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
|
17
17
|
xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
|
18
18
|
brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
|
@@ -20,46 +20,46 @@ cert_chain:
|
|
20
20
|
D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
|
21
21
|
3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
|
22
22
|
AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
|
23
|
-
2CdikiiE3fJhP/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAJbbNyWzFjqUNVPPCUCo
|
24
|
+
IMrhDa9xf1xkORXNYYbmXgoxRy/KyNbUr+jgEEoWJAm9GXlcqxxWAUI6pK/i4/Qi
|
25
|
+
X6rPFEFmeObDOHNvuqy8Hd6AYsu+kP94U/KJhe9wnWGMmGoNKJNU3EkW3jM/osSl
|
26
|
+
+JRxiH5t4WtnDiVyoYl5nYC02rYdjJkG6VMxDymXTqn7u6HhYgZkGujq1UPar8x2
|
27
|
+
hNIWJblDKKSu7hA2d6+kUthuYo13o1sg1Da/AEDg0hoZSUvhqDEF5Hy232qb3pDt
|
28
|
+
CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
|
29
|
+
RFE=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2022-
|
31
|
+
date: 2022-04-10 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: auto_injector
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.4'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.4'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: cogger
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '0.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '0.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: dry-container
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0.8'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: git_plus
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.1'
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.1'
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: refinements
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,11 +171,12 @@ files:
|
|
157
171
|
- exe/milestoner
|
158
172
|
- lib/milestoner.rb
|
159
173
|
- lib/milestoner/cli/actions/config.rb
|
174
|
+
- lib/milestoner/cli/actions/container.rb
|
175
|
+
- lib/milestoner/cli/actions/import.rb
|
160
176
|
- lib/milestoner/cli/actions/publish.rb
|
161
177
|
- lib/milestoner/cli/actions/status.rb
|
162
178
|
- lib/milestoner/cli/parser.rb
|
163
179
|
- lib/milestoner/cli/parsers/core.rb
|
164
|
-
- lib/milestoner/cli/parsers/security.rb
|
165
180
|
- lib/milestoner/cli/shell.rb
|
166
181
|
- lib/milestoner/commits/categorizer.rb
|
167
182
|
- lib/milestoner/configuration/content.rb
|
@@ -169,6 +184,7 @@ files:
|
|
169
184
|
- lib/milestoner/configuration/loader.rb
|
170
185
|
- lib/milestoner/container.rb
|
171
186
|
- lib/milestoner/error.rb
|
187
|
+
- lib/milestoner/import.rb
|
172
188
|
- lib/milestoner/presenters/commit.rb
|
173
189
|
- lib/milestoner/tags/creator.rb
|
174
190
|
- lib/milestoner/tags/publisher.rb
|
@@ -199,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
215
|
- !ruby/object:Gem::Version
|
200
216
|
version: '0'
|
201
217
|
requirements: []
|
202
|
-
rubygems_version: 3.3.
|
218
|
+
rubygems_version: 3.3.11
|
203
219
|
signing_key:
|
204
220
|
specification_version: 4
|
205
221
|
summary: A command line interface for crafting Git semantically versioned repository
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "refinements/structs"
|
4
|
-
|
5
|
-
module Milestoner
|
6
|
-
module CLI
|
7
|
-
module Parsers
|
8
|
-
# Handles parsing of Command Line Interface (CLI) security options.
|
9
|
-
class Security
|
10
|
-
using Refinements::Structs
|
11
|
-
|
12
|
-
def self.call(...) = new(...).call
|
13
|
-
|
14
|
-
def initialize configuration = Container[:configuration],
|
15
|
-
client: Parser::CLIENT,
|
16
|
-
container: Container
|
17
|
-
@configuration = configuration
|
18
|
-
@client = client
|
19
|
-
@container = container
|
20
|
-
end
|
21
|
-
|
22
|
-
def call arguments = []
|
23
|
-
client.separator "\nSECURITY OPTIONS:\n"
|
24
|
-
add_sign
|
25
|
-
client.parse arguments
|
26
|
-
configuration
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
attr_reader :configuration, :client, :container
|
32
|
-
|
33
|
-
def add_sign
|
34
|
-
client.on(
|
35
|
-
"--[no-]sign",
|
36
|
-
%(Sign with GPG key. Default: #{configuration.sign}.)
|
37
|
-
) do |value|
|
38
|
-
compute_sign value
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def compute_sign value
|
43
|
-
truth_table = [true, false].repeated_permutation(2).to_a
|
44
|
-
|
45
|
-
case truth_table.index [value, configuration.sign]
|
46
|
-
when 0..1 then configuration.merge! sign: true
|
47
|
-
when 2..3 then configuration.merge! sign: false
|
48
|
-
else logger.error { "--sign must be a boolean. Check gem configuration." }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def logger = container[__method__]
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|