pragmater 12.0.0 → 12.1.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/README.adoc +1 -1
- data/lib/pragmater/cli/actions/config.rb +2 -2
- data/lib/pragmater/cli/actions/run.rb +2 -2
- data/lib/pragmater/cli/parser.rb +4 -3
- data/lib/pragmater/cli/parsers/core.rb +4 -5
- data/lib/pragmater/cli/parsers/flag.rb +2 -1
- data/lib/pragmater/cli/shell.rb +7 -5
- data/lib/pragmater/runner.rb +2 -2
- data/pragmater.gemspec +2 -1
- data.tar.gz.sig +0 -0
- metadata +17 -3
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17995f32ef6db1b8bd5c02c2da9d1c9af1b0cb9d51ae0812fcd2a937613a2518
|
4
|
+
data.tar.gz: 81b887a4d5d57586288651585a48f02119b5f5044ac263181ac470bc020032a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c5f1fe0b8b00ba157c0bc4624e3f81af69ca5d6e4309aeddc975415793f3a368353305c83018383b8af0217b410dd5b043dce3938509d077a52486e0b453fb9
|
7
|
+
data.tar.gz: 4193ce3882a12d3bde0679a364a8d4d1cd2a0ad595afaae71d0cf2aa39e4979e4e87f433bd3977471c2dc694080939b3308709943c0b8c0bde04e21101fcbb2d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -7,8 +7,8 @@ module Pragmater
|
|
7
7
|
class Config
|
8
8
|
include Pragmater::Import[:kernel, :logger]
|
9
9
|
|
10
|
-
def initialize
|
11
|
-
super(**
|
10
|
+
def initialize(client: Configuration::Loader::CLIENT, **)
|
11
|
+
super(**)
|
12
12
|
@client = client
|
13
13
|
end
|
14
14
|
|
data/lib/pragmater/cli/parser.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
3
4
|
require "optparse"
|
4
5
|
|
5
6
|
module Pragmater
|
@@ -11,14 +12,14 @@ module Pragmater
|
|
11
12
|
CLIENT = OptionParser.new nil, 40, " "
|
12
13
|
SECTIONS = [Parsers::Core, Parsers::Flag].freeze # Order matters.
|
13
14
|
|
14
|
-
def initialize
|
15
|
-
super(**
|
15
|
+
def initialize(sections: SECTIONS, client: CLIENT, **)
|
16
|
+
super(**)
|
16
17
|
@sections = sections
|
17
18
|
@client = client
|
18
19
|
@configuration_duplicate = configuration.dup
|
19
20
|
end
|
20
21
|
|
21
|
-
def call arguments =
|
22
|
+
def call arguments = Core::EMPTY_ARRAY
|
22
23
|
sections.each { |section| section.call configuration_duplicate, client: }
|
23
24
|
client.parse arguments
|
24
25
|
configuration_duplicate.freeze
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
3
4
|
require "refinements/structs"
|
4
5
|
|
5
6
|
module Pragmater
|
@@ -13,15 +14,13 @@ module Pragmater
|
|
13
14
|
|
14
15
|
def self.call(...) = new(...).call
|
15
16
|
|
16
|
-
def initialize
|
17
|
-
|
18
|
-
**dependencies
|
19
|
-
super(**dependencies)
|
17
|
+
def initialize(configuration = Container[:configuration], client: Parser::CLIENT, **)
|
18
|
+
super(**)
|
20
19
|
@configuration = configuration
|
21
20
|
@client = client
|
22
21
|
end
|
23
22
|
|
24
|
-
def call arguments =
|
23
|
+
def call arguments = ::Core::EMPTY_ARRAY
|
25
24
|
client.banner = specification.labeled_summary
|
26
25
|
client.separator "\nUSAGE:\n"
|
27
26
|
collate
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
3
4
|
require "refinements/structs"
|
4
5
|
|
5
6
|
module Pragmater
|
@@ -16,7 +17,7 @@ module Pragmater
|
|
16
17
|
@client = client
|
17
18
|
end
|
18
19
|
|
19
|
-
def call arguments =
|
20
|
+
def call arguments = ::Core::EMPTY_ARRAY
|
20
21
|
client.separator "\nOPTIONS:\n"
|
21
22
|
collate
|
22
23
|
client.parse arguments
|
data/lib/pragmater/cli/shell.rb
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "core"
|
4
|
+
|
3
5
|
module Pragmater
|
4
6
|
module CLI
|
5
7
|
# The main Command Line Interface (CLI) object.
|
6
8
|
class Shell
|
7
9
|
include Actions::Import[:config, :run, :specification, :logger]
|
8
10
|
|
9
|
-
def initialize
|
10
|
-
super(**
|
11
|
+
def initialize(parser: Parser.new, **)
|
12
|
+
super(**)
|
11
13
|
@parser = parser
|
12
14
|
end
|
13
15
|
|
14
|
-
def call arguments =
|
15
|
-
|
16
|
+
def call arguments = Core::EMPTY_ARRAY
|
17
|
+
act_on parser.call(arguments)
|
16
18
|
rescue OptionParser::ParseError => error
|
17
19
|
logger.error { error.message }
|
18
20
|
end
|
@@ -21,7 +23,7 @@ module Pragmater
|
|
21
23
|
|
22
24
|
attr_reader :parser
|
23
25
|
|
24
|
-
def
|
26
|
+
def act_on configuration
|
25
27
|
case configuration
|
26
28
|
in action_config: Symbol => action then config.call action
|
27
29
|
in {action_insert: true} | {action_remove: true} then run.call configuration
|
data/lib/pragmater/runner.rb
CHANGED
data/pragmater.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "pragmater"
|
5
|
-
spec.version = "12.
|
5
|
+
spec.version = "12.1.1"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://www.alchemists.io/projects/pragmater"
|
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.2"
|
26
26
|
spec.add_dependency "cogger", "~> 0.5"
|
27
|
+
spec.add_dependency "core", "~> 0.1"
|
27
28
|
spec.add_dependency "dry-container", "~> 0.11"
|
28
29
|
spec.add_dependency "infusible", "~> 1.0"
|
29
30
|
spec.add_dependency "refinements", "~> 10.0"
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragmater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
|
29
29
|
RFE=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2023-02-05 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: cogger
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0.5'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: core
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.1'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.1'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: dry-container
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
206
|
- !ruby/object:Gem::Version
|
193
207
|
version: '0'
|
194
208
|
requirements: []
|
195
|
-
rubygems_version: 3.4.
|
209
|
+
rubygems_version: 3.4.6
|
196
210
|
signing_key:
|
197
211
|
specification_version: 4
|
198
212
|
summary: A command line interface for managing/formatting source file pragma comments.
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
����k��vdnc?����$+�
|
2
|
+
��HzTɵ,y���y'�2�zj��6��%6�;�v�n��B�&j&�����
|