milestoner 13.3.0 → 14.0.1
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/LICENSE.adoc +134 -214
- 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 +12 -22
- data/lib/milestoner/tags/publisher.rb +6 -6
- data/lib/milestoner/tags/pusher.rb +3 -11
- data/milestoner.gemspec +6 -5
- data.tar.gz.sig +0 -0
- metadata +40 -24
- metadata.gz.sig +0 -0
- data/lib/milestoner/cli/parsers/security.rb +0 -56
@@ -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
|