pragmater 14.6.0 → 15.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd701858d6d415d6c66cbad4224598a466c16eced2f498e0746ea1e9c8141e13
4
- data.tar.gz: 920d821f4b930b90e5c9e9ae35ee747ba06c1e7d89cd35d147ee319d5e8baa1e
3
+ metadata.gz: '06418440ae0c514a7339f942a5f0447fe087d90455ac6fcba00219d0c3cb5e9d'
4
+ data.tar.gz: 4fd78345bc023731cf29207f4e8842f7bc004a3c9e3e4d71d7b45bc0c01b4614
5
5
  SHA512:
6
- metadata.gz: d5c46449ef4e5758c7ac3928635434952a7c960e87007f8524bde35e7a945c57789598e82d719363971d242d5213bf879d4b198e0af1d2078a16c3052e3f6b35
7
- data.tar.gz: 20a73d1046d4873d8b91c58d408548e34ca71d027127c4142fdc4c0bc7409002e130af487f248bf3330c5d11f438439445ac1a02344f209d0d1e81cacad55509
6
+ metadata.gz: 15e7f66dc3ec1823400b556c812d11c07d57bb5465af4b97cd21b39b87733a42af4d1e24d715ddf567e40ab6efcc12c1717163abeec650cb6527bebbdec72674
7
+ data.tar.gz: 85a0b5f248959711bf58f6731673526394cc9564eaed45c26f1025d4d5cde264b349fc361ba1aac8f79afb36c03999d8eda46e006bc159fdf392a718ec15e6d5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -7,15 +7,15 @@ module Pragmater
7
7
  module Actions
8
8
  # Stores pragma comments.
9
9
  class Comment < Sod::Action
10
- include Import[:input]
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[:configuration].comments }
16
+ default { Container[:settings].comments }
17
17
 
18
- def call(comments = nil) = input.comments = Array(comments || default)
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[:input]
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[:configuration].patterns }
16
+ default { Container[:settings].patterns }
17
17
 
18
- def call(patterns = nil) = input.patterns = Array(patterns || default)
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[:input]
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[:configuration].root_dir }
16
+ default { Container[:settings].root_dir }
17
17
 
18
- def call(path = nil) = input.root_dir = Pathname(path || default)
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[:input, :kernel]
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(input) { |path| kernel.puts path }
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[:input, :kernel]
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(input) { |path| kernel.puts path }
25
+ def call = handler.call { |path| io.puts path }
26
26
 
27
27
  private
28
28
 
@@ -11,21 +11,17 @@ module Pragmater
11
11
  module Container
12
12
  extend Containable
13
13
 
14
- register :configuration do
15
- self[:defaults].add_loader(:yaml, 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
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 :kernel, Kernel
25
+ register :io, STDOUT
30
26
  end
31
27
  end
@@ -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 parser: Parsers::File.new
12
+ def initialize(parser: Parsers::File.new, **)
11
13
  @parser = parser
14
+ super(**)
12
15
  end
13
16
 
14
- def call configuration = Container[:configuration]
15
- Pathname(configuration.root_dir).files("{#{configuration.patterns.join ","}}").map do |path|
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, configuration.comments, action: :insert).join
20
+ path.write parser.call(path, settings.comments, action: :insert).join
18
21
  end
19
22
  end
20
23
 
@@ -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 parser: Parsers::File.new
12
+ def initialize(parser: Parsers::File.new, **)
11
13
  @parser = parser
14
+ super(**)
12
15
  end
13
16
 
14
- def call configuration = Container[:configuration]
15
- Pathname(configuration.root_dir).files("{#{configuration.patterns.join ","}}").map do |path|
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, configuration.comments, action: :remove).join
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 = "14.6.0"
5
+ spec.version = "15.1.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.15"
27
- spec.add_dependency "containable", "~> 0.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", "~> 1.6"
30
- spec.add_dependency "infusible", "~> 3.5"
31
- spec.add_dependency "refinements", "~> 12.1"
32
- spec.add_dependency "runcom", "~> 11.0"
33
- spec.add_dependency "sod", "~> 0.8"
29
+ spec.add_dependency "etcher", "~> 2.1"
30
+ spec.add_dependency "infusible", "~> 3.8"
31
+ spec.add_dependency "refinements", "~> 12.7"
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: 14.6.0
4
+ version: 15.1.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-05-31 00:00:00.000000000 Z
38
+ date: 2024-07-15 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.15'
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.15'
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.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.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: '1.6'
88
+ version: '2.1'
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: '1.6'
95
+ version: '2.1'
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.5'
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.5'
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.1'
116
+ version: '12.7'
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.1'
123
+ version: '12.7'
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.0'
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.0'
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.8'
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.8'
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.11
242
+ rubygems_version: 3.5.15
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