pragmater 14.5.0 → 15.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 +1 -1
- data/lib/pragmater/cli/actions/comment.rb +3 -3
- data/lib/pragmater/cli/actions/pattern.rb +3 -3
- data/lib/pragmater/cli/actions/root.rb +3 -3
- data/lib/pragmater/cli/commands/insert.rb +2 -2
- data/lib/pragmater/cli/commands/remove.rb +2 -2
- data/lib/pragmater/container.rb +5 -9
- data/lib/pragmater/inserter.rb +7 -4
- data/lib/pragmater/remover.rb +7 -4
- data/pragmater.gemspec +8 -8
- data.tar.gz.sig +0 -0
- metadata +17 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0ce7245289bf7343da9fdc3d340f6de43b2a3a63fc9c4f073557e722b0831a8
|
4
|
+
data.tar.gz: 8ab1f87a85171aac24e01cb4f98af86edc26a51ffb76b6c10f1804d7f1a479cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc5586758353fae47b692daa3fac683c22a9fb8b695ab5285a33aacb69951c6b7d0339420626de4c4478325a3da6e27db8979f6515bd8a57c76c00cf4ac2cf09
|
7
|
+
data.tar.gz: 466a613e31a3c924374de40618bdc7af94243fd6f7e8d63ffe19d0fe19a03729c7ec9632d8e1a18115ee85f37d179c89ba836ceb2e8b10b0c93ddd009362047b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -193,7 +193,7 @@ down frozen string literal issues:
|
|
193
193
|
--debug=frozen-string-literal
|
194
194
|
....
|
195
195
|
|
196
|
-
Finally, you can use `--debug` (or `$DEBUG=true`) to force all raised exceptions to print to the console whether they are rescued or not. This best used in conjunction with the above.
|
196
|
+
Finally, you can use `--debug` (or `$DEBUG=true`) to force all raised exceptions to print to the console whether they are rescued or not. This is best used in conjunction with the above.
|
197
197
|
|
198
198
|
Ruby 2.3.0 also added the following methods to the `String` class:
|
199
199
|
|
@@ -7,15 +7,15 @@ module Pragmater
|
|
7
7
|
module Actions
|
8
8
|
# Stores pragma comments.
|
9
9
|
class Comment < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Set pragma comments."
|
13
13
|
|
14
14
|
on %w[-c --comments], argument: "[a,b,c]"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].comments }
|
17
17
|
|
18
|
-
def call(comments = nil) =
|
18
|
+
def call(comments = nil) = settings.comments = Array(comments || default)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Pragmater
|
|
7
7
|
module Actions
|
8
8
|
# Stores file patterns.
|
9
9
|
class Pattern < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Set file patterns."
|
13
13
|
|
14
14
|
on %w[-p --patterns], argument: "[a,b,c]"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].patterns }
|
17
17
|
|
18
|
-
def call(patterns = nil) =
|
18
|
+
def call(patterns = nil) = settings.patterns = Array(patterns || default)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,15 +7,15 @@ module Pragmater
|
|
7
7
|
module Actions
|
8
8
|
# Stores root path.
|
9
9
|
class Root < Sod::Action
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings]
|
11
11
|
|
12
12
|
description "Set root directory."
|
13
13
|
|
14
14
|
on %w[-r --root], argument: "[PATH]"
|
15
15
|
|
16
|
-
default { Container[:
|
16
|
+
default { Container[:settings].root_dir }
|
17
17
|
|
18
|
-
def call(path = nil) =
|
18
|
+
def call(path = nil) = settings.root_dir = Pathname(path || default)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -7,7 +7,7 @@ module Pragmater
|
|
7
7
|
module Commands
|
8
8
|
# Inserts pragmas.
|
9
9
|
class Insert < Sod::Command
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings, :io]
|
11
11
|
|
12
12
|
handle "insert"
|
13
13
|
|
@@ -22,7 +22,7 @@ module Pragmater
|
|
22
22
|
@handler = handler
|
23
23
|
end
|
24
24
|
|
25
|
-
def call = handler.call
|
25
|
+
def call = handler.call { |path| io.puts path }
|
26
26
|
|
27
27
|
private
|
28
28
|
|
@@ -7,7 +7,7 @@ module Pragmater
|
|
7
7
|
module Commands
|
8
8
|
# Removes pragmas.
|
9
9
|
class Remove < Sod::Command
|
10
|
-
include Import[:
|
10
|
+
include Import[:settings, :io]
|
11
11
|
|
12
12
|
handle "remove"
|
13
13
|
|
@@ -22,7 +22,7 @@ module Pragmater
|
|
22
22
|
@handler = handler
|
23
23
|
end
|
24
24
|
|
25
|
-
def call = handler.call
|
25
|
+
def call = handler.call { |path| io.puts path }
|
26
26
|
|
27
27
|
private
|
28
28
|
|
data/lib/pragmater/container.rb
CHANGED
@@ -11,21 +11,17 @@ module Pragmater
|
|
11
11
|
module Container
|
12
12
|
extend Containable
|
13
13
|
|
14
|
-
register :
|
15
|
-
self[:defaults].add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active))
|
16
|
-
.then { |registry| Etcher.call registry }
|
17
|
-
end
|
18
|
-
|
19
|
-
register :defaults do
|
14
|
+
register :registry do
|
20
15
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
21
|
-
.add_loader(
|
16
|
+
.add_loader(:yaml, self[:defaults_path])
|
17
|
+
.add_loader(:yaml, self[:xdg_config].active)
|
22
18
|
end
|
23
19
|
|
20
|
+
register(:settings) { Etcher.call(self[:registry]).dup }
|
24
21
|
register(:specification) { Spek::Loader.call "#{__dir__}/../../pragmater.gemspec" }
|
25
|
-
register(:input) { self[:configuration].dup }
|
26
22
|
register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
|
27
23
|
register(:xdg_config) { Runcom::Config.new "pragmater/configuration.yml" }
|
28
24
|
register(:logger) { Cogger.new id: :pragmater }
|
29
|
-
register :
|
25
|
+
register :io, STDOUT
|
30
26
|
end
|
31
27
|
end
|
data/lib/pragmater/inserter.rb
CHANGED
@@ -5,16 +5,19 @@ require "refinements/pathname"
|
|
5
5
|
module Pragmater
|
6
6
|
# Inserts pragma comments.
|
7
7
|
class Inserter
|
8
|
+
include Import[:settings]
|
9
|
+
|
8
10
|
using Refinements::Pathname
|
9
11
|
|
10
|
-
def initialize
|
12
|
+
def initialize(parser: Parsers::File.new, **)
|
11
13
|
@parser = parser
|
14
|
+
super(**)
|
12
15
|
end
|
13
16
|
|
14
|
-
def call
|
15
|
-
Pathname(
|
17
|
+
def call
|
18
|
+
Pathname(settings.root_dir).files("{#{settings.patterns.join ","}}").map do |path|
|
16
19
|
yield path if block_given?
|
17
|
-
path.write parser.call(path,
|
20
|
+
path.write parser.call(path, settings.comments, action: :insert).join
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
data/lib/pragmater/remover.rb
CHANGED
@@ -5,16 +5,19 @@ require "refinements/pathname"
|
|
5
5
|
module Pragmater
|
6
6
|
# Removes pragma comments.
|
7
7
|
class Remover
|
8
|
+
include Import[:settings]
|
9
|
+
|
8
10
|
using Refinements::Pathname
|
9
11
|
|
10
|
-
def initialize
|
12
|
+
def initialize(parser: Parsers::File.new, **)
|
11
13
|
@parser = parser
|
14
|
+
super(**)
|
12
15
|
end
|
13
16
|
|
14
|
-
def call
|
15
|
-
Pathname(
|
17
|
+
def call
|
18
|
+
Pathname(settings.root_dir).files("{#{settings.patterns.join ","}}").map do |path|
|
16
19
|
yield path if block_given?
|
17
|
-
path.write parser.call(path,
|
20
|
+
path.write parser.call(path, settings.comments, action: :remove).join
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
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 = "
|
5
|
+
spec.version = "15.0.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/pragmater"
|
@@ -23,14 +23,14 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.3"
|
26
|
-
spec.add_dependency "cogger", "~> 0.
|
27
|
-
spec.add_dependency "containable", "~> 0.
|
26
|
+
spec.add_dependency "cogger", "~> 0.21"
|
27
|
+
spec.add_dependency "containable", "~> 0.2"
|
28
28
|
spec.add_dependency "dry-schema", "~> 1.13"
|
29
|
-
spec.add_dependency "etcher", "~>
|
30
|
-
spec.add_dependency "infusible", "~> 3.
|
31
|
-
spec.add_dependency "refinements", "~> 12.
|
32
|
-
spec.add_dependency "runcom", "~> 11.
|
33
|
-
spec.add_dependency "sod", "~> 0.
|
29
|
+
spec.add_dependency "etcher", "~> 2.0"
|
30
|
+
spec.add_dependency "infusible", "~> 3.8"
|
31
|
+
spec.add_dependency "refinements", "~> 12.5"
|
32
|
+
spec.add_dependency "runcom", "~> 11.5"
|
33
|
+
spec.add_dependency "sod", "~> 0.12"
|
34
34
|
spec.add_dependency "spek", "~> 3.0"
|
35
35
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
36
36
|
|
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:
|
4
|
+
version: 15.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-
|
38
|
+
date: 2024-07-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -43,28 +43,28 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.21'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.21'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: containable
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
60
|
+
version: '0.2'
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.2'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: dry-schema
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,70 +85,70 @@ dependencies:
|
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '2.0'
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '2.0'
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: infusible
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '3.
|
102
|
+
version: '3.8'
|
103
103
|
type: :runtime
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '3.
|
109
|
+
version: '3.8'
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: refinements
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '12.
|
116
|
+
version: '12.5'
|
117
117
|
type: :runtime
|
118
118
|
prerelease: false
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '12.
|
123
|
+
version: '12.5'
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: runcom
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '11.
|
130
|
+
version: '11.5'
|
131
131
|
type: :runtime
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '11.
|
137
|
+
version: '11.5'
|
138
138
|
- !ruby/object:Gem::Dependency
|
139
139
|
name: sod
|
140
140
|
requirement: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0.
|
144
|
+
version: '0.12'
|
145
145
|
type: :runtime
|
146
146
|
prerelease: false
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '0.
|
151
|
+
version: '0.12'
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: spek
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: '0'
|
241
241
|
requirements: []
|
242
|
-
rubygems_version: 3.5.
|
242
|
+
rubygems_version: 3.5.14
|
243
243
|
signing_key:
|
244
244
|
specification_version: 4
|
245
245
|
summary: A command line interface for managing pragma comments.
|
metadata.gz.sig
CHANGED
Binary file
|